/* ==========================================================================
   校鱼 · Beautiful UI 设计系统
   --------------------------------------------------------------------------
   Ported from the Beautiful UI Vue design system into 校鱼's native stack.
   No framework, no build step -- this file is the whole design language.

   Design principles carried over
     1. Hairline-first: separation comes from 1px lines, not heavy shadows.
        Every surface uses --shadow-hairline (0 0 0 1px var(--line)).
     2. Layered surfaces: page -> canvas -> surface -> inset -> hover.
        Each level is a distinct, deliberate value -- never ad-hoc greys.
     3. Tint, don't paint: state colours come from color-mix() over the accent,
        so the palette stays coherent when the brand hue changes.
     4. Two typefaces only: Inter for UI, JetBrains Mono for numbers and code.
     5. One motion curve: cubic-bezier(.23, 1, .32, 1) for everything.
     6. Dark mode is a first-class token set, not an afterthought filter.

   Load order in index.html:
     styles.css      structural reset + layout skeleton (unchanged)
     beautiful.css   <- this file: design system, owns all visual decisions
     rounded.css     product-level composer / dashboard tuning
     glass.css       optional translucency layer

   The brand palette (evergreen / cream / mint) comes from the icon work and
   is expressed here as the --accent family. Light and dark values are tuned
   separately for contrast rather than derived by inversion.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Fonts. Local-first: no remote font requests (the strict CSP blocks them
   anyway). The stacks below degrade gracefully to quality system faces, so
   the layout never breaks -- and the app works fully offline.
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   Design tokens -- light
   -------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* --- surfaces, lightest to deepest ------------------------------------ */
  --page: #f9fafb;          /* the app background behind everything        */
  --canvas: #f2f4f6;        /* recessed wells, demo stages, table stripes  */
  --surface: #ffffff;       /* raised cards, panels, the main workspace    */
  --inset: #f6f8f9;         /* inputs, code blocks, inset rows             */
  --hover: #f1f3f5;         /* hover wash on neutral rows                  */
  --hover-2: #e5e9ec;       /* stronger hover / pressed wash               */

  /* --- text ------------------------------------------------------------- */
  --ink: #1d2429;           /* headings, primary copy                      */
  --ink-2: #5b666e;         /* body copy, secondary labels                 */
  --ink-3: #939ca4;         /* metadata, captions, disabled                */

  /* --- lines ------------------------------------------------------------ */
  --line: #e7eaee;          /* hairline default                            */
  --line-strong: #dae0e5;   /* emphasised borders, button rings            */

  /* --- form fields ------------------------------------------------------ */
  --field: #f3f5f7;

  /* --- brand: evergreen (from the fish icon) ---------------------------- */
  --accent: #43825f;        /* the one interactive colour                  */
  --accent-ink: #f4faf5;    /* text on top of accent fills                 */

  /* --- semantic ---------------------------------------------------------- *
   * Deliberately distinct from --accent so "success" never reads as
   * "interactive". In the Chinese finance convention used by this product,
   * rising values are red and falling values are green -- see --up/--down.  */
  --green: #2f7d4f;
  --red: #c8393f;
  --orange: #c46a1e;
  --purple: #6d47c4;

  /* Charts. Two series: revenue (primary) and cost (secondary). */
  --chart-1: #2f6b4f;
  --chart-2: #9bb5a5;

  /* --- type ------------------------------------------------------------- */
  --font-sans: 'Inter', 'Microsoft YaHei UI', 'Microsoft YaHei',
               'PingFang SC', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', ui-monospace,
               SFMono-Regular, Consolas, monospace;

  /* Legacy aliases -- styles.css and rounded.css still reference these.
     Pointing them at the new tokens means those files need no edit. */
  --bg: var(--canvas);
  --soft: var(--hover);
  --muted: var(--ink-2);
  --accent-soft: color-mix(in srgb, var(--accent) 10%, transparent);
  --positive: var(--green);
  --warn: var(--orange);
  --danger: var(--red);
  --body: var(--font-sans);
  --mono: var(--font-mono);
  --display: var(--font-sans);

  /* --- elevation: hairlines do the work, shadows only lift ------------- */
  /* The fish mark as a mask, so the seal can tint it with currentColor. */
  --logo-mask: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%2279.2%2082.5%20837.6%20837.6%22%3E%3Cpath%20d%3D%22M133%20496%20C152%20470%20215%20415%20285%20372%20C345%20350%20395%20341%20441%20340%20C530%20351%20640%20392%20700%20434%20C712%20442%20718%20448%20721%20453%20C752%20424%20802%20395%20845%20376%20C859%20371%20867%20381%20861%20394%20C853%20420%20827%20462%20824%20502%20C822%20542%20838%20588%20856%20612%20C866%20626%20856%20638%20840%20630%20C800%20612%20750%20570%20730%20554%20C724%20548%20722%20542%20722%20547%20C638%20604%20550%20646%20465%20662%20C412%20666%20333%20652%20248%20616%20C198%20592%20152%20547%20133%20496%20Z%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%2227.6%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3Ccircle%20cx%3D%22258%22%20cy%3D%22492%22%20r%3D%2226%22%20fill%3D%22black%22%2F%3E%3Cpath%20d%3D%22M348%20541%20C352%20526%20372%20518%20400%20517%20C428%20516%20450%20525%20455%20541%20C458%20556%20436%20568%20404%20571%20C376%20572%20354%20562%20348%20549%20C347%20546%20347%20543%20348%20541%20Z%22%20fill%3D%22black%22%2F%3E%3C%2Fsvg%3E");

  --shadow-hairline: 0 0 0 1px var(--line);
  --shadow-btn: 0 0 0 1px var(--line-strong), 0 1px 2px rgb(16 24 40 / 5%);
  --shadow-overlay: 0 0 0 1px var(--line), 0 8px 28px rgb(0 0 0 / 7%);
  --shadow-raised: 0 0 0 1px var(--line), 0 1px 3px rgb(16 24 40 / 4%);
  --shadow-panel: 0 0 0 1px var(--line), 0 12px 32px rgb(16 24 40 / 5%);

  /* --- geometry --------------------------------------------------------- */
  --radius: 10px;
  --radius-sm: 7px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* --- motion ----------------------------------------------------------- */
  --ease: cubic-bezier(.23, 1, .32, 1);
  --dur-fast: 120ms;
  --dur: 160ms;
  --dur-slow: 240ms;
}

/* --------------------------------------------------------------------------
   Design tokens -- dark
   Tuned by eye for contrast, not generated by inverting the light set.
   Accents are lightened and slightly desaturated so they sit on dark
   surfaces without vibrating.
   -------------------------------------------------------------------------- */
:root.dark,
.dark {
  color-scheme: dark;

  --page: #14171a;
  --canvas: #191d20;
  --surface: #1f2427;
  --inset: #1b1f22;
  --hover: #262b2e;
  --hover-2: #2e3438;

  --ink: #eef1ef;
  --ink-2: #a4aeaa;
  --ink-3: #6b7570;

  --line: #2b3134;
  --line-strong: #394043;

  --field: #24292c;

  --accent: #6cb68c;
  --accent-ink: #0f1a14;

  --green: #56b37c;
  --red: #e9707a;
  --orange: #dd9950;
  --purple: #a48bea;

  --chart-1: #5aa87c;
  --chart-2: #46604f;

  --shadow-hairline: 0 0 0 1px var(--line);
  --shadow-btn: 0 0 0 1px var(--line-strong), 0 1px 2px rgb(0 0 0 / 30%);
  --shadow-overlay: 0 0 0 1px var(--line-strong), 0 8px 28px rgb(0 0 0 / 48%);
  --shadow-raised: 0 0 0 1px var(--line), 0 1px 3px rgb(0 0 0 / 24%);
  --shadow-panel: 0 0 0 1px var(--line), 0 12px 32px rgb(0 0 0 / 36%);

  --bg: var(--canvas);
  --soft: var(--hover);
  --muted: var(--ink-2);
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --positive: var(--green);
  --warn: var(--orange);
  --danger: var(--red);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */
body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur) ease, color var(--dur) ease;
}

/* Numbers read better in a mono face with fixed-width digits. */
.metric strong,
.metric-strip strong,
.rail-meta b,
.nav-item__count,
.badge,
.data-table-wrap td,
time {
  font-variant-numeric: tabular-nums;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

::selection {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}

/* --------------------------------------------------------------------------
   Sidebar -- Graphite navigation, now hairline-separated rather than a slab.
   -------------------------------------------------------------------------- */
.sidebar {
  width: 226px;
  padding: 22px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  color: var(--ink);
}

.shell {
  margin-left: 226px;
}

.brand {
  padding: 4px 8px 0;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.brand small {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  margin-top: 2px;
}

/* The seal is a real logo slot: the fish mark on a soft brand chip. */
.seal {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 88%, black);
  color: var(--accent-ink);
  font-size: 0;             /* the glyph is replaced by the icon mask */
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgb(16 24 40 / 12%);
}

.seal::after {
  content: '';
  position: absolute;
  inset: 5px;
  background: currentColor;
  -webkit-mask: var(--logo-mask) center / contain no-repeat;
  mask: var(--logo-mask) center / contain no-repeat;
}

.nav-caption {
  margin: 20px 8px 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

nav::-webkit-scrollbar {
  display: none;
}

/* A 1px dashed rule replaces the old solid divider -- lighter, more precise. */
.nav-group {
  margin-top: 14px;
  padding: 14px 8px 6px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.nav-link {
  position: relative;
  gap: 10px;
  min-height: 36px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: background-color var(--dur-fast) ease,
              color var(--dur-fast) ease,
              transform var(--dur-fast) ease;
}

.nav-link .ui-icon {
  width: 16px;
  height: 16px;
  opacity: 0.75;
  transition: opacity var(--dur-fast) ease;
}

.nav-link:hover {
  background: var(--hover);
  color: var(--ink);
}

.nav-link:hover .ui-icon {
  opacity: 1;
}

.nav-link:active {
  transform: scale(0.985);
}

/* Active state: a tinted pill plus a left accent bar. Two cues, no fill. */
.nav-link.active {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: color-mix(in srgb, var(--accent) 82%, var(--ink));
  font-weight: 600;
}

.nav-link.active .ui-icon {
  opacity: 1;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 50%;
  width: 2px;
  height: 16px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
  transform: translateY(-50%);
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px dashed var(--line);
  color: var(--ink-3);
  font-size: 10.5px;
}

.sidebar-foot small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--ink-3);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 14%, transparent);
}

/* --------------------------------------------------------------------------
   Topbar
   -------------------------------------------------------------------------- */
.topbar {
  height: 56px;
  padding: 0 26px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.breadcrumb {
  font-size: 11.5px;
  color: var(--ink-3);
}

.breadcrumb span {
  color: var(--ink-3);
  opacity: 0.6;
}

.breadcrumb b {
  color: var(--ink);
  font-weight: 600;
}

.topbar-meta {
  gap: 10px;
  font-size: 11px;
  color: var(--ink-2);
}

/* Task-mode pill: a real button. The dot colour tells the mode at a glance
   (lite evergreen / pro blue / competition purple), echoing the app grid. */
#mode-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  transition: border-color var(--dur-fast) ease,
              background-color var(--dur-fast) ease,
              color var(--dur-fast) ease;
}

#mode-label::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

#mode-label[data-mode="pro"]::before         { background: #4a7db3; }
#mode-label[data-mode="competition"]::before { background: var(--purple); }

#mode-label:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
}

.text-button {
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 11.5px;
  background: transparent;
  transition: background-color var(--dur-fast) ease,
              color var(--dur-fast) ease;
}

.text-button:hover {
  background: var(--hover);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   Badges -- tinted pills, mono type, no heavy borders.
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--field);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.5;
  white-space: nowrap;
}

.badge.good {
  background: color-mix(in srgb, var(--green) 12%, transparent);
  color: color-mix(in srgb, var(--green) 88%, var(--ink));
}

.badge.warn {
  background: color-mix(in srgb, var(--orange) 14%, transparent);
  color: color-mix(in srgb, var(--orange) 88%, var(--ink));
}

.badge.bad {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  color: color-mix(in srgb, var(--red) 88%, var(--ink));
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 33px;
  padding: 7px 13px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-btn);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color var(--dur-fast) ease,
              color var(--dur-fast) ease,
              transform var(--dur-fast) ease,
              box-shadow var(--dur-fast) ease;
}

.button:hover {
  background: var(--hover);
}

.button:active {
  transform: scale(0.975);
}

.button.small {
  min-height: 28px;
  padding: 5px 10px;
  font-size: 11px;
}

.button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 70%, black),
              0 1px 2px rgb(16 24 40 / 10%);
}

.button.primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, black);
}

.button.danger {
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
  color: var(--red);
  box-shadow: var(--shadow-btn);
}

.button.danger:hover {
  background: color-mix(in srgb, var(--red) 16%, var(--surface));
}

.button.prompt {
  min-height: 26px;
  padding: 5px 11px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  color: var(--ink-2);
  box-shadow: none;
  font-size: 11px;
  font-weight: 500;
}

.button.prompt::before {
  content: "→";
  margin-right: 5px;
  color: var(--accent);
  font-weight: 600;
}

.button.prompt:hover {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
  color: var(--ink);
}

.button:disabled {
  opacity: 0.5;
  transform: none;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Page headings -- mono eyebrow, tight display type.
   -------------------------------------------------------------------------- */
main {
  padding: 30px 32px 44px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 4px;
}

.page-heading h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.18;
}

.page-heading p {
  margin: 7px 0 0;
  max-width: 62ch;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.6;
}

.page-index {
  display: block;
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: var(--field);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 12px;
}

.section-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.section-heading > small {
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* A quiet solid rule above each block keeps long pages legible without boxing
   everything. Applies only to the FIRST heading of a section, so stacked
   headings inside one card do not each draw a rule. */
section > .section-heading:first-child {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* Consecutive top-level blocks inside <main> get a consistent rhythm.
   页面如果把自己的内容包进一个容器（competition-workbench 等），它就不再是
   <main> 的直接子元素 —— 规则会静默失效 → 整页节奏塌掉。给容器补同一条。 */
main > section + section,
main > div + section,
main > section + div,
.competition-workbench > section + section,
.competition-workbench > div + section,
.competition-workbench > section + div {
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Composer -- the primary input surface.
   -------------------------------------------------------------------------- */
.composer {
  padding: 16px 16px 14px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.composer label {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 500;
}

.composer textarea {
  width: 100%;
  min-height: 118px;
  padding: 4px 2px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.75;
  resize: vertical;
}

.composer textarea::placeholder {
  color: var(--ink-3);
}

.composer textarea:focus {
  outline: none;
}

.composer-footer {
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.composer-footer select {
  max-width: 180px;
  min-height: 30px;
  padding: 5px 9px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink-2);
  font-size: 11px;
  box-shadow: var(--shadow-hairline);
}

.composer details {
  margin-top: 6px;
  padding-top: 2px;
  border-top: 0;
}

.composer details > summary {
  padding: 6px 0;
  color: var(--ink-3);
  font-size: 11px;
}

.budget-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0;
}

/* --------------------------------------------------------------------------
   Fields
   -------------------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font-size: 12.5px;
  box-shadow: var(--shadow-hairline);
  transition: box-shadow var(--dur-fast) ease,
              background-color var(--dur-fast) ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--accent),
              0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

.field textarea {
  min-height: 82px;
  line-height: 1.65;
  resize: vertical;
}

.field small,
.help {
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.55;
}

.form-section {
  margin-bottom: 18px;
  padding: 18px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.form-section h2,
.form-section h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search-input {
  flex: 1;
  padding: 8px 11px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font-size: 12.5px;
  box-shadow: var(--shadow-hairline);
}

.search-input:focus {
  outline: none;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--accent),
              0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}

/* --------------------------------------------------------------------------
   Notices + empty states
   -------------------------------------------------------------------------- */
.notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 0;
  border-left: 2px solid var(--line-strong);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--inset);
  color: var(--ink-2);
  font-size: 12px;
  line-height: 1.65;
}

.notice.error {
  border-left-color: var(--red);
  background: color-mix(in srgb, var(--red) 7%, var(--surface));
  color: color-mix(in srgb, var(--red) 80%, var(--ink));
}

.empty {
  padding: 30px 22px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: transparent;
  text-align: center;
}

.empty strong,
.empty h3 {
  display: block;
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}

.empty p {
  max-width: 46ch;
  margin: 0 auto 14px;
  color: var(--ink-3);
  font-size: 11.5px;
  line-height: 1.65;
}

.subtle {
  color: var(--ink-3);
  font-size: 12px;
}

.prose {
  margin-bottom: 14px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   Lists -- dashed separators, no card-in-card.
   -------------------------------------------------------------------------- */
.list {
  border-top: 1px dashed var(--line);
}

.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 2px;
  border-bottom: 1px dashed var(--line);
  transition: background-color var(--dur-fast) ease;
}

.list-row:hover {
  background: var(--hover);
}

.list-row strong {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
}

.list-row p {
  margin: 3px 0 0;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
}

/* --------------------------------------------------------------------------
   Tables -- canvas header, hairline rows, mono numerics.
   -------------------------------------------------------------------------- */
.data-table-wrap {
  overflow: auto;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.data-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table-wrap th {
  padding: 10px 14px;
  background: var(--canvas);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.data-table-wrap td {
  padding: 10px 14px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}

.data-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.data-table-wrap tbody tr:hover td {
  background: var(--hover);
}

/* --------------------------------------------------------------------------
   Metrics
   -------------------------------------------------------------------------- */
.metric-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  overflow: hidden;
  margin-bottom: 22px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-raised);
}

.metric {
  padding: 18px 20px;
  border-right: 1px solid var(--line);
}

.metric:last-child {
  border-right: 0;
}

.metric label {
  display: block;
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.05em;
}

.metric strong {
  display: block;
  margin: 8px 0 3px;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--ink);
}

.metric small {
  color: var(--ink-3);
  font-size: 10.5px;
}

/* 涨跌配色：中国股市惯例 —— 涨红跌绿 */
.metric small.up   { color: var(--red); }
.metric small.down { color: var(--green); }

/* --------------------------------------------------------------------------
   Chart
   The SVG is authored in app.js with a 640x230 viewBox and a 48px left gutter
   for the y-axis labels, so the stylesheet must not fight that geometry --
   only colour, stroke weight and type belong here.
   -------------------------------------------------------------------------- */
.chart {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 10px;
  overflow: visible;
}

.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.chart text {
  fill: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
}

.chart .series {
  fill: none;
  stroke: var(--chart-1);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart .series.secondary {
  stroke: var(--chart-2);
  stroke-dasharray: 4 3;
}

.chart-key {
  display: flex;
  gap: 16px;
  padding-top: 2px;
  color: var(--ink-2);
  font-size: 10.5px;
}

.chart-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-key span::before {
  content: '';
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 1px;
  background: var(--chart-1);
  flex-shrink: 0;
}

.chart-key span:nth-child(2)::before {
  background: repeating-linear-gradient(
    90deg, var(--chart-2) 0 4px, transparent 4px 7px);
}

/* --------------------------------------------------------------------------
   Evidence rail
   -------------------------------------------------------------------------- */
.evidence-rail {
  padding: 28px 20px;
  background: var(--inset);
  border-left: 1px solid var(--line);
}

.rail-section + .rail-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}

.rail-section h2 {
  margin: 0 0 10px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rail-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  font-size: 11px;
}

.rail-meta span {
  color: var(--ink-3);
}

.rail-meta b {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
}

.rail-note {
  margin: 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.7;
}

.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 0 0 14px 16px;
  border-left: 1px solid var(--line);
}

.timeline li:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline li::before {
  content: '';
  position: absolute;
  left: -3.5px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--inset);
}

.timeline strong {
  display: block;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
}

.timeline time,
.timeline span {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

/* --------------------------------------------------------------------------
   Details / code / results
   -------------------------------------------------------------------------- */
details {
  border-radius: var(--radius-sm);
}

details > summary {
  padding: 8px 0;
  border-radius: var(--radius-sm);
  color: var(--ink-3);
  font-size: 11.5px;
  cursor: pointer;
  transition: color var(--dur-fast) ease;
}

details > summary:hover {
  color: var(--ink);
}

details[open] > summary {
  margin-bottom: 6px;
}

pre {
  margin: 0 0 12px;
  padding: 14px;
  overflow: auto;
  border-radius: var(--radius-sm);
  background: var(--inset);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.65;
  tab-size: 2;
}

/* Inline code must never widen its container: long URLs (webhook endpoints)
   previously pushed the whole page past the viewport on narrow screens.
   Break anywhere rather than overflow, and keep the same inset surface as pre. */
code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
  word-break: break-word;
}

code:not(pre code) {
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  background: var(--inset);
}

.result {
  margin-top: 18px;
  padding: 18px;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.result .section-heading:first-child {
  padding-top: 0;
  border-top: 0;
}

.inline-result {
  margin-top: 20px;
}

/* --------------------------------------------------------------------------
   Board roles
   -------------------------------------------------------------------------- */
.board-role {
  display: grid;
  grid-template-columns: minmax(120px, 168px) minmax(0, 1fr);
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--line);
}

.board-role h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.board-role small {
  display: block;
  margin-top: 4px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.board-role p {
  margin: 0;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.75;
}

/* --------------------------------------------------------------------------
   Drop zone
   -------------------------------------------------------------------------- */
.drop-zone {
  padding: 32px 24px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--inset);
  text-align: center;
  transition: background-color var(--dur) ease, border-color var(--dur) ease;
}

.drop-zone h3 {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 600;
}

.drop-zone p {
  margin: 0 0 14px;
  color: var(--ink-3);
  font-size: 11.5px;
}

.drop-zone.drag {
  border-color: var(--accent);
  border-style: solid;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

/* --------------------------------------------------------------------------
   Progress line + toast + footer
   -------------------------------------------------------------------------- */
.progress-line {
  position: relative;
  height: 2px;
  margin: 12px 0 18px;
  overflow: hidden;
  border-radius: 1px;
  background: var(--line);
}

.progress-line::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 34%;
  border-radius: 1px;
  background: var(--accent);
  animation: xiaoyu-sweep 1.4s var(--ease) infinite;
}

@keyframes xiaoyu-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(300%); }
}

.toast {
  position: fixed;
  z-index: 80;
  bottom: 22px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--canvas);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-overlay);
  transform: translateX(-50%);
  animation: xiaoyu-toast-in var(--dur-slow) var(--ease);
}

@keyframes xiaoyu-toast-in {
  from { opacity: 0; transform: translate(-50%, 8px) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 26px;
  border-top: 1px dashed var(--line);
  background: var(--surface);
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

/* --------------------------------------------------------------------------
   Home dashboard
   -------------------------------------------------------------------------- */
body[data-page=home] main {
  padding: 26px 32px 36px;
}

.desk-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 28px;
  padding-bottom: 4px;
}

.desk-date {
  margin-bottom: 12px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.desk-heading h1 {
  margin: 0 0 8px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.desk-heading p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
}

.desk-main,
.desk-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(270px, 1fr);
  gap: 22px;
  align-items: start;
}

.desk-bottom {
  margin-top: 22px;
}

.station-title {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 13px;
}

.station-title h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.station-title p {
  margin: 3px 0 0;
  color: var(--ink-3);
  font-size: 11.5px;
}

.station-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
  flex-shrink: 0;
}

.station-icon .ui-icon {
  width: 17px;
  height: 17px;
}

.prompt-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

/* Shortcuts -- four hairline tiles instead of a framed strip. */
.shortcut-section {
  margin-top: 24px;
}

.shortcut-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  border: 0;
}

.shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 18px 12px 15px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-hairline);
  text-align: center;
  transition: background-color var(--dur-fast) ease,
              box-shadow var(--dur) ease,
              transform var(--dur-fast) ease;
}

.shortcut:hover {
  background: var(--surface);
  box-shadow: var(--shadow-raised);
  transform: translateY(-1px);
}

.shortcut:active {
  transform: scale(0.99);
}

.shortcut > span:not(.shortcut-icon) {
  min-width: 0;
}

.shortcut-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
  flex-shrink: 0;
}

.shortcut-icon .ui-icon {
  width: 21px;
  height: 21px;
}

/* App-grid icons: one hue per capability, tuned to the same saturation and
   weight so the row reads as a designed set (like the reference POS grids),
   not as random decoration. */
.shortcut:nth-child(1) .shortcut-icon {
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
}

.shortcut:nth-child(2) .shortcut-icon {
  background: color-mix(in srgb, var(--blue-token, #3d628f) 13%, transparent);
  color: #3d628f;
}

.shortcut:nth-child(3) .shortcut-icon {
  background: color-mix(in srgb, var(--orange) 13%, transparent);
  color: var(--orange);
}

.shortcut:nth-child(4) .shortcut-icon {
  background: color-mix(in srgb, var(--purple) 12%, transparent);
  color: var(--purple);
}

.shortcut strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut small {
  display: block;
  margin-top: -4px;
  color: var(--ink-3);
  font-size: 10.5px;
  line-height: 1.5;
}

.shortcut > .ui-icon {
  width: 13px;
  height: 13px;
  margin-left: auto;
  color: var(--ink-3);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity var(--dur) ease, transform var(--dur) var(--ease);
}

.shortcut:hover > .ui-icon {
  opacity: 1;
  transform: translateX(0);
}

.recent-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 116px;
  border-top: 1px dashed var(--line);
  border-bottom: 1px dashed var(--line);
}

.recent-empty > .ui-icon {
  width: 26px;
  height: 26px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.recent-empty > div {
  flex: 1;
}

.recent-empty h3 {
  margin: 0 0 5px;
  font-size: 12.5px;
  font-weight: 600;
}

.recent-empty p {
  margin: 0;
  color: var(--ink-3);
  font-size: 11px;
  line-height: 1.7;
}

.setup-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 2px;
  border-bottom: 1px dashed var(--line);
  transition: background-color var(--dur-fast) ease;
}

.setup-row:hover {
  background: var(--hover);
}

.setup-row > .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--ink-3);
  flex-shrink: 0;
}

.setup-row > span:not(.badge) {
  flex: 1;
  min-width: 0;
}

.setup-row strong {
  display: block;
  font-size: 12px;
  font-weight: 500;
}

.setup-row small {
  display: block;
  margin-top: 3px;
  color: var(--ink-3);
  font-size: 10.5px;
}

.demo-link {
  margin-top: 12px;
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11px;
  text-align: left;
  transition: opacity var(--dur-fast) ease;
}

.demo-link:hover {
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Avatar stage
   -------------------------------------------------------------------------- */
.avatar-stage {
  padding: 26px 22px;
  border-radius: var(--radius-lg);
  background: var(--inset);
  text-align: center;
  box-shadow: var(--shadow-hairline);
}

.avatar-letter {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 24px;
  font-weight: 600;
}

.avatar-stage h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}

.avatar-stage p {
  max-width: 46ch;
  margin: 0 auto;
  color: var(--ink-2);
  font-size: 11.5px;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 1500px) {
  main,
  body[data-page=home] main {
    padding-left: 42px;
    padding-right: 42px;
  }

  .desk-main,
  .desk-bottom {
    gap: 28px;
  }
}

@media (max-width: 1190px) {
  .sidebar {
    width: 196px;
  }

  .shell {
    margin-left: 196px;
  }

  .desk-main,
  .desk-bottom {
    grid-template-columns: minmax(0, 1.4fr) minmax(250px, 1fr);
    gap: 18px;
  }

  .shortcut-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace-layout {
    grid-template-columns: minmax(0, 1fr) 210px;
  }

  .budget-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  main,
  body[data-page=home] main {
    padding: 24px 22px 32px;
  }

  .desk-main,
  .desk-bottom,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .board-role {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
}

@media (max-width: 680px) {
  /* The sidebar collapses into a horizontal, swipeable nav strip. These rules
     must live here as well as in styles.css: media queries do not increase
     specificity, so the un-guarded `.sidebar { width: 226px }` above would
     otherwise win over styles.css's mobile block. */
  .sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 12px 14px 6px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .shell {
    margin-left: 0;
  }

  .brand {
    font-size: 16px;
    padding-left: 2px;
  }

  .seal {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .brand small {
    font-size: 8px;
    margin-top: 1px;
  }

  .nav-caption,
  .nav-group,
  .sidebar-foot {
    display: none;
  }

  nav {
    flex-direction: row;
    flex: 0 0 auto;
    gap: 3px;
    margin-top: 10px;
    padding-bottom: 4px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-link {
    min-height: 36px;
    padding: 7px 11px;
    font-size: 12px;
    gap: 6px;
    white-space: nowrap;
  }

  .nav-link .ui-icon {
    width: 15px;
    height: 15px;
  }

  .nav-link.active::before {
    display: none;
  }

  .nav-link.active {
    box-shadow: none;
  }

  .topbar {
    height: 50px;
    padding: 0 16px;
  }

  main,
  body[data-page=home] main {
    padding: 22px 16px 30px;
  }

  /* Nothing may push the page wider than the viewport on a phone. */
  .shell,
  .workspace-layout,
  main,
  .desk-main,
  .desk-bottom,
  .composer,
  .task-station {
    min-width: 0;
    max-width: 100%;
  }

  .composer-footer {
    flex-wrap: wrap;
  }

  .composer-footer .actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .composer-footer select {
    max-width: 100%;
  }

  .chart {
    overflow: hidden;
  }
}

@media (max-width: 600px) {
  /* Tables scroll horizontally rather than squashing columns to nothing. */
  .data-table-wrap table {
    min-width: 520px;
  }

  .data-table-wrap th {
    white-space: nowrap;
  }

  .page-heading,
  .desk-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-heading h1 {
    font-size: 20px;
  }

  .desk-heading h1 {
    font-size: 19px;
  }

  .shortcut-strip,
  .budget-fields,
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    border-right: 1px solid var(--line);
  }

  .metric:nth-child(2n) {
    border-right: 0;
  }

  /* Touch targets: nothing below 40px on a phone. */
  .button,
  .button.small,
  .text-button,
  .demo-link,
  .composer-footer select,
  .nav-link {
    min-height: 40px;
  }

  .button.prompt {
    min-height: 32px;
  }

  .toast {
    width: max-content;
    max-width: calc(100% - 24px);
  }

  .list-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Business band -- full-width revenue board, POS-style (营业看板).
   Big figure left, three fact columns right, live-status strip below.
   Ink-blue hero: brand green stays on small controls, colour lives in
   the stat row instead of flooding the page.
   -------------------------------------------------------------------------- */
.business-band {
  display: flex;
  flex-direction: column;
  margin-bottom: 26px;
  padding: 22px 26px 16px;
  border-radius: var(--radius-lg);
  /* Ink-blue hero: keeps the "flagship dark card" weight without flooding
     the page in brand green -- the stats row carries the colour instead. */
  background: linear-gradient(160deg, #2c3e4e 0%, #1d2c3a 55%, #15202b 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 8%),
              0 1px 2px rgb(16 24 40 / 10%),
              0 12px 32px -12px rgb(16 24 40 / 45%);
  color: #f2f6fa;
}

.band-head {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgb(255 255 255 / 68%);
  font-size: 11.5px;
  letter-spacing: 0.05em;
}

.band-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 550;
}

.band-title .ui-icon {
  width: 15px;
  height: 15px;
  opacity: 0.85;
}

.band-shop {
  overflow: hidden;
  max-width: 42ch;
  color: rgb(255 255 255 / 52%);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.band-head > a {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 12%);
  color: inherit;
  transition: background-color var(--dur-fast) ease;
}

.band-head > a:hover {
  background: rgb(255 255 255 / 20%);
}

.band-head > a .ui-icon {
  width: 15px;
  height: 15px;
}

.band-main {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 30px;
  align-items: end;
  padding: 18px 0 18px;
}

.band-figure small {
  display: block;
  color: rgb(255 255 255 / 55%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.band-figure strong {
  display: block;
  margin: 9px 0 12px;
  font-family: var(--font-mono);
  font-size: 52px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.band-trend {
  display: flex;
  gap: 18px;
  color: rgb(255 255 255 / 62%);
  font-size: 11.5px;
}

.band-trend b {
  font-family: var(--font-mono);
  font-weight: 650;
}

/* On the dark card: rising red / falling green (CN convention), tuned
   brighter than the light-theme pair so they keep contrast on evergreen. */
.band-trend b.up   { color: #ffa39a; }
.band-trend b.down { color: #8ce6b1; }

.band-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.band-stats > div {
  padding-left: 22px;
  border-left: 1px solid rgb(255 255 255 / 15%);
}

.band-stats small {
  display: block;
  color: rgb(255 255 255 / 58%);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.band-stats b {
  display: block;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* Multi-hue stats on the ink card: gross profit warm amber, orders pale
   cyan, ticket pale violet -- so the hero carries colour, not green. */
.band-stats > div:nth-child(1) b { color: #ffd58a; }
.band-stats > div:nth-child(2) b { color: #9fd4e8; }
.band-stats > div:nth-child(3) b { color: #cbb8f5; }

.band-strip {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-top: 12px;
  border-top: 1px solid rgb(255 255 255 / 14%);
  color: rgb(255 255 255 / 55%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
}

.band-src {
  overflow: hidden;
  margin-left: auto;
  max-width: 52ch;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.band-empty {
  padding: 14px 0 10px;
}

.band-empty strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.band-empty span {
  display: block;
  margin-top: 6px;
  max-width: 52ch;
  color: rgb(255 255 255 / 66%);
  font-size: 11.5px;
  line-height: 1.7;
}

.band-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  background: rgb(255 255 255 / 14%);
  color: inherit;
  font-size: 12px;
  font-weight: 550;
  transition: background-color var(--dur-fast) ease;
}

.band-cta:hover {
  background: rgb(255 255 255 / 22%);
}

.band-cta .ui-icon {
  width: 14px;
  height: 14px;
}

/* Dark theme: the ink card goes a touch deeper to sit on dark surfaces. */
:root.dark .business-band,
.dark .business-band {
  background: linear-gradient(160deg, #263644 0%, #1a2530 55%, #141d26 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 5%),
              0 1px 2px rgb(0 0 0 / 40%),
              0 12px 32px -12px rgb(0 0 0 / 55%);
}

/* Dark theme: brighter blue token for the app-grid icon. */
:root.dark .shortcut:nth-child(2) .shortcut-icon,
.dark .shortcut:nth-child(2) .shortcut-icon {
  background: color-mix(in srgb, #7ba3cf 16%, transparent);
  color: #7ba3cf;
}

/* Mobile: band stacks, stats keep three columns at reduced size. */
@media (max-width: 680px) {
  .business-band {
    padding: 18px 16px 14px;
  }

  .band-main {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 14px 0 14px;
  }

  .band-figure strong {
    font-size: 40px;
  }

  .band-stats > div {
    padding-left: 14px;
  }

  .band-stats b {
    font-size: 16px;
  }

  .band-strip {
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .band-src {
    display: none;
  }

  .shortcut-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .week-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

/* Desk columns: the first block in each column sits flush with the top,
   no extra rule or padding above it. */
.desk-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

/* Weekly read-out card: quiet white card, one warm highlight (the best day)
   so the right column carries colour beyond the evergreen band. */
.week-card {
  padding: 4px 0 0;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.week-grid > div {
  min-width: 0;
}

.week-grid small {
  display: block;
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.week-grid strong {
  display: block;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.week-best {
  color: var(--orange) !important;
}

.week-sub {
  display: block;
  margin-top: 6px;
  color: var(--ink-3);
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.week-delta {
  display: block;
  margin-top: 6px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 650;
  white-space: nowrap;
}

.week-delta.up   { color: var(--red); }
.week-delta.down { color: var(--green); }

/* Prompt chips: one tinted family each, so the composer area echoes the
   four-colour app grid without turning into confetti. */
.prompt-strip .button.prompt:nth-child(1) {
  color: color-mix(in srgb, var(--accent) 80%, var(--ink));
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.prompt-strip .button.prompt:nth-child(2) {
  color: #4a7db3;
  background: color-mix(in srgb, #4a7db3 10%, transparent);
}

.prompt-strip .button.prompt:nth-child(3) {
  color: color-mix(in srgb, var(--purple) 82%, var(--ink));
  background: color-mix(in srgb, var(--purple) 10%, transparent);
}

.prompt-strip .button.prompt:hover {
  filter: brightness(0.96);
}

.prompt-strip .button.prompt::before {
  color: inherit;
}

.desk-col > section:first-child > .section-heading:first-child {
  padding-top: 0;
  border-top: 0;
}

.desk-main {
  align-items: start;
}
