/* ============================================================
   Scribe — Workshop admin

   Deliberately not the storefront. This is a tool: dense, legible,
   quiet. It borrows the brand's warmth — the cream, the clay pink,
   the serif on the headings — and none of its softness. Nothing
   here is decoration that costs a row of a table.

   Same class names throughout as the plainer version this
   replaces, so it is a change of clothes rather than a rebuild:
   every view is untouched by it.
   ============================================================ */

:root {
    /* Surfaces. Warmer than white — this sits under a lot of paper. */
    --a-bg: #F7F3EE;
    --a-panel: #FFFFFF;
    --a-panel-2: #FCFAF7;
    --a-side: #33261C;
    --a-side-2: #241A13;

    --a-ink: #2A231D;
    --a-ink-2: #5A4C42;
    --a-muted: #8B7C71;
    --a-line: #E8DED3;
    --a-line-soft: #F1E9E0;

    /* The brand's pinks and golds, pulled a little deeper so they hold
       their own as text on white. */
    --a-rose: #C58A7A;
    --a-rose-dark: #A96F60;
    --a-rose-wash: #FBF1ED;
    --a-gold: #B8912F;
    --a-green: #3F7D53;
    --a-red: #A6353F;
    --a-blue: #3D6382;

    --a-radius: 12px;
    --a-radius-sm: 8px;
    --a-pill: 999px;
    --a-side-w: 236px;

    --a-shadow: 0 1px 2px rgba(58, 42, 30, .04), 0 6px 18px -12px rgba(58, 42, 30, .18);
    --a-shadow-lift: 0 2px 4px rgba(58, 42, 30, .05), 0 16px 34px -20px rgba(58, 42, 30, .3);

    --a-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --a-font: 'Nunito Sans', 'Segoe UI', -apple-system, Roboto, Helvetica, Arial, sans-serif;
    --a-mono: 'Cascadia Mono', Consolas, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--a-font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--a-ink);
    background: var(--a-bg);
    padding-left: var(--a-side-w);
    -webkit-font-smoothing: antialiased;
}
body.signed-out { padding-left: 0; }

/* Headings carry the serif; everything a person has to scan quickly —
   labels, tables, buttons — stays in the sans. */
h1 {
    font-family: var(--a-display);
    font-size: 1.75rem; margin: 0 0 .15rem; font-weight: 600;
    letter-spacing: -.015em; line-height: 1.2;
}
h2 {
    font-family: var(--a-display);
    font-size: 1.12rem; margin: 0 0 .8rem; font-weight: 600; letter-spacing: -.005em;
}
h3 { font-size: .95rem; margin: 0 0 .6rem; font-weight: 700; }
p { margin: 0 0 .8rem; }
a { color: var(--a-rose-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--a-mono); }

::selection { background: var(--a-rose-wash); }

/* ---------- Sidebar ---------- */
.adm-side {
    position: fixed; inset: 0 auto 0 0; width: var(--a-side-w);
    background: linear-gradient(168deg, var(--a-side), var(--a-side-2));
    color: #D9CFC4; display: flex; flex-direction: column; padding: 1.15rem 0 1rem;
    z-index: 5;
}
/* A hairline of the brand pink down the inside edge — the only ornament
   in here, and it earns its place by telling you which app this is. */
.adm-side::after {
    content: ""; position: absolute; inset: 0 0 0 auto; width: 1px;
    background: linear-gradient(180deg, rgba(197,138,122,.5), rgba(184,145,47,.28) 55%, transparent);
}

.adm-brand {
    display: flex; align-items: center; gap: .65rem;
    padding: 0 1.1rem 1.15rem; color: #fff; font-weight: 700; font-size: 1.06rem;
    font-family: var(--a-display); letter-spacing: -.01em;
}
.adm-brand:hover { text-decoration: none; color: #fff; }
.adm-brand small {
    display: block; font-family: var(--a-font);
    font-size: .6rem; letter-spacing: .2em;
    text-transform: uppercase; color: #A2907E; font-weight: 700;
}
.adm-mark {
    width: 32px; height: 32px; border-radius: 9px; flex: none;
    background: linear-gradient(135deg, var(--a-rose), var(--a-gold));
    display: grid; place-items: center; color: #fff; font-weight: 700;
    font-family: var(--a-display); font-size: 1rem;
    box-shadow: 0 4px 12px -4px rgba(197,138,122,.7);
}

.adm-nav { display: flex; flex-direction: column; padding: .35rem .6rem; flex: 1; gap: 1px; }
.adm-nav a {
    position: relative; display: flex; align-items: center; gap: .6rem;
    padding: .5rem .7rem; border-radius: var(--a-radius-sm);
    color: #C3B5A7; font-weight: 600; font-size: .855rem;
    transition: background .15s, color .15s;
}
.adm-nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.adm-nav a.active {
    background: rgba(255,255,255,.1); color: #fff;
}
/* The marker is a rounded stub inside the pill rather than a border on the
   sidebar's edge — it moves with the highlight instead of floating beside it. */
.adm-nav a.active::before {
    content: ""; position: absolute; left: -.6rem; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; border-radius: 0 3px 3px 0; background: var(--a-rose);
}
.adm-nav-ico { flex: none; display: grid; place-items: center; width: 17px; height: 17px; opacity: .8; }
.adm-nav-ico svg { width: 17px; height: 17px; display: block; }
.adm-nav a.active .adm-nav-ico { opacity: 1; color: var(--a-rose); }
.adm-nav-label { flex: 1; min-width: 0; }

.adm-side-foot {
    padding: .9rem 1.1rem 0; margin: 0 .6rem;
    border-top: 1px solid rgba(255,255,255,.09);
}
.adm-side-link { display: block; color: #A2907E; font-size: .8rem; margin-bottom: .35rem; }
.adm-side-link:hover { color: #fff; }
.adm-signout {
    background: none; border: none; padding: 0; cursor: pointer;
    color: #A2907E; font-family: inherit; font-size: .8rem; font-weight: 600;
}
.adm-signout:hover { color: #fff; text-decoration: underline; }
.adm-who {
    font-size: .7rem; color: #7A6A5C; margin: .8rem 0 0; word-break: break-all;
    letter-spacing: .02em;
}

/* ---------- Main ---------- */
.adm-main { padding: 2rem 2.2rem 4rem; max-width: 1320px; }
.adm-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
}
.adm-head .sub { color: var(--a-muted); margin: 0; }

.adm-flash, .adm-warn {
    display: flex; align-items: flex-start; gap: .6rem;
    padding: .75rem 1rem; border-radius: var(--a-radius);
    margin-bottom: 1.2rem; box-shadow: var(--a-shadow);
}
.adm-flash {
    background: #EDF6EF; border: 1px solid #C9E2CF; color: #2C6039; font-weight: 600;
}
.adm-flash-mark {
    flex: none; width: 18px; height: 18px; margin-top: .09rem; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--a-green); color: #fff; font-size: .58rem; font-weight: 900;
}
.adm-warn {
    display: block;
    background: #FDF5E9; border: 1px solid #EEDCB6; color: #77551A;
}
.adm-warn b { color: #5D410E; }

.panel {
    background: var(--a-panel); border: 1px solid var(--a-line);
    border-radius: var(--a-radius); padding: 1.3rem 1.4rem;
    box-shadow: var(--a-shadow);
}
.panel + .panel { margin-top: 1.2rem; }
.panel-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; margin-bottom: 1rem;
}
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-head a { font-size: .82rem; font-weight: 700; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.3rem; }
.stat {
    position: relative; overflow: hidden;
    background: var(--a-panel); border: 1px solid var(--a-line);
    border-radius: var(--a-radius); padding: 1.05rem 1.15rem;
    box-shadow: var(--a-shadow);
    transition: box-shadow .18s, transform .18s;
}
.stat:hover { box-shadow: var(--a-shadow-lift); transform: translateY(-1px); }
/* A thin wash across the top. Four identical white boxes are hard to tell
   apart at a glance; four with a coloured edge are not. */
.stat::before {
    content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
    background: linear-gradient(90deg, var(--a-rose), var(--a-gold));
    opacity: .75;
}
.stat .k {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--a-muted); font-weight: 800;
}
.stat .v {
    font-family: var(--a-display);
    font-size: 1.95rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.15;
    font-variant-numeric: tabular-nums;
}
.stat .v.rose { color: var(--a-rose-dark); }

/* ---------- Tables ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
    text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em;
    color: var(--a-muted); font-weight: 800; padding: .55rem .75rem;
    border-bottom: 1px solid var(--a-line); white-space: nowrap;
}
.tbl td {
    padding: .65rem .75rem; border-bottom: 1px solid var(--a-line-soft);
    vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--a-panel-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .shrink { width: 1%; white-space: nowrap; }
.tbl-scroll { overflow-x: auto; }

.empty {
    text-align: center; padding: 3rem 1rem; color: var(--a-muted);
    border: 1px dashed var(--a-line); border-radius: var(--a-radius);
    background: var(--a-panel-2);
}
.empty b { color: var(--a-ink-2); }

/* ---------- Chips, badges, status ---------- */
.chip {
    display: inline-block; padding: .16rem .6rem; border-radius: var(--a-pill);
    font-size: .71rem; font-weight: 700; letter-spacing: .01em;
    background: #F3EEE8; color: var(--a-muted); border: 1px solid var(--a-line);
}
.st {
    display: inline-block; padding: .18rem .65rem; border-radius: var(--a-pill);
    font-size: .71rem; font-weight: 800; letter-spacing: .015em; white-space: nowrap;
}
.st-awaitingpayment { background: #FDF0E3; color: #8A5A16; }
.st-paid           { background: #E7F1F7; color: #2E5674; }
.st-inproduction   { background: #F3EDFA; color: #5B3E85; }
.st-shipped        { background: #E7F3EA; color: #2F6540; }
.st-cancelled      { background: #F2EFED; color: #6E6560; }

.swatch-dot {
    display: inline-block; width: 16px; height: 16px; border-radius: 50%;
    border: 1px solid rgba(0,0,0,.15); vertical-align: -3px; margin-right: .35rem;
    box-shadow: inset 0 -1px 2px rgba(0,0,0,.12);
}

/* ---------- Filter bar ---------- */
.filters { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.1rem; }
.filters a {
    padding: .34rem .8rem; border-radius: var(--a-pill); border: 1px solid var(--a-line);
    background: var(--a-panel); color: var(--a-muted); font-size: .81rem; font-weight: 700;
    transition: border-color .15s, color .15s, background .15s;
}
.filters a:hover { text-decoration: none; border-color: var(--a-rose); color: var(--a-rose-dark); }
.filters a.on { background: var(--a-side); border-color: var(--a-side); color: #fff; }
.filters form { margin-left: auto; display: flex; gap: .4rem; }

/* ---------- Forms ---------- */
.f { display: flex; flex-direction: column; margin-bottom: 1rem; }
.f label {
    font-size: .72rem; font-weight: 800; color: var(--a-muted); margin-bottom: .3rem;
    text-transform: uppercase; letter-spacing: .07em;
}
.f input[type=text], .f input[type=email], .f input[type=password],
.f input[type=number], .f input[type=file], .f select, .f textarea, .inp {
    font-family: inherit; font-size: .9rem; color: var(--a-ink);
    padding: .5rem .65rem; border: 1px solid var(--a-line); border-radius: var(--a-radius-sm);
    background: #fff; width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
.f input:focus, .f select:focus, .f textarea:focus, .inp:focus {
    outline: none; border-color: var(--a-rose); box-shadow: 0 0 0 3px rgba(197,138,122,.16);
}
.f input:disabled, .f input[readonly] {
    background: var(--a-panel-2); color: var(--a-muted); cursor: not-allowed;
}
.f textarea { resize: vertical; }
.f .hint { font-size: .75rem; color: var(--a-muted); margin-top: .3rem; line-height: 1.45; }
.f .hint code {
    font-size: .72rem; background: var(--a-panel-2); border: 1px solid var(--a-line);
    border-radius: 4px; padding: 0 .25rem;
}
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.f-row.three { grid-template-columns: 1fr 1fr 1fr; }
.f-check { display: flex; align-items: center; gap: .45rem; margin-bottom: .9rem; font-weight: 700; }
.f-check input { width: 16px; height: 16px; accent-color: var(--a-rose-dark); }

.field-validation-error, .validation-summary-errors { color: var(--a-red); font-size: .78rem; font-weight: 700; }
.field-validation-error:not(:empty) { margin-top: .3rem; display: block; }
.validation-summary-errors ul { margin: 0 0 .9rem; padding-left: 1.1rem; }
.input-validation-error { border-color: #D08B90 !important; background: #FDF7F7 !important; }

/* Inline cell inputs on the pricing grid */
.cell-inp {
    padding: .34rem .5rem; font-size: .85rem; border: 1px solid var(--a-line);
    border-radius: 6px; font-family: inherit; background: #fff; color: var(--a-ink);
    transition: border-color .15s, box-shadow .15s;
}
.cell-inp:focus { outline: none; border-color: var(--a-rose); box-shadow: 0 0 0 2px rgba(197,138,122,.16); }
.cell-inp.w-price { width: 88px; text-align: right; font-variant-numeric: tabular-nums; }
.cell-inp.w-order { width: 58px; text-align: right; }
.cell-inp.w-name { width: 100%; min-width: 130px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .4rem; justify-content: center;
    font-family: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
    padding: .5rem 1.05rem; border-radius: var(--a-pill); border: 1px solid transparent;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--a-side); color: #fff; box-shadow: 0 4px 12px -6px rgba(51,38,28,.7); }
.btn-primary:hover { background: #48372A; color: #fff; }
.btn-rose { background: var(--a-rose); color: #fff; box-shadow: 0 4px 12px -6px rgba(197,138,122,.9); }
.btn-rose:hover { background: var(--a-rose-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--a-line); color: var(--a-ink); }
.btn-ghost:hover { border-color: var(--a-rose); color: var(--a-rose-dark); background: var(--a-rose-wash); }
.btn-danger { background: #fff; border-color: #E6C9CB; color: var(--a-red); }
.btn-danger:hover { background: #FCF4F4; border-color: #D9AFB2; }
.btn-sm { padding: .32rem .7rem; font-size: .79rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; }
.btn:focus-visible { outline: 2px solid var(--a-rose); outline-offset: 2px; }

/* ---------- Sign-in ---------- */
/* The one screen in here allowed to be handsome: it is the front door, it is
   mostly empty space anyway, and it is the first thing she sees each morning. */
.signin-wrap {
    min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
    background:
        radial-gradient(58rem 34rem at 50% -8rem, #FBF1EC, transparent 70%),
        var(--a-bg);
}
.signin {
    width: 100%; max-width: 390px; background: var(--a-panel);
    border: 1px solid var(--a-line); border-radius: 18px; padding: 2.1rem 2rem;
    box-shadow: 0 24px 60px -30px rgba(51,38,28,.45), 0 2px 6px rgba(51,38,28,.05);
}
.signin .adm-mark { width: 44px; height: 44px; font-size: 1.25rem; border-radius: 12px; margin-bottom: 1.1rem; }
.signin h1 { font-size: 1.5rem; }
.signin .sub { color: var(--a-muted); margin-bottom: 1.5rem; }
.signin .btn { margin-top: .3rem; }

/* ---------- Your account ---------- */
/* Two short forms rather than one long one, because they are two different
   errands and neither should look like a step of the other. */
.acct-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.2rem; align-items: start; max-width: 900px;
}
.acct-grid .panel + .panel { margin-top: 0; }

/* ---------- Who can sign in ---------- */
/* The per-row password reset. A field and a button on one line, sized so the two
   forms in the actions cell don't stack into a tall row. */
.ppl-reset { display: flex; gap: .35rem; align-items: center; }
.ppl-reset input { width: 150px; }

/* ---------- Order detail ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 330px; gap: 1.2rem; align-items: start; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: .35rem .8rem; font-size: .88rem; }
.kv dt { color: var(--a-muted); font-weight: 700; }
.kv dd { margin: 0; }

.build {
    border: 1px solid var(--a-line); border-radius: var(--a-radius);
    padding: 1.1rem; margin-bottom: 1rem; background: var(--a-panel-2);
}
.build-head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; margin-bottom: .75rem; }
.build-head h3 { margin: 0; }
.spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .4rem .9rem; font-size: .86rem; }
.spec .s-k { color: var(--a-muted); }
.spec .s-v { font-weight: 700; }
.inscription {
    margin-top: .85rem; padding: .8rem 1rem; background: #fff;
    border: 1px dashed var(--a-line); border-radius: var(--a-radius-sm);
}
.inscription .lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .09em; color: var(--a-muted); font-weight: 800; }
.inscription .txt { font-size: 1.2rem; font-weight: 600; font-family: var(--a-display); }

.thumb {
    width: 54px; height: 72px; border-radius: 6px; object-fit: cover;
    border: 1px solid var(--a-line); background: var(--a-bg);
}

/* ---------- Print: the build sheet ---------- */
@media print {
    body { padding-left: 0; background: #fff; font-size: 12px; }
    .adm-side, .adm-flash, .no-print { display: none !important; }
    .adm-main { padding: 0; max-width: none; }
    .panel, .build { border-color: #999; break-inside: avoid; box-shadow: none; }
    .stat::before { display: none; }
    a { color: #000; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    body { padding-left: 0; }
    .adm-side {
        position: static; width: auto; flex-direction: row; flex-wrap: wrap;
        align-items: center; gap: .5rem; padding: .75rem 1rem;
    }
    .adm-side::after { display: none; }
    .adm-brand { padding: 0; }
    .adm-nav { flex-direction: row; flex-wrap: wrap; flex: 1 0 100%; padding: 0; gap: .25rem; }
    .adm-nav a { padding: .4rem .65rem; font-size: .8rem; }
    .adm-nav a.active::before { display: none; }
    .adm-side-foot {
        border-top: none; padding: 0; margin: 0; display: flex; gap: .9rem; align-items: center;
    }
    .adm-side-link { margin-bottom: 0; }
    .adm-who { display: none; }
    .adm-main { padding: 1.3rem 1rem 3rem; }
    .f-row, .f-row.three { grid-template-columns: 1fr; }
}

/* ---------- Commissions ----------
   Briefs from the custom-request page. Their own status pills rather than a
   reuse of the order ones, because a commission is not an order and the two
   lists should not be mistakable for each other at a glance. */
.st-cmn-new       { background: #FDF0E3; color: #8A5A16; }
.st-cmn-reviewing { background: #E7F1F7; color: #2E5674; }
.st-cmn-quoted    { background: #F3EDFA; color: #5B3E85; }
.st-cmn-accepted  { background: #E7F3EA; color: #2F6540; }
.st-cmn-closed    { background: #F2EFED; color: #6E6560; }

.lbl {
    display: block; margin-bottom: .35rem;
    font-size: .71rem; text-transform: uppercase; letter-spacing: .09em;
    color: var(--a-muted); font-weight: 800;
}

/* ---------- Commission options editor ---------- */
/* The per-row photo / delete forms. They cannot be nested inside the bulk save
   form, so they sit at the end of the panel and the controls point at them by
   their `form` attribute. Nothing here is ever seen. */
.cmo-hidden { display: none; }

.cmo-photo { display: flex; align-items: center; gap: .5rem; }
/* The thumbnail is itself a button — 46px is far too small to judge a hide by,
   so pressing it opens the picture at full size. */
.cmo-thumb {
    padding: 0; border: none; background: none; cursor: zoom-in; display: block;
    border-radius: 6px;
}
.cmo-thumb:focus-visible { outline: 2px solid var(--a-rose); outline-offset: 2px; }
.cmo-photo img {
    width: 46px; height: 38px; object-fit: cover; border-radius: 6px;
    border: 1px solid var(--a-line); background: #F3F0EC; display: block;
    transition: border-color .16s ease;
}
.cmo-thumb:hover img { border-color: var(--a-rose); }
.cmo-drawn {
    display: grid; place-items: center; width: 46px; height: 38px; border-radius: 6px;
    border: 1px dashed var(--a-line); background: var(--a-panel-2);
    font-size: .58rem; letter-spacing: .07em; text-transform: uppercase;
    color: var(--a-muted); font-weight: 800;
}
/* The file input itself is never shown — the label is the control. */
.cmo-pick { position: relative; overflow: hidden; display: inline-block; }
.cmo-pick input[type=file] {
    position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer;
}
.cmo-pick span {
    display: inline-block; padding: .3rem .7rem; border-radius: var(--a-pill);
    border: 1px solid var(--a-line); background: #fff;
    font-size: .75rem; font-weight: 700; color: var(--a-ink); cursor: pointer;
    transition: border-color .15s, color .15s, background .15s;
}
.cmo-pick:hover span { border-color: var(--a-rose); color: var(--a-rose-dark); background: var(--a-rose-wash); }
.cmo-pick input[type=file]:focus-visible + span { outline: 2px solid var(--a-rose); outline-offset: 1px; }

.cmo-actions { display: flex; align-items: center; gap: .4rem; white-space: nowrap; }

.cmo-add {
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
    margin-top: 1.1rem; padding: .9rem 1rem;
    border: 1px dashed var(--a-line); border-radius: var(--a-radius);
    background: var(--a-panel-2);
}
.cmo-add-label {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .1em;
    color: var(--a-muted); font-weight: 800; margin-right: .3rem;
}

.adm-nav a .pip {
    flex: none; min-width: 19px; padding: 0 5px; border-radius: var(--a-pill);
    background: var(--a-rose); color: #fff;
    font-size: .67rem; font-weight: 800; line-height: 19px; text-align: center;
}

@media (max-width: 980px) {
    /* the commission detail's two columns stop paying their way well before the
       sidebar collapses, so they stack earlier */
    .cmn-detail { grid-template-columns: 1fr !important; }
}

/* ---------- Landing page photos ---------- */
/* Picture-first, unlike the commission options table: this screen exists to
   answer "what does the front page look like right now", so the photograph is
   the row and the name is the caption. */
.hmi-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: .9rem;
}
.hmi-strip { display: flex; flex-wrap: wrap; gap: .9rem; }
.hmi-strip .hmi-card { width: 12rem; }

.hmi-card {
    border: 1px solid var(--a-line); border-radius: var(--a-radius);
    background: var(--a-panel-2); padding: .65rem;
    display: flex; flex-direction: column; gap: .5rem;
    transition: border-color .16s, box-shadow .16s;
}
.hmi-card:hover { border-color: #E0D2C4; box-shadow: var(--a-shadow); }
/* A fixed height, not an aspect ratio: the thumbnail inside is sized in
   percentages, and the two together leave the box's height circular — which
   Chrome resolves from the picture, so a photographed card grows taller than the
   drawn one beside it. */
.hmi-shot { height: 7.5rem; }
.hmi-thumb {
    padding: 0; border: none; background: none; cursor: zoom-in;
    display: block; width: 100%; height: 100%; border-radius: var(--a-radius-sm);
}
.hmi-thumb:focus-visible { outline: 2px solid var(--a-rose); outline-offset: 2px; }
.hmi-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    border-radius: var(--a-radius-sm); border: 1px solid var(--a-line);
    transition: border-color .16s ease;
}
.hmi-thumb:hover img { border-color: var(--a-rose); }

/* No photograph yet — the page is drawing this one. */
.hmi-drawn {
    display: grid; place-items: center; width: 100%; height: 100%;
    border-radius: var(--a-radius-sm); border: 1px dashed var(--a-line); background: #F4F1ED;
}
.hmi-drawn em {
    font-style: normal; font-size: .58rem; letter-spacing: .09em;
    text-transform: uppercase; font-weight: 800;
    color: #fff; background: rgba(42, 35, 29, .45);
    padding: .14rem .45rem; border-radius: var(--a-pill);
}

.hmi-name {
    font-size: .82rem; font-weight: 700; color: var(--a-ink);
    display: flex; align-items: center; gap: .35rem; line-height: 1.25;
}
.hmi-out {
    font-size: .58rem; text-transform: uppercase; letter-spacing: .07em;
    color: var(--a-red); border: 1px solid currentColor;
    border-radius: var(--a-pill); padding: 0 .35rem; font-weight: 800;
}
.hmi-actions { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin-top: auto; }
.hmi-actions form { display: inline; }

.hmi-caption { display: flex; gap: .3rem; }
.hmi-caption input {
    flex: 1; min-width: 0; padding: .28rem .45rem; font-size: .75rem;
    border: 1px solid var(--a-line); border-radius: 6px; background: #fff;
    font-family: inherit; color: var(--a-ink);
}
.hmi-caption input:focus-visible { outline: 2px solid var(--a-rose); outline-offset: -1px; }

.hmi-count {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .09em;
    color: var(--a-muted); font-weight: 800; white-space: nowrap;
}
.hmi-empty { color: var(--a-muted); margin: 0 0 .4rem; }

.hmi-add {
    display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
    margin-top: 1.1rem; padding: .9rem 1rem;
    border: 1px dashed var(--a-line); border-radius: var(--a-radius);
    background: var(--a-panel-2);
}
.hmi-add input[type=text] {
    flex: 1; min-width: 12rem; padding: .38rem .6rem; font-size: .82rem;
    border: 1px solid var(--a-line); border-radius: var(--a-radius-sm); background: #fff;
    font-family: inherit; color: var(--a-ink);
}


/* ============================================================
   PHONE

   The back office is a desk tool and is not being redrawn for a
   phone — but the shop is run from one, and "add a photo of the
   new hide from the bench" is a real errand. So: nothing may
   run off the side of the screen, nothing may zoom the page on
   focus, and every control has to be pressable.
   ============================================================ */
@media (max-width: 760px) {
    /* Six of the eight tables sit in a .tbl-scroll wrapper; Orders/Details and
       Commissions/Details have none, and Catalog and the Dashboard have one
       wrapper between several tables. Rather than thread a div through every
       view, let the table itself be the scroller — a block-level table gets an
       anonymous table box inside it, so the rows are unaffected. */
    .tbl {
        display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    .tbl td, .tbl th { white-space: nowrap; }
    /* …except the columns that are prose, which should still wrap. */
    .tbl td.wrap, .tbl th.wrap { white-space: normal; min-width: 12rem; }

    /* Same 16px floor as the shop: iOS zooms on anything smaller and stays
       zoomed, which on an admin table is genuinely disorienting. */
    input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
    input[type="number"], input[type="password"], input[type="search"],
    input[type="date"], select, textarea, .f-in, .cmo-in { font-size: 16px; }

    /* Targets. The upload control in particular was a .28rem pill. */
    .cmo-pick span { padding: .6rem 1rem; font-size: .85rem; }
    .btn-sm { min-height: 40px; padding-inline: .9rem; }
    .cmo-actions, .hmi-actions { gap: .45rem; }
    .adm-nav a { min-height: 40px; }

    /* The photo cards were sized for a desk grid; one across reads better than
       two 9.5rem cards squeezed side by side. */
    .hmi-grid { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
    .hmi-strip .hmi-card { width: 100%; }
    .hmi-add { flex-wrap: wrap; }

    .acct-grid { grid-template-columns: 1fr; }
}
