/* ListToCart - mobile first, no framework.
   Tap targets are 48px minimum throughout; this gets used one-handed in a
   parking lot outside a school. */

:root {
    --ink:        #16202c;
    --ink-soft:   #55636f;
    --ink-faint:  #8a97a3;
    --line:       #dfe5ea;
    --bg:         #f6f8fa;
    --surface:    #ffffff;
    --brand:      #1f6feb;
    --brand-dark: #1a5fca;
    --accent:     #f0932b;
    --good:       #1e874b;
    --bad:        #c23b3b;
    --radius:     14px;
    --shadow:     0 1px 2px rgba(22, 32, 44, .06), 0 4px 14px rgba(22, 32, 44, .07);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
    padding: 0 0 3rem;
}

main { max-width: 640px; margin: 0 auto; padding: 0 1rem; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --- header --- */

.site-header {
    text-align: center;
    padding: 2rem 1rem 1.25rem;
}

.wordmark {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 750;
    letter-spacing: -.02em;
    color: var(--ink);
}

.tagline {
    margin: .4rem 0 0;
    color: var(--ink-soft);
    font-size: 1rem;
}

/* --- mode picker --- */

.mode-picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: .625rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 30rem) {
    .mode-picker { grid-template-columns: 1fr 1fr; }
}

.mode-btn {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-height: 72px;
    padding: 1rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.mode-btn:hover { border-color: #c6d0d9; }

.mode-btn.is-active {
    border-color: var(--brand);
    background: #eef4fe;
}

.mode-title { font-weight: 650; font-size: 1.0625rem; }
.mode-sub   { color: var(--ink-soft); font-size: .875rem; }

/* --- cards --- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.card h2 {
    margin: 0 0 1rem;
    font-size: 1.0625rem;
    font-weight: 650;
    color: var(--ink);
}

/* --- tabs --- */

.tabs {
    display: flex;
    gap: .375rem;
    background: var(--bg);
    border-radius: 10px;
    padding: .25rem;
    margin-bottom: 1rem;
}

.tab {
    flex: 1;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.tab.is-active {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 1px 3px rgba(22, 32, 44, .12);
}

/* --- dropzone --- */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-height: 168px;
    padding: 1.5rem 1rem;
    border: 2px dashed #c3d0dc;
    border-radius: 12px;
    background: #fbfcfd;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}

.dropzone:hover,
.dropzone.is-dragover { border-color: var(--brand); background: #eef4fe; }

.dropzone.has-file { border-style: solid; border-color: var(--good); background: #f0f9f4; }

.dropzone-icon {
    width: 40px; height: 40px;
    border: 2.5px solid var(--ink-faint);
    border-radius: 8px;
    position: relative;
}

.dropzone-icon::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 16px; height: 2.5px;
    background: var(--ink-faint);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 0 transparent;
}

.dropzone-icon::before {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 2.5px; height: 16px;
    background: var(--ink-faint);
    transform: translate(-50%, -50%);
}

.dropzone.has-file .dropzone-icon { border-color: var(--good); }
.dropzone.has-file .dropzone-icon::before { display: none; }
.dropzone.has-file .dropzone-icon::after {
    width: 18px; height: 9px;
    background: transparent;
    border-left: 3px solid var(--good);
    border-bottom: 3px solid var(--good);
    transform: translate(-50%, -65%) rotate(-45deg);
}

.dropzone-title { font-weight: 650; }
.dropzone-sub   { color: var(--ink-soft); font-size: .875rem; }

.dropzone-file {
    margin-top: .35rem;
    padding: .3rem .6rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
    font-size: .8125rem;
    color: var(--ink-soft);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- fields --- */

.field { margin-bottom: 1rem; }
.field:last-child { margin-bottom: 0; }

.field-row { display: flex; gap: .75rem; }
.field-row .field { flex: 1; }

label { display: block; font-weight: 600; margin-bottom: .4rem; font-size: .9375rem; }

.optional { font-weight: 400; color: var(--ink-faint); font-size: .8125rem; }

input[type="text"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: .7rem .8rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    /* 16px minimum stops iOS Safari zooming on focus. */
    font-size: 16px;
}

textarea { min-height: 180px; resize: vertical; line-height: 1.55; }

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(31, 111, 235, .15);
}

.hint { margin: .45rem 0 0; font-size: .8125rem; color: var(--ink-soft); }
.hint-strong { color: var(--ink); font-size: .875rem; }

/* --- toggles --- */

.toggle {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .875rem;
    margin-top: .75rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 400;
}

.toggle:has(input:checked) { border-color: var(--brand); background: #f7faff; }

.toggle input {
    width: 22px; height: 22px;
    margin: 2px 0 0;
    accent-color: var(--brand);
    flex: none;
}

.toggle-body { display: flex; flex-direction: column; gap: .2rem; }
.toggle-title { font-weight: 650; font-size: .9375rem; }
.toggle-sub   { color: var(--ink-soft); font-size: .8125rem; line-height: 1.45; }

/* --- buttons --- */

.submit-btn {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-size: 1.0625rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.submit-btn:hover { background: var(--brand-dark); }
.submit-btn:disabled { background: var(--ink-faint); cursor: not-allowed; }

.fine-print {
    margin: .9rem 0 0;
    text-align: center;
    font-size: .8125rem;
    color: var(--ink-soft);
}

/* --- alerts --- */

.alert {
    padding: .875rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: .9375rem;
}

.alert-error { background: #fdeeee; border: 1px solid #f3c9c9; color: #8f2b2b; }
.alert-info  { background: #eef4fe; border: 1px solid #cfe0fb; color: #1a4a94; }

/* --- overlay --- */

.overlay {
    position: fixed; inset: 0;
    background: rgba(22, 32, 44, .55);
    display: flex; align-items: center; justify-content: center;
    padding: 1.25rem;
    z-index: 50;
    /* A card taller than the viewport must stay reachable. Centring alone
       clips it at both ends with nothing to scroll -- on a landscape phone the
       geo warning lost its heading off the top edge. */
    overflow-y: auto;
}

/* Required. The `hidden` attribute only sets display:none in the UA
   stylesheet, and the author rule above beats it -- without this the modal is
   visible on page load no matter what the markup or JS say. */
.overlay[hidden] { display: none; }

.overlay-card {
    position: relative;
    /* Pairs with overflow-y on .overlay: auto margins centre the card when
       there is room and, unlike align-items, give way instead of clipping
       when there is not. */
    margin: auto;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 12px 40px rgba(22, 32, 44, .25);
}

.overlay-x {
    position: absolute;
    top: .5rem; right: .5rem;
    width: 40px; height: 40px;
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 8px;
}

.overlay-x:hover { background: var(--bg); color: var(--ink); }

.overlay-card h2 { margin: 0 0 .75rem; font-size: 1.25rem; }
.overlay-card p  { margin: 0 0 .75rem; color: var(--ink-soft); font-size: .9375rem; }

.overlay-close {
    margin-top: .75rem;
    min-height: 48px;
    width: 100%;
    border: 0;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

/* Quieter partner to .overlay-close, for the decline side of a two-button
   modal. Same 48px target so it is no harder to hit on a phone -- only the
   colour says which one is the suggested path. */
.overlay-secondary {
    margin-top: .5rem;
    min-height: 48px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-weight: 550;
    cursor: pointer;
}

.overlay-secondary:hover { background: var(--bg); color: var(--ink); }

/* The geo modal carries longer prose than the coming-soon one, so it reads
   left-aligned and a little wider rather than as a centred announcement. */
#geoWarn .overlay-card { max-width: 460px; text-align: left; }
#geoWarn .overlay-card h2 { font-size: 1.125rem; line-height: 1.35; }

/* Persistent non-US reminder under the submit button. Muted on purpose: it is
   a footnote for people who have already been warned once, not a second nag. */
.geo-note {
    margin: .75rem 0 0;
    font-size: .8125rem;
    color: var(--ink-soft);
    text-align: center;
}

.geo-note[hidden] { display: none; }

/* --- status / progress --- */

.status-wrap { text-align: center; padding: 2.5rem 1rem; }

.spinner {
    width: 44px; height: 44px;
    margin: 0 auto 1.25rem;
    border: 4px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 900ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .spinner { animation-duration: 2.5s; }
}

.status-title { margin: 0 0 .5rem; font-size: 1.25rem; font-weight: 700; }
.status-sub   { margin: 0; color: var(--ink-soft); }

.progress-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #eef4fe;
    border-radius: 10px;
    font-size: .875rem;
    color: #1a4a94;
}

/* --- results --- */

.results-header { padding: 1.5rem 0 .5rem; }
.results-header h1 { margin: 0 0 .35rem; font-size: 1.4rem; }
.results-meta { color: var(--ink-soft); font-size: .9375rem; margin: 0; }

.item-block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem;
    margin-bottom: 1rem;
}

.item-head { margin-bottom: .875rem; }

.item-name {
    margin: 0 0 .2rem;
    font-size: 1.0625rem;
    font-weight: 700;
}

.item-raw {
    margin: 0;
    font-size: .8125rem;
    color: var(--ink-faint);
    font-style: italic;
}

.item-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }

.tag {
    font-size: .75rem;
    font-weight: 600;
    padding: .2rem .5rem;
    border-radius: 999px;
    background: var(--bg);
    color: var(--ink-soft);
    border: 1px solid var(--line);
}

.tag-qty      { background: #eef4fe; color: #1a4a94; border-color: #cfe0fb; }
.tag-fungible { background: #f0f9f4; color: var(--good); border-color: #c7e6d4; }
.tag-diverse  { background: #fdf4e8; color: #96590d; border-color: #f5ddba; }
.tag-brand    { background: #f5f0fb; color: #6b3fa0; border-color: #ddd0ee; }

.product-card {
    display: flex;
    gap: .875rem;
    padding: .75rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    align-items: flex-start;
}

.product-card.is-primary { border-color: var(--brand); background: #f7faff; }

.product-thumb {
    width: 68px; height: 68px;
    flex: none;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.product-body { flex: 1; min-width: 0; }

.product-title {
    margin: 0 0 .3rem;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-meta {
    display: flex; flex-wrap: wrap; gap: .5rem;
    font-size: .8125rem; color: var(--ink-soft);
}

.product-price { font-weight: 700; color: var(--ink); }
.product-oos   { color: var(--bad); font-weight: 600; }

.product-reason {
    margin: .5rem 0 0;
    font-size: .8125rem;
    color: var(--ink-soft);
    line-height: 1.45;
}

.alternates { margin-top: .75rem; }

.alternates-label {
    font-size: .8125rem;
    font-weight: 650;
    color: var(--ink-soft);
    margin: 0 0 .5rem;
}

.alternate-slot { margin-bottom: 1rem; }
.alternate-slot:last-child { margin-bottom: 0; }
.alternates .product-card { margin-bottom: .5rem; }

.swap-btn {
    margin-top: .5rem;
    min-height: 40px;
    padding: 0 .9rem;
    border: 1.5px solid var(--brand);
    border-radius: 8px;
    background: var(--surface);
    color: var(--brand);
    font: inherit;
    font-size: .875rem;
    font-weight: 650;
    cursor: pointer;
}

.swap-btn:hover { background: #eef4fe; }
.swap-btn:disabled { opacity: .55; cursor: not-allowed; }

.item-problem {
    padding: .875rem;
    background: #fdf4e8;
    border: 1px solid #f5ddba;
    border-radius: 10px;
    font-size: .875rem;
    color: #96590d;
}

/* --- cart bar --- */

.cart-bar {
    position: sticky;
    bottom: 0;
    margin: 1.5rem -1rem 0;
    /* Tight on purpose: every pixel here is a pixel of item card the parent
       cannot see on a phone. */
    padding: .75rem 1rem;
    /* Matches the top padding; the env() still protects notched devices. */
    padding-bottom: max(.75rem, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--line);
}

.cart-summary {
    display: flex; justify-content: space-between;
    gap: .5rem;
    font-size: .875rem;
    margin-bottom: .5rem;
}

.cart-summary[hidden] { display: none; }

.cart-total { font-weight: 700; }

.cart-btn {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #2b1a05;
    font: inherit;
    font-size: 1.0625rem;
    font-weight: 750;
    cursor: pointer;
}

.cart-btn:hover { background: #e0871f; }
.cart-btn:disabled { background: var(--ink-faint); color: #fff; cursor: not-allowed; }

.cart-extra {
    margin-top: .625rem;
    font-size: .8125rem;
    color: var(--ink-soft);
    text-align: center;
}

/* It carries error text only when something has gone wrong. Empty, its
   margins were still costing 23px of permanent sticky overlay. */
.cart-extra:empty { margin: 0; display: none; }

.cart-extra a { color: var(--brand); }

/* --- footer --- */

.site-footer {
    margin-top: 2.5rem;
    padding: 1.25rem 1rem;
    text-align: center;
    font-size: .8125rem;
    color: var(--ink-faint);
}

.disclosure { margin: 0; }

.wordmark a { color: inherit; text-decoration: none; }

/* --- phase 5 additions --- */

.commission-note {
    margin: 0 0 1rem;
    text-align: center;
    font-size: .8125rem;
    color: var(--ink-soft);
}

/* Honeypot. Kept out of the layout without display:none or visibility:hidden,
   both of which the more careful bots check for. */
.hp-field {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px; height: 1px;
    overflow: hidden;
}

.capacity-card { text-align: center; }
.capacity-card h2 { margin-bottom: .75rem; }
.capacity-card p { color: var(--ink-soft); margin: 0 0 1.25rem; }
.waitlist-form { text-align: left; }

.turnstile-wrap { display: flex; justify-content: center; margin-bottom: 1rem; }

.cart-disclosure {
    margin: .45rem 0 0;
    font-size: .6875rem;
    line-height: 1.3;
    color: var(--ink-faint);
    text-align: center;
}

/* --- not-sourceable section --- */

.section-heading {
    margin: 2rem 0 .35rem;
    font-size: 1.125rem;
    font-weight: 700;
}

.section-sub {
    margin: 0 0 1rem;
    color: var(--ink-soft);
    font-size: .875rem;
}

.offline-list {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fcfdfe;
    padding: .35rem 1rem;
}

.offline-item {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: baseline;
    padding: .75rem 0;
    border-bottom: 1px solid var(--line);
}

.offline-item:last-child { border-bottom: 0; }

.offline-name { font-weight: 600; font-size: .9375rem; }
.offline-raw { color: var(--ink-faint); font-size: .8125rem; font-style: italic; flex-basis: 100%; }

.reason-tag {
    font-size: .75rem;
    font-weight: 600;
    padding: .2rem .5rem;
    border-radius: 999px;
    background: #fdf4e8;
    color: #96590d;
    border: 1px solid #f5ddba;
    white-space: nowrap;
}

/* --- expired / invalid link --- */

.notice-card {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.notice-card h2 { margin: 0 0 .75rem; }
.notice-card p { color: var(--ink-soft); margin: 0 0 1.25rem; }


/* --- phase 6: item controls --- */

.item-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.item-title-row .item-name { flex: 1; min-width: 0; }

.qty-control {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    flex: none;
    margin: 0;
    padding: .15rem .3rem .15rem .5rem;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-weight: 600;
    font-size: .8125rem;
}

.qty-label { color: var(--ink-soft); }

.qty-select {
    width: auto;
    min-height: 34px;
    min-width: 52px;
    padding: 0 .1rem 0 .35rem;
    border: 0;
    background: transparent;
    font: inherit;
    font-weight: 700;
    color: var(--ink);
}

.qty-select:focus { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

.item-actions { margin-top: .625rem; }

.skip-btn, .unskip-btn {
    min-height: 38px;
    padding: 0 .75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: .8125rem;
    font-weight: 600;
    cursor: pointer;
}

.skip-btn:hover { border-color: var(--bad); color: var(--bad); }

.unskip-btn {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--surface);
}

.unskip-btn:hover { background: #eef4fe; }

.item-block.is-skipped { opacity: .62; background: var(--bg); }
.item-block.is-skipped .item-name { text-decoration: line-through; }

.item-block.is-skipped .product-card.is-primary {
    border-color: var(--line);
    background: var(--surface);
}

/* --- source badges --- */

.source-badges {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-top: .4rem;
}

.source-badge {
    font-size: .6875rem;
    font-weight: 600;
    padding: .15rem .45rem;
    border-radius: 999px;
    background: #eef1f5;
    color: var(--ink-soft);
    border: 1px solid #dde3ea;
}

.offline-item .source-badges { flex-basis: 100%; margin-top: .2rem; }

/* --- view on Amazon --- */

.amazon-link {
    flex: none;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    margin: -.25rem -.25rem 0 0;
    color: var(--ink-faint);
    border-radius: 8px;
    text-decoration: none;
}

.amazon-link:hover { color: var(--brand); background: var(--bg); }
.amazon-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }

/* --- shopping report --- */

.report {
    margin-top: .75rem;
    border-top: 1px solid var(--line);
    padding-top: .625rem;
}

.report-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    list-style: none;
    cursor: pointer;
    font-size: .8125rem;
    color: var(--ink-soft);
    padding: .2rem 0;
}

.report-summary::-webkit-details-marker { display: none; }

.report-toggle { color: var(--brand); font-weight: 600; white-space: nowrap; }
.report-toggle::after { content: " \25be"; }
.report[open] .report-toggle::after { content: " \25b4"; }

.report-body { padding: .5rem 0 .25rem; }

.report-section { margin-bottom: .75rem; }
.report-section:last-child { margin-bottom: 0; }

.report-heading {
    margin: 0 0 .25rem;
    font-size: .8125rem;
    font-weight: 700;
    color: var(--ink);
}

.report-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: .8125rem;
    color: var(--ink-soft);
    line-height: 1.5;
}

.report-note { margin: 0; font-size: .8125rem; color: var(--ink-soft); }
.report-reason { color: var(--ink-faint); }

/* --- phase 6: the list stack --- */

.add-text-btn {
    margin-top: .75rem;
    width: 100%;
    min-height: 46px;
    border: 1.5px solid var(--brand);
    border-radius: 10px;
    background: var(--surface);
    color: var(--brand);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.add-text-btn:hover { background: #eef4fe; }

.list-stack { margin-top: 1.25rem; }

.list-stack-label {
    margin: 0 0 .5rem;
    font-size: .875rem;
    font-weight: 700;
    color: var(--ink);
}

.list-card {
    display: flex;
    gap: .75rem;
    align-items: flex-start;
    padding: .75rem;
    margin-bottom: .625rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.list-thumb {
    width: 52px; height: 52px;
    flex: none;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-thumb img { width: 100%; height: 100%; object-fit: cover; }

.list-thumb.is-doc {
    font-size: .6875rem;
    font-weight: 700;
    color: var(--ink-faint);
    letter-spacing: .03em;
}

.list-card-body { flex: 1; min-width: 0; }

.list-source {
    margin: 0 0 .35rem;
    font-size: .75rem;
    color: var(--ink-faint);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-name-input {
    min-height: 42px;
    padding: .45rem .6rem;
    font-size: 16px;
    font-weight: 600;
}

.list-name-hint {
    margin: .3rem 0 0;
    font-size: .75rem;
    color: var(--ink-faint);
    line-height: 1.4;
}

.list-remove {
    flex: none;
    width: 36px; height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-faint);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.list-remove:hover { background: #fdeeee; color: var(--bad); }

.list-warning {
    margin: .5rem 0 0;
    padding: .625rem .75rem;
    background: #fdf4e8;
    border: 1px solid #f5ddba;
    border-radius: 8px;
    font-size: .8125rem;
    color: #96590d;
}

.submit-btn:disabled { background: var(--ink-faint); cursor: not-allowed; }

/* --- phase 6.1: upload optimisation + turnstile --- */

.optimize-note {
    margin: 1rem 0 0;
    padding: .625rem .75rem;
    background: #eef4fe;
    border: 1px solid #cfe0fb;
    border-radius: 8px;
    font-size: .8125rem;
    font-weight: 600;
    color: #1a4a94;
}

/* Turnstile's Managed widget keeps showing its success tick, which reads as a
   step still to do. Hide it once solved.

   display:none rather than a max-height collapse: the wrapper is a flex
   container and the collapse did not reliably win the cascade against the
   base rule. The iframe stays in the DOM, so the token remains valid. */
.turnstile-wrap.is-solved {
    display: none !important;
}

/* --- phase 6.4: sequential batch actions --- */

/* Completed batches, collapsed to chips. Still tappable, because re-adding a
   batch is sometimes what you want. */
.batch-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem;
    margin-bottom: .4rem;
}

.batch-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 .6rem;
    border: 1px solid #c7e6d4;
    border-radius: 999px;
    background: #f0f9f4;
    color: var(--good);
    font: inherit;
    font-size: .75rem;
    font-weight: 650;
    cursor: pointer;
    white-space: nowrap;
}

.batch-chip:hover { background: #e3f4ea; }

.batch-chip.is-tapped {
    background: var(--good);
    color: #fff;
    border-color: var(--good);
}

.batch-btn { display: block; width: 100%; }

.batch-status {
    margin: .4rem 0 0;
    text-align: center;
    font-size: .75rem;
    color: var(--ink-soft);
}

.batch-done {
    margin: .25rem 0 0;
    text-align: center;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--good);
}

/* One collapsed line. A tooltip would be the wrong control here -- there is
   no hover on a phone. */
.batch-why {
    margin-top: .3rem;
    font-size: .6875rem;
    color: var(--ink-faint);
}

.batch-why summary {
    cursor: pointer;
    list-style: none;
    text-align: center;
    padding: .15rem 0;
}

.batch-why summary::-webkit-details-marker { display: none; }
.batch-why summary::after { content: " \25be"; }
.batch-why[open] summary::after { content: " \25b4"; }

.batch-why p {
    margin: .35rem 0 0;
    line-height: 1.45;
    text-align: center;
}

/* The shopping report now renders at the end of the list rather than inside
   the sticky overlay. */
.report-inline {
    margin-top: 1.5rem;
    padding: .75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.report-inline .report { margin-top: 0; border-top: 0; padding-top: 0; }

/* --- phase 6.3: collapsible alternates --- */

.alternates-toggle {
    display: flex;
    align-items: center;
    gap: .45rem;
    width: 100%;
    min-height: 44px;
    padding: .4rem 0;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font: inherit;
    font-size: .8125rem;
    font-weight: 650;
    cursor: pointer;
    text-align: left;
}

.alternates-toggle:hover { color: var(--brand); }

.alternates-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 .3rem;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--line);
    font-size: .6875rem;
    font-weight: 700;
}

.alternates-caret {
    width: 0; height: 0;
    margin-left: auto;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid currentColor;
    transition: transform .18s ease;
}

.alternates:not(.is-collapsed) .alternates-caret { transform: rotate(180deg); }

.alternates-toggle.is-loading .alternates-caret {
    border-top-color: transparent;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.alternates-toggle.is-loading::after {
    content: "";
    width: 14px; height: 14px;
    margin-left: auto;
    border: 2px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.alternates-toggle.is-loading .alternates-caret { display: none; }

.alternates-body { padding-top: .35rem; }

/* --- phase 6.3: real progress on the waiting page --- */

.status-expectation {
    max-width: 30rem;
    margin: 0 auto 1.5rem;
    color: var(--ink-soft);
    font-size: .9375rem;
    line-height: 1.55;
}

.progress-track {
    height: 8px;
    max-width: 26rem;
    margin: 0 auto 1rem;
    background: var(--line);
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--brand);
    border-radius: 999px;
    /* Slow enough to read as real movement, not an animation loop. */
    transition: width .6s ease;
}

.status-sub {
    margin: 0 0 1rem;
    font-weight: 650;
    color: var(--ink);
}

.status-elapsed {
    margin: 1.25rem 0 0;
    font-size: .8125rem;
    color: var(--ink-faint);
}

.status-wrap .spinner { margin-bottom: 0; }
.status-wrap .spinner[hidden] { display: none; }

/* --- phase 6.5: worker offline --- */

.alert-warn {
    background: #fdf4e8;
    border: 1px solid #f5ddba;
    color: #8a5209;
}
