/* shop.antonnovikov.com — catalog, calculator, account and order pages.
   Tokens and components (.page, .home, .facts, .page-head, .sec-title, .rows, .btn, .chip,
   .input, .table) come from styles.css; this file only adds what the shop needs
   and uses nothing but the site's tokens, so both themes work unchanged.
   The home page is the site's own two-column page; the calculator speaks the same language:
   a small-caps label on the left, the content on the right, figures like `.facts`. */

/* the strip above every shop page: who you are on the left, the shop links with their
   counts on the right (always visible, nothing to open); breadcrumbs sit under it */
.shop .page-head { max-width: 52rem; }
.shop .lede { overflow-wrap: anywhere; }
.shop-bar {
    display: flex;
    align-items: center;
    min-height: 42px;
    margin: -0.5rem 0 1.1rem;
    padding: 0;
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-sm);
}
.home-main > .shop-bar { margin-top: 0; }
.shop-nav, .shop-bar-guest { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; gap: 0 1.2rem; margin: 0; --who-dot: var(--ok); }
.shop-nav[data-who="admin"] { --who-dot: var(--accent); }
.shop-nav-id { display: flex; align-items: center; gap: 0.5rem; margin-right: auto; min-width: 0; color: var(--fg-dim); }
.shop-nav-id strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); font-weight: 600; }
.shop-nav-mail { flex-shrink: 4; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xs); }
.shop-dot { flex: none; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--who-dot); }
.shop-badge { flex: none; padding: 0 0.35rem; border: 1px solid var(--accent); border-radius: 3px; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent); }
.shop-nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1.2rem; }
.shop-nav a, .shop-nav button, .shop-bar-guest a:not(.btn) {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--fg-mid);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.shop-nav a:hover, .shop-nav button:hover, .shop-bar-guest a:not(.btn):hover { color: var(--accent); }
.shop-nav form { display: flex; align-items: center; padding-left: 1.2rem; border-left: 1px solid var(--border); }
/* count circles: grey = how many, red = needs you */
.shop-count {
    display: inline-grid;
    place-items: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    line-height: 1;
    color: var(--fg-mid);
    text-decoration: none;
}
.shop-count.is-hot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
/* not signed in: the hint on the left, the two ways in on the right */
.shop-bar-hint { margin-right: auto; color: var(--fg-dim); }
.shop-bar-guest .btn { min-height: 34px; }
.shop-bar + .shop-crumbs { margin-top: 0; }
@media (max-width: 560px) { .shop-bar-hint, .shop-nav-mail { display: none; } .shop-bar-guest { justify-content: flex-end; } }
/* narrow windows and phones: who you are + log out on the first row, the links on the second. The
   switch is at 880px, not 700px: the Russian labels ("Обратная связь") need about 770px to sit in one row,
   and a half-wrapped row (name cut to "Ad…", "Магазин" dropped under the links) looks worse than two clean ones */
.shop-nav-links { white-space: nowrap; }
@media (max-width: 880px) {
    .shop-nav { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id out" "links links"; gap: 0 1rem; }
    .shop-nav-id { grid-area: id; margin-right: 0; }
    .shop-nav form { grid-area: out; padding-left: 0; border-left: 0; }
    .shop-nav-links { grid-area: links; gap: 0 0.9rem; border-top: 1px solid var(--border); white-space: normal; }
}
@media (max-width: 700px) {
    /* the crumbs already say where you are: skip the eyebrow that repeats them */
    .shop-crumbs { min-height: 32px; }
    .shop-crumbs + .page-head .eyebrow { display: none; }
}

.shop-sec { margin-top: 2.6rem; }
.page-head + .shop-sec, .shop-crumbs + .page-head + .shop-sec { margin-top: 0; }
.shop-narrow { max-width: 28rem; }

.shop-cta { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.shop-sec > .shop-cta { margin-top: 1rem; }

.shop-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    margin: -0.5rem 0 0.5rem;
    font-size: var(--fs-sm);
    color: var(--fg-dim);
}
.shop-crumbs a { color: var(--fg-mid); }
.shop-crumbs a:hover { color: var(--accent); }

.shop-head-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
    margin-top: 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    color: var(--fg-dim);
}

/* ── home: the site's two-column page; the contents list carries the prices ────── */
.shop-home .home-role { max-width: 17rem; }
.shop-home .facts dd { font-size: clamp(1.45rem, 1rem + 1.4vw, 2.1rem); }
.shop-home .home-sec { margin-bottom: 2rem; }
.shop-toc { list-style: none; margin-top: 2.2rem; border-top: 1px solid var(--border-strong); }
.shop-toc li { border-bottom: 1px solid var(--border); }
.shop-svc {
    display: grid;
    grid-template-columns: 2.4rem minmax(0, 1fr) auto;
    column-gap: 1rem;
    row-gap: 0.2rem;
    align-items: baseline;
    padding: 1.15rem 0 1.1rem;
    border-bottom: 0;
    color: inherit;
    text-decoration: none;
}
.shop-svc-n { grid-column: 1; grid-row: 1; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent); }
.shop-svc-head { grid-column: 2 / 4; grid-row: 1; display: flex; align-items: baseline; gap: 0.7rem; min-width: 0; }
.shop-svc-title { font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.005em; line-height: 1.3; }
.shop-svc-fill { flex: 1 1 1rem; min-width: 1rem; border-bottom: 1px dotted var(--border-strong); transform: translateY(-0.3em); }
.shop-svc-price { font-family: var(--font-mono); font-size: 0.9375rem; white-space: nowrap; color: var(--fg); }
.shop-svc-text { grid-column: 2; grid-row: 2; max-width: var(--measure); font-size: var(--fs-sm); color: var(--fg-mid); }
.shop-svc-meta { grid-column: 3; grid-row: 2; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--fg-dim); text-align: right; white-space: nowrap; }
.shop-svc:hover .shop-svc-title { color: var(--accent); }
.shop-svc:hover .shop-svc-fill { border-bottom-style: solid; border-bottom-color: var(--accent); }
.shop-svc:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 640px) {
    .shop-svc { grid-template-columns: 2rem minmax(0, 1fr); column-gap: 0.6rem; }
    .shop-svc-head { grid-column: 2; flex-wrap: wrap; gap: 0.1rem 0.8rem; }
    .shop-svc-fill { display: none; }
    .shop-svc-text { grid-column: 2; }
    .shop-svc-meta { grid-column: 2; grid-row: 3; text-align: left; white-space: normal; }
}

.shop-steps { list-style: none; counter-reset: step; max-width: var(--measure); border-top: 1px solid var(--border); }
/* the number sits in the left gutter; heading and text flow in one block (a grid
   made the bare text node its own item in the 2rem number column) */
.shop-steps li {
    counter-increment: step;
    position: relative;
    padding: 0.8rem 0 0.8rem 2.2rem;
    border-bottom: 1px solid var(--border);
    color: var(--fg-mid);
}
.shop-steps li::before { content: counter(step); position: absolute; left: 0; top: 0.95rem; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); }
.shop-steps strong { display: block; color: var(--fg); font-weight: 600; }

.shop-list { list-style: none; max-width: var(--measure); }
.shop-list li { position: relative; padding: 0.35rem 0 0.35rem 1.3rem; color: var(--fg-mid); }
.shop-list li::before { content: '–'; position: absolute; left: 0; color: var(--accent); }

.shop-faq { max-width: var(--measure); border-top: 1px solid var(--border); }
.shop-faq details { border-bottom: 1px solid var(--border); }
.shop-faq summary, .shop-danger summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 48px;
    padding: 0.4rem 0;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
}
.shop-faq summary::-webkit-details-marker, .shop-danger summary::-webkit-details-marker { display: none; }
.shop-faq summary::after { content: '+'; font-family: var(--font-mono); color: var(--accent); }
.shop-faq details[open] summary::after { content: '–'; }
.shop-faq details p { padding-bottom: 0.6rem; }
.shop-security { display: grid; gap: 0.9rem; max-width: 34rem; margin: 1.6rem 0; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.shop-sub { font-size: var(--fs-md); font-weight: 600; }
.shop-security summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; font-weight: 600; }
.shop-danger { margin-top: 1.4rem; max-width: 34rem; }
.shop-danger summary { justify-content: flex-start; font-weight: 400; color: var(--fg-mid); }

/* filters (the owner's order list) */
.shop-chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }
.shop-chips .chip { text-decoration: none; border-bottom: 1px solid var(--border-strong); }
.shop-chips .chip[data-active] { background: var(--fg); border-color: var(--fg); color: var(--bg); }

/* the service picker of the calculator: words, the current one underlined (the links are `.chip` for the script) */
.shop-pick { list-style: none; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.shop-pick .chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    color: var(--fg-mid);
    font-size: 0.9375rem;
    text-decoration: none;
}
.shop-pick .chip:hover { color: var(--fg); }
.shop-pick .chip[data-active] { background: none; color: var(--fg); font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ── calculator: the estimate on the left, ruled option rows on the right ──────── */
.shop-calc { display: grid; gap: 1.2rem 4.5rem; align-items: start; margin-top: 1.4rem; }
@media (min-width: 900px) { .shop-calc { grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr); } }

.shop-estimate { min-width: 0; }
@media (min-width: 900px) { .shop-estimate { position: sticky; top: 82px; } }
.shop-estimate-label { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: 0.08em; color: var(--accent); }
.shop-figs { margin-top: 0.5rem; border-top: 1px solid var(--border); }
.shop-fig { display: flex; flex-direction: column; gap: 0.4rem; padding: 0.95rem 0 0.9rem; border-bottom: 1px solid var(--border); }
.shop-fig[hidden] { display: none; }
.shop-fig dd { order: -1; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.shop-fig-main dd { font-size: clamp(1.9rem, 1.4rem + 1.3vw, 2.4rem); letter-spacing: -0.02em; }
.shop-fig-text dd { font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0; line-height: 1.4; }
.shop-fig dt { font-size: var(--fs-xs); color: var(--fg-dim); letter-spacing: 0.02em; line-height: 1.35; }
.shop-fig [data-out].is-tick { display: inline-block; animation: shop-tick 0.3s ease-out; }
@keyframes shop-tick { from { opacity: 0.25; transform: translateY(0.2em); } to { opacity: 1; transform: none; } }
/* what the last click cost, for a moment next to the price */
.shop-fig-main dd { position: relative; }
.shop-delta { position: absolute; right: 0; bottom: -1.3rem; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0; color: var(--accent); opacity: 0; transition: opacity 0.25s; white-space: nowrap; }
.shop-delta.is-on { opacity: 1; }
.shop-estimate .shop-fine { margin-top: 0.9rem; }
.shop-estimate-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.js .shop-estimate-actions [data-calc-submit] { display: none; }
@media (prefers-reduced-motion: reduce) { .shop-fig [data-out].is-tick { animation: none; } .shop-delta { transition: none; } }

.shop-rows { min-width: 0; border-top: 1px solid var(--border); }
.shop-legend-note { padding: 0.75rem 0; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.5; color: var(--fg-dim); }
.shop-opt { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 0 1.5rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border); }
.shop-opt[hidden] { display: none; }
.shop-opt-label { padding-top: 0.95rem; font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim); line-height: 1.4; }
.shop-opt-body { min-width: 0; padding-bottom: 0.4rem; }
.shop-help { max-width: var(--measure); margin: -0.05rem 0 0.3rem; font-size: var(--fs-xs); line-height: 1.55; color: var(--fg-dim); }
.shop-choices { display: flex; flex-wrap: wrap; gap: 0 1.6rem; }
.shop-choices.is-tiers { flex-direction: column; }

/* a choice is words you tick: [ ] / [×] for several, ( ) / (●) for one; the real input is invisible but covers it */
.shop-choice { position: relative; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.5rem; min-height: 44px; padding: 0.6rem 0; color: var(--fg-mid); cursor: pointer; }
.shop-choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.shop-mark { flex: none; min-width: 1.9rem; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--fg-dim); white-space: pre; }
.shop-choice input[type="checkbox"] ~ .shop-mark::before { content: '[ ]'; }
.shop-choice input[type="checkbox"]:checked ~ .shop-mark::before { content: '[×]'; }
.shop-choice input[type="radio"] ~ .shop-mark::before { content: '( )'; }
.shop-choice input[type="radio"]:checked ~ .shop-mark::before { content: '(●)'; }
.shop-choice-text { line-height: 1.35; }
.shop-choice-help { flex: 1 1 12rem; min-width: 0; font-size: var(--fs-sm); line-height: 1.4; color: var(--fg-dim); }
.shop-choice-price { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--fg-dim); white-space: nowrap; }
/* tiers with a description: the name and the price share the first line, the description sits under the name */
.shop-choices.is-tiers .shop-choice { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 0.5rem; align-items: baseline; width: 100%; padding: 0.7rem 0; }
.shop-choices.is-tiers .shop-choice-text { grid-column: 2; grid-row: 1; }
.shop-choices.is-tiers .shop-choice-price { grid-column: 3; grid-row: 1; text-align: right; }
.shop-choices.is-tiers .shop-choice-help { grid-column: 2 / 4; grid-row: 2; margin-top: 0.2rem; }
.shop-choice:hover { color: var(--fg); }
.shop-choice input:checked ~ .shop-choice-text { color: var(--fg); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.shop-choice input:checked ~ .shop-mark, .shop-choice input:checked ~ .shop-choice-price { color: var(--accent); }
.shop-choice input:focus-visible ~ .shop-choice-text { outline: 2px solid var(--focus); outline-offset: 3px; }

.shop-number { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem 0.5rem; min-height: 44px; padding: 0.35rem 0; }
.shop-num {
    width: 3.4rem;
    min-height: 36px;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--border-strong);
    border-radius: 0;
    background: transparent;
    color: var(--fg);
    font-family: var(--font-mono);
    font-size: 1rem;
    text-align: center;
}
.shop-num:focus { border-bottom-color: var(--accent); }
.js .shop-num { -moz-appearance: textfield; appearance: textfield; }
.js .shop-num::-webkit-outer-spin-button, .js .shop-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop-step { width: 36px; height: 36px; border: 1px solid var(--border-strong); border-radius: 3px; background: none; color: var(--fg); font-family: var(--font-mono); font-size: 1rem; line-height: 1; cursor: pointer; }
.shop-step:hover { border-color: var(--accent); color: var(--accent); }
.shop-number-note { margin-left: 0.5rem; font-size: var(--fs-sm); color: var(--fg-dim); }

.shop-fine { margin-top: 0.8rem; max-width: var(--measure); font-size: var(--fs-xs); line-height: 1.5; color: var(--fg-dim); }

/* a phone: the estimate is a bar at the bottom of the form, the figures stay in view while you tick */
@media (max-width: 899px) {
    .shop-calc { display: flex; flex-direction: column; gap: 1.2rem; }
    .shop-rows { order: 1; }
    .shop-estimate {
        order: 2;
        position: sticky;
        bottom: 0;
        z-index: 4;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.8rem;
        margin: 0 calc(var(--pad-x) * -1);
        padding: 0.55rem var(--pad-x) calc(0.55rem + env(safe-area-inset-bottom, 0px));
        background: var(--bg);
        border-top: 1px solid var(--border-strong);
    }
    .shop-estimate-label, .shop-estimate .shop-fine, .shop-fig-text { display: none; }
    .shop-figs { display: flex; flex-wrap: wrap; gap: 0 1.2rem; min-width: 0; margin: 0; border: 0; }
    .shop-fig { padding: 0; border: 0; gap: 0.1rem; }
    .shop-fig dd, .shop-fig-main dd { font-size: 1.0625rem; }
    .shop-fig dt { display: none; }
    .shop-estimate-actions { flex: none; margin: 0; }
    .shop-estimate-actions .btn { min-height: 40px; padding-inline: 0.9rem; }
    .shop-estimate-actions .btn:not(.btn-primary) { display: none; }
}
@media (max-width: 640px) {
    .shop-opt { grid-template-columns: 1fr; }
    .shop-opt-label { padding-top: 0.8rem; }
}

/* the subscriptions page: plan matrix and prices per service (the site's .table, row headers set in plain type) */
.shop-plans { min-width: 34rem; }
.shop-plans tbody th { padding: 0.55rem 0.75rem 0.55rem 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); font-weight: 500; letter-spacing: 0; color: var(--fg); text-align: left; }
.shop-plans td { color: var(--fg-mid); }
.shop-plans td.is-main { color: var(--fg); font-weight: 600; }
.shop-plans thead th.is-main { color: var(--accent); }
.shop-plans a { color: var(--fg); }

/* forms */
.shop-form { display: grid; gap: 1rem; max-width: 40rem; margin-top: 1rem; }
.shop-field { display: grid; gap: 0.35rem; }
.shop-field > span { font-size: var(--fs-sm); color: var(--fg-mid); }
.shop-textarea { min-height: 8rem; padding: 0.65rem 0.85rem; line-height: 1.5; resize: vertical; }
.shop-inline { display: flex; flex-wrap: wrap; align-items: end; gap: 0.8rem; margin-top: 1rem; }
.shop-inline .shop-field { min-width: 14rem; }
.shop-summary { font-size: var(--fs-sm); color: var(--fg-mid); }
.shop-summary strong { color: var(--fg); }
/* the request as a ruled document: small-caps label on the left, a line to write on at the right */
.shop-ruled { max-width: 52rem; gap: 0; border-top: 1px solid var(--border); }
.shop-ruled > * { margin-top: 0.9rem; }
.shop-ruled .shop-field { grid-template-columns: 9.5rem minmax(0, 1fr); align-items: start; gap: 0 1.5rem; margin-top: 0; padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.shop-ruled .shop-field > span { padding-top: 0.8rem; font-size: var(--fs-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-dim); line-height: 1.4; }
.shop-ruled .input { padding: 0.6rem 0; border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0; background: transparent; }
.shop-ruled .input:focus { border-bottom-color: var(--accent); }
.shop-ruled .shop-textarea { min-height: 7rem; }
.shop-ruled .btn { justify-self: start; margin-bottom: 0.5rem; }
@media (max-width: 640px) { .shop-ruled .shop-field { grid-template-columns: 1fr; } .shop-ruled .shop-field > span { padding-top: 0.2rem; } }
.shop-errors, .shop-ok, .shop-state {
    list-style: none;
    max-width: 40rem;
    padding: 0.7rem 0.9rem;
    border-left: 4px solid var(--err);
    background: var(--bg-tag);
    font-size: var(--fs-sm);
    color: var(--fg);
}
.shop-ok { border-left-color: var(--ok); margin-bottom: 1.2rem; }
.shop-state { border-left-color: var(--border-strong); color: var(--fg-mid); margin: 1rem 0; }

/* orders */
.shop-status {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 0.55rem;
    margin: 0 0.3rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.02em;
    color: var(--fg-mid);
    white-space: nowrap;
}
.shop-status[data-status="new"] { color: var(--warn); }
.shop-status[data-status="quoted"], .shop-status[data-status="in_progress"] { color: var(--accent); }
.shop-status[data-status="done"], .shop-status[data-status="agreed"] { color: var(--ok); }

/* the owner's offer on an order */
.shop-offer { border: 1px solid var(--border-strong); border-left: 4px solid var(--accent); padding: 1rem 1.2rem 1.2rem; background: var(--bg-pre); max-width: 46rem; }
.shop-offer[data-offer="accepted"] { border-left-color: var(--ok); }
.shop-offer[data-offer="declined"] { border-left-color: var(--border-strong); }
.shop-offer .sec-title { margin-bottom: 0.8rem; }
.shop-offer-price { margin: 0.2rem 0 0.6rem; font-size: 1.6rem; font-weight: 650; letter-spacing: -0.01em; }
.shop-offer-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.8rem; margin-top: 1rem; }
.shop-offer-actions form { margin: 0; }
.shop-offer-decline { display: grid; gap: 0.5rem; flex: 1 1 18rem; }
.shop-status[data-status="cancelled"] { color: var(--fg-dim); }
.shop-orders .meta { display: block; margin-top: 0.15rem; }

.shop-facts { max-width: 44rem; border-top: 1px solid var(--border); }
.shop-facts > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.shop-facts dt { color: var(--fg-dim); }
.shop-facts dd { overflow-wrap: anywhere; }
@media (max-width: 520px) { .shop-facts > div { grid-template-columns: 1fr; gap: 0.1rem; } }
.shop-brief { margin-top: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }

.shop-thread, .shop-feedback { list-style: none; max-width: 44rem; margin-bottom: 1rem; }
.shop-msg { padding: 0.7rem 1rem; margin-bottom: 0.7rem; border-left: 3px solid var(--border-strong); background: var(--bg-tag); }
.shop-msg[data-author="owner"] { border-left-color: var(--accent); }
.shop-msg[data-handled] { opacity: 0.6; }
.shop-msg .prose { margin: 0.3rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
.shop-msg form { margin-top: 0.6rem; }

/* "refine from the description" row of the calculator */
.shop-ai .shop-field { margin-top: 0.4rem; }
.shop-ai .shop-textarea { min-height: 5.5rem; font-size: var(--fs-sm); }
.shop-ai .btn { margin-top: 0.7rem; }
.shop-ai [data-ai-msg]:not(:empty) { color: var(--fg); padding-left: 0.6rem; border-left: 3px solid var(--accent); }

/* admin order page */
.shop-status-pick { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.shop-status-pick .chip { min-height: 38px; padding: 0 0.95rem; font-size: var(--fs-sm); }
.shop-lead { max-width: 46rem; margin: -0.6rem 0 1.2rem; font-size: var(--fs-sm); color: var(--fg-mid); }
.shop-edit-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.4rem; max-width: 52rem; margin-bottom: 1.6rem; }
.shop-field-wide { grid-column: 1 / -1; }
.shop-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 11rem)); gap: 1rem 1.2rem; }
.shop-offer-form { max-width: 46rem; }
.shop-offer-now { margin-bottom: 1.2rem; }
.shop-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; }
.shop-withdraw { margin-top: 0.8rem; }
.shop-fill-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.9rem; margin: 0.2rem 0 1.1rem; }
.shop-fill-row .shop-fine { margin: 0; }
.shop-fill { min-height: 36px; }
.shop-link-btn { padding: 0; border: 0; background: none; color: var(--fg); font: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; cursor: pointer; }
.shop-link-btn:hover { color: var(--accent); text-decoration-color: var(--accent); }
@media (max-width: 640px) { .shop-edit-fields, .shop-grid3 { grid-template-columns: minmax(0, 1fr); } }

/* orders list on phones: one card per order instead of a table that scrolls sideways */
@media (max-width: 700px) {
    .shop-orders, .shop-orders tbody, .shop-orders tr, .shop-orders td { display: block; }
    .shop-orders thead { display: none; }
    .shop-orders tr { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.9rem; padding: 0.8rem 0; border-bottom: 1px solid var(--border); }
    .shop-orders td { padding: 0; border: 0; }
    .shop-orders .shop-orders-title, .shop-orders .shop-orders-client, .shop-orders td.num { flex: 1 0 100%; }
    .shop-orders .shop-orders-title { font-size: var(--fs-md, 1rem); margin-top: 0.15rem; }
    .shop-orders td.num { text-align: left; color: var(--fg-mid); }
}

.shop-from-mo { display: block; margin-top: 0.1rem; font-size: var(--fs-xs); color: var(--fg-dim); }

/* the table the owner's offer note can carry (app/shop/notes.py): a table on a wide screen,
   one small card per row on a phone (the cell's data-label says what each value is) */
.shop-note-table { margin: 0.5rem 0; font-size: var(--fs-sm); white-space: normal; }
.shop-note-table th:last-child, .shop-note-table td:last-child { text-align: right; white-space: nowrap; }
.shop-note-table td { overflow-wrap: break-word; }
@media (max-width: 700px) {
    .shop-note-table, .shop-note-table tbody, .shop-note-table tr, .shop-note-table td { display: block; }
    .shop-note-table thead { display: none; }
    .shop-note-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 0.9rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border); }
    .shop-note-table td, .shop-note-table td:last-child { padding: 0; border: 0; text-align: left; white-space: normal; }
    .shop-note-table td:first-child { grid-column: 1; font-weight: 600; color: var(--fg); }
    .shop-note-table td:last-child { grid-column: 2; grid-row: 1; text-align: right; white-space: nowrap; font-weight: 600; color: var(--fg); }
    .shop-note-table td:not(:first-child):not(:last-child) { grid-column: 1 / -1; color: var(--fg-mid); }
    .shop-note-table td[data-label]:not(:first-child):not(:last-child)::before { content: attr(data-label) ": "; color: var(--fg-dim); }
}
/* very narrow: the amount drops under the name instead of squeezing it */
@media (max-width: 440px) {
    .shop-note-table td:last-child { grid-column: 1 / -1; grid-row: auto; text-align: left; white-space: normal; order: 1; color: var(--accent); }
    .shop-note-table td:first-child { order: 0; }
    .shop-note-table td:not(:first-child):not(:last-child) { order: 2; }
}
