/* EtsyDashboard — one stylesheet, light and dark, no framework. */
/* One theme, taken from the Creektree Clayworks logo:
     clay #c6a187 · charcoal #4d5556 · light grey #d3d5d4 · slate #63777e · sand #c6a88f · white
   There is deliberately no dark mode: the brand is white paper and glazed clay. */
:root {
  color-scheme: light;
  --bg: #f7f6f4;
  --surface: #ffffff;
  --surface-2: #f0efed;
  --line: #e2e3e2;
  --line-strong: #c9cccb;
  --ink: #2f3536;            /* charcoal, deepened for body text */
  --ink-2: #4d5556;          /* logo charcoal */
  --ink-3: #7d8687;
  --accent: #c6a187;         /* logo clay */
  --accent-ink: #2f3536;
  --accent-soft: #efe3d9;
  --accent-deep: #a67d5f;    /* clay dark enough for text on white (4.5:1) */
  --slate: #63777e;          /* logo slate: links, bars */
  --slate-deep: #4c5e65;
  --focus: #63777e;
  --good: #5f8a62; --warning: #c99a3a; --serious: #c47a52; --critical: #b5493f;
  --series-1: #63777e; --series-2: #c6a187; --series-3: #4d5556; --series-4: #d3d5d4;
  --seq-250: #c9d0d3; --seq-350: #a4b0b4; --seq-450: #63777e; --seq-550: #4c5e65; --seq-650: #38474c;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(77,85,86,.08), 0 4px 14px rgba(77,85,86,.06);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--slate-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---- top bar ---- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 10px 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .brand { display: flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -.01em; }
.topbar .brand img { width: 30px; height: 30px; border-radius: 7px; object-fit: cover; background: var(--surface-2); }
.topbar .brand .sub { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.topbar .spacer { flex: 1; }
.topbar .status { font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.dot.good { background: var(--good); } .dot.warn { background: var(--warning); } .dot.bad { background: var(--critical); }
.dot.spin { background: var(--slate); animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .35 } to { opacity: 1 } }

/* ---- buttons / inputs ---- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.primary:focus-visible { outline-color: var(--slate-deep); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.danger { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; }
.btn.icon { padding: 7px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .01em; }
.field .help { font-size: 12px; color: var(--ink-3); }
.input, select.input, textarea.input { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); width: 100%; }
.input:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- layout ---- */
.page { padding: 18px 20px 60px; max-width: 1700px; margin: 0 auto; }
.narrow { max-width: 760px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card .hd h2 { margin: 0; font-size: 14px; font-weight: 650; }
.card .hd .spacer { flex: 1; }
.card .bd { padding: 14px 16px; }
h1 { font-size: 20px; margin: 0 0 4px; letter-spacing: -.015em; }
.banner { padding: 12px 16px; border-radius: var(--radius); border: 1px solid; margin-bottom: 16px; display: flex; gap: 12px; align-items: center; }
.banner.info { border-color: color-mix(in srgb, var(--slate) 40%, transparent); background: color-mix(in srgb, var(--slate) 10%, var(--surface)); }
.banner.warn { border-color: color-mix(in srgb, var(--warning) 60%, transparent); background: color-mix(in srgb, var(--warning) 12%, var(--surface)); }
.banner.bad  { border-color: color-mix(in srgb, var(--critical) 50%, transparent); background: color-mix(in srgb, var(--critical) 10%, var(--surface)); }
.banner .spacer { flex: 1; }

/* ---- KPI tiles ---- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-height: 84px; }
.tile.click { cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .12s, transform .12s; display: block; width: 100%; }
/* The three numbers that decide what to do today: bigger, accented, first. */
.kpis.hero { grid-template-columns: repeat(3, 1fr); margin-bottom: 10px; }
.tile.hero { padding: 16px 18px 14px; border-left: 5px solid var(--accent); background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 160%); min-height: 104px; }
.tile.hero .k { font-size: 12.5px; color: var(--ink-2); }
.tile.hero .v { font-size: 40px; margin-top: 6px; }
.tile.hero .d { font-size: 13px; margin-top: 6px; }
/* "Needs a look" is warm clay, never red: this row is meant to feel good. */
.tile.hero.attn { border-left-color: var(--accent-deep); background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 120%); }
.tile.hero.attn .v { color: var(--accent-deep); }
.tile.hero.calm { border-left-color: var(--good); }
.tile.hero.calm .v { color: var(--good); }
.tile.click:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile .k { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.tile .v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .v small { font-size: 13px; color: var(--ink-3); font-weight: 500; margin-left: 4px; }
.tile .d { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.tile .d b { color: var(--ink-2); font-weight: 600; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; margin-bottom: 16px; }
@media (max-width: 1100px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* ---- charts (inline SVG) ---- */
.chart { width: 100%; height: auto; display: block; }
.chart text { font-family: var(--sans); fill: var(--ink-2); font-size: 11px; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); }
.chart .bar { fill: var(--series-1); }
.chart .bar.alt { fill: var(--series-2); }
.chart .bar:hover { filter: brightness(1.15); }
.chart .label { fill: var(--ink); font-weight: 600; }
.chart .val { fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--ink-2); color: #ffffff; padding: 6px 9px; border-radius: 6px;
  font-size: 12px; box-shadow: var(--shadow); max-width: 280px; }
.tip b { font-weight: 650; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); padding: 0 16px 10px; flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---- welcome header ---- */
.welcome { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center;
  padding: 26px 30px; margin-bottom: 18px; border-radius: 14px; color: #ffffff;
  background: linear-gradient(115deg, #4d5556 0%, #63777e 55%, #8c9a9e 100%); box-shadow: var(--shadow); }
.welcome::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(198,161,135,.55), rgba(198,161,135,0)); pointer-events: none; }
.welcome::after { content: ""; position: absolute; left: -60px; bottom: -120px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(211,213,212,.28), rgba(211,213,212,0)); pointer-events: none; }
.welcome .w-art { position: relative; width: 84px; height: 84px; border-radius: 20px; background: rgba(255,255,255,.92); display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.welcome .w-art img { width: 64px; height: 64px; object-fit: contain; }
.welcome .w-text { position: relative; min-width: 0; }
.welcome .w-hi { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; font-size: 30px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.welcome .w-hi em { font-style: normal; color: #efdccb; }
.welcome .w-quote { display: block; margin-top: 8px; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; max-width: 900px; }
.welcome .w-quote .q { display: block; font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; font-style: italic; font-size: 17px; line-height: 1.45; color: rgba(255,255,255,.95); transition: opacity .5s ease, transform .5s ease; }
.welcome .w-quote .by { display: block; margin-top: 4px; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.72); transition: opacity .5s ease; }
.welcome .w-quote.fade .q, .welcome .w-quote.fade .by { opacity: 0; transform: translateY(4px); }
.welcome .w-quote:hover .q { color: #ffffff; }
.welcome .w-quote:focus-visible { outline: 2px solid #efdccb; outline-offset: 6px; border-radius: 4px; }
.welcome .w-date { position: relative; text-align: right; white-space: nowrap; align-self: center; }
.welcome .w-clock { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; font-size: 40px; font-weight: 600; line-height: 1; letter-spacing: -.01em; color: #ffffff; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,.15); }
.welcome .w-clock small { font-size: 16px; font-weight: 500; margin-left: 5px; color: #efdccb; letter-spacing: .04em; }
.welcome .w-day { margin-top: 6px; font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; font-size: 22px; color: rgba(255,255,255,.92); }
@media (prefers-reduced-motion: reduce) { .welcome .w-quote .q, .welcome .w-quote .by { transition: none; } }

/* ---- days to sell ---- */
.sell-grid { display: grid; grid-template-columns: minmax(0, 560px) 1fr; gap: 0 16px; align-items: start; }
.sell-grid .tbl th { top: 0; }
@media (max-width: 1100px) { .sell-grid { grid-template-columns: 1fr; } }

/* ---- par levels ---- */
.parbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 13px; }
.chip.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.chip.short { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }

/* ---- explore facets ---- */
.facets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.facet { padding: 10px 16px 12px; border-right: 1px solid var(--line); min-width: 0; }
.facet:last-child { border-right: 0; }
.facet .fh { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.facet .fh .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.crumbs { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: 6px; }
.crumbs .chip { cursor: pointer; }
.crumbs .chip:hover { border-color: var(--line-strong); }
.crumbs .chip .x { color: var(--ink-3); margin-left: 2px; }
.chart .brow.click { cursor: pointer; }
.chart .brow.on .bar { fill: var(--accent); }
.chart .brow.on .label { fill: var(--accent-deep); }
.chart .brow.dim .bar { opacity: .45; }
@media (max-width: 1100px) { .facets { grid-template-columns: 1fr; } .facet { border-right: 0; border-bottom: 1px solid var(--line); } .facet:last-child { border-bottom: 0; } }

/* ---- listings toolbar + grid/table ---- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.toolbar .input { width: auto; min-width: 180px; padding: 6px 9px; }
.toolbar select.input { min-width: 0; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 5px 10px; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.chip.active { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.chip.sold_out { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, transparent); }
.chip.draft { color: var(--slate-deep); border-color: color-mix(in srgb, var(--series-1) 45%, transparent); }
.chip.expired, .chip.inactive { color: var(--ink-3); }
.chip.low { color: var(--serious); border-color: color-mix(in srgb, var(--serious) 55%, transparent); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding: 14px 16px; }
.lcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease; text-align: left; padding: 0; }
.lcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.lcard .img { aspect-ratio: 4 / 3; background: var(--surface-2); display: grid; place-items: center; color: var(--ink-3); font-size: 12px; overflow: hidden; }
.lcard .img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lcard .body { padding: 9px 11px 10px; display: flex; flex-direction: column; gap: 4px; }
.lcard .t { font-weight: 600; font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.lcard .m { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink-2); }
.lcard .m .p { font-weight: 650; color: var(--ink); font-size: 14px; }
.lcard .s { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.tbl th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 600; position: sticky; top: 52px; background: var(--surface); cursor: pointer; user-select: none; }
.tbl th.r, .tbl td.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl td.title { white-space: normal; max-width: 420px; }
.tbl tr.click { cursor: pointer; }
.tbl .thumb { width: 36px; height: 28px; object-fit: cover; border-radius: 4px; background: var(--surface-2); vertical-align: middle; }
.empty { padding: 40px 16px; text-align: center; color: var(--ink-3); }

/* ---- inspector drawer ---- */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -8px 0 30px rgba(0,0,0,.18); z-index: 40; transform: translateX(100%); transition: transform .18s ease; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
/* Closed, the drawer sits translated off the right edge; on phones that still
   widens the scrollable area, so hide it outright until it opens. */
.drawer:not(.open) { visibility: hidden; }
.drawer .hd { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.drawer .hd h3 { margin: 0; font-size: 15px; line-height: 1.3; flex: 1; }
.drawer .bd { padding: 14px 16px; overflow: auto; flex: 1; }
.drawer .hero { aspect-ratio: 4/3; background: var(--surface-2); border-radius: 8px; overflow: hidden; margin-bottom: 10px; }
.drawer .hero img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.thumbs img { width: 56px; height: 44px; object-fit: cover; border-radius: 5px; cursor: pointer; border: 2px solid transparent; }
.thumbs img.on { border-color: var(--accent); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-bottom: 12px; }
.facts .f .k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.facts .f .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.tags .chip { font-weight: 500; }
.desc { white-space: pre-wrap; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 30; display: none; }
.scrim.open { display: block; }

/* ---- reviews / orders lists ---- */
.rev { padding: 10px 0; border-bottom: 1px solid var(--line); }
.rev:last-child { border-bottom: 0; }
.rev .stars { color: var(--warning); letter-spacing: 1px; font-size: 12px; }
.rev .q { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.rev .w { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.order { display: grid; grid-template-columns: 90px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: start; }
.order:last-child { border-bottom: 0; }
.order .items { color: var(--ink-2); font-size: 12.5px; }
.order .tot { font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: min(400px, 100%); }
.login .card .bd { display: flex; flex-direction: column; gap: 14px; }
.login .logo { font-size: 22px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.login .logo img { width: 44px; height: 44px; object-fit: contain; }
.err { color: var(--critical); font-size: 13px; min-height: 1.2em; }
.ok { color: var(--good); font-size: 13px; }

/* ---- settings ---- */
.settings .card { margin-bottom: 16px; }
.settings .bd { display: flex; flex-direction: column; gap: 14px; }
.steps { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 13px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.users li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.users ul { list-style: none; margin: 0; padding: 0; }

/* ---- phones (iPhone first) ----
   One column where it must be, two where it helps, nothing wider than the
   screen. Inputs stay at 16px so iOS Safari does not zoom into them. */
@media (max-width: 720px) {
  html { -webkit-text-size-adjust: 100%; }
  html, body { overflow-x: hidden; max-width: 100vw; }
  body { padding-bottom: env(safe-area-inset-bottom); }
  .page { padding: 12px 12px 60px; }
  .topbar { padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); gap: 6px; flex-wrap: nowrap; }
  .topbar .brand { min-width: 0; flex: 1; }
  .topbar .brand > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .brand .sub, .topbar .status, .topbar .spacer { display: none; }
  .topbar .btn { padding: 6px 9px; font-size: 13px; }
  .topbar #logout { display: none; }        /* sign-out lives on the Settings page too */
  .input, select.input, textarea.input { font-size: 16px; }
  .facts { grid-template-columns: 1fr; }
  .grid2, .grid3 { grid-template-columns: 1fr; gap: 12px; }
  .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tile { padding: 10px 12px; min-height: 0; }
  .tile .v { font-size: 22px; }
  .tile .k { font-size: 10.5px; letter-spacing: .04em; }
  .tile .d { font-size: 11.5px; }
  .kpis.hero { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tile.hero { padding: 10px 10px 10px 12px; border-left-width: 4px; min-height: 0; }
  .tile.hero .k { font-size: 10.5px; line-height: 1.25; }
  .tile.hero .v { font-size: 28px; margin-top: 4px; }
  .tile.hero .d { font-size: 11px; line-height: 1.3; }
  .card .hd { flex-wrap: wrap; padding: 10px 12px; row-gap: 8px; }
  .card .hd .spacer { display: none; }
  .card .bd { padding: 12px; }
  #explore .hd .crumbs { flex-basis: 100%; margin-left: 0; order: 2; }
  #explore .hd #explore-sub { flex-basis: 100%; order: 3; font-size: 12.5px; }
  #explore .hd .seg, #explore .hd #explore-edit { order: 4; }
  #explore .hd #period { order: 5; flex-basis: 100%; }
  #explore .hd #period-custom { order: 6; flex-basis: 100%; }
  #sell-card .hd #sell-range { flex-basis: 100%; }
  #sell-card .hd #sell-custom { flex-basis: 100%; }
  .facets { grid-template-columns: 1fr; }
  .facet { padding: 8px 12px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .facet:last-child { border-bottom: 0; }
  .toolbar { padding: 8px 12px; gap: 6px; }
  .toolbar .input { min-width: 0; flex: 1 1 45%; }
  .toolbar #q { flex-basis: 100%; }
  .toolbar .spacer { display: none; }
  .toolbar #count { font-size: 12px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 10px 12px; }
  .lcard .t { font-size: 12.5px; }
  .lcard .body { padding: 7px 9px 8px; }
  .lcard .s { font-size: 11px; }
  #listings { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tbl th { top: 0; }
  .parbar { padding: 8px 12px; gap: 6px; }
  .parbar .input { flex: 1; min-width: 0; }
  #pa-color { width: 100% !important; }
  .order { grid-template-columns: 1fr auto; }
  .order > div:first-child { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; }
  .welcome { grid-template-columns: 1fr; padding: 18px 18px 16px; gap: 12px; margin-bottom: 12px; }
  .welcome .w-art { display: none; }
  .welcome .w-hi { font-size: 24px; }
  .welcome .w-quote .q { font-size: 15.5px; }
  .welcome .w-date { text-align: left; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .welcome .w-clock { font-size: 28px; }
  .welcome .w-day { margin-top: 0; font-size: 16px; }
  .drawer { width: 100vw; }
  .drawer .hd { padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top)); }
  .drawer .bd { padding: 12px 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .drawer .hd h3 { font-size: 14px; }
  .thumbs img { width: 48px; height: 38px; }
  .btn, .seg button { min-height: 36px; }   /* finger-sized targets */
}
@media (max-width: 400px) {
  .kpis.hero { gap: 6px; }
  .tile.hero .v { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) { .lcard, .drawer { transition: none; } }
.topbar .brand .logo { width: 30px; height: 30px; object-fit: contain; }

/* ---- goals ---- */
.fh { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; color: var(--ink-3); margin: 4px 0 6px; }
.goal { display: grid; grid-template-columns: 130px 1fr; gap: 4px 16px; align-items: center; padding: 6px 0 12px; }
.goal + .goal { border-top: 1px solid var(--line); padding-top: 14px; }
.goal .gk { font-weight: 650; font-size: 13px; }
.goal .gk small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.goal .gv { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.goal .gv .big { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.goal .gbar { grid-column: 2; position: relative; height: 12px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); }
.goal .gbar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--series-1); }
.goal .gbar .fill.done { background: var(--good); }
.goal .gbar .mark { position: absolute; top: -7px; bottom: -7px; width: 4px; margin-left: -2px; background: var(--accent-deep); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--surface); cursor: help; }
.goal .gbar .mark::before { content: ''; position: absolute; left: 50%; top: -9px; transform: translateX(-50%);
  border: 6px solid transparent; border-top: 7px solid var(--accent-deep); border-bottom: 0; }
.goal .gd { grid-column: 2; font-size: 12.5px; color: var(--ink-3); }
.goal .gd b { color: var(--ink-2); font-weight: 600; }
.goal .up { color: var(--good); font-weight: 600; } .goal .down { color: var(--critical); font-weight: 600; }

/* ---- customers / timing / sitting ---- */
.card .hd.sub { border-top: 1px solid var(--line); }
.cust-grid { display: grid; grid-template-columns: minmax(0, 520px) 1fr; gap: 0 8px; align-items: start; }
.kpis.mini { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.kpis.mini .tile { padding: 9px 11px; min-height: 0; }
.kpis.mini .tile .v { font-size: 20px; }
.chart .cell:hover { stroke: var(--ink); stroke-width: 1.5; }
.chart .tl { font-size: 10.5px; font-weight: 650; pointer-events: none; }
.chart .tl.on-dark { fill: #ffffff; }
.chart .tl small, .chart .tv { font-size: 9px; font-weight: 500; pointer-events: none; }
.chart .tv.on-dark { fill: #ffffff; }
.tbl tr.sub td { background: var(--surface-2); white-space: normal; font-size: 12.5px; }
.chip.b-loved { color: var(--accent-deep); border-color: color-mix(in srgb, var(--accent) 70%, transparent); background: var(--accent-soft); }
.chip.b-overlooked { color: var(--slate-deep); border-color: color-mix(in srgb, var(--series-1) 55%, transparent); }
.chip.b-overdue { color: var(--ink-2); }
.chip.b-fresh { color: var(--ink-3); }
#rep-table .tbl th, #sit-table .tbl th { top: 0; z-index: 1; }
.time-grid { display: grid; grid-template-columns: minmax(0, 760px) minmax(0, 1fr); gap: 0 8px; align-items: start; }
@media (max-width: 1100px) { .cust-grid, .time-grid { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .goal { grid-template-columns: 1fr; }
  .goal .gbar, .goal .gd { grid-column: 1; }
  #cust-card .hd #cust-range, #time-card .hd #time-range { flex-basis: 100%; }
  #sit-card .hd .seg { flex-wrap: wrap; }
  #sit-table, #rep-table, #heat { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #heat svg { min-width: 620px; }   /* readable cells; the card scrolls sideways, not the page */
}
