/* One-tap eBay listing (ebay.js). Uses the app.css tokens; a bottom sheet on phones, a centred panel on wider screens. */
.ebay-acct { display: inline-flex; align-items: center; gap: 10px; color: var(--text); min-width: 0; }
.ebay-acct svg { color: var(--muted); }

dialog.ebay-sheet { padding: 0; border: 1px solid var(--card-border); background: var(--bg); color: var(--text);
  width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 18px 18px 0 0; display: flex; flex-direction: column; overflow: hidden; }
dialog.ebay-sheet:not([open]) { display: none; }
dialog.ebay-sheet::backdrop { background: var(--backdrop); }
.es-head { display: flex; align-items: center; justify-content: space-between; padding: 16px var(--inset) 12px; border-bottom: 1px solid var(--hairline); flex: none; }
.es-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.es-close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--elevated); color: var(--secondary); display: grid; place-items: center; }
.es-close svg { width: 16px; height: 16px; }
.es-body { font-size: 14px; padding: 18px var(--inset) calc(18px + env(safe-area-inset-bottom)); overflow-y: auto; }
.es-body .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.es-sub { margin-top: 6px; }
.es-req { color: var(--accent-text); font-weight: 600; font-size: 12px; margin-left: 4px; }

.es-photos { margin-bottom: 18px; }
.es-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.es-ph, .es-add { position: relative; aspect-ratio: 1; border-radius: var(--r-thumb); overflow: hidden; background: var(--card); border: 1px solid var(--card-border); }
.es-ph img { width: 100%; height: 100%; object-fit: cover; }
.es-ph.pending img { opacity: .45; }
.es-ph button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--overlay-btn-strong); color: var(--text); display: grid; place-items: center; }
.es-ph button svg { width: 12px; height: 12px; }
.es-spin { position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--spin-track); border-top-color: var(--text); animation: es-spin .8s linear infinite; }
@keyframes es-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .es-spin { animation-duration: 2.4s; } }
.es-add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; color: var(--secondary); font-size: 12.5px; font-weight: 600; border-style: dashed; border-color: var(--chip-border); }
.es-add svg { width: 20px; height: 20px; color: var(--accent-text); }
.es-add:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

.es-pick { position: relative; }
.es-pick-btn { display: flex; align-items: center; text-align: left; cursor: pointer; padding-right: 40px; }
.es-pick-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-pick-btn::after { content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; margin-top: -5px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .18s ease; }
.es-pick-btn[aria-expanded="true"] { border-color: var(--accent); }
.es-pick-btn[aria-expanded="true"]::after { transform: translateY(3px) rotate(225deg); }
.es-pick-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; max-height: 280px; overflow-y: auto;
  background: var(--elevated); border: 1px solid var(--chip-border); border-radius: var(--r-field); box-shadow: 0 12px 32px var(--shadow-soft); }
.es-pick-list [role=option] { padding: 11px 12px; border-radius: 8px; cursor: pointer; font-size: 16px; color: var(--secondary); }
.es-pick-list [role=option]:hover, .es-pick-list [role=option]:focus { background: var(--card); color: var(--text); outline: none; }
.es-pick-list [role=option][aria-selected="true"] { color: var(--text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .es-pick-btn::after { transition: none; } }
.es-terms { margin: 4px 0 18px; padding: 4px 16px; }
.es-terms div { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.es-terms div:last-child { border-bottom: 0; }
.es-terms dt { color: var(--muted); }
.es-terms dd { margin: 0; color: var(--secondary); }
.es-foot { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: var(--bg); padding: 12px 0 4px; margin-top: 4px; }
.es-foot .help { text-align: center; }

.es-connect h3, .es-done h3 { margin: 0 0 8px; font-size: 21px; }
.es-connect p, .es-done p { color: var(--secondary); margin: 0 0 14px; }
.es-connect ul { margin: 0 0 22px; padding-left: 20px; color: var(--secondary); font-size: 14px; display: grid; gap: 6px; }
.es-done { display: flex; flex-direction: column; gap: 10px; text-align: center; padding-top: 8px; }
.es-tick { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 6px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.es-tick svg { width: 28px; height: 28px; }

@media (min-width: 720px) {
  dialog.ebay-sheet { width: 600px; margin: auto; border-radius: 18px; max-height: 88vh; }
  .es-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
