/* Admin layout — builds on the tokens in app.css */
body.admin { background: var(--paper-2); }
.admin-shell { display: grid; min-height: 100dvh; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .admin-shell { grid-template-columns: 240px 1fr; } }
.admin-side { background: #171816; color: #d9d7d0; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s4); }
@media (min-width: 1024px) { .admin-side { position: sticky; top: 0; height: 100dvh; overflow-y: auto; } }
.admin-side .logo { color: #f5f2ec; margin: 0; }
.admin-side .logo-text small { color: #a5a39b; }
.admin-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
@media (min-width: 1024px) { .admin-nav { flex-direction: column; flex-wrap: nowrap; } }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: #d9d7d0; text-decoration: none; font-size: var(--fs-sm); font-weight: 500; }
.admin-nav a:hover { background: #262724; color: #f5f2ec; }
.admin-nav a[aria-current='page'] { background: #383633; color: #f5f2ec; }
.admin-nav .count { margin-left: auto; background: var(--gold); color: #1b1c1a; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
.admin-nav .sep { height: 1px; background: #2c2d2a; margin: 8px 0; }
.admin-side .who { margin-top: auto; font-size: var(--fs-xs); color: #a5a39b; }
.admin-side .who button { color: #f5f2ec; border-color: #3a3b37; }
.admin-main { padding: var(--s5) var(--s4); min-width: 0; }
@media (min-width: 768px) { .admin-main { padding: var(--s6); } }
.admin-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s5); }
.admin-head h1 { font-size: var(--fs-xl); margin: 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); }
.panel + .panel { margin-top: var(--s4); }
.panel h2 { font-size: var(--fs-md); }
.panel-grid { display: grid; gap: var(--s4); }
@media (min-width: 1100px) { .panel-grid-2 { grid-template-columns: 1fr 1fr; } .panel-grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); align-items: start; } }
.kpis { display: grid; gap: var(--s3); grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: var(--s5); }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); text-decoration: none; color: var(--ink); display: block; }
.kpi:hover { border-color: var(--line-strong); color: var(--ink); }
.kpi strong { display: block; font-size: 1.7rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: end; margin-bottom: var(--s4); }
.filters .field { min-width: 140px; }
.filters .input, .filters .select { min-height: 40px; font-size: var(--fs-sm); padding-block: 6px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); background: var(--paper); }
.admin-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--paper-2); position: sticky; top: 0; }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tr:hover td { background: var(--paper-2); }
.admin-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.admin-table input.input, .admin-table select.select { min-height: 36px; padding: 6px 10px; font-size: var(--fs-sm); }
.admin-table .price-input { width: 110px; text-align: right; }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.item-card { display: grid; gap: var(--s4); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
@media (min-width: 900px) { .item-card { grid-template-columns: 220px 1fr; } }
.item-card + .item-card { margin-top: var(--s3); }
.photo-box { background: var(--paper-3); border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; min-height: 200px; }
.photo-box img { max-height: 280px; width: auto; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; font-size: var(--fs-sm); margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.instructions-box { background: var(--gold-tint); border: 1px solid #e7d7ae; border-radius: var(--radius-sm); padding: var(--s3); font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
.stage-steps { display: flex; flex-wrap: wrap; gap: 4px; margin: var(--s2) 0; }
.stage-steps span { font-size: 11px; padding: 3px 8px; border-radius: var(--radius-pill); background: var(--paper-3); color: var(--muted); font-weight: 600; }
.stage-steps span.done { background: var(--success-tint); color: var(--success); }
.stage-steps span.current { background: var(--green); color: #f5f2ec; }
.events { list-style: none; margin: 0; padding: 0; font-size: var(--fs-sm); }
.events li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.events .meta { font-size: var(--fs-xs); color: var(--muted); }
.i18n-grid { display: grid; gap: var(--s3); }
@media (min-width: 900px) { .i18n-grid { grid-template-columns: repeat(5, 1fr); } .i18n-grid.long { grid-template-columns: 1fr 1fr; } }
.i18n-grid label { font-size: var(--fs-xs); }
.shape-preview { width: 160px; height: 200px; background: var(--paper-3); border-radius: var(--radius); display: grid; place-items: center; padding: var(--s3); }
.settings-nav { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s5); }
.danger-zone { border-color: var(--error-line); }
.conv-log { display: flex; flex-direction: column; gap: var(--s3); max-height: 560px; overflow-y: auto; padding: var(--s3); background: var(--paper-2); border-radius: var(--radius); }
.conv-log .msg-customer { align-self: flex-start; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; border-bottom-right-radius: 16px; }
.conv-log .msg-staff { align-self: flex-end; background: var(--green); color: #f5f2ec; border: 0; border-bottom-right-radius: 4px; border-bottom-left-radius: 16px; }
.admin-login { max-width: 420px; margin: 10vh auto; }
.flag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 6px; background: var(--warning-tint); color: var(--warning); font-weight: 700; }

/* DARK THEME (owner, 2026-10-14): tokens come from app.css; only the hard-coded colours here. Delete to revert. */
body.admin { background: var(--bg); }
.admin-side { background: var(--off-black); border-right: 1px solid var(--line); }
.admin-nav a:hover { background: var(--paper-2); }
.admin-nav a[aria-current='page'] { background: var(--paper-3); }
.admin-side .who button { border-color: var(--line-strong); }
.instructions-box { border-color: #5a4a2a; }

/* ===== Easier on the eyes (owner, 2026-10-31) =====================================================================
   The pages are light like the shop (the same palette as .page-light main); the side menu stays dark and is grouped
   under small headings. Long pages show one section at a time from a menu on the left. Nothing was removed.
   To revert: delete this block (and the matching markup changes noted in the templates). */
.admin-main {
  color-scheme: light;
  --ink: #1b1c1a; --ink-2: #353733; --muted: #5b5f58; --line: #e4e1d9; --line-strong: #cbc6bb;
  --bg: #fcfbf9; --paper: #fcfbf9; --paper-2: #f3f1ec; --paper-3: #e9e5dd;
  --green: #1b1c1a; --green-hover: #33312d; --green-tint: #ebe8e2;
  --gold-ink: #7a5e1f; --gold-tint: #f6efdc;
  --error: #b42318; --error-tint: #fdeceb; --error-line: #f1b4ad;
  --success: #1d6b40; --success-tint: #e5f2e9; --warning: #7d4f00; --warning-tint: #fcf1dc; --info: #1e4a72; --info-tint: #e8f0f8;
  --shadow-sm: 0 1px 2px rgba(27, 28, 26, .06); --shadow: 0 6px 24px -8px rgba(27, 28, 26, .18), 0 2px 6px rgba(27, 28, 26, .05);
  --dk-panel: #fcfbf9; --dk-card: #f5f3ef; --dk-input: #fdfcfa;
  color: var(--ink); background: #f3f1ec; }
body.admin { background: #f3f1ec; }
@media (min-width: 768px) { .admin-main { padding: var(--s6) clamp(24px, 3vw, 48px); } }
.admin-main a:not(.btn):not(.chip):not(.kpi) { color: var(--ink); }
.admin-main .panel { background: #fcfbf9; border-color: #e4e1d9; border-radius: 14px; box-shadow: 0 1px 2px rgba(27, 28, 26, .04); padding: clamp(18px, 2vw, 28px); }
.admin-main .panel + .panel { margin-top: var(--s4); }
.admin-main .panel h2 { margin-top: 0; font-size: 1.15rem; font-weight: 700; }
.admin-main :is(.input, .select, .textarea) { background: #fdfcfa; color: var(--ink); border-color: #d9d4ca; }
.admin-main :is(.input, .select, .textarea):focus { border-color: #8f8a80; }
.admin-main .admin-table { background: #fcfbf9; }
.admin-main .admin-table th { background: #f3f1ec; }
.admin-main .admin-table tr:hover td { background: #f7f5f1; }
.admin-main .table-scroll { border-color: #e4e1d9; border-radius: 12px; }
.admin-main .instructions-box { background: #f8f1df; border-color: #e7d7ae; color: var(--ink); }
.admin-main .btn:not(.btn-primary) { --bg: #fcfbf9; --fg: var(--ink); --bd: #d9d4ca; }
.admin-main .btn-primary { --bg: #1b1c1a; --fg: #f5f2ec; --bd: #1b1c1a; }
.admin-main .alert-warning { background: #fcf1dc; color: #6b4400; border-color: #ecd59e; }
.nowrap { white-space: nowrap; }

/* Side menu: small group headings instead of plain separators. */
.admin-nav .nav-group { margin: 14px 12px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8d897f; }
.admin-nav .nav-group:first-child { margin-top: 2px; }
.admin-nav a { padding: 8px 12px; }

/* Dashboard: the to-do tiles first and large, the stages as a quieter row. */
.dash-title { margin: 0 0 10px; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.admin-main .kpi { background: #fcfbf9; border-color: #e4e1d9; border-radius: 14px; color: var(--ink); }
.admin-main .kpi:hover { border-color: #b9b3a7; box-shadow: 0 6px 18px -10px rgba(27, 28, 26, .25); }
.kpis-main { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: var(--s5); }
.kpis-main .kpi { padding: 18px 20px; }
.kpis-main .kpi strong { font-size: 2.1rem; margin: 4px 0 2px; }
.kpis-main .kpi small { display: block; color: var(--muted); font-size: .8rem; }
.kpis-main .kpi.is-due { border-color: #d9bf7a; background: #fbf6ea; }
.kpis-main .kpi.is-due strong { color: #7a5e1f; }
.kpis-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: var(--s5); }
.kpis-row .kpi { padding: 12px 16px; }
.kpis-row .kpi strong { font-size: 1.35rem; }
/* Recent orders across the full width; revenue and setup side by side under it. */
.dash-grid { grid-template-columns: minmax(0, 1fr); }
.dash-side { display: grid; gap: var(--s4); align-items: start; }
@media (min-width: 1100px) { .dash-side { grid-template-columns: 1fr 1fr; } }
.dash-side > .panel + .panel { margin-top: 0; }
/* The dark menu column runs the full height of long pages. */
@media (min-width: 1024px) { .admin-shell { background: linear-gradient(to right, #141613 240px, transparent 240px); } }
.setup-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.setup-panel > summary::-webkit-details-marker { display: none; }
.setup-panel > summary h2 { margin: 0; }
.setup-panel[open] > summary { margin-bottom: var(--s3); }
.setup-count { flex: none; padding: 3px 10px; border-radius: 999px; background: #fcf1dc; color: #6b4400; font-size: .78rem; font-weight: 700; }
.setup-count.is-ok { background: #e5f2e9; color: #1d6b40; }

/* Long pages: a section menu on the left (sticky), the chosen section on the right. */
.admin-split { display: grid; gap: var(--s4); align-items: start; }
@media (min-width: 1100px) { .admin-split { grid-template-columns: 220px minmax(0, 1fr); gap: var(--s5); } }
.admin-split-body { min-width: 0; }
.section-tabs { margin: 0; }
@media (min-width: 1100px) {
  .section-tabs { position: sticky; top: var(--s5); display: grid; gap: 2px; padding: 10px; border: 1px solid #e4e1d9; border-radius: 14px; background: #fcfbf9; }
  .section-tabs .chip { justify-content: flex-start; border: 0; border-radius: 9px; background: none; padding: 8px 12px; min-height: 0; font-weight: 600; }
}
.section-tabs .chip { color: var(--ink); text-decoration: none; white-space: normal; line-height: 1.3; }
@media (min-width: 1100px) { .section-tabs .chip { width: 100%; box-sizing: border-box; } }
.section-tabs .chip:hover { background: #f3f1ec; }
.section-tabs .chip[aria-current='true'] { background: #1b1c1a; color: #f5f2ec; }
.section-tabs-group { margin: 10px 12px 2px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8d897f; }
.section-tabs-group:first-child { margin-top: 2px; }
@media (max-width: 1099px) { .section-tabs { display: flex; flex-wrap: wrap; gap: 6px; } .section-tabs-group { flex-basis: 100%; margin: 6px 0 0; } }
.admin-split-body > .panel[hidden] { display: none; }
.admin-split-body > .panel + .panel { margin-top: 0; }

/* Five-language fields: language buttons, one field shown; a dot marks an empty language. */
.lang-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 8px; }
.lang-tabs button { position: relative; padding: 4px 10px; border: 1px solid #d9d4ca; border-radius: 999px; background: #fcfbf9; color: var(--ink); font: inherit; font-size: .75rem; font-weight: 700; letter-spacing: .06em; cursor: pointer; }
.lang-tabs button[aria-pressed='true'] { background: #1b1c1a; border-color: #1b1c1a; color: #f5f2ec; }
.lang-tabs button.is-empty::after { content: ''; position: absolute; top: -2px; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: #c0841a; }
.i18n-grid.is-tabbed { grid-template-columns: minmax(0, 1fr) !important; }
.i18n-grid.is-tabbed > .field[hidden] { display: none; }
.i18n-grid.is-tabbed > .field > label { display: none; }

/* Shapes & sizes: one grid for the headings and every size row, so the columns line up. */
.size-grid { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(80px, 1fr) 80px 100px 70px 90px 70px minmax(110px, auto); gap: 8px; align-items: center; padding: 8px 10px; }
.size-grid-head { padding-block: 10px; }
.size-grid-head span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.size-grid .num { text-align: right; }

/* Variants table: a heading row per shape. */
.admin-table .group-row th { position: static; padding: 14px 10px 6px; background: #fcfbf9; color: var(--ink); font-size: .8rem; letter-spacing: .1em; border-bottom: 1px solid #d9d4ca; }

/* ===== Orders, easier to find your way (owner, 2026-10-31: "extremely hard to navigate") ===========================
   One order: a summary bar that stays at the top (who, total, status pills, next step, tabs), then one tab at a time.
   The list: quick views, search, folded filters, coloured statuses and a next-step column. To revert: delete this
   block and restore order.ejs / orders.ejs / admin.js from backups/pre-admin-order-ux-*. */
.order-head { margin-bottom: var(--s4); }
.order-bar { position: sticky; top: 0; z-index: 20; margin: 0 0 var(--s5); padding: 16px 20px 0; background: #fcfbf9; border: 1px solid #e4e1d9; border-radius: 14px; box-shadow: 0 8px 24px -16px rgba(27, 28, 26, .35); }
.order-bar-main { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.order-bar-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; font-size: 1rem; }
.order-bar-who strong { font-size: 1.15rem; }
.order-bar-who span { color: var(--muted); }
.order-bar-who .order-bar-total { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.order-bar-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.order-bar-next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #ece9e2; }
.order-bar-label { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8d897f; margin-right: 4px; }
.order-next { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fcf1dc; border: 1px solid #ecd59e; color: #6b4400 !important; font-size: .85rem; font-weight: 600; text-decoration: none; }
.order-next:hover { background: #f8e6bf; }
.order-next.is-done { background: #e5f2e9; border-color: #b9dcc5; color: #1d6b40 !important; }
.order-tabs { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; scrollbar-width: none; }
.order-tabs a { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; color: var(--muted) !important; font-size: .92rem; font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.order-tabs a:hover { color: var(--ink) !important; }
.order-tabs a[aria-current='true'] { color: var(--ink) !important; border-bottom-color: #1b1c1a; }
.order-tab-count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #e9e5dd; color: var(--ink); font-size: 11px; line-height: 20px; text-align: center; }
.order-tab[hidden] { display: none; }
/* An address like #payments scrolls to just under the summary bar, not behind it. */
.order-tab, .order-tab .panel, .order-tab [id] { scroll-margin-top: 240px; }
/* The same summary bar and tabs are used by a quotation, a support conversation and a customer (2026-10-31). */
.order-bar-pills .btn { min-height: 34px; }
.order-bar-pills form { margin: 0; }
.order-tab + .order-tab { margin-top: var(--s5); }
.order-tab .panel-grid-2 > div > .panel + .panel { margin-top: var(--s4); }
.order-tab .panel-grid-2 { align-items: start; }

/* One item: a header row, the photo beside "what to make", production underneath in its own band. */
.order-tab .item-card { display: block; padding: 0; overflow: hidden; border-radius: 12px; }
.item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 20px; background: #f3f1ec; border-bottom: 1px solid #e4e1d9; }
.item-head h3 { margin: 0; font-size: 1.05rem; }
.item-head-total { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.item-body { display: grid; gap: var(--s5); padding: 20px; }
@media (min-width: 900px) { .item-body { grid-template-columns: 240px minmax(0, 1fr); } }
.item-media { min-width: 0; }
.item-file { overflow-wrap: anywhere; }
.item-sub { margin: 0 0 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #8d897f; }
.item-info .kv { gap: 8px 20px; font-size: .92rem; }
.item-color-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.item-prod { padding: 18px 20px 20px; border-top: 1px solid #e4e1d9; background: #f8f7f3; }
.item-prod-form { display: grid; gap: 12px 16px; align-items: start; margin-top: 18px; }
@media (min-width: 900px) { .item-prod-form { grid-template-columns: 240px minmax(0, 1fr); } .item-prod-form > div:last-child { grid-column: 1 / -1; } }
.item-files { margin-top: 14px; }
.item-files > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: .85rem; font-weight: 600; }

/* Production stages as numbered steps on a line. */
.order-tab .stage-steps { display: flex; flex-wrap: wrap; gap: 0; margin: 4px 0 0; padding: 0; list-style: none; counter-reset: none; }
.order-tab .stage-steps li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1 1 0; min-width: 92px; text-align: center; }
.order-tab .stage-steps li::before { content: ''; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: #dcd8cf; z-index: 0; }
.order-tab .stage-steps li:first-child::before { content: none; }
.order-tab .stage-steps li.done::before, .order-tab .stage-steps li.current::before { background: #1d6b40; }
.order-tab .stage-steps .stage-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border-radius: 50%; background: #fcfbf9; border: 2px solid #dcd8cf; color: var(--muted); font-size: 12px; font-weight: 700; }
.order-tab .stage-steps .stage-name { display: block; padding: 0; background: none; border-radius: 0; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.order-tab .stage-steps .stage-name::first-letter { text-transform: uppercase; }
.stage-steps li.done .stage-dot { background: #1d6b40; border-color: #1d6b40; color: #fcfbf9; }
.stage-steps li.current .stage-dot { background: #1b1c1a; border-color: #1b1c1a; color: #fcfbf9; box-shadow: 0 0 0 4px #e9e5dd; }
.stage-steps li.current .stage-name { color: var(--ink); }

/* Orders list. */
.order-views { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s3); }
.order-views .chip { text-decoration: none; color: var(--ink); }
.order-views .chip[aria-current='true'] { background: #1b1c1a; border-color: #1b1c1a; color: #f5f2ec; }
.order-filters { padding: var(--s4); }
.order-filters .order-search { flex: 1 1 280px; }
.order-more { flex-basis: 100%; }
.order-more > summary { cursor: pointer; font-size: .85rem; font-weight: 600; width: max-content; }
.order-more > .filters { margin: 12px 0 0; }
.order-table tbody tr[data-href] { cursor: pointer; }
.order-step { display: inline-block; padding: 3px 10px; border-radius: 999px; background: #fcf1dc; color: #6b4400; font-size: .8rem; font-weight: 600; }
.order-table td, .order-table th { padding: 10px 8px; }
.order-table .status-pill { white-space: normal; }

/* Photos sent with a contact-form message (owner, 2026-11-05): small thumbnails, each opens the original. */
.conv-log .msg-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.conv-log .msg-photos img { display: block; width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--paper-2); }
.conv-log .msg-photos a:hover img { border-color: var(--ink-2); }

/* Phones and tablets (2026-11-08): the menu folds behind one button so each page starts with its own content. */
.admin-side-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.admin-side-body { display: contents; }
.admin-menu-btn { display: none; }
/* Screen-reader labels inside a sideways-scrolling table must scroll with it, not widen the page. */
.table-scroll { position: relative; }
.size-field { display: contents; }
.size-cap { display: none; }
@media (max-width: 1023px) {
  .admin-side { padding-block: 12px; gap: 0; }
  .admin-side-body { display: flex; flex-direction: column; gap: var(--s4); padding-top: var(--s4); }
  .admin-side.menu-ready:not(.is-open) .admin-side-body { display: none; }
  .menu-ready .admin-menu-btn { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 0 16px; border: 1px solid #3a3b37; border-radius: 999px; background: transparent; color: #f5f2ec; font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; touch-action: manipulation; }
  .admin-menu-btn[aria-expanded='true'] { background: #383633; }
  .admin-menu-btn .count { background: var(--gold); color: #1b1c1a; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 7px; line-height: 18px; }
  .admin-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 6px; }
  .admin-nav .nav-group, .admin-nav .sep { grid-column: 1 / -1; }
  .admin-nav a { min-height: 44px; }
  .admin-side .who .btn { min-height: 44px; }
}
@media (max-width: 899px) {
  .order-bar { position: static; }
  .order-tab, .order-tab .panel, .order-tab [id] { scroll-margin-top: 16px; }
  .item-body { grid-template-columns: minmax(0, 1fr); }
  .item-info .kv { grid-template-columns: max-content minmax(0, 1fr); }
  .item-info .kv img { max-width: 100% !important; }
  .item-files form { align-items: stretch; }
  .item-files input[type='file'] { flex: 1 1 100%; max-width: 100%; min-height: 44px; }
  .item-files form .input { flex: 1 1 100%; max-width: none !important; }
  .lang-tabs button { min-width: 44px; min-height: 44px; }
  .order-bar-pills .btn, .order-next, .order-bar-pills .select { min-height: 44px; }
  .item-files > summary, .order-more > summary { min-height: 44px; }
  .order-more > summary { display: flex; align-items: center; }
}
/* Phones: the orders list as one card per order, and each size as a small form with its labels showing. */
@media (max-width: 767px) {
  .order-table, .order-table tbody { display: block; }
  .order-table thead { display: none; }
  .order-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 12px; padding: 14px 14px 16px; border-bottom: 1px solid var(--line); }
  .order-table tbody tr:last-child { border-bottom: 0; }
  .order-table td { display: block; padding: 0; border: 0; max-width: none !important; }
  .order-table td:nth-child(1) { order: 1; white-space: normal; }
  .order-table td:nth-child(4) { order: 2; }
  .order-table td:nth-child(2) { order: 3; grid-column: 1 / -1; }
  .order-table td:nth-child(3) { order: 4; grid-column: 1 / -1; }
  .order-table td:nth-child(5) { order: 5; }
  .order-table td:nth-child(7) { order: 6; text-align: right; }
  .order-table td:nth-child(6) { order: 7; grid-column: 1 / -1; }
  .order-table td:nth-child(6):has(> .muted) { display: none; }
  .order-table td:nth-child(8) { order: 8; grid-column: 1 / -1; }

  .admin-table:has(.size-grid) thead { display: none; }
  .admin-table .size-grid:not(.size-grid-head) { grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr) minmax(0, .85fr); gap: 12px 10px; padding: 14px 12px; }
  .size-field { display: grid; gap: 4px; }
  .size-cap { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
  .size-grid .check { order: 1; align-items: center; gap: 6px; min-height: 44px; font-size: 12.5px; }
  .size-grid .check input { margin: 0; }
  .size-grid .check .sr-only { position: static !important; width: auto !important; height: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; clip: auto !important; clip-path: none !important; white-space: nowrap !important; }
  .admin-table .size-grid > .num { order: 2; align-self: center; text-align: left; font-size: 12.5px; color: var(--muted); }
  .admin-table .size-grid > .num::before { content: 'Variants: '; }
  .size-grid > .cluster { order: 3; grid-column: span 2; justify-content: flex-end; }
  .admin-table .size-grid input.input { font-size: 16px; min-height: 44px; }
}
