:root {
  --paper: #f7f5f1; --card: #ffffff; --ink: #1c1f26; --muted: #6b7080; --line: #e6e2da;
  --accent: #0f5b57; --accent-ink: #ffffff; --accent-soft: #e3f0ee;
  --red: #b42318; --red-soft: #fdecea; --amber: #a15c07; --amber-soft: #fdf3e2;
  --green: #17803d; --green-soft: #e7f5ec; --blue: #2457a6; --blue-soft: #e8f0fb;
  --radius: 14px; --shadow: 0 1px 2px rgba(28,31,38,.05), 0 4px 16px rgba(28,31,38,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14161a; --card: #1c1f25; --ink: #eceae6; --muted: #9a9fab; --line: #2c3038;
    --accent: #3fb3a9; --accent-ink: #0d1514; --accent-soft: #17302e;
    --red: #f2786c; --red-soft: #3a1f1d; --amber: #f0b45a; --amber-soft: #352a19;
    --green: #5bd08a; --green-soft: #183223; --blue: #8cb4f0; --blue-soft: #1b2638;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 Inter, system-ui, sans-serif; }
a { color: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
h1, h2, h3 { margin: 0; letter-spacing: -0.01em; }
h1 { font: 600 34px/1.15 Fraunces, Georgia, serif; }
h2 { font-size: 15px; font-weight: 650; margin-bottom: 12px; }
h3 { font-size: 14px; font-weight: 650; margin: 16px 0 8px; }

.top { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; gap: 28px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; font-size: 17px; }
.brand svg { width: 26px; height: 26px; }
.brand circle { fill: var(--accent); }
.brand path { stroke: var(--accent-ink); stroke-width: 3; fill: none; stroke-linecap: round; }
nav { display: flex; gap: 4px; }
nav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; }
nav a.on, nav a:hover { color: var(--ink); background: var(--paper); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; }
.shopname { font-weight: 600; }
.mode { padding: 3px 9px; border-radius: 99px; font-weight: 600; font-size: 12px; background: var(--amber-soft); color: var(--amber); }
.mode-sandbox { background: var(--blue-soft); color: var(--blue); }

.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 34px 0 22px; }
.lede { color: var(--muted); margin: 8px 0 0; max-width: 620px; }

.btn { font: inherit; font-weight: 600; border-radius: 10px; padding: 10px 16px; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--muted); }
.btn.small { padding: 7px 12px; font-size: 13px; }
.btn.wide { width: 100%; padding: 13px; font-size: 15px; margin-top: 6px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 13px; padding: 8px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 13px; }
.stat.warn .v { color: var(--red); }

.cases { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.case { display: grid; grid-template-columns: 116px 1fr auto 230px; align-items: center; gap: 18px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow);
  border-left: 4px solid var(--line); transition: border-color .15s, transform .15s; }
.case:hover { border-color: var(--muted); transform: translateY(-1px); }
.case.u-critical, .case.u-overdue { border-left-color: var(--red); }
.case.u-soon { border-left-color: var(--amber); }
.case.u-ok { border-left-color: var(--green); }
.clock .t { font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.clock .l { font-size: 12px; color: var(--muted); }
.u-critical .clock .t, .u-overdue .clock .t { color: var(--red); }
.u-soon .clock .t { color: var(--amber); }
.line2 { margin-top: 3px; display: flex; gap: 8px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.amt { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.rec { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--paper); border: 1px solid var(--line); }
.tag-out { background: var(--amber-soft); border-color: transparent; color: var(--amber); margin: 3px 4px 0 0; }
.chip { font-size: 12.5px; font-weight: 650; padding: 4px 10px; border-radius: 99px; display: inline-flex; gap: 6px; align-items: center; }
.chip-fight { background: var(--accent-soft); color: var(--accent); }
.chip-partial_refund, .chip-refund_with_return { background: var(--blue-soft); color: var(--blue); }
.chip-refund { background: var(--amber-soft); color: var(--amber); }
.chip-busy { background: var(--paper); color: var(--muted); }
.state { font-size: 12px; color: var(--muted); }
.s-ready { color: var(--accent); font-weight: 600; }
.s-failed { color: var(--red); font-weight: 600; }
.empty { text-align: center; padding: 60px 20px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); }
.busy { display: flex; gap: 10px; align-items: center; color: var(--muted); }

.spin { width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); display: inline-block; animation: sp .8s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(360deg); } }

.back { display: inline-block; margin: 24px 0 10px; color: var(--muted); text-decoration: none; font-size: 14px; }
.casehead { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; padding-bottom: 20px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.casehead h1 { font-size: 30px; margin: 8px 0 6px; }
.eyebrow { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bigclock { text-align: right; flex: none; }
.bigclock .amt { font-size: 15px; color: var(--muted); font-weight: 600; }
.bigclock .t { font-size: 40px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.bigclock .l { font-size: 13px; color: var(--muted); }
.u-critical .bigclock .t, .u-overdue .bigclock .t { color: var(--red); }
.u-soon .bigclock .t { color: var(--amber); }
.u-ok .bigclock .t { color: var(--green); }

.banner { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px; }
.banner.bad { background: var(--red-soft); color: var(--red); }
.banner.ok { background: var(--green-soft); color: var(--green); }
.banner.info { background: var(--blue-soft); color: var(--blue); }
.live-trace { margin: 8px 0 0; padding-left: 20px; font-size: 13px; }
.live-trace:empty { display: none; }

.grid { display: grid; grid-template-columns: 1fr 1.08fr; gap: 18px; align-items: start; }
.col { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card.narrow { max-width: 560px; }
blockquote.untrusted { margin: 0 0 10px; padding: 10px 14px; border-left: 3px solid var(--line); background: var(--paper); border-radius: 0 10px 10px 0; }
.who { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.asked { margin-top: 12px; font-size: 13px; }
.strength { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 99px; margin-bottom: 10px; }
.st-strong { background: var(--green-soft); color: var(--green); }
.st-medium { background: var(--amber-soft); color: var(--amber); }
.st-weak { background: var(--red-soft); color: var(--red); }
.findings { margin: 0 0 10px; padding-left: 18px; }
.findings li { margin-bottom: 5px; }
.note.warn { font-size: 13px; background: var(--amber-soft); color: var(--amber); padding: 8px 12px; border-radius: 9px; margin: 8px 0; }
.cites { display: flex; flex-wrap: wrap; gap: 6px; }
.cites code { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--muted); }

.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 10px 12px; display: grid; grid-template-columns: 1fr; font-size: 13.5px; }
.timeline li::before { content: ""; position: absolute; left: -20px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.timeline li.last::before { background: var(--accent); }
.timeline .when { color: var(--muted); font-size: 12px; }
.timeline .where { color: var(--muted); font-size: 12.5px; }
.timeline li.last .what { font-weight: 650; }
.msg { padding: 10px 14px; border-radius: 12px; margin-bottom: 8px; font-size: 14px; background: var(--paper); }
.msg-seller { background: var(--accent-soft); margin-left: 28px; }
.msg-buyer { margin-right: 28px; }

.options { display: grid; gap: 8px; }
.opt { display: grid; grid-template-columns: 20px 1fr auto; gap: 2px 10px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.opt input { grid-row: span 2; margin-top: 3px; accent-color: var(--accent); }
.opt .ol { font-weight: 600; }
.opt .ol em { font-style: normal; font-size: 11.5px; font-weight: 650; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 99px; margin-left: 6px; }
.opt .oc { font-weight: 700; font-variant-numeric: tabular-nums; }
.opt .od { grid-column: 2 / 4; font-size: 13px; color: var(--muted); }
.opt.chosen { border-color: var(--accent); background: var(--accent-soft); }

.planhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.summary { background: var(--paper); border-radius: 10px; padding: 11px 14px; margin: 0 0 6px; font-size: 14px; }
.ev { margin-bottom: 12px; }
.evhead { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.doc { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
textarea, input[type=number], select { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
textarea { resize: vertical; line-height: 1.45; }
textarea:focus, input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea[readonly] { opacity: .8; }
.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; margin: 14px 0; }
.field .muted { font-weight: 400; }

.checks { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 9px; }
.checks li { display: grid; grid-template-columns: 24px 1fr; gap: 8px; font-size: 14px; }
.checks .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.checks .ok .ic { background: var(--green-soft); color: var(--green); }
.checks .bad .ic { background: var(--red-soft); color: var(--red); }
.checks .warn .ic { background: var(--amber-soft); color: var(--amber); }
.log { margin: 0; padding-left: 18px; font-size: 13.5px; display: grid; gap: 5px; }
.log .when { color: var(--muted); font-size: 12px; }
.sandbox { border-style: dashed; }
.trace { margin-top: 18px; }
.trace summary { cursor: pointer; font-weight: 600; }
.trace ol { font-size: 13px; padding-left: 20px; margin: 12px 0 0; display: grid; gap: 7px; }
.trace .res { color: var(--muted); font: 11.5px ui-monospace, Menlo, monospace; word-break: break-all; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.product { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.product h3 { margin: 6px 0 0; font-size: 15.5px; }
.product p { margin: 0; flex: 1; }
.price { font-weight: 700; font-size: 18px; margin: 4px 0 6px; }
.pimg { height: 190px; width: 100%; border-radius: 10px; object-fit: cover; display: block; background: var(--paper); }
.studio-banner { margin-top: 24px; height: 220px; border-radius: var(--radius); background-size: cover; background-position: center 45%;
  display: flex; align-items: flex-end; padding: 20px 24px; color: #fff; position: relative; overflow: hidden; }
.studio-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,16,12,.65), rgba(20,16,12,0) 60%); }
.studio-banner div { position: relative; z-index: 1; display: grid; gap: 2px; }
.studio-banner span { font: 600 30px/1.1 Fraunces, Georgia, serif; }
.studio-banner small { font-size: 14px; opacity: .9; }
.photo-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.photo-pair figure { margin: 0; }
.photo-pair img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.photo-pair figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; }
.ai-note { font-size: 13.5px; background: var(--blue-soft); color: var(--ink); border-radius: 10px; padding: 10px 12px; }
.ai-note b { color: var(--blue); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; display: block; margin-bottom: 3px; }
.pimg-vase-indigo { background: radial-gradient(circle at 50% 70%, #2f4a8a 0 30%, transparent 31%), linear-gradient(#ece5da, #ddd3c4); }
.pimg-chai-rust { background: radial-gradient(circle at 30% 60%, #9a4a25 0 14%, transparent 15%), radial-gradient(circle at 55% 62%, #8c4322 0 14%, transparent 15%), radial-gradient(circle at 78% 60%, #a5552c 0 13%, transparent 14%), linear-gradient(#efe7dc, #e0d4c3); }
.pimg-coaster-block { background: repeating-linear-gradient(45deg, #c46d3f 0 10px, #d9895a 10px 20px); }
.pimg-planter-pair { background: radial-gradient(ellipse at 35% 75%, #b8613a 0 22%, transparent 23%), radial-gradient(ellipse at 70% 72%, #c06a40 0 18%, transparent 19%), linear-gradient(#ebe3d6, #d8cbb8); }
.sim { display: grid; gap: 8px; font-size: 12.5px; color: var(--muted); }
.sim label { display: grid; gap: 4px; }
.orders { margin-bottom: 20px; overflow-x: auto; }
.orders table { width: 100%; border-collapse: collapse; font-size: 14px; }
.orders th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 10px 8px 0; border-bottom: 1px solid var(--line); }
.orders td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pstate { font-size: 12px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--paper); }
.ps-delivered { background: var(--green-soft); color: var(--green); }
.ps-in_transit { background: var(--blue-soft); color: var(--blue); }
.ps-label_created { background: var(--amber-soft); color: var(--amber); }
.foot { color: var(--muted); font-size: 12.5px; padding-top: 40px; padding-bottom: 40px; }

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .case { grid-template-columns: 88px 1fr auto; }
  .case .rec { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .top-in { gap: 12px; }
  .who .shopname { display: none; }
  nav a { padding: 6px 8px; }
  h1 { font-size: 27px; }
  .hero, .casehead { flex-direction: column; align-items: flex-start; }
  .bigclock { text-align: left; }
  .case { grid-template-columns: 1fr auto; }
  .case .clock { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
}

/* The disputes board grid (AG Grid Community, Quartz theme in the app's colours) */
.ag-theme-quartz.dispute-grid { --ag-font-family: Inter, system-ui, sans-serif; --ag-font-size: 14px;
  --ag-foreground-color: var(--ink); --ag-secondary-foreground-color: var(--muted); --ag-data-color: var(--ink);
  --ag-background-color: var(--card); --ag-header-background-color: var(--card); --ag-odd-row-background-color: var(--card);
  --ag-border-color: var(--line); --ag-row-border-color: var(--line); --ag-header-foreground-color: var(--muted);
  --ag-row-hover-color: var(--paper); --ag-active-color: var(--accent); --ag-input-focus-border-color: var(--accent);
  --ag-wrapper-border-radius: var(--radius); --ag-header-column-resize-handle-color: var(--line);
  --ag-control-panel-background-color: var(--card); --ag-modal-overlay-background-color: transparent;
  box-shadow: var(--shadow); border-radius: var(--radius); }
.dispute-grid .ag-header-cell-text { font-weight: 600; font-size: 12.5px; }
.dispute-grid .gc-row { cursor: pointer; }
.dispute-grid .ag-cell { display: flex; align-items: center; }
.dispute-grid .ag-floating-bottom .ag-row { background: var(--paper); font-weight: 600; cursor: default; }
.gc-clock { display: flex; flex-direction: column; line-height: 1.2; }
.gc-clock b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.gc-clock span { font-size: 12px; color: var(--muted); }
.gc-clock[data-tone=critical] b, .gc-clock[data-tone=overdue] b { color: var(--red); }
.gc-clock[data-tone=soon] b { color: var(--amber); }
.gc-clock[data-tone=ok] b { color: var(--green); }
.gc-two { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.gc-two span { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-amount { font-weight: 700; font-variant-numeric: tabular-nums; justify-content: flex-end; }
.dispute-grid .strength { margin: 0; }
.dispute-grid .tag, .dispute-grid .strength, .dispute-grid .chip { line-height: 1.35; white-space: nowrap; }
.dispute-grid .gc-total { white-space: nowrap; overflow: visible; }
.dispute-grid .ag-floating-bottom .ag-cell { overflow: visible; }
.grid-tools { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.grid-tools input { font: inherit; font-size: 14px; color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; width: min(340px, 100%); }
.grid-tools input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }

/* Insights (AG Studio) */
.studio { height: max(760px, calc(100vh - 260px)); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--paper); }
.studio-pages { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.studio-pages button { font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 9px; padding: 7px 12px; cursor: pointer; }
.studio-pages button.on, .studio-pages button:hover { color: var(--ink); background: var(--card); border-color: var(--line); }
