/* Orderseam inbox: the site's colors and fonts, with the demo's size grid. */
:root {
  --bg: #f6f1e7; --surface: #fffdf8; --ink: #14213d; --muted: #5b6475; --line: #e7dfcf; --line-strong: #d3c8b2;
  --accent: #1f4d3a; --accent-ink: #fffdf8; --accent-soft: #e4efe8;
  --ok: #1f7a4d; --ok-bg: #e3f4ea; --fix: #8a5a00; --fix-bg: #fdf1d6; --flag: #b42318; --flag-bg: #fde8e6;
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Plus Jakarta Sans", "Helvetica Neue", Arial, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --radius: 10px; --logo-bg: #14213d; --thread: #b08d57; --shadow: 0 1px 2px rgba(20,33,61,.06), 0 1px 1px rgba(20,33,61,.04);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0d1424; --surface: #121b2e; --ink: #efe9dc; --muted: #a9b0bf; --line: #26314a; --line-strong: #34405c;
    --accent: #8fc7a8; --accent-ink: #0d1424; --accent-soft: #1a3328;
    --ok: #6fd3a0; --ok-bg: #12301f; --fix: #f0c060; --fix-bg: #33280e; --flag: #ff8a80; --flag-bg: #3a1a18; --logo-bg: #efe9dc; --thread: #c9a464; --shadow: none; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0d1424; --surface: #121b2e; --ink: #efe9dc; --muted: #a9b0bf; --line: #26314a; --line-strong: #34405c;
  --accent: #8fc7a8; --accent-ink: #0d1424; --accent-soft: #1a3328;
  --ok: #6fd3a0; --ok-bg: #12301f; --fix: #f0c060; --fix-bg: #33280e; --flag: #ff8a80; --flag-bg: #3a1a18; --logo-bg: #efe9dc; --thread: #c9a464; --shadow: none; color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; }
h1 { font: 700 30px/1.15 var(--font-display); }
h2 { font: 700 20px/1.2 var(--font-display); margin-bottom: 10px; }
h3 { font: 600 12px/1.2 var(--font-data); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 16px 64px; display: grid; gap: 18px; }

/* app bar: logo on the left, account on the right, like a store admin */
.appbar { position: sticky; top: 0; z-index: 10; background: var(--surface); border-bottom: 1px solid var(--line); }
.appbar-in { max-width: 1240px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font: 800 19px/1 var(--font-display); flex: none; }
.page-head .eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 4px; }
.page-head .sub { max-width: 720px; }
.admin-tag { font: 600 11px/1 var(--font-body); letter-spacing: 0; text-transform: none; padding: 4px 8px; border-radius: 999px; background: var(--fix-bg); color: var(--fix); }
.sub { color: var(--muted); margin: 4px 0 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; box-shadow: var(--shadow); }
.card.narrow { max-width: 520px; width: 100%; margin: clamp(16px, 6vw, 56px) auto 0; border-top: 3px solid var(--thread); padding: clamp(20px, 4vw, 30px); }
.card.narrow h1 { margin-bottom: 6px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.spread { justify-content: space-between; }
input[type=password], input[type=text], input[type=email], input[type=tel] { font: inherit; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); }
.btn { font: 600 15px/1 var(--font-body); padding: 11px 16px; border-radius: 8px; border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; text-decoration: none; display: inline-block; box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.btn:hover:not(:disabled) { filter: brightness(1.08); }
.btn.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); padding: 8px 12px; font-size: 14px; box-shadow: 0 1px 0 rgba(20,33,61,.05); }
.btn.ghost:hover:not(:disabled) { filter: none; background: var(--bg); }
.btn:disabled { opacity: .5; cursor: default; }
.check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.stock-rules { display: grid; gap: 8px; margin-top: 10px; }
.stock-rules .check { align-items: flex-start; }
.stock-rules input { margin-top: 3px; }
.muted { color: var(--muted); font-size: 13.5px; }
.msg { padding: 10px 12px; border-radius: 7px; overflow-wrap: anywhere; font-size: 14px; }
.msg.ok { background: var(--ok-bg); color: var(--ok); }
.msg.warn { background: var(--fix-bg); color: var(--fix); }
.msg.err { background: var(--flag-bg); color: var(--flag); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.side { display: grid; gap: 18px; }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } }

/* setup checklist */
.setup { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.setup li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 6px; }
.setup .y { color: var(--ok); font-weight: 700; }
.setup .n { color: var(--flag); font-weight: 700; }
.setup .i { color: var(--muted); font-weight: 700; }
.addr { font: 500 14px/1.4 var(--font-data); overflow-wrap: anywhere; }

/* PO list */
.po-list { list-style: none; margin: 0; padding: 0; }
.po-list li { border-top: 1px solid var(--line); }
.po-list li:first-child { border-top: 0; }
.po-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 4px; text-decoration: none; color: inherit; }
.po-list a:hover { background: var(--bg); }
.po-list .t { font-weight: 600; overflow-wrap: anywhere; }
.po-list .s { grid-column: 1 / -1; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.chip, .pill { display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px/1 var(--font-body); padding: 5px 10px 5px 8px; border-radius: 999px; white-space: nowrap; align-self: start; }
.chip::before, .pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.review, .chip.failed { color: var(--flag); background: var(--flag-bg); }
.chip.approved { color: var(--ok); background: var(--ok-bg); }
.chip.reading, .chip.received { color: var(--fix); background: var(--fix-bg); }
.chip.rejected, .chip.duplicate { color: var(--muted); background: var(--bg); border: 1px solid var(--line); }

/* list tabs and empty state */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin: 6px -4px 4px; padding: 0 4px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.tab { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 10px 9px; font: 600 14px/1 var(--font-body); color: var(--muted); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.count { font: 600 11.5px/1 var(--font-body); padding: 3px 7px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.count.hot { background: var(--flag-bg); border-color: transparent; color: var(--flag); }
.empty-state { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 30px 12px; color: var(--muted); font-size: 14px; }
.empty-state svg { color: var(--line-strong); }
.po-list a { border-radius: 6px; }

/* how it works, trust, setup steps */
.how { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-size: 13.5px; color: var(--muted); }
.how li { display: flex; gap: 8px; align-items: flex-start; }
.how b { color: var(--ink); }
.how .n { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 700 12px/1 var(--font-body); }
@media (max-width: 640px) { .how { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
.trust { border-top: 3px solid var(--thread); }
.trust-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; color: var(--muted); }
.trust-list li { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; }
.trust-list svg { color: var(--accent); margin-top: 1px; }
.trust-list b { color: var(--ink); }
.steps { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.steps li { position: relative; display: grid; gap: 2px; padding: 0 0 14px 34px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 700 12px/1 var(--font-body); border: 1.5px solid var(--line-strong); color: var(--muted); background: var(--surface); }
.steps li::after { content: ""; position: absolute; left: 11px; top: 24px; bottom: 2px; width: 1.5px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: var(--surface); }
.steps .muted { font-size: 13.5px; }

/* settings, memory */
.trusted { display: grid; gap: 6px; margin: 8px 0 0; }
.mem { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.mem li { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; }
.drop { position: relative; display: flex; gap: 12px; align-items: center; justify-content: center; text-align: left; min-height: 96px; background: var(--bg); border: 1.5px dashed var(--line-strong); border-radius: var(--radius); cursor: pointer; padding: 12px; }
.drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop b { color: var(--accent); }
.drop-ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }

/* one PO */
.back { font-size: 14px; }
.po-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; padding-top: 8px; border-top: 2px solid var(--ink); }
.eyebrow { font: 500 11.5px/1.3 var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 8px 0 6px; overflow-wrap: anywhere; }
.po-head h2 { font-size: clamp(22px, 2.6vw, 28px); margin: 0; }
.po-meta { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 8px 0 0; font-size: 13.5px; }
.po-meta div { display: flex; gap: 6px; }
.po-meta dt { color: var(--muted); white-space: nowrap; }
.po-meta dd { margin: 0; }
.tallies { display: flex; flex-wrap: wrap; gap: 10px; }
.tally { min-width: 120px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.tally .n { font: 700 22px/1.1 var(--font-display); font-variant-numeric: tabular-nums; }
.tally .l { font-size: 12px; color: var(--muted); }
.tally.ready { border-color: var(--ok); } .tally.ready .n { color: var(--ok); }
.tally.fix .n { color: var(--fix); }
.tally.flag { border-color: var(--flag); background: var(--flag-bg); } .tally.flag .n { color: var(--flag); }
.tally.flag.clear { border-color: var(--line); background: var(--surface); } .tally.flag.clear .n { color: var(--ok); }

.po-dates { display: grid; gap: 8px; padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.po-dates.flagged { border-color: var(--flag); background: var(--flag-bg); }
.date-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.date-chip { font-size: 13.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); }
.date-chip b { font: 600 11px/1 var(--font-data); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 4px; }
.date-chip.muted, .date-lead { color: var(--muted); font-size: 12.5px; }

.grid-pane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.pane-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table-scroll { overflow-x: auto; }
.swipe-hint { display: none; margin: 0; padding: 8px 16px 0; font-size: 12.5px; }
@media (max-width: 760px) {
  .swipe-hint { display: block; }
  .sizegrid tr.main td:first-child, .sizegrid th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
  .sizegrid tr.main td:first-child { min-width: 128px; max-width: 150px; box-shadow: 1px 0 0 var(--line); }
  .sizegrid th:first-child { box-shadow: 1px 0 0 var(--line); }
  .style-name { font-size: 13.5px; line-height: 1.3; }
}
.sizegrid { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.sizegrid th { font: 600 11px/1 var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.sizegrid th.sz, .sizegrid td.sz { text-align: center; width: 46px; }
.sizegrid th.num, .sizegrid td.num { text-align: right; }
.sizegrid td { padding: 9px 8px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.sizegrid tr.main td:first-child { border-left: 4px solid transparent; padding-left: 10px; }
.sizegrid tr.main.s-ok td:first-child { border-left-color: var(--ok); }
.sizegrid tr.main.s-fix td:first-child { border-left-color: var(--fix); }
.sizegrid tr.main.s-flag td:first-child { border-left-color: var(--flag); }
.sizegrid tr.main.has-notes td { border-bottom: 0; }
.sizegrid tr.removed td { opacity: .45; text-decoration: line-through; }
.style-no { font: 500 12.5px/1.2 var(--font-data); color: var(--muted); }
.style-name { font-weight: 600; }
.unmatched { color: var(--flag); font-weight: 600; }
.cell { display: inline-grid; place-items: center; min-width: 32px; height: 28px; padding: 0 6px; border-radius: 4px; font-weight: 600; border: 1px solid transparent; }
.cell.ok { background: var(--ok-bg); }
.cell.fix { background: var(--fix-bg); border-color: var(--fix); }
.cell.flag { background: var(--flag-bg); border-color: var(--flag); color: var(--flag); }
.cell.removed { color: var(--muted); text-decoration: line-through; }
.cell.empty { color: var(--line-strong); font-weight: 400; }
.cell.warn::after { content: "?"; font-size: 11px; margin-left: 1px; }
.pill.ok { color: var(--ok); background: var(--ok-bg); }
.pill.fix { color: var(--fix); background: var(--fix-bg); }
.pill.flag { color: var(--flag); background: var(--flag-bg); }
.pill.removed { color: var(--muted); background: var(--bg); }
.price-po { display: block; font-size: 12px; color: var(--flag); text-decoration: line-through; }
tr.notes td { padding: 0 10px 12px 14px; border-left: 4px solid transparent; }
tr.notes.s-fix td { border-left-color: var(--fix); }
tr.notes.s-flag td { border-left-color: var(--flag); }
tr.notes.s-ok td { border-left-color: var(--ok); }
.asw { font: 400 12.5px/1.4 var(--font-data); color: var(--muted); margin: 0 0 6px; overflow-wrap: anywhere; }
.issues { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.issue { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 6px; font-size: 13.5px; line-height: 1.45; }
.issue .ic { font-weight: 700; text-align: center; }
.issue.fix .ic, .issue.resolved .ic { color: var(--fix); }
.issue.flag .ic { color: var(--flag); }
.issue.flag .tx { font-weight: 500; }
.issue .tx { color: var(--muted); }
.issue.flag .tx { color: var(--ink); }
.choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.choice { font-size: 13px; padding: 5px 10px; border-radius: 4px; border: 1px solid var(--accent); color: var(--accent); background: var(--surface); cursor: pointer; }
.choice:hover { background: var(--accent-soft); }
.choice.quiet { border-color: var(--line-strong); color: var(--muted); }
.draft-bar { display: grid; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--line); }
.confirm { display: grid; gap: 6px; }
.confirm-email { display: flex; gap: 8px; align-items: center; padding-left: 24px; }
.confirm-email label { font-size: 14px; color: var(--muted); white-space: nowrap; }
.confirm-email input { max-width: 420px; padding: 7px 10px; }
.confirm-note { margin: 0; padding-left: 24px; font-size: 13px; }
.approve-hint { margin: 0; font-size: 13px; }
.export-row { margin: 8px 0 0; font-size: 13px; }
.export-row .link-btn { font-size: 13px; }
.account-pop hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }

.revision { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--accent); background: var(--surface); }
.revision p { margin: 0; color: var(--muted); font-size: 14px; }
.diff { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font: 13px/1.45 var(--font-data); }
.diff li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px; padding: 3px 8px; border-radius: 3px; }
.d-ic { font-weight: 700; text-align: center; }
.d-added { background: var(--ok-bg); } .d-added .d-ic { color: var(--ok); }
.d-removed { background: var(--flag-bg); text-decoration: line-through; } .d-removed .d-ic { color: var(--flag); }
.d-changed, .d-dates { background: var(--fix-bg); } .d-changed .d-ic, .d-dates .d-ic { color: var(--fix); }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; }
.events time { display: block; font: 500 11.5px/1.3 var(--font-data); color: var(--muted); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }

/* brand accounts (admin) and the admin login */
.admin-login { margin-top: 14px; }
.admin-login summary { cursor: pointer; }
.accounts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.accounts li { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.accounts li:last-child { border-bottom: 0; padding-bottom: 0; }
.accounts select { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); max-width: 100%; }
.accounts .off { text-decoration: line-through; color: var(--muted); }
.file-btn { cursor: pointer; display: inline-flex; align-items: center; }
.top-actions { gap: 8px; }
.account-wrap { position: relative; }
.account-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 220px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px -12px rgba(0,0,0,.35); font-size: 14px; overflow-wrap: anywhere; }
.top-actions { flex-wrap: nowrap; }
.top-actions .btn { white-space: nowrap; }
.top-actions .short { display: none; }
@media (max-width: 560px) {
  .logo span { display: none; }
  .appbar-in { padding: 8px 12px; }
  .top-actions { gap: 6px; }
  .top-actions .btn.ghost { padding: 7px 9px; font-size: 13px; }
  .top-actions .long { display: none; }
  .top-actions .short { display: inline; }
}
.on-po .page-head { display: none; }
@media (max-width: 560px) {
  .tallies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; }
  .tally { min-width: 0; padding: 8px 10px; }
  .tally .n { font-size: 20px; }
}

/* Brands card (admin) */
.brand-form summary { cursor: pointer; font-weight: 600; margin-top: 12px; }
.brand-form form { display: grid; gap: 10px; margin-top: 10px; }
.brand-form label { display: grid; gap: 4px; font-size: 14px; }
.brand-form textarea { font: 13.5px/1.45 var(--font-data, monospace); padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); width: 100%; resize: vertical; }
.brand-form select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); max-width: 100%; }
.brands-now { font-weight: 600; color: var(--ok); }

/* Invoice builder (inbox/invoice.js): one sheet laid out like the PDF */
.inv-intro { margin: 0 0 6px; }
.inv-empty { padding: 10px 4px; }
.inv-top { align-items: center; }
.inv-actions { gap: 8px; }
#invoice-view { display: grid; gap: 14px; width: 100%; max-width: 1040px; margin: 0 auto; }
#invoice-view[hidden] { display: none !important; }
.inv-sheet { display: grid; gap: 22px; padding: clamp(16px, 3.5vw, 36px); border-top: 3px solid var(--thread); }
.inv-sheet input[type=date], .inv-sheet select, .inv-sheet textarea { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); }
.inv-sheet textarea { resize: vertical; line-height: 1.45; }
.inv-sheet input:focus, .inv-sheet textarea:focus, .inv-sheet select:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.inv-top-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.inv-logo { display: grid; gap: 6px; align-content: start; justify-items: start; }
.inv-logo img { max-width: 220px; max-height: 90px; object-fit: contain; border-radius: 4px; }
.inv-logo-add { display: grid; place-items: center; width: 200px; height: 84px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; background: var(--bg); }
.inv-logo-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.inv-facts { display: grid; gap: 8px; width: min(100%, 360px); }
.inv-facts label { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.inv-facts label:first-child { color: var(--ink); }
.inv-facts label:first-child input { font: 700 18px/1.2 var(--font-display); }
.inv-parties { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.inv-parties fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.inv-parties legend { font: 700 15px/1.2 var(--font-body); padding: 0; margin-bottom: 8px; }
.inv-parties input { font-weight: 600; }
.inv-items { display: grid; gap: 8px; }
.inv-row { display: grid; grid-template-columns: minmax(0, 1fr) 78px 112px 76px 112px 32px; gap: 8px; align-items: start; }
.inv-headrow { font: 600 11px/1 var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 0 0 8px; border-bottom: 1px solid var(--line-strong); }
.inv-headrow span:nth-child(n+2) { text-align: right; }
.inv-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.inv-name { display: grid; gap: 6px; }
.inv-name input { font-weight: 600; }
.inv-name textarea { font-size: 13.5px; color: var(--muted); min-height: 38px; }
.inv-item label input { text-align: right; font-variant-numeric: tabular-nums; }
.inv-item .m-lab { display: none; }
.inv-amt { text-align: right; padding-top: 9px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inv-x { width: 32px; height: 36px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.inv-x:hover { background: var(--flag-bg); color: var(--flag); }
.inv-add { width: 100%; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--bg); color: var(--accent); font-weight: 700; cursor: pointer; margin-top: 6px; }
.inv-add:hover { border-color: var(--accent); background: var(--accent-soft); }
.inv-summary { display: flex; justify-content: flex-end; }
.inv-summary-in { width: min(100%, 340px); display: grid; gap: 10px; }
.inv-summary select { width: 100%; }
.inv-sums { margin: 0; display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.inv-sums div { display: flex; justify-content: space-between; gap: 12px; }
.inv-sums dt { color: var(--muted); font-weight: 600; }
.inv-sums dd { margin: 0; font-weight: 600; }
.inv-sums .grand { border-top: 1px solid var(--ink); padding-top: 8px; font-size: 18px; }
.inv-sums .grand dt { color: var(--ink); }
.inv-summary .muted { margin: 0; text-align: right; }
.inv-notes { display: grid; gap: 6px; font-weight: 600; font-size: 14px; border-top: 1px solid var(--line); padding-top: 18px; }

.inv-help li { grid-template-columns: 14px minmax(0, 1fr); }
.inv-help-card .btn { margin-top: 12px; }
@media (max-width: 720px) {
  .inv-parties { grid-template-columns: minmax(0, 1fr); }
  .inv-facts { width: 100%; }
  .inv-headrow { display: none; }
  .inv-row { grid-template-columns: repeat(3, minmax(0, 1fr)) 32px; }
  .inv-name { grid-column: 1 / -1; }
  .inv-item .m-lab { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
  .inv-amt { grid-column: 1 / -2; text-align: left; padding-top: 0; }
  .inv-amt::before { content: "Amount "; color: var(--muted); font-weight: 400; font-size: 13px; }
  .inv-item .inv-x { grid-column: -2 / -1; grid-row: 3; }
  .inv-actions { width: 100%; }
}

/* Invoices page (#invoices): recent cards, then a sortable table */
#invoices-view { display: grid; gap: 16px; }
#invoices-view[hidden] { display: none !important; }
.inv-list-head h1 { margin: 0; }
.inv-recent-wrap h3 { margin-bottom: 10px; }
.inv-recent { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .inv-recent { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.inv-card { display: grid; gap: 2px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); min-width: 0; }
.inv-card:hover { border-color: var(--accent); }
.inv-card b { font: 700 22px/1.2 var(--font-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.inv-card-logo { height: 40px; margin-bottom: 10px; display: flex; align-items: center; }
.inv-card-logo img { max-height: 40px; max-width: 120px; object-fit: contain; }
.inv-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font: 700 18px/1 var(--font-display); }
.inv-card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.inv-recent .empty-state { grid-column: 1 / -1; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.inv-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin: 8px 0 12px; }
.inv-filters label { display: grid; gap: 4px; font-size: 13.5px; color: var(--muted); }
.inv-filters select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); }
@media (max-width: 640px) { .inv-filters { grid-template-columns: minmax(0, 1fr); } }
.inv-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; min-width: 640px; }
.inv-table th { text-align: left; border-bottom: 1px solid var(--line-strong); padding: 0; }
.inv-table th button { background: none; border: 0; padding: 10px 8px; font: 600 11px/1 var(--font-data); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); cursor: pointer; white-space: nowrap; }
.inv-table th[aria-sort="ascending"] button, .inv-table th[aria-sort="descending"] button { color: var(--ink); }
.inv-table th.num, .inv-table td.num { text-align: right; }
.inv-table td { padding: 11px 8px; border-bottom: 1px solid var(--line); }
.inv-table tbody tr[data-href] { cursor: pointer; }
.inv-table tbody tr[data-href]:hover { background: var(--bg); }
.inv-table td a { font-weight: 600; text-decoration: none; }
.inv-table td.late { color: var(--flag); font-weight: 600; }

/* Top bar: PO inbox and Invoice builder side by side, the current one filled in. On a phone's
   PO page the row is already full, and the PO has its own "Make invoice" button. */
.nav-tabs { display: inline-flex; gap: 8px; }
.nav-tabs[hidden] { display: none; }
@media (max-width: 720px) { #nav-setup { display: none; } }
.top-actions .nav-tabs .btn[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 560px) { .nav-tabs { gap: 6px; } body.on-po:not(.on-inv) .nav-tabs { display: none; } }

/* Clients: the form (#client=...) and the list on the Invoices page */
#client-view { display: grid; gap: 14px; width: 100%; max-width: 1040px; margin: 0 auto; }
#client-view[hidden] { display: none !important; }
.client-form { display: grid; gap: 20px; padding: clamp(16px, 3.5vw, 32px); border-top: 3px solid var(--thread); }
.client-form select, .client-form textarea { font: inherit; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); }
.client-form input:focus, .client-form select:focus, .client-form textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.client-logo { display: grid; gap: 6px; justify-items: start; }
.client-label { font-size: 14px; font-weight: 600; }
.client-logo-add { width: min(100%, 320px); height: 64px; }
#client-logo-img { max-height: 56px; max-width: 200px; object-fit: contain; border-radius: 4px; }
.client-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 20px; }
.client-grid label { display: grid; gap: 5px; font-size: 14px; font-weight: 600; color: var(--muted); }
.client-grid .client-wide { grid-column: 1 / -1; }
.req { color: var(--flag); }
.client-actions { gap: 10px; }
.client-delete { margin-left: auto; color: var(--flag); }
@media (max-width: 640px) { .client-grid { grid-template-columns: minmax(0, 1fr); } }
#inv-client { font-weight: 600; }
.client-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); }
.client-row:first-child { border-top: 0; }
.client-mark img { max-width: 40px; max-height: 36px; object-fit: contain; display: block; }
.client-text { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.client-btns { gap: 6px; flex-wrap: nowrap; }
.client-btns .choice { text-decoration: none; white-space: nowrap; }
@media (max-width: 560px) { .client-row { grid-template-columns: 40px minmax(0, 1fr); } .client-btns { grid-column: 2; } }
.client-btns { align-items: center; align-self: center; }
.client-btns .choice { display: inline-block; line-height: 1.3; align-self: center; padding: 5px 10px; border-radius: 4px; }
.client-btns .choice:hover { background: var(--accent-soft); }

/* Invoice extras: tax IDs, ship-to, discount and shipping in the summary, payments */
.link-btn { background: none; border: 0; padding: 2px 0; font: 600 14px/1.3 var(--font-body); color: var(--accent); cursor: pointer; justify-self: start; text-decoration: underline; text-underline-offset: 3px; }
.inv-parties input.inv-light { font-weight: 400; font-size: 14px; }
.inv-ship { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.inv-ship b { font-size: 14px; }
.inv-sums .inv-adj { align-items: center; }
.inv-sums .inv-adj dd { display: flex; align-items: center; gap: 10px; }
.inv-adj-in { display: inline-flex; gap: 4px; }
.inv-adj-in input { width: 84px; text-align: right; font-variant-numeric: tabular-nums; }
.inv-sums dt select { width: auto; padding: 2px 6px; font-weight: 600; color: var(--muted); }
.inv-adj-in select { width: auto; padding: 6px 4px; }
.inv-adj dt label { font-weight: 600; }
.inv-sums .inv-paid-row:not(.grand) dd { color: var(--ok); }
.inv-pay { display: grid; gap: 12px; }
.inv-pay h2 { margin: 0; }
.inv-pay .pill.unpaid { color: var(--muted); background: var(--bg); }
.inv-pay p { margin: 0; }
.inv-pay-list { list-style: none; margin: 0; padding: 0; display: grid; }
.inv-pay-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto 32px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.inv-pay-list li b { font-weight: 600; }
.inv-pay-form { display: grid; grid-template-columns: 150px 130px 190px minmax(0, 1fr); gap: 10px; align-items: end; }
.inv-pay-form label { display: grid; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.inv-pay-form input, .inv-pay-form select { font: inherit; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); }
.inv-pay-btns { grid-column: 1 / -1; gap: 8px; }
@media (max-width: 760px) { .inv-pay-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .inv-pay-form { grid-template-columns: minmax(0, 1fr); } }
.pill.unpaid { color: var(--muted); background: var(--bg); }
.inv-card .pill { justify-self: start; margin-top: 8px; }

/* Payments: total, received, pending at a glance */
.inv-pay-sums { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.inv-pay-sums div { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.inv-pay-sums dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.inv-pay-sums dd { margin: 2px 0 0; font: 700 20px/1.2 var(--font-display); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.inv-pay-sums .pending { border-color: var(--line-strong); }
.inv-pay-sums .pending.zero dd { color: var(--ok); }
.inv-pay-btns .muted { font-size: 14px; }

/* Email this invoice */
.inv-mail { display: grid; gap: 12px; }
.inv-mail h2 { margin: 0; }
.inv-mail p { margin: 0; }
.inv-mail-form { display: grid; gap: 12px; }
.inv-mail-form > label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.inv-mail-form > label .muted { font-weight: 400; }
.inv-mail-form input[type=text], .inv-mail-form textarea { font: inherit; font-weight: 400; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); }
.inv-check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.inv-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.inv-check > span { display: grid; gap: 2px; }
.inv-mail-log { list-style: none; margin: 0; padding: 0; display: grid; font-size: 14px; }
.inv-mail-log li { padding: 8px 0; border-top: 1px solid var(--line); }
.inv-mail-log li:first-child { border-top: 0; }
@media (max-width: 560px) { .inv-pay-sums dd { font-size: 16px; } }

/* Reminder dates and the brand's reminder email */
.inv-rem { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.inv-rem[hidden] { display: none; }
.inv-rem-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.inv-dates { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.inv-dates li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); font-size: 14px; font-variant-numeric: tabular-nums; }
.inv-dates li.sent { color: var(--muted); text-decoration: line-through; }
.inv-dates li.next { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.inv-dates button { width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.inv-dates button:hover { background: var(--flag-bg); color: var(--flag); }
.inv-date-add { gap: 8px; }
.inv-date-add input { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.inv-tpl summary { cursor: pointer; }
.inv-tpl label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.inv-tpl input, .inv-tpl textarea { font: inherit; font-weight: 400; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.inv-tpl code { font-size: 12.5px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.inv-tpl #inv-tpl-preview { white-space: pre-wrap; border-left: 3px solid var(--line-strong); padding-left: 10px; }

/* Guided tour (tour.js): the page dims, the part being explained gets a gold ring, a card explains it,
   and "Skip tour" stays at the bottom left. */
.tour { position: fixed; inset: 0; z-index: 100; }
.tour-block { position: fixed; inset: 0; }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 3px var(--thread), 0 0 0 9999px rgba(10,16,30,.62); pointer-events: none; transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease; }
.tour-spot.none { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; box-shadow: 0 0 0 9999px rgba(10,16,30,.62); }
.tour-card { position: fixed; width: min(380px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-top: 4px solid var(--thread); border-radius: 12px; padding: 18px 18px 16px; box-shadow: 0 18px 50px -12px rgba(0,0,0,.5); transition: left .25s ease, top .25s ease; }
.tour-card.center { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tour-card h2 { font-size: 21px; margin: 2px 0 8px; }
.tour-card p { margin: 0; }
.tour-card #tour-text { color: var(--ink); font-size: 15px; line-height: 1.55; }
.tour-count { font: 600 11.5px/1.2 var(--font-data); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.tour-dots { display: flex; flex-wrap: wrap; gap: 5px; margin: 14px 0 0; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.tour-dots span.on { background: var(--thread); width: 18px; border-radius: 4px; }
.tour-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.tour-btns .btn { padding: 10px 18px; }
.tour-skip { position: fixed; left: 16px; bottom: 16px; z-index: 101; font: 600 14px/1 var(--font-body); padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: 0 6px 18px -6px rgba(0,0,0,.45); }
.tour-skip:hover { background: var(--bg); }
.tour-card.docked { left: 12px !important; right: 12px; top: auto !important; bottom: 70px; width: auto; transform: none; }
body.touring { overscroll-behavior: contain; }
.tour-card.corner { left: auto !important; top: auto !important; right: 16px; bottom: 16px; }
@media (max-width: 820px) { .top-actions .tour-btn { display: none; } }
/* A PO's page has two more buttons in the top bar: short labels, and the tour button moves into Account. */
@media (max-width: 1100px) { .on-po .top-actions .tour-btn { display: none; } }
@media (max-width: 1000px) { .on-po .top-actions .long { display: none; } .on-po .top-actions .short { display: inline; } }
@media (max-width: 700px) { .on-po .logo span { display: none; } }

/* Demo inbox (/inbox/?demo) and the "while you wait" box on the setting-up page. */
.demo-banner { border-top: 3px solid var(--thread); margin-bottom: 14px; }
.demo-banner p { margin: 0; }
.demo-banner .row { margin-top: 12px; gap: 10px; flex-wrap: wrap; }
.wait-try { margin: 18px 0 6px; padding: 14px 16px; border: 1px dashed var(--line-strong, var(--line)); border-radius: 8px; display: grid; gap: 8px; }
.wait-try p { margin: 0; }
.wait-try .file-btn { justify-self: start; cursor: pointer; position: relative; }
.wait-try .file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }

/* "Set up your inbox": a new account connects its own store. */
.card.narrow.self-setup { max-width: 600px; }
.self-setup > p { margin: 0 0 4px; }
.self-setup .steps { margin: 14px 0 6px; }
.self-setup .steps li.now::before { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.sell-on { border: 0; margin: 4px 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-width: 0; }
.sell-on legend { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 8px; }
.sell-on .opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 14px; line-height: 1.35; }
.sell-on .opt input { margin-top: 3px; accent-color: var(--accent); }
.sell-on .opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.setup-form { display: grid; gap: 12px; }
.setup-form label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.setup-form label .muted { font-weight: 400; }
.setup-form select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--ink); width: 100%; }
.setup-form .two { display: grid; grid-template-columns: minmax(0, 1fr) 130px; gap: 10px; align-items: end; }
.setup-form .btn { justify-self: start; }
.setup-form .drop { min-height: 80px; font-weight: 400; }
.setup-form > p { margin: 0; }
.howto { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; font-size: 14px; }
.howto summary { cursor: pointer; font-weight: 600; }
.howto ol { margin: 10px 0 8px; padding-left: 20px; display: grid; gap: 6px; }
.howto code { font: 500 12.5px/1.4 var(--font-data, monospace); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; overflow-wrap: anywhere; }
.howto p { margin: 0; }
.self-setup #setup-msg { margin-top: 12px; }
.self-setup .wait-try summary { cursor: pointer; font-weight: 600; font-size: 14px; }
@media (max-width: 560px) {
  .sell-on { grid-template-columns: 1fr; }
  .setup-form .two { grid-template-columns: minmax(0, 1fr) 100px; }
  .setup-form .btn { justify-self: stretch; }
}

/* A brand not on Shopify (no-store mode) doesn't see Shopify-only tips. */
body.no-store .shop-only { display: none; }
