@font-face {
  font-family: "Red Hat Display";
  src: url("assets/red-hat-display.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: Commissioner;
  src: url("assets/commissioner.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}
@font-face {
  font-family: "Reddit Mono";
  src: url("assets/reddit-mono.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Material Symbols Outlined";
  src: url("assets/material-symbols-outlined.woff2") format("woff2");
  font-display: block;
}

:root {
  color-scheme: light;
  --background: #f4f5f7;
  --surface: #fff;
  --surface-low: #f9f9fb;
  --surface-medium: #f0f0f2;
  --ink: #1a1c1d;
  --muted: #5d5e60;
  --line: #e4e4e7;
  --control-line: #b3b2b7;
  --dark: #1b1b1e;
  --dark-hover: #303033;
  --orange: #c93b12;
  --orange-bright: #f15a29;
  --orange-tint: #ffede8;
  --positive: #14532d;
  --positive-tint: #e8f8ee;
  --warning: #713f12;
  --warning-tint: #fef9c3;
  --error: #ba1a1a;
  --error-tint: #ffdad6;
  --heading: "Red Hat Display", "Segoe UI", sans-serif;
  --body: Commissioner, "Segoe UI", sans-serif;
  --mono: "Reddit Mono", Consolas, monospace;
  --gap: 20px;
  --radius: 24px;
  --shadow: 0 1px 2px rgb(27 27 30 / 6%);
  font: 400 13px/20px var(--body);
  color: var(--ink);
  background: var(--background);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
::selection { background: var(--orange-tint); color: #5b1500; }
input, textarea { caret-color: var(--orange); }

h1 { font: 700 28px/36px var(--heading); letter-spacing: -.25px; }
h2 { font: 600 18px/24px var(--heading); letter-spacing: -.1px; }
h3 { font: 600 15px/22px var(--body); }
.muted, .field-help, .empty { color: var(--muted); }
.field-help, .label { font-size: 11px; line-height: 16px; }
.label { font-weight: 600; }
.error, .accent { color: var(--error); }
.success { color: var(--positive); }
.plain-list { margin: 0; padding: 0; list-style: none; }
.sr-only, .icon-library { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.sr-only { white-space: nowrap; }

.skip-link {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 16px;
  transform: translateY(-150%);
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--surface);
}
.skip-link:focus { transform: translateY(0); }
.shell { max-width: 1440px; margin-inline: auto; padding: 20px 16px 32px; }
.topbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; justify-self: start; gap: 8px; border-radius: 999px; font: 600 18px/24px var(--heading); text-decoration: none; }
.icon { display: inline-grid; flex: none; place-items: center; width: 20px; height: 20px; }
.icon > svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.material-ready .icon[data-glyph] > svg { display: none; }
.material-ready .icon[data-glyph]::before {
  content: attr(data-glyph);
  font: 20px/1 "Material Symbols Outlined";
  font-variant-ligatures: common-ligatures;
  font-feature-settings: "liga";
  direction: ltr;
}
.brand .brand-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--orange); color: white; box-shadow: var(--shadow); }
.brand-mark > svg { width: 20px; height: 20px; }
.capsule {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.top-nav { padding: 6px; }
.top-nav a { padding: 8px 18px; border-radius: 999px; color: var(--muted); font-weight: 600; line-height: 18px; text-align: center; text-decoration: none; }
.top-nav a:hover, .icon-button:hover { background: var(--surface-medium); color: var(--ink); }
.top-nav a[aria-current="page"], .rail a[aria-current="page"] { background: var(--dark); color: white; }
.utilities { justify-self: end; padding: 4px; white-space: nowrap; }
.sample-label { border-radius: 999px; padding: 4px 9px; background: var(--orange-tint); color: #5b1500; font-size: 11px; font-weight: 600; }
.icon-button { display: inline-grid; flex: none; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; text-decoration: none; }

.workspace { display: flex; gap: var(--gap); margin-top: var(--gap); }
.rail { display: none; }
main, .view { min-width: 0; }
main { flex: 1; }
.view { display: grid; gap: var(--gap); }
.page-heading { display: grid; gap: 4px; padding-top: 4px; }
.page-heading > h1 { justify-self: start; }
.page-heading > p { font-size: 13px; line-height: 20px; }
.panel {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel-head, .metric-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-head { flex-wrap: wrap; }
.notice { margin-top: var(--gap); border: 1px solid #eed776; border-radius: 16px; padding: 12px 16px; background: var(--warning-tint); color: var(--warning); }
.notice.error { border-color: #efb3ae; background: var(--error-tint); color: var(--error); }
.message { font-weight: 600; }
.message:not(:empty) { margin-block: 8px; }
.notice, .message, td, dd, h3 { overflow-wrap: anywhere; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
.dash-side { display: flex; flex-direction: column; gap: var(--gap); }
.revenue-panel { display: flex; flex-direction: column; gap: 16px; }
.revenue-panel h2 { color: var(--muted); font: 600 15px/22px var(--body); }
.display-number { font: 700 clamp(26px, 2.55vw, 36px)/1.23 var(--heading); letter-spacing: -.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.revenue-caption { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.panel-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.button, .pill-control {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-low);
}
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; font-weight: 600; line-height: 18px; text-align: center; }
.button .icon { width: 16px; height: 16px; }
.button .icon::before { font-size: 16px; }
.button.primary { border-color: var(--dark); background: var(--dark); color: white; }
.button.primary:hover { border-color: var(--dark-hover); background: var(--dark-hover); }
.button.secondary:hover, .pill-control:hover { background: var(--surface-medium); }
.button:disabled { cursor: default; opacity: .55; }
.pill-control { max-width: 100%; padding: 5px 10px; font-size: 13px; line-height: 18px; }
select.pill-control { padding-right: 24px; }
.revenue-panel .pill-control { min-height: 32px; font-size: 11px; font-weight: 600; }
.revenue-breakdown { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.revenue-breakdown > div { min-width: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-low); padding: 10px; }
.revenue-breakdown dt { font-size: 11px; line-height: 16px; color: var(--muted); }
.revenue-breakdown dd { margin-top: 4px; font: 600 15px/22px var(--body); font-variant-numeric: tabular-nums; }
.badge { display: inline-block; width: fit-content; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 16px; white-space: nowrap; }
.badge.neutral { background: var(--surface-medium); color: var(--ink); }
.badge.positive { background: var(--positive-tint); color: var(--positive); }
.badge.warning { background: var(--warning-tint); color: var(--warning); }
.badge.negative { background: var(--error-tint); color: #93000a; }
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.metric { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 16px; text-decoration: none; }
.metric h2 { font: 600 13px/18px var(--body); }
.metric.featured, .stock-tile.orange { border-color: var(--orange); background: var(--orange); color: white; }
a.metric:hover { box-shadow: 0 2px 5px rgb(27 27 30 / 14%); }
.metric-icon { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-medium); color: var(--ink); }
.metric-icon > svg { width: 16px; height: 16px; }
.metric-icon::before { font-size: 16px; }
.featured .metric-icon { background: var(--dark-hover); color: white; }
.metric-number { font: 600 24px/32px var(--heading); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-note { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 16px; }
.featured .metric-note { color: #fff4ef; }
.chart-panel { display: flex; flex-direction: column; gap: 12px; }
.plot { flex: 1; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-low); }
.chart-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 11px; }
.chart-legend li { display: flex; align-items: center; gap: 5px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.swatch.net, .chart-net { background: var(--dark); fill: var(--dark); }
.swatch.refund { background: var(--orange-bright); }
.chart-refund { fill: url(#refund-stripe); }
#sales-chart { display: block; width: 100%; height: auto; max-height: 192px; }
#sales-chart.chart-hidden { display: none; }
.chart-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-label { fill: var(--muted); font-family: var(--body); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-details { color: var(--muted); font-size: 11px; line-height: 16px; }
summary { cursor: pointer; font-weight: 600; }
.chart-data { display: grid; gap: 3px; margin-top: 6px; }
.progress-panel, .stock-summary, .table-panel, .inventory-panel { display: flex; flex-direction: column; gap: 16px; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; }
.progress-panel .accent { color: var(--orange); }
progress {
  appearance: none;
  width: 100%;
  height: 14px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: var(--surface-medium);
}
progress::-webkit-progress-bar { background: repeating-linear-gradient(-45deg, var(--surface-medium), var(--surface-medium) 4px, var(--line) 4px, var(--line) 8px); }
progress::-webkit-progress-value { border-radius: 999px; background: var(--orange-bright); }
progress::-moz-progress-bar { border-radius: 999px; background: var(--orange-bright); }
.stock-summary { flex: 1; }
.stock-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stock-tile { display: flex; flex-direction: column; align-items: start; justify-content: space-between; min-height: 144px; gap: 6px; padding: 16px; border-radius: 20px; text-decoration: none; }
.stock-tile:hover { text-decoration: underline; }
.stock-tile.dark { background: var(--dark); color: white; }
.stock-tile .badge { background: white; color: var(--ink); }
.stock-tile strong { margin-top: auto; font: 700 24px/32px var(--heading); }
.low-stock-list li, .inventory-list li { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding-block: 8px; overflow-wrap: anywhere; }
.low-stock-list li + li, .inventory-list li + li { border-top: 1px solid var(--line); }
.inventory-list li:first-child { padding-top: 0; }
.inventory-list .badge { margin-top: 4px; }
.inventory-balance { font: 600 18px/24px var(--heading); font-variant-numeric: tabular-nums; }
.table-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.search-field { position: relative; display: flex; max-width: 100%; }
.search-field .icon { position: absolute; top: 8px; left: 9px; color: var(--muted); pointer-events: none; }
.search-field input { width: 208px; padding-inline: 32px 12px; }
.search-field input::placeholder { color: var(--muted); opacity: 1; }
.table-scroll { min-width: 0; max-width: 100%; overflow-x: auto; border-radius: 8px; }
.table-scroll:focus-visible { outline-offset: 1px; }
table { width: 100%; min-width: 580px; border-collapse: collapse; text-align: left; }
th { padding: 11px 9px; background: var(--surface-low); color: var(--muted); font-weight: 600; }
td { padding: 12px 9px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: var(--surface-low); }
tbody th { padding: 12px 9px; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); overflow-wrap: anywhere; }
.mono { font: 500 12px/18px var(--mono); }
.numeric-cell { font-variant-numeric: tabular-nums; }
.cell-action { min-height: 32px; padding: 4px 9px; font-size: 11px; }
.transaction-note { max-width: 320px; white-space: pre-wrap; }

.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.board-instructions { margin-bottom: 10px; color: var(--muted); }
.board-column { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 24px; background: var(--surface-medium); }
.column-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.column-heading .badge { background: var(--surface); }
.card-list { display: grid; gap: 8px; }
.task-card { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow-wrap: anywhere; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; color: var(--muted); }
.card-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-top: 12px; }
.card-controls .field { flex: 1 1 96px; }
.task-creation { padding: 0; }
.task-creation summary { padding: 14px 24px; font-size: 15px; }
.task-creation summary:focus-visible { border-radius: var(--radius); outline-offset: -4px; }
.task-creation[open] summary { border-bottom: 1px solid var(--line); }
.task-form { padding: 16px 24px; }
.task-fields, .form-grid, .stock-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.task-fields { align-items: end; }
.field { display: grid; gap: 4px; min-width: 0; }
.field label, .inline-field label { font-weight: 600; }
.field label .muted { font-weight: 400; }
.field input, .field select, .field textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--control-line);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--surface);
}
.field textarea { resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--error); }
.wide { grid-column: 1 / -1; }
.inline-field { display: flex; align-items: center; gap: 8px; max-width: 100%; }
.inline-field select { min-width: 0; }
.form-panel { align-self: start; }
.form-panel h2 { margin-bottom: 16px; }
.form-panel > button { margin-top: 16px; }
.stock-grid { gap: var(--gap); align-items: start; }

dialog {
  width: min(100% - 32px, 540px);
  max-height: calc(100% - 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 40px rgb(27 27 30 / 18%);
}
dialog::backdrop { background: rgb(27 27 30 / 38%); }
.dialog-header { margin-bottom: 12px; }
.edit-summary { margin-bottom: 12px; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; margin-top: 16px; }

@media (min-width: 650px) {
  .form-grid, .task-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stock-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .shell { padding-inline: 24px; }
  .rail { display: flex; flex-direction: column; align-items: center; align-self: stretch; flex: 0 0 56px; gap: var(--gap); padding-top: 8px; }
  .rail-group { flex-direction: column; padding: 6px; }
  .rail-group a.icon-button { width: 40px; height: 40px; }
  .rail-bottom { margin-top: 4px; }
  h1 { font-size: 36px; line-height: 44px; letter-spacing: -.5px; }
  .dash-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  #view-dasbor > .dash-grid:first-of-type { min-height: 365px; }
  .span-4 { grid-column: span 4; }
  .span-8 { grid-column: span 8; }
  .task-fields { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; }
}

@media (max-width: 730px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .top-nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; }
  .top-nav a { flex: 1; padding-inline: 10px; }
  .panel { padding: 16px; }
  .task-creation { padding: 0; }
  .task-creation summary, .task-form { padding-inline: 16px; }
  .table-tools { width: 100%; }
  .search-field { flex: 1 1 145px; }
  .search-field input { width: 100%; min-width: 0; }
  .view { gap: 16px; }
  .pill-control, .field input, .field select, .field textarea { min-height: 42px; }
  .panel-actions .button { min-height: 42px; padding-inline: 7px; }
}

@media (max-width: 480px) {
  .revenue-breakdown { grid-template-columns: minmax(0, 1fr); }
  .revenue-breakdown > div { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 6px 10px; }
  .revenue-breakdown dd { min-width: 0; margin: 0; text-align: end; }
}
