/*
 * lottly. A dark sidebar, a calm light canvas, and one hot pink for the thing to do next.
 * Colours are OKLCH. Display and text type are Nunito, figures and labels are Geist Mono.
 * Sizes are compact: a 13px base, 30 to 34px controls and 14 to 16px card corners, so a lot of stock fits on one screen.
 */

:root {
  --bg: oklch(0.968 0.003 135);
  --card: oklch(0.996 0.001 135);
  --ink: oklch(0.19 0.012 135);
  --ink-2: oklch(0.36 0.014 135);
  --mute: oklch(0.5 0.014 135);
  --faint: oklch(0.58 0.01 135);
  --line: oklch(0.915 0.005 135);
  --line-2: oklch(0.86 0.007 135);
  --line-3: oklch(0.8 0.008 135);
  --sunk: oklch(0.945 0.004 135);

  --acc: oklch(0.5 0.15 152);
  --acc-hi: oklch(0.57 0.16 152);
  --acc-lo: oklch(0.42 0.13 152);
  --acc-bg: oklch(0.963 0.03 150);
  --acc-text: oklch(0.45 0.14 152);

  --good: oklch(0.46 0.13 158);
  --good-bg: oklch(0.95 0.045 158);
  --good-mid: oklch(0.72 0.15 158);
  --good-line: oklch(0.85 0.07 158);
  --bad: oklch(0.5 0.185 27);
  --bad-bg: oklch(0.955 0.03 27);
  --warn: oklch(0.47 0.1 65);
  --warn-bg: oklch(0.96 0.065 90);
  --warn-line: oklch(0.85 0.1 85);
  --amber: oklch(0.82 0.14 85);

  --side: oklch(0.27 0.055 158);
  --side-hi: oklch(0.33 0.065 158);
  --side-on: oklch(0.37 0.07 158);
  --side-line: oklch(0.34 0.05 158);
  --side-ink: oklch(0.86 0.035 150);
  --side-mute: oklch(0.74 0.04 150);

  --radius: 9px;
  --radius-lg: 16px;
  --side-w: 208px;
  --gutter: 12px;
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --lt: 0.02em; /* added to every display letter-spacing: Nunito wants less tightening than a grotesk */
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 13px/1.45 var(--font);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, dl, dd, fieldset, figure { margin: 0; padding: 0; }
ul { list-style: none; }

h1 { font: 600 clamp(30px, 24px + 1.6vw, 40px)/1.05 var(--display); letter-spacing: calc(-0.03em + var(--lt)); }
h2 { font: 600 15px/1.25 var(--display); letter-spacing: calc(-0.01em + var(--lt)); }
.h3, h3 { font: 600 14px/1.3 var(--display); letter-spacing: calc(-0.01em + var(--lt)); }

a { color: var(--acc-text); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--acc-lo); }
::selection { background: oklch(0.9 0.14 100); }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.muted { color: var(--mute); }
.small { font-size: 13px; }
code, pre { font-family: var(--mono); font-size: 0.85em; }
code { background: var(--sunk); padding: 1px 5px; border-radius: 5px; }
pre { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--radius); overflow-x: auto; margin: 8px 0; }
pre code { background: transparent; padding: 0; }
kbd { font: 500 10.5px/1 var(--mono); padding: 3px 5px; border-radius: 5px; background: var(--sunk); }

/* A small mono caption above a heading or over a figure. */
.eyebrow { font: 500 10.5px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }

/* Shell: the dark sidebar and the page beside it --------------------------------------------- */

.shell { display: flex; flex-direction: column; min-height: 100vh; }
.main { flex: 1; min-width: 0; padding: 12px var(--gutter) 64px; }
.page { max-width: 1680px; margin-inline: auto; display: flex; flex-direction: column; gap: 14px; }
.page--narrow { max-width: 1280px; }
.main--bare { display: grid; place-items: start center; padding-top: 12vh; }
.main--bare .page { width: min(100%, 28rem); }

.sidebar {
  display: none;
  width: var(--side-w); flex: none; position: sticky; top: 0; height: 100vh; z-index: 20;
  flex-direction: column; gap: 12px; padding: 16px 10px 12px;
  background: var(--side); color: var(--side-ink);
}
.wordmark { font: 700 22px/1 var(--display); letter-spacing: calc(-0.04em + var(--lt)); color: #fff; text-decoration: none; }
.wordmark:hover { color: #fff; }
.wordmark i { font-style: normal; color: oklch(0.88 0.17 95); }
.sidebar .wordmark { padding: 0 8px 2px; }

.side-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; cursor: pointer; text-decoration: none; text-align: left;
  font: 600 13px/1 var(--font);
}
.side-btn--add { height: 34px; padding: 0 8px 0 11px; border-radius: 9px; background: var(--acc); color: #fff; }
.side-btn--add:hover { background: var(--acc-hi); color: #fff; }
.side-btn--add kbd { background: oklch(1 0 0 / 0.22); color: #fff; }
.side-btn--find { height: 30px; padding: 0 7px 0 10px; border-radius: 8px; border: 1px solid oklch(0.3 0.014 135); background: oklch(0.22 0.013 135); color: oklch(0.72 0.012 135); font-weight: 400; font-size: 12.5px; cursor: text; }
.side-btn--find:hover { color: #fff; }
.side-btn--find kbd { background: oklch(0.3 0.014 135); color: var(--side-ink); padding-inline: 6px; }
.side-btn span { flex: 1; }

.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-label { font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: oklch(0.62 0.012 135); padding: 10px 9px 6px; }
.side-link {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 9px; border-radius: 8px;
  color: var(--side-ink); text-decoration: none; font-weight: 500; font-size: 13px;
}
.side-link:hover { background: var(--side-hi); color: #fff; }
.side-link[aria-current="page"] { background: var(--side-on); color: #fff; }
.side-link svg { flex: none; color: oklch(0.66 0.012 135); }
.side-link[aria-current="page"] svg { color: oklch(0.88 0.17 95); }
.side-link > span:first-of-type { flex: 1; }
.side-count { font: 500 11px/1 var(--mono); color: var(--side-mute); }
.side-hot { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; display: grid; place-items: center; background: var(--acc); color: #fff; font: 600 10.5px/1 var(--mono); }
.side-dot { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); flex: none; }
.side-grow { flex: 1; }

.side-user { display: flex; align-items: center; gap: 9px; padding: 10px 4px 0; border-top: 1px solid var(--side-line); }
.side-avatar { width: 28px; height: 28px; border-radius: 50%; background: oklch(0.3 0.016 135); display: grid; place-items: center; font: 600 10.5px/1 var(--font); color: #fff; flex: none; }
.side-who { flex: 1; min-width: 0; }
.side-who b { display: block; color: #fff; font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-who span { display: block; font-size: 11px; line-height: 1.3; color: var(--side-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user form { margin: 0; }
.side-signout { width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: oklch(0.72 0.012 135); cursor: pointer; display: grid; place-items: center; padding: 0; }
.side-signout:hover { background: var(--side-hi); color: #fff; }

/* Narrow screens swap the sidebar for a dark bar across the top. */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--side); padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; }
.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar .wordmark { font-size: 20px; }
.topbar .side-btn--add { width: auto; height: 30px; padding: 0 12px 0 10px; border-radius: 8px; font-size: 12.5px; gap: 6px; }
.pill-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.pill-nav a { flex: none; height: 28px; padding: 0 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px/1 var(--font); color: var(--side-ink); text-decoration: none; }
.pill-nav a[aria-current="page"] { background: var(--side-on); color: #fff; }
.pill-nav .side-hot { min-width: 18px; height: 16px; padding: 0 5px; border-radius: 8px; font-size: 10px; }
.topbar form { margin: 0; }

@media (min-width: 1024px) {
  .shell { flex-direction: row; }
  .sidebar { display: flex; }
  .topbar { display: none; }
  .main { padding: 20px 28px 56px; }
}

/* Toasts: what just happened, bottom left, then gone ---------------------------------------- */

.toasts { position: fixed; left: 12px; bottom: 20px; z-index: 60; display: grid; gap: 8px; max-width: min(26rem, calc(100vw - 24px)); }
@media (min-width: 1024px) { .toasts { left: calc(var(--side-w) + 20px); } }
.flash {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4;
  box-shadow: 0 10px 30px oklch(0.19 0.012  135 / 0.28); animation: rs-up 0.22s ease-out;
}
.flash::before { content: ""; flex: none; width: 8px; height: 8px; margin-top: 5px; border-radius: 50%; background: var(--good-mid); }
.flash-alert::before { background: oklch(0.7 0.19 27); }
.flash-text { flex: 1; }
.flash ul { padding-left: 1.2rem; list-style: disc; }
.flash a { color: oklch(0.88 0.17 95); }
.flash-close { border: 0; background: transparent; color: oklch(0.75 0.01 135); font: 500 16px/1 var(--font); cursor: pointer; padding: 0 2px; }
.flash-close:hover { color: #fff; }
@keyframes rs-up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rs-right { from { transform: translateX(36px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rs-fade { from { opacity: 0; } to { opacity: 1; } }

/* Page furniture --------------------------------------------------------------------------- */

.narrow { max-width: 34rem; }
.narrow-wide { max-width: 46rem; }
.stack > * + * { margin-top: 16px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.page-head h1 { margin-top: 10px; }
.page-head .eyebrow + h1 { margin-top: 10px; }
.count { font: 500 13px/1 var(--mono); color: var(--mute); margin-left: 6px; letter-spacing: 0; vertical-align: middle; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font: 500 10.5px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.crumb a { color: var(--mute); text-decoration: none; }
.crumb a:hover { color: var(--ink); }

.notice-bar { background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; }
.notice-bar a { color: inherit; }
.notice-bar > * + * { margin-top: 8px; }
.error-text { color: var(--bad); font-size: 13px; margin-top: 4px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; }
.panel > * + * { margin-top: 12px; }
.panel > h2:first-child, .panel > .h3:first-child { margin-top: 0; }

.empty { background: var(--card); border: 1.5px dashed var(--line-3); border-radius: 14px; padding: 32px 20px; text-align: center; color: var(--mute); }
.empty > * + * { margin-top: 10px; }
.empty h2 { color: var(--ink); }
.empty p { max-width: 36rem; margin-inline: auto; }
.empty .btn { margin-top: 12px; }

/* Buttons and forms ------------------------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 13px/1 var(--font); white-space: nowrap;
  padding: 0 14px; height: 34px;
  background: var(--card); color: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--sunk); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn-primary:hover { background: var(--acc-hi); border-color: var(--acc-hi); color: #fff; }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: oklch(0.27 0.014 135); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; }
.btn-quiet:hover { background: var(--sunk); }
.btn-danger { color: var(--bad); border-color: oklch(0.85 0.06 27); }
.btn-danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn-danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-solid:hover { background: oklch(0.44 0.185 27); color: #fff; }
.btn-small { height: 28px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn[disabled], .btn:disabled { opacity: 0.45; cursor: not-allowed; }
form { margin: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions form { display: contents; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font: 600 12.5px/1.2 var(--font); color: var(--ink-2); }
.hint { color: var(--mute); font-size: 12.5px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="date"], input[type="url"], select, textarea {
  width: 100%;
  font: inherit; color: var(--ink);
  padding: 0 11px; height: 34px;
  background: var(--card);
  border: 1px solid var(--line-2); border-radius: 8px;
}
textarea { height: auto; padding: 8px 11px; resize: vertical; line-height: 1.5; }
select { padding-right: 8px; }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { border-color: var(--acc); outline: 3px solid var(--acc-bg); outline-offset: 0; }
input::placeholder, textarea::placeholder { color: var(--faint); }

.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 12px; }

.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-weight: 600; color: var(--mute); }
.input-prefix input { padding-left: 24px; font-variant-numeric: tabular-nums; }

.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 15px; height: 15px; accent-color: var(--acc); margin: 0; }

/* Prices and badges --------------------------------------------------------------------------- */

.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--sunk); color: var(--ink); font: 600 12.5px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tag-lg { height: 34px; padding: 0 16px; font: 600 20px/1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px;
  font: 600 11.5px/1 var(--font); background: var(--sunk); color: var(--ink-2); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: oklch(0.7 0.01 135); }
.badge-name { font-weight: 700; }
.badge-live, .badge-connected { background: var(--good-bg); color: var(--good); }
.badge-live::before, .badge-connected::before { background: var(--good-mid); }
.badge-queued, .badge-publishing, .badge-connecting { background: var(--acc-bg); color: var(--acc); }
.badge-queued::before, .badge-publishing::before, .badge-connecting::before { background: var(--acc); }
.badge-failed, .badge-error { background: var(--bad-bg); color: var(--bad); }
.badge-failed::before, .badge-error::before { background: var(--bad); }
.badge-needs_attention, .badge-needs_login { background: var(--warn-bg); color: var(--warn); }
.badge-needs_attention::before, .badge-needs_login::before { background: var(--amber); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.gain { color: var(--good); }
.loss { color: var(--bad); }

/* Tables ------------------------------------------------------------------------------------- */

.table-scroll { overflow-x: auto; }
.table-scroll:has(.table) { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font: 500 10px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); background: var(--card); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: oklch(0.985 0.002 135); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table a { color: var(--ink); font-weight: 600; text-decoration: none; }
.table a:hover { color: var(--acc-text); }
.table .btn { font-weight: 600; }

/* Ranked lists --------------------------------------------------------------------------------- */

.ranked { display: grid; gap: 8px; }
.ranked li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }

/* Tabs, filter chips, search -------------------------------------------------------------------- */

.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 12.5px; color: var(--ink-2); background: var(--card); border: 1px solid var(--line-2); }
.filter:hover { background: var(--sunk); color: var(--ink); }
.filter[aria-current="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.search { flex: 1 1 14rem; max-width: 24rem; }

.tabs { display: flex; flex-wrap: wrap; gap: 0 22px; border-bottom: 1px solid var(--line); }
.tab { padding: 8px 0; margin-bottom: -1px; text-decoration: none; font-weight: 600; color: var(--mute); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--ink); border-bottom-color: var(--acc); }
.tab .count { margin-left: 4px; font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; background: var(--card); border: 1px solid var(--line-2); text-decoration: none; font-size: 12.5px; color: var(--ink-2); }
.chip:hover { border-color: var(--ink); color: var(--ink); }

.filter-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding-inline: 5px; border-radius: 999px; background: var(--acc); color: #fff; font: 600 10.5px/1 var(--mono); }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; align-items: start; }
.filter-grid fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.filter-grid legend { font: 600 12.5px/1.2 var(--font); color: var(--ink-2); padding: 0; margin-bottom: 6px; }

/* The bar that floats up when items are ticked: a dark pill over the foot of the page. */
.bulkbar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 40; width: max-content; max-width: calc(100vw - 20px);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 12px;
  background: var(--ink); color: #fff; box-shadow: 0 18px 44px -14px oklch(0.19 0.012  135 / 0.55);
  animation: rs-bar 0.22s ease-out;
}
@keyframes rs-bar { from { transform: translate(-50%, 14px); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@media (min-width: 1024px) { .bulkbar { left: calc(50% + var(--side-w) / 2); max-width: calc(100vw - var(--side-w) - 20px); } }
.bulkbar[hidden] { display: none; }
.bulkbar-count { font-size: 13px; }
.bulkbar-count span { font: 600 15px/1 var(--display); }
.bulkbar-accounts { display: flex; flex-wrap: wrap; gap: 6px 14px; border: 0; padding: 0 4px; font-size: 12.5px; }
.bulkbar .btn { height: 30px; padding: 0 12px; border-radius: 8px; font-size: 12.5px; background: transparent; border-color: oklch(0.38 0.016 135); color: #fff; }
.bulkbar .btn:hover { background: oklch(0.28 0.016 135); }
.bulkbar .btn-primary { background: var(--acc); border-color: var(--acc); }
.bulkbar .btn-primary:hover { background: var(--acc-hi); }
.bulkbar .btn-danger-solid { background: transparent; border-color: oklch(0.38 0.016 135); color: oklch(0.8 0.12 27); }
.bulkbar .btn-danger-solid:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.bulkbar .btn-quiet { border-color: transparent; color: oklch(0.8 0.01 135); }
.bulkbar .btn-quiet:hover { color: #fff; background: transparent; }

/* Item form --------------------------------------------------------------------------------------- */

.form-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .form-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; } }
.photos-col > * + * { margin-top: 12px; }

.dropzone {
  position: relative; display: grid; gap: 4px; place-content: center; text-align: center;
  min-height: 176px; padding: 24px;
  border: 1.5px dashed var(--line-3); border-radius: 14px; background: var(--card); cursor: pointer; color: var(--mute);
}
.dropzone:hover, .dropzone:focus-within { border-color: var(--acc); background: var(--acc-bg); }
.dropzone-title { font-weight: 600; color: var(--ink); }
.dropzone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.photo-strip img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.photo-strip li { display: grid; gap: 4px; }

.form-section { padding-top: 8px; border-top: 1px solid var(--line); }
.fields-col > * + * { margin-top: 16px; }
.fields-col > .form-section:first-child { padding-top: 0; border-top: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.kind-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.fold { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.fold > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.fold-body { padding: 0 16px 16px; }

/* Item page --------------------------------------------------------------------------------------- */

.detail { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 52rem) { .detail { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; } }
.detail-photos > * + * { margin-top: 10px; }
.no-photo { text-decoration: none; display: grid; place-items: center; width: 100%; height: 100%; color: var(--mute); font-size: 13px; background: var(--sunk); }
.cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); display: block; }
.detail-info .page-head { align-items: flex-start; }
.detail-info > * + * { margin-top: 20px; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 14px 20px; }
.facts dt { font: 500 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.facts dd { font-weight: 600; margin-top: 4px; }

.preview { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.preview > * + * { margin-top: 8px; }
.preview-title { font: 600 17px/1.25 var(--display); }
.preview-body { white-space: pre-line; max-width: 62ch; }
.money > * + * { margin-top: 10px; }

.listings { border-top: 1px solid var(--line); padding-top: 20px; }
.listings > h2 { margin-bottom: 14px; }
.listing-rows { background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.listing-row { display: grid; grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr) auto; gap: 12px 24px; align-items: center; padding: 14px 16px; }
.listing-row + .listing-row { border-top: 1px solid var(--line); }
.listing-who { display: grid; }
.listing-state { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.listing-state .error-text { flex-basis: 100%; }
@media (max-width: 40rem) { .listing-row { grid-template-columns: 1fr; } }

/* Accounts: the danger zone (the cards are further down) ------------------------------------------- */

.danger { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.danger > * + * { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Prices: eBay estimate and CeX values ------------------------------------------------------------------ */

.suggest { display: grid; gap: 10px; justify-items: start; }
.suggest-output { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; width: 100%; }
.suggest-output > * + * { margin-top: 8px; }
.comps { display: grid; gap: 4px; font-size: 13.5px; }

.market { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 24px; }
.market > * + * { margin-top: 16px; }
.market-figures { display: flex; flex-wrap: wrap; gap: 8px 32px; }
.market-figures dt { font: 500 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.market-figures dd { font: 600 20px/1.2 var(--display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.market-listings { display: grid; gap: 2px; max-height: 22rem; overflow-y: auto; border-top: 1px solid var(--line); }
.market-listing { display: grid; grid-template-columns: auto 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.market-listing img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.market-listing a { color: var(--ink); font-weight: 500; text-decoration: none; }
.market-listing a:hover { color: var(--acc-text); }
.market-listing .price { font-weight: 600; font-variant-numeric: tabular-nums; }
.market-listing.is-junk { opacity: 0.55; }

.recent { margin-top: 24px; }
.recent > * + * { margin-top: 12px; }

/* Items table: rows, cells, inline editing ----------------------------------------------------------------- */

.items-table { border: 0; font-size: 13.5px; }
.items-table th, .items-table td { padding: 10px 12px; vertical-align: middle; white-space: nowrap; }
.items-table .check-col { width: 36px; padding-right: 0; }
.items-table tbody tr:has(input:checked) { background: var(--acc-bg); }
.items-table .cell-item { white-space: normal; min-width: 208px; max-width: 384px; }
.items-table .cell-needs { white-space: normal; min-width: 128px; max-width: 256px; }
.items-table .cell-specifics > span { display: block; max-width: 192px; overflow: hidden; text-overflow: ellipsis; }
.items-table .cell-type, .items-table .cell-condition, .items-table .cell-from, .items-table .cell-bought_on { color: var(--mute); }
.items-table .badges { flex-wrap: nowrap; gap: 4px; }
.items-table .muted { font-size: 13px; }
.item-cell { display: flex; align-items: center; gap: 12px; }
.item-cell > a { flex: none; line-height: 0; }
.sort-link { text-decoration: none; color: inherit; }
.sort-link:hover { color: var(--ink); }
.row-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: inline-block; }
.row-thumb-empty { background: var(--sunk); }
.row-title { font-weight: 600; line-height: 1.25; }
.row-sub { font-size: 13px; color: var(--mute); line-height: 1.25; min-height: 1em; }
.item-lines { display: grid; gap: 2px; min-width: 0; }

.inline { display: inline-block; min-width: 24px; padding: 2px 6px; margin: -2px -6px; border-radius: 6px; cursor: text; }
.inline:hover, .inline:focus-visible { background: var(--sunk); box-shadow: inset 0 0 0 1px var(--line-2); }
.inline.saving { opacity: 0.5; }
.inline-input { height: 32px; padding: 0 8px; font-size: 13.5px; width: 100%; min-width: 96px; }
.inline-error { display: block; color: var(--bad); font-size: 12.5px; max-width: 256px; text-align: left; white-space: normal; }
.placeholder { opacity: 0; font-style: italic; }
.inline:hover .placeholder, .inline:focus-visible .placeholder { opacity: 0.7; }

/* The sheet: every figure on a row, like a spreadsheet. The heading and the item stay put while the rest scrolls. */

.table-scroll:has(.items-table[data-view="sheet"]) { max-height: calc(100vh - 14rem); overflow: auto; }
.items-table[data-view="sheet"] { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.items-table[data-view="sheet"] th, .items-table[data-view="sheet"] td { padding: 6px 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.items-table[data-view="sheet"] thead th { position: sticky; top: 0; z-index: 3; background: var(--sunk); }
.items-table[data-view="sheet"] .check-col, .items-table[data-view="sheet"] .cell-item { position: sticky; z-index: 2; background: var(--card); }
.items-table[data-view="sheet"] thead .check-col, .items-table[data-view="sheet"] thead .col-item { z-index: 4; background: var(--sunk); }
.items-table[data-view="sheet"] .check-col { left: 0; width: 36px; min-width: 36px; padding-right: 10px; }
.items-table[data-view="sheet"] .cell-item, .items-table[data-view="sheet"] .col-item { left: 36px; min-width: 260px; max-width: 320px; box-shadow: 1px 0 0 var(--line-2); }
.items-table[data-view="sheet"] tbody tr:hover td { background: var(--sunk); }
.items-table[data-view="sheet"] tbody tr:has(input:checked) td { background: var(--acc-bg); }
.items-table[data-view="sheet"] .row-thumb { width: 34px; height: 34px; border-radius: 8px; }
.items-table[data-view="sheet"] .item-cell { gap: 10px; }
.items-table[data-view="sheet"] td:not(.cell-item) .inline { display: block; margin: -6px -10px; padding: 6px 10px; border-radius: 0; }
.items-table[data-view="sheet"] td .inline:hover, .items-table[data-view="sheet"] td .inline:focus-visible { box-shadow: inset 0 0 0 2px var(--acc); }
.items-table[data-view="sheet"] td:not(.cell-item) .inline-input { height: 100%; min-width: 72px; border-radius: 0; }
.items-table[data-view="sheet"] .cell-total_cost, .items-table[data-view="sheet"] .cell-worth, .items-table[data-view="sheet"] .cell-margin, .items-table[data-view="sheet"] .cell-ebay { background-image: linear-gradient(oklch(0.19 0.012  135 / 0.025), oklch(0.19 0.012  135 / 0.025)); } /* worked out, not typed: a faint tint says so */
.cols-menu { position: relative; }
.cols-menu > summary { list-style: none; cursor: pointer; }
.cols-menu > summary::-webkit-details-marker { display: none; }
.cols-panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: min(320px, 90vw); padding: 14px; background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 44px -14px oklch(0.19 0.012  135 / 0.35); display: grid; gap: 12px; }
.cols-panel fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.cols-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.cols-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.cols-opt input { width: 15px; height: 15px; margin: 0; }
.cols-actions { display: flex; gap: 8px; justify-content: space-between; }
/* History: one line chart a figure ------------------------------------------------------------------------ */

.hist-grid-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 12px; }
.hist-card { padding: 14px 16px 10px; display: grid; gap: 8px; min-width: 0; }
.hist-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.hist-head h2 { font-size: 15px; }
.hist-now { display: grid; text-align: right; gap: 2px; flex: none; }
.hist-now b { font: 600 22px/1.1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); }
.hist-plot { position: relative; }
.hist-plot svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; border-radius: 8px; }
.hist-plot svg:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
.hist-grid { stroke: var(--line); stroke-width: 1; }
.hist-zero { stroke: var(--line-3); stroke-width: 1; }
.hist-axis { fill: var(--mute); font: 500 10px var(--mono); }
.hist-line { fill: none; stroke: var(--acc); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.hist-dot { fill: var(--acc); stroke: var(--card); stroke-width: 2; }
.hist-cross { stroke: var(--line-3); stroke-width: 1; }
.hist-cross[hidden], .hist-dot[hidden] { display: none; }
.hist-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); display: grid; gap: 1px; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; z-index: 2; }
.hist-tip.is-right { transform: translate(calc(-100% + 14px), calc(-100% - 12px)); }
.hist-tip b { font-size: 14px; }
.hist-tip span { opacity: 0.75; }
.hist-tip[hidden] { display: none; }
.hist-table > summary { list-style: none; cursor: pointer; width: max-content; }
.hist-table > summary::-webkit-details-marker { display: none; }
.hist-table[open] > summary { margin-bottom: 10px; }

/* Categories ------------------------------------------------------------------------------------------- */

.field-pair { display: contents; }
.scan-field { display: flex; gap: 8px; align-items: stretch; }
.scan-field input { flex: 1; min-width: 0; }
.scan-field .btn { flex: none; gap: 6px; }
.cat-add { display: flex; gap: 8px; max-width: 28rem; }
.cat-add input { flex: 1; }
.cat-list { display: grid; gap: 12px; }
.cat { display: grid; gap: 10px; padding: 14px 16px; }
.cat-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-head h2 { font-size: 16px; margin-right: auto; }
.cat-head h2 a, .cat-subs a { color: var(--ink); text-decoration: none; }
.cat-head h2 a:hover, .cat-subs a:hover { color: var(--acc-text); }
.cat-count { font: 500 12px/1 var(--mono); color: var(--mute); }
.cat-subs { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-subs li { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); font-size: 13px; }
.cat-subs li .cat-count { margin-right: 2px; }
.cat-link { all: unset; cursor: pointer; font-size: 12px; color: var(--mute); }
.cat-link:hover { color: var(--ink); text-decoration: underline; }
.cat-edit > summary { list-style: none; cursor: pointer; }
.cat-edit > summary::-webkit-details-marker { display: none; }
.cat-edit[open] { flex-basis: 100%; }
.cat-inline { display: flex; gap: 8px; align-items: center; }
.cat-inline input { flex: 1; min-width: 0; height: 30px; }
.cat-subs .cat-edit[open] { flex-basis: auto; }

/* Attributes: on an item, and the Attributes page */
.attrs { display: grid; gap: 12px; }
.attr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 12px; }
.attr-label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.attr-label .pill { height: 18px; padding: 0 7px; font-size: 10.5px; }
.pill-ai { background: oklch(0.95 0.04 300); color: oklch(0.42 0.12 300); }
.attr-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.attr-pick { position: relative; }
.attr-pick input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.attr-pick span { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); font-size: 13px; }
.attr-pick input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.attr-pick input:focus-visible + span { outline: 2px solid var(--acc-text); outline-offset: 2px; }
.attr-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.attr-new { display: grid; gap: 8px; }
.attr-new .attr-add { grid-template-columns: 1fr 1fr; }
.attr-values { display: flex; flex-wrap: wrap; gap: 6px; }
.attr-values a { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--card); font-size: 13px; color: var(--ink); text-decoration: none; }
.attr-values a:hover { border-color: var(--ink); }
.attr-values b { font: 500 11.5px/1 var(--mono); color: var(--mute); }
.attr-new-card { padding: 14px 16px; margin: 16px 0; }
.attr-new-card > summary { list-style: none; display: inline-flex; }
.attr-new-card > summary::-webkit-details-marker { display: none; }
.attr-new-card[open] > summary { margin-bottom: 12px; }
.attr-edit { margin-top: 10px; }
@media (max-width: 560px) { .attr-add { grid-template-columns: 1fr; } }
.cat-sub-add { max-width: 26rem; }

.sheet-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Bundles ----------------------------------------------------------------------------------------------- */

.pick-list { display: grid; gap: 4px; max-height: 22rem; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 8px 14px; }
.pick-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 4px 0; }

/* Layout helpers ------------------------------------------------------------------------------------------- */

.col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }
.seg { display: flex; padding: 2px; gap: 2px; background: var(--sunk); border-radius: 8px; }
.seg a { display: inline-flex; align-items: center; height: 24px; padding: 0 11px; border-radius: 6px; font: 600 12px/1 var(--font); color: var(--mute); text-decoration: none; }
.seg a:hover { color: var(--ink); }
.seg a.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px oklch(0.19 0.012  135 / 0.12); }
.mode-bar { padding: 10px 14px; border-radius: 12px; background: var(--sunk); color: var(--ink-2); }

/* Stock: stage cards and the tools above the list ---------------------------------------------------------- */

.stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.stage-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); text-decoration: none; }
.stage-card:hover { border-color: var(--mute); color: var(--ink); }
.stage-card.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.stage-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 13.5px; }
.stage-top b { font: 600 24px/1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); }
.stage-val { font: 500 12px/1.2 var(--mono); color: var(--mute); }
.stage-card.is-on .stage-val { color: var(--side-ink); }

.tool-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tool-search { position: relative; flex: 1 1 220px; min-width: 180px; max-width: 340px; }
.tool-search svg { position: absolute; left: 10px; top: 8px; color: var(--mute); pointer-events: none; }
.tool-search input { height: 30px; padding: 0 10px 0 30px; border-radius: 8px; font: 400 12.5px/1 var(--font); }
.tool-grow { flex: 1; }
.tool-btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: 600 12.5px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; }
.tool-btn:hover { border-color: var(--mute); color: var(--ink); }
.tool-btn.is-set { border-color: var(--acc); background: var(--acc-bg); }
.tool-btn.is-primary { border-color: var(--acc); background: var(--acc); color: #fff; font-size: 12px; padding: 0 12px; }
.tool-btn.is-primary:hover { background: var(--acc-hi); }
.tool-select { position: relative; display: inline-flex; align-items: center; }
.tool-select select { appearance: none; -webkit-appearance: none; width: auto; min-width: 100%; height: 34px; padding: 0 30px 0 12px; border-radius: 9px; font: 500 13px/1 var(--font); cursor: pointer; }
.tool-select svg { position: absolute; right: 11px; pointer-events: none; color: var(--ink-2); }
.tool-select.is-set select { border-color: var(--acc); background: var(--acc-bg); }
.clear-link { font: 600 12px/1 var(--font); color: var(--acc-text); padding: 5px 6px; text-decoration: none; white-space: nowrap; }
.clear-link:hover { color: var(--acc-lo); }
.btn-new { height: 40px; padding: 0 18px 0 14px; border-radius: 10px; font-size: 13.5px; }

/* Stock: the list ---------------------------------------------------------------------------------------- */

.stock, .grid-wrap { container-type: inline-size; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: clip; }
.srow {
  position: relative; display: grid; align-items: center; gap: 0 10px; padding: 7px 14px;
  grid-template-columns: 28px minmax(0, 1fr) 118px;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.srow:hover:not(.srow-head) { background: oklch(0.975 0.003 135); }
.srow:has(input:checked) { background: var(--acc-bg); }
.srow-head { position: sticky; top: 82px; z-index: 6; height: 30px; padding-block: 0; background: oklch(0.975 0.003 135); font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.srow-head a { color: inherit; text-decoration: none; }
.srow-head a:hover { color: var(--ink); }
.c-prep, .c-paid, .c-worth, .c-margin, .c-listed { display: none; }
.c-paid, .c-worth, .c-margin, .c-ask { text-align: right; }
.c-ask { display: flex; justify-content: flex-end; align-items: center; gap: 3px; position: relative; z-index: 2; }
.srow-head .c-ask { display: block; }
.c-check { display: flex; position: relative; z-index: 2; }
.c-worth { align-items: center; justify-content: flex-end; gap: 8px; }
.c-margin { align-items: baseline; justify-content: flex-end; gap: 6px; }
.c-margin b { font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.c-margin .roi { min-width: 28px; text-align: right; font-size: 11.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.srow:not(.srow-head) .c-paid, .c-worth .num { font-weight: 500; font-size: 13px; font-variant-numeric: tabular-nums; }
.c-worth .num { min-width: 52px; }
.c-listed { gap: 5px; flex-wrap: wrap; align-items: center; }

@container (min-width: 560px) {
  .srow { grid-template-columns: 28px minmax(0, 1fr) 118px 104px; }
  .c-margin { display: flex; }
}
@container (min-width: 700px) {
  .srow { grid-template-columns: 28px minmax(0, 1fr) 118px 124px 104px; }
  .c-worth { display: flex; }
}
@container (min-width: 780px) {
  .srow { grid-template-columns: 28px minmax(0, 1fr) 64px 118px 124px 104px; }
  .c-paid { display: block; }
}
@container (min-width: 870px) {
  .srow { grid-template-columns: 28px minmax(0, 1fr) 70px 64px 118px 124px 104px; }
  .c-prep { display: block; }
}
@container (min-width: 1030px) {
  .srow { grid-template-columns: 28px minmax(0, 1fr) 70px 64px 118px 124px 104px 136px; }
  .c-listed { display: flex; }
}
@media (min-width: 1024px) {
  .srow { padding-block: 4px; }
  .srow-head { top: 0; padding-block: 0; }
}

.s-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.s-thumb { position: relative; width: 36px; height: 36px; flex: none; border-radius: 7px; overflow: hidden; display: grid; place-items: center; font: 500 10px/1 var(--mono); color: var(--mute); background: repeating-linear-gradient(135deg, oklch(0.93 0.006 135) 0 5px, oklch(0.955 0.004 135) 5px 10px); }
.s-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.srow .s-thumb { width: 30px; height: 30px; }
@media (max-width: 1023px) { .srow .s-thumb { width: 36px; height: 36px; } }
.s-text { min-width: 0; flex: 1; display: block; }
.s-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 600; font-size: 13px; line-height: 1.25; color: var(--ink); text-decoration: none; }
@media (min-width: 1024px) { .srow .s-title { -webkit-line-clamp: 1; } }
.srow .s-title::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.s-title:hover { color: var(--acc-text); }
.s-post { display: block; margin-top: 1px; font-size: 12px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-meta { display: flex; align-items: center; gap: 6px; margin-top: 1px; font-size: 11.5px; line-height: 1.3; color: var(--mute); }
.s-meta i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.s-meta span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prep-tiles { display: flex; gap: 3px; }
.prep-tile { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font: 600 10px/1 var(--mono); color: var(--faint); border: 1px dashed var(--line-3); }
.prep-tile.is-done { background: var(--good-bg); color: var(--good); border: 1px solid var(--good-line); }

.ribbon { position: relative; display: block; width: 48px; height: 5px; border-radius: 3px; background: var(--sunk); flex: none; }
.ribbon-band { position: absolute; top: 0; bottom: 0; background: oklch(0.82 0.04 135); border-radius: 3px; }
.ribbon-mid { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.ribbon-dot { position: absolute; top: -1px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; border: 1.5px solid #fff; box-sizing: content-box; transform: translate(-1.5px, -1.5px); }
.ribbon-paid { background: var(--ink); }
.ribbon-ask { background: var(--acc); }

.c-ask .inline { padding: 0 8px; margin: 0; height: 26px; display: inline-flex; align-items: center; border: 1px solid transparent; border-radius: 7px; font: 600 13px/1 var(--font); font-variant-numeric: tabular-nums; cursor: text; }
.c-ask .inline:hover, .c-ask .inline:focus-visible { background: #fff; border-color: var(--line-2); box-shadow: none; }
.c-ask .inline-input { width: 100px; height: 26px; text-align: right; padding: 0 8px; border: 1.5px solid var(--acc); border-radius: 7px; box-shadow: 0 0 0 3px var(--acc-bg); background: #fff; font: 600 13px/1 var(--font); }
.c-ask .inline[title="Set an asking price"] { height: 24px; padding: 0 10px; border: 1.5px dashed var(--line-3); border-radius: 7px; color: var(--mute); font-weight: 500; font-size: 12px; }
.c-ask .inline[title="Set an asking price"]:hover { border-color: var(--mute); }
.c-ask .inline[title="Type your own price"] { width: 22px; height: 24px; padding: 0; justify-content: center; border-radius: 6px; color: var(--mute); }
.c-ask .inline[title="Type your own price"] svg { width: 13px; height: 13px; }
.c-ask .inline[title="Type your own price"]:hover { background: var(--sunk); border-color: transparent; }
.c-ask form { display: contents; }
.use-sug { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1.5px dashed oklch(0.78 0.1 150); border-radius: 7px; background: var(--acc-bg); color: oklch(0.4 0.12 152); font: 600 12px/1 var(--font); white-space: nowrap; cursor: pointer; font-variant-numeric: tabular-nums; }
.use-sug:hover { background: oklch(0.93 0.05 150); }

.lchip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px; font: 600 11px/1 var(--font); white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.lchip i { width: 5px; height: 5px; border-radius: 50%; background: oklch(0.7 0.01 135); }
.lchip-live { background: var(--good-bg); color: var(--good); }
.lchip-live i { background: var(--good-mid); }
.lchip-failed { background: var(--bad-bg); color: var(--bad); }
.lchip-failed i { background: var(--bad); }
.lchip-wait { background: var(--acc-bg); color: var(--acc); }
.lchip-wait i { background: var(--acc); }
.lchip-warn { background: var(--warn-bg); color: var(--warn); }
.lchip-warn i { background: var(--amber); }

.stage { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font: 600 11.5px/1 var(--font); white-space: nowrap; }
.stage-prep { background: var(--warn-bg); color: var(--warn); }
.stage-ready { background: var(--acc-bg); color: var(--acc); }
.stage-live { background: var(--good-bg); color: var(--good); }
.stage-sold { background: var(--ink); color: #fff; }

.stock-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; padding: 7px 14px; background: oklch(0.975 0.003 135); }
.foot-left { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.range { font: 500 11.5px/1 var(--mono); color: var(--mute); }
.rows-select { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--mute); }
.rows-select .tool-select select { height: 26px; padding: 0 22px 0 9px; border-radius: 7px; font: 600 12px/1 var(--font); }
.rows-select .tool-select svg { right: 7px; }
.pager { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font: 600 12px/1 var(--font); text-decoration: none; font-variant-numeric: tabular-nums; }
.pg:hover { border-color: var(--mute); color: var(--ink); }
.pg.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pg-gap { display: inline-block; min-width: 18px; text-align: center; color: var(--mute); font-size: 12px; }
.legend { color: var(--mute); font-size: 11.5px; display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-band { width: 14px; height: 5px; border-radius: 3px; background: oklch(0.82 0.04 135); display: inline-block; }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); display: inline-block; }
.lg-ask { background: var(--acc); }

/* Stock: the grid ---------------------------------------------------------------------------------------- */

.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; padding: 14px; }
.gcard { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.gcard:hover { border-color: var(--mute); }
.gcard:has(input:checked) { background: var(--acc-bg); }
.gcard-photo { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; font: 500 10.5px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); background: repeating-linear-gradient(135deg, oklch(0.93 0.006 135) 0 7px, oklch(0.955 0.004 135) 7px 14px); }
.gcard-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gcard-check { position: absolute; left: 8px; top: 8px; z-index: 3; display: flex; padding: 4px; border-radius: 6px; background: oklch(1 0 0 / 0.85); }
.gcard-photo .stage { position: absolute; right: 8px; top: 8px; }
.gcard-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.gcard-title::after { content: ""; position: absolute; inset: 0; }
.gcard-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.gcard-figures span { display: flex; flex-direction: column; gap: 4px; }
.gcard-figures .right { align-items: flex-end; }
.gcard-figures small { font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.gcard-figures b { font-weight: 600; font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gcard-figures .roi { display: none; }

/* The bar that floats up when items are ticked */
.bulkbar-field { display: flex; gap: 8px; align-items: center; }
.bulkbar-field input { width: 160px; height: 30px; background: oklch(0.26 0.015 135); border-color: oklch(0.38 0.016 135); color: #fff; font-size: 12.5px; }
.bulkbar-field input::placeholder { color: var(--side-mute); }

/* Filters panel ------------------------------------------------------------------------------------------ */

.fpanel { position: fixed; top: 16px; right: 16px; bottom: 30px; width: 380px; max-width: calc(100vw - 32px); z-index: 51; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 22px; background: oklch(0.972 0.003 135); box-shadow: -10px 14px 36px -14px oklch(0.19 0.012  135 / 0.4), 0 30px 70px -20px oklch(0.19 0.012  135 / 0.5); overflow: hidden; animation: rs-right 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fpanel-form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.fpanel-head { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 14px; background: var(--card); border-bottom: 1px solid var(--line); }
.fpanel-head h2 { font: 600 18px/1.1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); }
.fpanel-head p { color: var(--mute); font-size: 12.5px; margin-top: 3px; }
.fpanel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 22px; }
.fpanel-foot { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--card); border-top: 1px solid var(--line); }
.fpanel-foot .btn { height: 34px; padding: 0 18px; border-radius: 9px; }
.fgroup { display: flex; flex-direction: column; gap: 10px; }
.fgroup h3 { font: 600 13.5px/1.2 var(--display); letter-spacing: calc(-0.01em + var(--lt)); }
.fgroup > div > p, .fmore-all p { color: var(--mute); font-size: 12.5px; line-height: 1.35; margin-top: 3px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { position: relative; cursor: pointer; }
.fchip > span { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 6px 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); font: 500 12.5px/1 var(--font); white-space: nowrap; }
.fchip > span:not(:has(b)) { padding-right: 11px; }
.fchip:hover > span { border-color: var(--mute); }
.fchip > span b { min-width: 22px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; font: 600 10.5px/1 var(--mono); background: var(--sunk); color: var(--ink-2); }
.fchip:has(input:checked) > span { background: var(--ink); border-color: var(--ink); color: #fff; }
.fchip:has(input:checked) > span b { background: oklch(1 0 0 / 0.2); color: #fff; }
.fchip:has(input:focus-visible) > span { outline: 2px solid var(--acc); outline-offset: 2px; }
.fmore > summary { cursor: pointer; list-style: none; font: 600 12px/1 var(--font); color: var(--acc-text); padding: 2px 0 8px; }
.fmore > summary::-webkit-details-marker { display: none; }
.fmore .fchips { margin-top: 2px; }
.fmore-all { border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.fmore-all > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.fmore-all > summary::-webkit-details-marker { display: none; }
.fmore-all > summary > span { flex: 1; }
.fmore-all > summary svg { color: var(--mute); transition: transform 0.15s; }
.fmore-all[open] > summary svg { transform: rotate(90deg); }
.fmore-all .filter-grid { padding: 4px 14px 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }

/* Overview ---------------------------------------------------------------------------------------------------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px 10px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); color: var(--mute); font-size: 12px; display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; }
.mono { font-family: var(--mono); }
.r { text-align: right; }
.more { font: 600 12px/1 var(--font); color: var(--acc-text); text-decoration: none; white-space: nowrap; }
.more:hover { color: var(--acc-lo); }
.key { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.key.dark, i.dark { background: oklch(0.27 0.014 135); }
.key.good, i.good { background: var(--good-mid); }
.key.bad, i.bad { background: var(--bad); }

.refresh-btn { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid oklch(0.88 0.015 80); background: oklch(0.996 0.001  135 / 0.7); font: 500 12.5px/1 var(--font); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.refresh-btn:hover { background: #fff; }
.refresh-btn b { color: var(--acc-text); font-weight: 600; }

.ov-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: stretch; }
.ov-wide { flex: 3 1 520px; display: flex; flex-direction: column; }
.ov-side { flex: 2 1 360px; display: flex; flex-direction: column; }

/* The hero: a warm panel with the one number that matters, written as a sentence. */
.ov-hero { background: oklch(0.972 0.016 80); border: 1px solid oklch(0.93 0.02 80); border-radius: 20px; padding: 18px 16px; display: flex; flex-direction: column; gap: 20px; }
.ov-hero-top { display: flex; gap: 22px 48px; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; }
.ov-hero-text { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ov-hero h1 { font-size: 28px; line-height: 1.04; letter-spacing: calc(-0.035em + var(--lt)); text-wrap: balance; }
.ov-hero h1 .is-gain { color: var(--acc); }
.ov-hero h1 .is-loss { color: var(--bad); }
.ov-cover { color: var(--ink-2); font-size: 13px; line-height: 1.5; max-width: 480px; }
.ov-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.ov-queue { height: 36px; padding: 0 8px 0 13px; border-radius: 10px; }
.count-pill { min-width: 24px; height: 20px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: oklch(1 0 0 / 0.22); font: 600 11.5px/1 var(--mono); }
@media (min-width: 700px) { .ov-hero { padding: 26px 30px; } .ov-hero h1 { font-size: 34px; } }
@media (min-width: 1024px) { .ov-hero h1 { font-size: 40px; } }
@media (min-width: 1280px) { .ov-hero h1 { font-size: 46px; } }

.ov-figures { flex: 1 1 320px; max-width: 480px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.ov-figures dd { font: 600 30px/1 var(--display); letter-spacing: calc(-0.035em + var(--lt)); font-variant-numeric: tabular-nums; }
.ov-figures dt { font-weight: 600; font-size: 13px; margin-top: 7px; }
.ov-figures p { color: var(--mute); font-size: 12px; margin-top: 1px; }
.ov-figures .meter { height: 4px; border-radius: 2px; background: oklch(0.9 0.012 80); margin-top: 7px; }
.ov-figures .meter + dt { margin-top: 6px; }
.ov-note { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-top: 8px; color: var(--mute); font-size: 12px; }
.ov-note b { font-weight: 600; color: var(--ink-2); }

.break-even { position: relative; padding-top: 28px; }
.break-label { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.break-label span { font: 500 10px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.break-label i { width: 1px; height: 9px; background: var(--ink-2); }
.break-bar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; background: oklch(0.935 0.012 80); }
.break-bar > div { display: flex; align-items: center; gap: 8px; padding: 0 12px; font: 600 12.5px/1 var(--font); white-space: nowrap; overflow: hidden; }
.break-bar span { opacity: 0.75; }
.break-spent { background: oklch(0.27 0.014 135); color: #fff; }
.break-gain { background: repeating-linear-gradient(135deg, oklch(0.78 0.13 158) 0 6px, oklch(0.83 0.11 158) 6px 12px); color: oklch(0.24 0.07 158); }
.break-loss { background: repeating-linear-gradient(135deg, oklch(0.68 0.16 27) 0 6px, oklch(0.75 0.13 27) 6px 12px); color: oklch(0.22 0.07 27); }

.meter { height: 6px; border-radius: 3px; background: var(--line); margin-top: 10px; overflow: hidden; }
.meter i { display: block; height: 100%; background: oklch(0.62 0.15 158); }
.meter.dark { height: 4px; border-radius: 2px; background: var(--sunk); margin-top: 5px; }
.meter.dark i { background: oklch(0.27 0.014 135); }

/* The pipeline: one round-iconed row per stage. */
.ov-pipeline { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.ov-pipe-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 2px 2px 0; }
.ov-pipe-head p { color: var(--mute); font-size: 12px; }
.pipe-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 16px 11px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 8px 20px -14px oklch(0.19 0.012  135 / 0.3); color: var(--ink); text-decoration: none; }
.pipe-row:hover { border-color: var(--mute); color: var(--ink); }
.pipe-icon { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; }
.pipe-icon.pipe-prep { background: oklch(0.86 0.13 85); color: oklch(0.3 0.07 70); }
.pipe-icon.pipe-ready { background: var(--acc); color: #fff; }
.pipe-icon.pipe-live { background: oklch(0.78 0.14 158); color: oklch(0.25 0.07 158); }
.pipe-icon.pipe-sold { background: var(--ink); color: #fff; }
.pipe-icon svg { stroke-width: 2.2; }
.pipe-text { flex: 1; min-width: 0; }
.pipe-text b { display: block; font: 600 15px/1.2 var(--display); letter-spacing: calc(-0.01em + var(--lt)); }
.pipe-text span { display: block; color: var(--mute); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-n { font: 600 26px/1 var(--display); letter-spacing: calc(-0.03em + var(--lt)); }

.ov-next { flex: 1.15 1 420px; padding: 16px 12px 8px; display: flex; flex-direction: column; gap: 2px; }
.ov-next h2 { font-size: 24px; line-height: 1.1; letter-spacing: calc(-0.03em + var(--lt)); padding: 0 6px; }
.ov-next > p:first-of-type { color: var(--mute); font-size: 12.5px; margin: 4px 0 8px; padding: 0 6px; }
.task { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.task:hover { background: var(--sunk); color: var(--ink); }
.task > svg { color: var(--mute); flex: none; }
.task-n { flex: none; min-width: 42px; height: 42px; padding: 0 8px; border-radius: 12px; display: grid; place-items: center; font: 600 18px/1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); background: var(--sunk); }
.task-n.tone-bad { background: var(--bad-bg); color: var(--bad); }
.task-n.tone-acc { background: var(--acc-bg); color: var(--acc); }
.task-text { flex: 1; min-width: 0; }
.task-text b { display: block; font-size: 13px; }
.task-text span { display: block; color: var(--mute); font-size: 12px; margin-top: 1px; }
.task-none { padding: 18px 6px; color: var(--mute); }

.card > h2 + .ov-sub { margin: 3px 0 6px; }
.ov-sub { color: var(--mute); font-size: 12px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }

.grp { display: grid; grid-template-columns: minmax(170px, 1.2fr) minmax(80px, 1.5fr) 78px 46px; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.grp-head { padding: 0 0 6px; border-top: 0; margin-top: 10px; font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.grp-name { min-width: 0; }
.grp-name b { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.grp-name b i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.grp-name b span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-name > span { display: block; margin-top: 2px; color: var(--mute); font: 400 11px/1.3 var(--mono); }
.grp-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--sunk); }
.grp-bar i { display: block; }
.grp-profit { font-weight: 600; font-size: 13px; }
.grp-return { color: var(--mute); font: 500 12px/1 var(--mono); }
.ov-wide .card-foot { margin-top: 0; }
@media (max-width: 520px) { .grp { grid-template-columns: minmax(0, 1fr) minmax(48px, 0.7fr) 64px 40px; gap: 8px; } .mon { grid-template-columns: minmax(80px, 1fr) 40px 62px 62px; gap: 6px; } }

.route { padding: 9px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.route-top, .route-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.route-top { font-size: 13px; }
.route-top span { font: 500 12px/1 var(--mono); }
.route-foot { font-size: 12px; color: var(--mute); }
.route-foot b { font-weight: 600; }
.route-bar { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.route-bar i { display: block; height: 100%; background: oklch(0.27 0.014 135); }
.route-bar.is-empty { background: transparent; border: 1.5px dashed var(--line-3); }

.duo { display: flex; gap: 8px 28px; flex-wrap: wrap; }
.duo > div { flex: 1 1 260px; min-width: 0; }
.duo .card-head { margin-bottom: 6px; align-items: baseline; flex-wrap: nowrap; }
.mrow { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 5px 6px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.mrow:hover { background: var(--sunk); color: var(--ink); }
.mrow .s-thumb { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.mrow-text { min-width: 0; }
.mrow-text b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow-text span { display: block; font: 400 11px/1.3 var(--mono); color: var(--mute); }
.mrow > b { font-size: 13px; }

.mon { display: grid; grid-template-columns: minmax(100px, 1fr) 52px 72px 72px; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.mon-head { padding: 6px 0; border-top: 0; font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.mon > span { font: 500 12px/1 var(--mono); }
.mon-head > span { font: inherit; }
.ov-side h2 + .mon-head { margin-top: 4px; }

/* Bundles ------------------------------------------------------------------------------------------------------ */

.lede { color: var(--ink-2); max-width: 700px; font-size: 13px; }
.grow { min-width: 0; flex: 1 1 360px; }
.pad { padding: 12px 16px 8px; }
.card.flush { padding: 0; overflow: hidden; }
.scroll-x { overflow-x: auto; }

.bundles { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; overflow-y: hidden; }
.brow { display: grid; align-items: center; gap: 0 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); grid-template-columns: minmax(200px, 2fr) 90px 70px 56px 96px 76px 100px 96px 104px; min-width: 1040px; font-size: 13px; }
.bundles .brow:hover:not(.brow-head) { background: oklch(0.975 0.003 135); }
.brow-head { height: 30px; padding-block: 0; background: oklch(0.975 0.003 135); font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.brow-title { display: block; font-weight: 600; font-size: 13px; color: var(--ink); text-decoration: none; }
.brow-title::after { content: ""; position: absolute; inset: 0; }
.bundles .brow { position: relative; }
.brow-title:hover { color: var(--acc-text); }
.split { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--sunk); margin-top: 8px; max-width: 220px; }
.split i { display: block; }
.split i.fees, i.fees { background: oklch(0.82 0.16 92); }
.key.fees { background: oklch(0.82 0.16 92); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; }
.kpi dd { font: 600 26px/1.1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); margin-top: 10px; font-variant-numeric: tabular-nums; }
.kpi p { color: var(--mute); font-size: 12.5px; margin-top: 4px; min-height: 17px; }
.kpi dd.gain { color: var(--good); }
.kpi dd.loss { color: var(--bad); }

.bd-layout { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.bd-details { flex: 1 1 340px; max-width: 480px; display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.bd-main { flex: 2 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.bd-main .card { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.bd-main .card.flush { padding: 0; gap: 0; }
.bd-main .card-head { margin: 0; align-items: baseline; }
.bd-main .card.flush .card-head { padding: 12px 16px 8px; }
.bd-main .card-head p { font-size: 13px; }

.brow-items { grid-template-columns: minmax(180px, 1fr) 96px 72px 72px 80px 70px; gap: 0 10px; padding: 5px 16px; min-width: 640px; }
.brow-items.brow-head { height: 30px; border-top: 1px solid var(--line); }
.brow-item { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; font-size: 12.5px; line-height: 1.3; }
.brow-item .inline { font-weight: 600; }
.brow-items:not(.brow-head) .num, .brow-items:not(.brow-head) .r { font-size: 13px; }
.open-link { color: var(--mute); display: inline-flex; flex: none; }
.open-link:hover { color: var(--acc-text); }
.own-price { width: 100%; height: 28px; text-align: right; padding: 0 9px; border-radius: 8px; border-color: oklch(0.9 0.005 135); font: 500 13px/1 var(--font); font-variant-numeric: tabular-nums; }
.own-price.saving { opacity: 0.5; }
.link-danger { border: 0; background: transparent; cursor: pointer; font: 600 12.5px/1 var(--font); color: var(--bad); padding: 6px 0; }
.link-danger:hover { text-decoration: underline; }
.brow-group { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 16px; border-bottom: 1px solid var(--line); background: var(--acc-bg); text-decoration: none; min-width: 640px; }
.brow-group b { font-size: 12.5px; color: oklch(0.35 0.14 150); }
.brow-group span { font: 500 12px/1 var(--mono); color: oklch(0.4 0.1 150); }
.brow-items form { display: contents; }
.brow-thumb { flex: none; line-height: 0; }
.brow-thumb .s-thumb { width: 26px; height: 26px; border-radius: 6px; }

.inner-list { display: flex; flex-direction: column; }
.inner-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.inner-row b { text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.inner-row span { font: 500 12.5px/1 var(--mono); color: var(--mute); }
.inner-row:hover b { color: var(--acc-text); }
.field > label, .label, .attr-label > label { font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.field > label.check { text-transform: none; font: 400 13px/1.3 var(--font); letter-spacing: 0; color: var(--ink); }
.bd-main .search { flex: none; max-width: 420px; }
.pick-list { gap: 0; padding: 0; border-radius: 12px; max-height: 300px; }
.pick-list li { padding: 6px 12px; border-bottom: 1px solid oklch(0.94 0.004 135); font-size: 12.5px; }
.pick-list li:last-child { border-bottom: 0; }

/* The pages of Bundles, Snippets and Accounts are a little narrower than Stock, with a 26px heading. */
.page--mid { max-width: 1320px; gap: 12px; }
.page--mid .page-head h1 { margin-top: 6px; font-size: 26px; line-height: 1.1; }
.page--mid .page-head .eyebrow, .page--mid .crumb { font-size: 10.5px; }

/* Snippets ------------------------------------------------------------------------------------------------------ */

.snippets { flex: 3 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.snippet { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.snippet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.snippet h2 { font-size: 14.5px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pills span { height: 24px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; background: var(--sunk); font-size: 12.5px; color: var(--ink-2); }
.snippet-tools { display: flex; align-items: center; gap: 8px; }
.snippet-tools form { display: contents; }
.switch-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; cursor: pointer; font: 500 12.5px/1 var(--font); color: var(--ink-2); padding: 4px; }
.switch { position: relative; display: block; width: 34px; height: 20px; border-radius: 10px; background: var(--line-3); flex: none; }
.switch i { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.switch.is-on { background: var(--ink); }
.switch.is-on i { left: 16px; }
.sq-btn { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; display: grid; place-items: center; color: var(--ink); padding: 0; }
.sq-btn:hover { background: var(--sunk); }
.sq-btn:disabled { opacity: 0.3; cursor: default; }
.snippet-fade { white-space: pre-line; font-size: 13px; line-height: 1.55; color: oklch(0.28 0.014 135); max-height: 150px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.snippet-preview { flex: 2 1 340px; min-width: 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.snippet-preview h2 { font-size: 15px; }
.snippet-preview .seg { padding: 3px; border-radius: 10px; }
.snippet-preview .seg a { height: 28px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.reads { display: flex; flex-direction: column; gap: 10px; }
.read-snip { padding: 12px 14px; border-radius: 12px; background: var(--acc-bg); }
.read-snip .eyebrow { font-size: 10px; color: oklch(0.42 0.14 150); margin-bottom: 7px; }
.read-snip p:last-child { white-space: pre-line; font-size: 13px; line-height: 1.5; color: oklch(0.28 0.014 135); }
.read-own { padding: 18px 14px; border-radius: 12px; border: 1.5px dashed var(--line-3); text-align: center; font: 500 11.5px/1.4 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.form-card { border-color: var(--acc); box-shadow: 0 0 0 4px var(--acc-bg); padding: 16px 18px; }
.form-card.stack > * + * { margin-top: 10px; }

/* Accounts -------------------------------------------------------------------------------------------------------- */

.accounts-page { max-width: 960px; margin-inline: auto; width: 100%; }
.account-list { display: grid; gap: 12px; }
.account { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.account-main > * + * { margin-top: 5px; }
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.account-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-title h2 { font-size: 15px; }
.account-line { color: var(--ink-2); font-size: 13px; max-width: 520px; }
.account-stat { font: 500 12.5px/1 var(--mono); color: var(--mute); }
.add-account > * + * { margin-top: 12px; }
.add-account h2 { font-size: 14.5px; }
.add-account .btn { height: 32px; padding: 0 18px; border-radius: 10px; font-size: 12.5px; }
.account-actions .btn { height: 30px; padding: 0 16px; border-radius: 10px; font-size: 12.5px; }
.account-actions .btn-quiet { padding: 0 14px; }
.account-title .badge { height: 24px; padding: 0 10px; font-size: 12px; }
.account-title .badge::before { display: none; }
.snippet .btn-small { height: 30px; padding: 0 16px; border-radius: 9px; font-size: 13px; }

/* Dialogs: Quick add -------------------------------------------------------------------------------------------- */

.overlay { position: fixed; inset: 0; z-index: 70; background: oklch(0.19 0.012  135 / 0.5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; animation: rs-fade 0.16s ease-out; overflow-y: auto; }
.overlay.no-anim, .overlay.no-anim .dialog { animation: none; }
.dialog { width: min(580px, 100%); background: var(--card); border-radius: 18px; box-shadow: 0 40px 90px -20px oklch(0.19 0.012  135 / 0.6); overflow: hidden; animation: rs-up 0.2s ease-out; }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 24px 28px 0; }
.dialog-head h2 { font: 600 20px/1.1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); }
.dialog-head p { font-size: 12.5px; margin-top: 6px; }
.dialog-head .icon-btn { width: 34px; height: 28px; border-radius: 9px; }
.dialog-form { padding: 20px 28px 24px; display: flex; flex-direction: column; gap: 10px; }
input.big-input { height: 50px; padding: 0 16px; border-radius: 12px; font: 500 17px/1 var(--font); }
.dialog-form .row { grid-template-columns: minmax(140px, 1fr) minmax(200px, 1.4fr); gap: 10px; }
.dialog-form .row input, .dialog-form .row select { height: 44px; border-radius: 12px; font: 500 15px/1 var(--font); }
.dialog-form .input-prefix span { left: 14px; font-size: 15px; }
.dialog-form .input-prefix input { padding-left: 30px; }
.seg-wide { width: 100%; border-radius: 12px; padding: 3px; }
.seg-opt { flex: 1; position: relative; }
.seg-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg-opt span { display: grid; place-items: center; height: 30px; border-radius: 10px; font: 600 12.5px/1 var(--font); color: var(--ink-2); white-space: nowrap; padding: 0 6px; }
.seg-opt input:checked + span { background: var(--ink); color: #fff; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--acc); outline-offset: 1px; }
.dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 8px; }
.dialog-foot .btn { height: 34px; border-radius: 10px; font-size: 13px; }
.dialog-foot kbd { background: oklch(1 0 0 / 0.22); color: #fff; padding: 3px 6px; margin-left: 4px; }
.dialog-more { font-size: 12.5px; }
.flash-link { flex: none; align-self: center; height: 28px; padding: 0 10px; border-radius: 8px; background: oklch(1 0 0 / 0.14); color: #fff; font: 600 13px/28px var(--font); text-decoration: none; }
.flash-link:hover { background: oklch(1 0 0 / 0.24); color: #fff; }

/* The item drawer ----------------------------------------------------------------------------------------------- */

body.drawer-open { overflow: hidden; }
.scrim { position: fixed; inset: 0; z-index: 50; background: oklch(0.19 0.012  135 / 0.42); display: flex; justify-content: flex-end; align-items: stretch; padding: 16px 16px 30px; animation: rs-fade 0.16s ease-out; }

/* The panel floats over the right of the page. The item and each sheet are cards stacked inside the form, so a sheet can slide over the item. */
.drawer { position: relative; width: min(1000px, 100%); height: 100%; animation: rs-right 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); container: drawer / inline-size; }
.dr-form { position: absolute; inset: 0; margin: 0; }
.dr-main, .dsheet {
  position: absolute; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 22px;
  box-shadow: -10px 14px 36px -14px oklch(0.19 0.012  135 / 0.4), 0 30px 70px -20px oklch(0.19 0.012  135 / 0.5);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dr-main { background: oklch(0.972 0.003 135); }
.dr-cover { position: absolute; inset: 0; background: oklch(0.19 0.012  135 / 0.06); opacity: 0; pointer-events: none; transition: opacity 0.34s; }
.dr-main.is-covered .dr-cover, .dsheet.is-covered::after { opacity: 1; pointer-events: auto; cursor: pointer; }
.dsheet.is-covered::after { content: ""; position: absolute; inset: 0; background: oklch(0.19 0.012  135 / 0.06); }
@media (max-width: 699px) {
  .scrim { padding: 0; }
  .dr-main, .dsheet { border-radius: 0; border: 0; }
}

.icon-btn { width: 28px; height: 28px; border: 0; border-radius: 8px; background: var(--sunk); cursor: pointer; display: grid; place-items: center; flex: none; color: var(--ink-2); padding: 0; }
.icon-btn:hover { background: var(--line); }
.icon-btn.line { border: 1px solid var(--line-2); background: var(--card); color: var(--ink); text-decoration: none; }
.icon-btn.line:hover { background: var(--sunk); }
.icon-btn.line.is-danger { color: var(--bad); }
.icon-btn.line.is-danger:hover { background: var(--bad-bg); }
.icon-btn.dark { background: var(--ink); color: #fff; }
.icon-btn.dark:hover { background: oklch(0.3 0.014 135); }
.icon-btn.flat { width: 32px; height: 32px; border-radius: 9px; background: transparent; }
.icon-btn.flat:hover { background: var(--sunk); }
.icon-btn[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }

.dr-head { flex: none; background: var(--card); border-bottom: 1px solid var(--line); padding: 16px 16px 12px; }
.dr-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dr-tools .eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 10px; line-height: 1; }
.dr-tools .eyebrow i { opacity: 0.5; font-style: normal; }
.dr-pos { font: 500 12.5px/1 var(--mono); color: var(--mute); margin-right: 6px; }
.dr-sep { width: 1px; height: 20px; background: oklch(0.9 0.005 135); margin: 0 4px; }

.dr-title { position: relative; margin-top: 8px; }
.dr-title input { width: 100%; height: auto; border: 0; background: transparent; padding: 4px 64px 4px 0; font: 600 22px/1.2 var(--display); letter-spacing: calc(-0.02em + var(--lt)); outline: none; box-shadow: none; text-overflow: ellipsis; border-radius: 0; }
.dr-title input:focus { outline: none; box-shadow: none; }
.dr-title input::placeholder { color: var(--faint); }
.dr-count { position: absolute; right: 0; top: 9px; font: 500 11px/1 var(--mono); color: var(--mute); }
.dr-count.is-over { color: var(--bad); }
.dr-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.dr-chips .stage { height: 22px; font-size: 11.5px; padding: 0 9px; }
.pill { display: inline-flex; align-items: center; gap: 7px; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font: 500 11.5px/1 var(--font); }
.pill i { width: 8px; height: 8px; border-radius: 50%; }

.dr-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 28px; }
.dr-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.dr-side { order: 1; }
@container drawer (min-width: 820px) { .dr-grid { grid-template-columns: minmax(0, 1fr) 300px; } .dr-side { order: 0; } }
.dr-col { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.dr-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.dr-card > h2 { margin: 0; }
.dr-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.dr-sub { font: 600 13.5px/1.3 var(--display); letter-spacing: calc(-0.01em + var(--lt)); margin-top: 4px; }

.dr-foot { flex: none; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 16px; background: var(--card); border-top: 1px solid var(--line); }
.dr-saved { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--mute); }
.dr-saved svg { color: var(--good); }
.dr-saved[data-state="pending"] svg { display: none; }
.dr-foot .btn { height: 32px; padding: 0 16px; border-radius: 11px; font-size: 12.5px; }

/* The Listing card: progress, five rows that open sheets, and where it can be listed. */
.dr-listing { padding: 0; gap: 0; overflow: hidden; }
.dr-listing-head { padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; }
.dr-listing-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ready-text { font: 600 12.5px/1 var(--font); }
.ready-text.tone-good { color: var(--good); }
.ready-text.tone-warn { color: var(--warn); }
.dr-prog { display: flex; gap: 4px; }
.dr-prog i { flex: 1; height: 4px; border-radius: 2px; background: var(--line-2); }
.dr-prog i.is-done { background: var(--good-mid); }
.dr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-top: 1px solid oklch(0.94 0.004 135); }
.dr-row:hover { background: oklch(0.975 0.003 135); }
.dr-row-main { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 12px 0 12px 14px; border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.dr-row-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); }
.dr-row-icon.tone-good { background: var(--good-bg); color: var(--good); }
.dr-row-icon.tone-warn { background: var(--warn-bg); color: var(--warn); }
.dr-row-text { min-width: 0; }
.dr-row-text b { display: block; font: 600 14.5px/1.2 var(--display); letter-spacing: calc(-0.01em + var(--lt)); }
.dr-row-text span { display: block; color: var(--mute); font-size: 12.5px; line-height: 1.35; margin-top: 3px; }
.dr-row-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; max-width: 260px; padding: 12px 16px 12px 0; }
.dr-mini { width: 30px; height: 30px; border-radius: 7px; flex: none; overflow: hidden; background: repeating-linear-gradient(135deg, oklch(0.93 0.006 135) 0 5px, oklch(0.955 0.004 135) 5px 10px); }
.dr-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dr-row-value { font-weight: 600; font-size: 13px; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-row-value.tone-warn { color: var(--warn); }
.dr-act { flex: none; display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 9px; border: 1px solid oklch(0.78 0.1 150); background: var(--acc-bg); color: oklch(0.4 0.12 152); font: 600 12.5px/1 var(--font); white-space: nowrap; text-decoration: none; cursor: pointer; }
.dr-act:hover { background: oklch(0.93 0.05 150); color: oklch(0.4 0.12 152); }
.dr-row-go { flex: none; display: grid; place-items: center; width: 14px; border: 0; background: transparent; color: var(--mute); padding: 0; cursor: pointer; }
@container drawer (max-width: 520px) {
  .dr-row { grid-template-columns: minmax(0, 1fr); }
  .dr-row-main { padding-bottom: 4px; }
  .dr-row-end { max-width: none; justify-content: flex-start; padding: 0 16px 12px 68px; }
  .dr-row-go { margin-left: auto; }
}
.dr-listing-foot { padding: 10px 16px 14px; border-top: 1px solid oklch(0.94 0.004 135); display: flex; flex-direction: column; gap: 5px; }
.dr-listing-foot .label { padding-top: 4px; }
.market-row { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.market-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.market-name b { font-size: 13px; }
.market-row .lchip { height: 22px; padding: 0 9px; font-size: 11.5px; }
.market-row .lchip i { width: 6px; height: 6px; }
.dr-public { margin-top: 5px; flex-wrap: wrap; }
.offer-terms { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--sunk); font-size: 13px; }
.offer-lines { display: flex; flex-direction: column; gap: 8px; }
.offer-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.offer-pct { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); }
.offer-pct input { width: 64px; height: 28px; padding: 0 8px; text-align: right; border: 1px solid var(--line-2); border-radius: 7px; font: 600 13px/1 var(--font); font-variant-numeric: tabular-nums; }
.offer-terms:has(.offer-on input[type="checkbox"]:not(:checked)) .offer-lines { display: none; }
.offer-line:has(input[type="checkbox"]:not(:checked)) .offer-pct { opacity: 0.4; pointer-events: none; }
.dr-public .market-name { flex: 1 1 220px; gap: 2px; }
.dr-public small { font-size: 12.5px; line-height: 1.4; }
.market-row .btn-small { height: 30px; padding: 0 13px; border-radius: 9px; font-size: 13px; }
.lchip-none { background: var(--sunk); color: var(--ink-2); }
.btn-soft { background: var(--acc-bg); border-color: oklch(0.78 0.1 150); color: oklch(0.4 0.12 152); }
.btn-soft:hover { background: oklch(0.93 0.05 150); color: oklch(0.4 0.12 152); }
.btn-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.btn-warn:hover { background: oklch(0.94 0.08 90); color: var(--warn); }
.btn.is-disabled { background: var(--sunk); color: var(--mute); cursor: not-allowed; }
.btn.is-disabled:hover { background: var(--sunk); color: var(--mute); }

/* The Deal card and the preview of what buyers read */
.deal > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.deal dt { color: var(--ink-2); }
.deal dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.deal-sold { margin: 4px 0 12px; }
.deal-sold dt { color: var(--mute); }
.profit-box { padding: 16px; border-radius: 14px; background: oklch(0.975 0.003 135); }
.profit-box b { display: block; font: 600 24px/1.1 var(--display); letter-spacing: calc(-0.03em + var(--lt)); margin-top: 8px; }
.profit-box b.gain { color: var(--good); }
.profit-box b.loss { color: var(--bad); }
.profit-box small { display: block; color: var(--mute); font-size: 13px; margin-top: 4px; }
.buyer-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.buyer-photo { position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center; background: repeating-linear-gradient(135deg, oklch(0.93 0.006 135) 0 7px, oklch(0.955 0.004 135) 7px 14px); font: 500 11px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--mute); }
.buyer-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.buyer-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 5px; }
.buyer-body h3 { font: 600 14.5px/1.25 var(--display); letter-spacing: calc(-0.01em + var(--lt)); }
.buyer-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.buyer-price b { font: 600 18px/1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); }
.buyer-price span { font-size: 12.5px; color: var(--mute); }
.buyer-seg { font-size: 13px; line-height: 1.5; white-space: pre-line; color: var(--ink); }
.buyer-seg.is-empty { color: var(--mute); }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pills span { height: 24px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; background: var(--sunk); font-size: 12px; color: var(--ink-2); }
.bundle-note { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: var(--acc-bg); font-size: 13px; color: oklch(0.3 0.1 150); }
.dr-sale { display: flex; flex-direction: column; gap: 10px; }
.sale-start { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 18px; border-top: 1px solid var(--line); }
.sale-start span { max-width: 360px; }
.dr-sale:has(.row) { padding-top: 18px; border-top: 1px solid var(--line); }
.sale-net { display: flex; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: oklch(0.975 0.003 135); font-size: 12.5px; }
.dr-card .row { gap: 8px; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); }

/* Sheets: a card slid over the item, with a back button, a title pill and a Done button. */
.dsheet { background: var(--card); animation: rs-right 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.dsheet[hidden] { display: none; }
.dsheet.is-leaving { animation: rs-xo 0.22s ease-in forwards; }
@keyframes rs-xo { from { transform: none; opacity: 1; } to { transform: translateX(36px); opacity: 0; } }
.dsheet-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px; }
.dsheet-title { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 13px 0 10px; border-radius: 999px; border: 1px solid var(--line-2); font: 600 13px/1 var(--font); min-width: 0; }
.dsheet-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 24px 20px; }
.dsheet-col { width: 100%; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.dsheet-desc { color: var(--mute); font-size: 14px; line-height: 1.4; padding-bottom: 12px; border-bottom: 1px solid oklch(0.94 0.004 135); }
.dsheet-foot { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 24px 14px; border-top: 1px solid oklch(0.94 0.004 135); }
.dsheet-foot .btn { width: 100%; max-width: 720px; height: 42px; border-radius: 12px; font-size: 14px; }
.dsheet-foot span { font: 500 11.5px/1 var(--mono); color: var(--mute); }
.dr-sheet-section { display: flex; flex-direction: column; gap: 14px; }
.dr-label-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dr-label-row label { font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }
.mono-input { font-family: var(--mono) !important; }
.dr-checked { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 12.5px; color: var(--mute); }

.dropzone-lg { border: 2px dashed var(--line-3); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; background: oklch(0.975 0.003 135); }
.dropzone-lg.is-over, .photo-grid.is-over { border-color: var(--acc); background: var(--acc-bg); }
.dropzone-lg b { font-size: 15px; }
.drop-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--acc-bg); color: var(--acc-text); display: grid; place-items: center; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; border-radius: 14px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--sunk); margin: 0; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-cover, .ph-make { position: absolute; left: 8px; bottom: 8px; height: 22px; padding: 0 9px; border-radius: 999px; display: inline-flex; align-items: center; font: 600 11.5px/1 var(--font); text-decoration: none; }
.ph-cover { background: var(--ink); color: #fff; }
.ph-make { background: oklch(1 0 0 / 0.9); color: var(--ink); }
.ph-remove { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; border-radius: 50%; background: oklch(1 0 0 / 0.9); display: grid; place-items: center; color: var(--ink); text-decoration: none; }
.ph-add { aspect-ratio: 1; border: 2px dashed var(--line-3); border-radius: 12px; background: oklch(0.975 0.003 135); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-2); font: 600 13px/1 var(--font); }
.ph-add:hover { border-color: var(--acc); background: var(--acc-bg); }
.is-uploading { opacity: 0.6; pointer-events: none; }

.dr-price-row { display: flex; gap: 14px 20px; flex-wrap: wrap; align-items: flex-end; }
.dr-market-prices { display: grid; gap: 8px; margin: 14px 0; }
.preview-price { display: block; max-width: 140px; }
.dr-ask { flex: 0 1 220px; min-width: 170px; }
.big-money { position: relative; }
.big-money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font: 600 20px/1 var(--display); color: var(--mute); }
.big-money input { height: 52px; padding: 0 14px 0 32px; border-radius: 12px; border-width: 1.5px; font: 600 24px/1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); }
.dr-summary { display: contents; }
.big-suggest { display: inline-flex; align-items: center; gap: 12px; height: 52px; padding: 0 18px; border-radius: 12px; border: 1.5px dashed oklch(0.78 0.1 150); background: var(--acc-bg); color: oklch(0.4 0.12 152); text-decoration: none; }
.big-suggest:hover { background: oklch(0.93 0.05 150); color: oklch(0.4 0.12 152); }
.big-suggest b { font: 600 20px/1 var(--display); letter-spacing: calc(-0.02em + var(--lt)); }
.big-suggest span { font: 600 13px/1 var(--font); }
.dr-profit { flex: 1 1 170px; min-width: 150px; }
.dr-profit b { font: 600 18px/1.25 var(--display); letter-spacing: calc(-0.01em + var(--lt)); }
.dr-profit b.gain { color: var(--good); }
.dr-profit b.loss { color: var(--bad); }
.dr-price-note { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: oklch(0.975 0.003 135); font-size: 13px; color: var(--ink-2); }
.dr-price-note .more { border: 0; background: transparent; padding: 0; cursor: pointer; }
.label { font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); }

.market-box { background: oklch(0.975 0.003 135); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.market-box.is-working { opacity: 0.6; pointer-events: none; }
.market-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.market-mid { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.market-mid b { font: 600 30px/1 var(--display); letter-spacing: calc(-0.03em + var(--lt)); }
.market-none { margin-top: 10px; font: 600 18px/1.2 var(--display); color: var(--ink-2); }
.comp-ribbon { position: relative; height: 62px; margin-top: 6px; }
.cr-dots { position: absolute; left: 0; right: 0; top: 0; height: 14px; }
.cr-dots i { position: absolute; top: 1px; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; border: 1.5px solid var(--ink); background: #fff; }
.cr-dots i.is-on { background: var(--ink); }
.cr-track { position: absolute; left: 0; right: 0; top: 26px; height: 14px; border-radius: 7px; background: oklch(0.93 0.004 135); }
.cr-band { position: absolute; top: 0; bottom: 0; background: oklch(0.8 0.045 135); border-radius: 7px; }
.cr-mid { position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; background: var(--ink); border-radius: 2px; }
.cr-dot { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2.5px solid #fff; box-sizing: content-box; transform: translate(-2.5px, -2.5px); }
.cr-paid { background: var(--ink); }
.cr-ask { background: var(--acc); }
.cr-label { position: absolute; top: 46px; transform: translateX(-50%); font: 500 11.5px/1 var(--mono); color: var(--ink); white-space: nowrap; }
.cr-label.is-ask { color: oklch(0.46 0.2 150); font-weight: 600; }
.legend .lg-dot.is-hollow { background: transparent; border: 1.5px solid var(--ink); }
.lg-tick { width: 3px; height: 12px; background: var(--ink); border-radius: 2px; display: inline-block; }
.comps-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.comps-head b { font: 600 14px/1.2 var(--display); }
.comps-head p { margin-top: 3px; }
.comp-row { display: grid; grid-template-columns: 22px 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.comp-row.is-off { opacity: 0.55; }
.comp-img { width: 40px; height: 40px; border-radius: 9px; overflow: hidden; background: repeating-linear-gradient(135deg, oklch(0.93 0.006 135) 0 5px, oklch(0.955 0.004 135) 5px 10px); }
.comp-img img { width: 100%; height: 100%; object-fit: cover; }
.comp-text { min-width: 0; }
.comp-text a { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 500; font-size: 13px; line-height: 1.3; color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px; }
.comp-text .small { display: flex; gap: 8px; align-items: center; margin-top: 3px; }
.flag { font-style: normal; height: 18px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; background: var(--warn-bg); color: var(--warn); font: 600 11px/1 var(--font); }
.comps-empty { padding: 16px; border: 1.5px dashed var(--line-3); border-radius: 12px; color: var(--ink-2); font-size: 13px; line-height: 1.5; }
.search-again { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding-top: 14px; border-top: 1px solid var(--line); }
.search-again .field { flex: 1 1 240px; }
.cex-block { padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.cex-block .card-head b { font: 600 14px/1.2 var(--display); }
.best-out { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 14px; background: oklch(0.975 0.003 135); }
.bo-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) 72px; gap: 12px; align-items: center; font-size: 13px; }
.bo-bar { height: 10px; border-radius: 5px; background: oklch(0.93 0.004 135); overflow: hidden; }
.bo-bar i { display: block; height: 100%; background: var(--ink-2); }
.bo-bar i.is-best { background: var(--acc); }
.market-listing a { color: var(--ink); }

.dr-sheet-section .seg-wide { border-radius: 10px; padding: 2px; }
.dr-sheet-section .seg-opt span { height: 30px; border-radius: 8px; font-size: 12.5px; }
.count-pill { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: grid; place-items: center; background: oklch(1 0 0 / 0.2); font: 600 12px/1 var(--mono); }

/* The eBay preview dialog: what would be sent, before it is */
.dialog-wide { width: min(680px, 100%); }
.preview { gap: 16px; max-height: 72vh; overflow-y: auto; }
.preview-block h3 { font: 600 13px/1 var(--display); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.preview-category { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.preview-search { display: flex; gap: 8px; margin-bottom: 8px; }
.preview-search input { flex: 1; }
.preview-alts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.preview-alts a { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: inherit; }
.preview-alts a:hover { background: oklch(0.97 0.004 135); }
.preview-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.preview-table th, .preview-table td { text-align: left; padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.preview-table th { font-weight: 600; width: 34%; }
.preview-table .is-missing { background: var(--bad-bg); }
.preview .warn-text { color: var(--warn); }
.preview-facts { display: grid; grid-template-columns: 90px 1fr; gap: 4px 12px; font-size: 13.5px; }
.preview-facts dt { color: var(--muted); }
.preview-facts dd { min-width: 0; }
.preview-facts .preview-title-input { width: 100%; margin-bottom: 2px; }
.preview-facts dd .small { display: block; }
.preview-facts .preview-subtitle { display: flex; margin: 4px 0; }
.preview-body { margin-top: 6px; }

/* Offers: one card per offer, the item and buyer on the left, the money and the button on the right */
.offer-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.offer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; flex-wrap: wrap; }
.offer-main, .offer-price { display: flex; flex-direction: column; gap: 3px; }
.offer-price { align-items: flex-end; text-align: right; }

/* Shop settings: one row per volume-discount step. */
.discount-steps { display: flex; flex-direction: column; gap: 8px; }
.discount-step { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.discount-step label:not(.check) { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.discount-step input[type=number] { width: 78px; }

/* Compare: what we hold beside what a marketplace shows */
.compare { margin-top: 16px; display: grid; gap: 14px; }
.compare-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.compare-table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.compare-table th, .compare-table td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-line; }
.compare-table thead th { font: 500 11px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); background: var(--sunk); }
.compare-table tbody th { width: 17%; font-weight: 600; color: var(--ink-2); }
.compare-table td { width: 41.5%; }
.compare-differs td, .compare-missing td, .compare-extra td { background: var(--warn-bg); }
.compare-differs td:last-child, .compare-missing td:last-child, .compare-extra td:last-child { box-shadow: inset 3px 0 0 var(--amber); }
.compare-info td { color: var(--mute); }
.compare-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.compare-photos .photo-strip img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.compare-money tbody th { width: 34%; }
.compare-money td { width: 33%; font-variant-numeric: tabular-nums; }
.compare-total th, .compare-total td { font-weight: 700; background: var(--sunk); }
.compare-note { margin-top: 8px; max-width: 78ch; }

/* The review queue: a list of every live eBay listing beside the one being checked. */
.review-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.review-bar i { display: block; height: 100%; background: var(--good-mid); }
.review-grid { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 18px; align-items: start; }
.review-list { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.review-list ol { list-style: none; margin: 0; padding: 4px; }
.review-item { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; color: var(--ink-2); text-decoration: none; }
.review-item:hover { background: var(--sunk); }
.review-item[aria-current="page"] { background: var(--acc-bg); color: var(--ink); font-weight: 600; }
.review-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-price { font: 500 11.5px/1 var(--mono); color: var(--mute); }
.review-tick { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line-3); display: grid; place-items: center; }
.review-tick.is-checked { border-color: var(--good-mid); background: var(--good-bg); color: var(--good); }
.review-main { display: grid; gap: 14px; min-width: 0; }
.review-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.review-title h2 { margin: 4px 0 0; font-size: 20px; line-height: 1.2; }
.review-links { display: flex; gap: 8px; flex-wrap: wrap; }
.review-actions { position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.review-actions form { margin: 0; }
.review-spacer { flex: 1; }
@media (max-width: 860px) {
  .review-grid { grid-template-columns: minmax(0, 1fr); }
  .review-list { position: static; max-height: 220px; }
}

/* A heads-up that an item being added looks like one already in stock; adding it anyway is always one press away. */
.dupe-warning { display: block; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.dupe-warning > * + * { margin-top: 8px; }
.dupe-warning a { color: inherit; font-weight: 600; }
.dupe-warning .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dupe-line + .dupe-line { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--warn-line); }
.dupe-list { margin: 0; padding-left: 18px; }
.dupe-list .muted { color: inherit; opacity: 0.75; }

/* History: how much a figure changed, and which items moved most */
.hist-change.gain { color: var(--good); }
.hist-change.loss { color: var(--bad); }
.hist-change.flat { color: var(--mute); }
.hist-change { font-weight: 600; }
.hist-sum { padding: 14px 16px; display: grid; gap: 10px; }
.hist-sum h2, .hist-movers h2 { font-size: 15px; }
.hist-sum .table-scroll:has(.table) { border: 0; border-radius: 0; background: none; }
.hist-movers { display: grid; gap: 10px; }
.hist-movers-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.hist-movers-card { padding: 14px 16px; display: grid; gap: 8px; align-content: start; min-width: 0; }
.hist-movers-card h3 { font-size: 13px; }
.hist-movers-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hist-movers-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: baseline; }
.hist-movers-list a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-movers-list b { grid-row: 1 / span 2; grid-column: 2; white-space: nowrap; }
