/*
 * Shared design system for the Meesho intelligence screens.
 *
 * One stylesheet, one set of tokens. Before this, five pages each redeclared the same ~100 lines
 * of variables and component rules, which is why they had already started to drift apart.
 *
 * Deliberate choices:
 *  - A single dark theme. This is a tool people sit in for a whole capture session, next to a
 *    Meesho tab; one well-tuned dark palette beats two half-tuned ones.
 *  - One accent, orchid — a nod to the marketplace — and it is the same colour the charts draw
 *    with, so the eye only learns one "important" colour. Green, red and amber are kept back for
 *    status — up, down, needs attention — and never used for decoration.
 *  - Numbers use tabular figures throughout, so prices and rating counts line up in columns.
 *    Monospace is kept for code, handles and raw payloads only.
 */

@import url("https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&display=swap");

:root {
  color-scheme: dark;

  /* Surfaces, darkest to lightest */
  --bg: #13151d;
  --panel: #1a1d28;
  --panel-2: #222634;
  --panel-3: #292e3f;
  --border-soft: #242837;
  --border: #2c3144;
  --border-strong: #3a4058;

  /* Ink */
  --text: #e7e9f0;
  --text-2: #b9bfd1;
  --muted: #8a91a7;
  --faint: #5d6479;

  /* One accent — the same hue the charts use. --series is the name the inline SVGs
     reference, kept as an alias so chart marks and interface accents cannot drift apart. */
  --accent: #c77ddb;
  --accent-strong: #d896e9;
  --series: #c77ddb;
  --series-soft: rgba(199, 125, 219, .24);
  --accent-ink: #1b1020;
  --accent-soft: rgba(199, 125, 219, .12);
  --accent-line: rgba(199, 125, 219, .34);

  /* Status, reserved */
  --up: #62c9a0;
  --up-soft: rgba(98, 201, 160, .12);
  --down: #eb8f8f;
  --down-soft: rgba(224, 122, 122, .12);
  --warn: #e6b05c;
  --warn-soft: rgba(230, 176, 92, .12);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .4), 0 10px 22px -10px rgba(0, 0, 0, .6);
  --shadow-3: 0 16px 40px rgba(0, 0, 0, .45);

  /* Radii vary by nesting: softer outside, tighter within */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 14px;

  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;

  --t: 150ms cubic-bezier(.2, .6, .3, 1);

  --z-sticky: 20;
  --z-overlay: 40;
  --z-tip: 60;
}

* { box-sizing: border-box; }

/* Components set their own display; the hidden attribute must still win */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* Numbers line up, everywhere */
.num, td.num, th.num, .value, .bar-value, .pct, .count b {
  font-variant-numeric: tabular-nums;
}

kbd {
  font: 600 10.5px/1 var(--sans);
  padding: 3px 5px;
  border-radius: var(--r-xs);
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, .08);
}

.skip {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: var(--z-tip);
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: var(--r-sm);
  /* Clipped rather than pushed off-screen, so it never adds to the page's scroll width */
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus { clip-path: none; box-shadow: var(--shadow-3); }

/* ---------- shell ---------- */

header.app {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 58px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-soft);
}
header.app h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
}
header.app .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
header.app .brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--accent), #8e5bd0);
  color: var(--accent-ink);
}
header.app .brand-name { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }

header.app nav { display: flex; gap: 2px; min-width: 0; }
header.app nav a {
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t), background var(--t);
}
header.app nav a:hover { color: var(--text); background: var(--panel); }
header.app nav a.on { color: var(--text); background: var(--panel-2); }

header.app .right {
  margin-left: auto;
  color: var(--muted);
  font-size: 12.5px;
  text-align: right;
}
header.app .right b { color: var(--text); font-weight: 600; }
header.app .right.stale b { color: var(--warn); }
/* The menu sits at the far right; when a page has no .right of its own, it takes the push */
header.app .menu-wrap { margin-left: 4px; }
header.app .menu-wrap.push { margin-left: auto; }

/* ---------- popovers (header menu, week summary) ---------- */

.pop-wrap { position: relative; }
.popover {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: var(--z-overlay);
  min-width: 240px;
  padding: 8px;
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity 140ms, transform 140ms;
}
.popover.open { opacity: 1; transform: none; pointer-events: auto; }
.pop-title { font-size: 12px; color: var(--faint); padding: 6px 8px 8px; }
.pop-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 8px; font-size: 13px; color: var(--muted); }
.pop-row b { color: var(--text); font-weight: 600; }
.pop-row b.warn { color: var(--warn); }
.menu-status { display: flex; align-items: center; gap: 8px; padding: 8px 10px 10px; font-size: 12.5px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  border: 0; background: transparent; border-radius: var(--r-sm);
  cursor: pointer; font-size: 13px; color: var(--text); text-decoration: none;
}
.menu-item:hover { background: var(--panel-3); text-decoration: none; }

.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: none; }
.status-dot.ok { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.status-dot.bad { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }

.menu-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, #3a3f58, #2a2e40);
  color: var(--text-2);
  cursor: pointer;
}
.menu-btn:hover, .menu-btn[aria-expanded="true"] { border-color: var(--accent); }
.menu-btn .status-dot {
  position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px;
  border: 2px solid var(--bg); box-shadow: none;
}

main.app {
  position: relative;
  z-index: 1;
  padding: 28px 32px 56px;
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
main.app.narrow { max-width: 1020px; }
/* Slots that are empty until something needs saying must not hold open a gap */
main.app > :empty { display: none; }

/* ---------- drawer layout ----------
 * Every page is the same two panes under the app bar: a drawer on the left for search, filters
 * and views, and the page itself on the right. Both scroll on their own. */

.shell { display: grid; grid-template-rows: auto 1fr; grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; }
.layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); min-height: 0; }
.page { min-width: 0; overflow-y: auto; padding: 28px 32px 48px; }
.page > * + * { margin-top: 16px; }
.page > :empty { display: none; }

.sidebar { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border-soft); background: var(--bg); }
.side-filters { padding: 16px; display: grid; gap: 10px; border-bottom: 1px solid var(--border-soft); }
.side-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--faint); font-weight: 500; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input[type="search"] { width: 100%; min-width: 0; padding: 9px 40px 9px 36px; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.side-filters .seg, .side-filters .tabs { display: flex; }

.side-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.side-list ul:not(.group-body) { list-style: none; margin: 0; padding: 0; }
.side-label { font-size: 11.5px; color: var(--faint); padding: 12px 12px 6px; font-weight: 500; }
.group { margin-bottom: 4px; }
.group-head {
  width: 100%; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px; border: 0; background: transparent; border-radius: var(--r-md); cursor: pointer; text-align: left;
}
.group-head:hover { background: var(--panel); }
.group-head .chev { color: var(--faint); transition: transform .18s; }
.group[data-open="true"] > .group-head .chev { transform: rotate(90deg); }
.group-title { display: block; font-weight: 600; font-size: 13.5px; }
.group-sub { display: flex; align-items: center; gap: 8px; margin-top: 5px; min-width: 0; }
.group-sub .pbar { max-width: 110px; }
.group-sub small { font-size: 11.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-sub small.on { color: var(--accent-strong); }
.group-count { font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--border-soft); padding: 2px 8px; border-radius: 99px; }
.group[data-open="true"] > .group-head .group-count { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.group-body { list-style: none; padding: 2px 0 8px 12px; margin: 0 0 0 16px; border-left: 1px solid var(--border-soft); display: none; }
.group[data-open="true"] > .group-body { display: block; }
.tier-label { font-size: 11.5px; color: var(--faint); padding: 8px 12px 4px; font-weight: 500; }

/* One row in the drawer: a view, a filter value, a suggested question */
.side-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid transparent; border-radius: var(--r-md);
  background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 500;
  text-align: left; text-decoration: none; cursor: pointer;
  transition: background var(--t), color var(--t);
}
.side-item:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.side-item[aria-selected="true"], .side-item[aria-current="page"], .side-item.on {
  background: var(--panel-2); border-color: var(--border); color: var(--text); font-weight: 600;
}
.side-item:disabled { opacity: .45; cursor: default; }
.side-item > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item small { font-size: 12px; color: var(--faint); font-weight: 500; flex: none; }
.side-item.stacked { display: grid; gap: 2px; }
.side-item.stacked > span:first-child { white-space: normal; }

.sidebar-foot {
  padding: 11px 16px; border-top: 1px solid var(--border-soft);
  font-size: 12px; color: var(--faint); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
}

/* Page heading: title, a line of context, and the page's actions on the right */
.head { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 24px; }
.head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.head-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.head-meta.line { display: block; }
.head-meta b { color: var(--text); font-weight: 600; }
.head-meta.stale b { color: var(--warn); }
.head-meta a { display: inline-flex; align-items: center; gap: 5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 16px 20px 0; }
.panel-head h2 { margin: 0; font-size: 14px; font-weight: 600; }
.panel-head p { margin: 0; font-size: 12.5px; color: var(--muted); }
.count { font-size: 12px; color: var(--muted); padding: 2px 8px; border-radius: 99px; background: var(--panel-2); margin-left: 8px; font-weight: 500; }

@media (max-width: 860px) {
  .shell { height: auto; min-height: 100vh; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .page { padding: 20px 16px 40px; overflow: visible; }
}

/* ---------- controls ---------- */

.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

select, input[type="search"], input[type="text"], input[type="url"], textarea {
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--t);
}
select {
  appearance: none;
  padding-right: 30px;
  cursor: pointer;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%238a91a7' stroke-width='1.6'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 11px center;
}
select:hover, input:hover, textarea:hover { border-color: var(--border-strong); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input[type="search"] { min-width: 210px; }
::placeholder { color: var(--faint); opacity: 1; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: var(--r-md);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: border-color var(--t), background var(--t), transform var(--t);
}
.btn:hover:not(:disabled) { border-color: var(--border-strong); background: var(--panel-2); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn.primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.primary kbd { background: rgba(0, 0, 0, .15); color: var(--accent-ink); border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); background: var(--panel); border-color: transparent; }
.btn.small { padding: 3px 9px; font-size: 12px; border-radius: var(--r-sm); }

.link-btn { border: 0; background: none; color: var(--accent-strong); font-size: 12px; font-weight: 500; cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* Segmented control. .tabs is the older name, kept so every page gets the same look. */
.tabs, .seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--panel);
}
.tabs button, .seg button {
  flex: 1;
  border: 0;
  background: none;
  padding: 6px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: color var(--t), background var(--t);
}
.tabs button:hover, .seg button:hover { color: var(--text); }
.tabs button.on, .seg button[aria-checked="true"] { background: var(--panel-2); color: var(--text); }

/* ---------- cards ---------- */

.card, .panel {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
}
.card > h1, .card > h2 {
  margin: 0;
  padding: 16px 20px 0;
  font-size: 14px;
  font-weight: 600;
}
.card > .hint {
  padding: 3px 20px 0;
  color: var(--muted);
  font-size: 12.5px;
  max-width: 78ch;
  text-wrap: pretty;
}
.card > .body { padding: 14px 20px 18px; }

.row-2 { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; }
@media (max-width: 1000px) { .row-2 { grid-template-columns: 1fr; } }

/* ---------- stat tiles ---------- */

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(176px, 1fr)); gap: 12px; }
.kpi {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 14px 16px 15px;
  transition: border-color var(--t);
}
.kpi:hover { border-color: var(--border); }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .value {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
}
.kpi .value.text { font-size: 20px; font-weight: 600; }
.kpi .value.accent { color: var(--up); }
.kpi .value.warn { color: var(--warn); }
.kpi .value.bad { color: var(--down); }
.kpi .foot { margin-top: 4px; color: var(--faint); font-size: 12px; }
.kpi .foot.stale { color: var(--warn); }

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; border-radius: var(--r-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel);
  color: var(--faint);
  font-weight: 500;
  font-size: 12px;
  white-space: nowrap;
}
td.num, th.num { text-align: right; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--t); }
tbody tr:hover td { background: rgba(255, 255, 255, .02); }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--panel-2); }
.rank { color: var(--faint); width: 32px; font-size: 12px; font-variant-numeric: tabular-nums; }
td.barcol { width: 40%; min-width: 120px; }

.sub { color: var(--muted); font-size: 12px; }
.pname { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 400px; }
.mono { font-family: var(--mono); font-size: 11.8px; color: var(--muted); }
.thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-2);
  display: block;
  flex: none;
}
.up { color: var(--up); font-weight: 600; }
.down { color: var(--down); font-weight: 600; }

/* ---------- bars ---------- */

.bars { display: flex; flex-direction: column; gap: 2px; }
.bar-row {
  display: grid;
  grid-template-columns: minmax(96px, 210px) 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 5px 8px;
  margin: 0 -8px;
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.bar-row.click { cursor: pointer; }
.bar-row:hover { background: var(--panel-2); }
.bar-row.click:hover .bar-label { color: var(--accent-strong); }
.bar-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--border-soft); border-radius: 99px; height: 6px; overflow: hidden; }
.bar-fill {
  height: 6px;
  background: var(--accent);
  border-radius: inherit;
  min-width: 2px;
  transition: width 420ms cubic-bezier(.2, .7, .3, 1);
}
.bar-value {
  font-size: 12px;
  color: var(--muted);
  min-width: 64px;
  text-align: right;
  transition: color var(--t);
}
.bar-row:hover .bar-value { color: var(--text); }

/* Thin progress bar — seller coverage, category completion */
.pbar { flex: 1; height: 4px; border-radius: 99px; background: var(--border-soft); overflow: hidden; }
.pbar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.pbar.full span { background: var(--up); }

/* ---------- badges ---------- */

.tag, .pill, .chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--border-soft);
  color: var(--muted);
  white-space: nowrap;
}
.chip { font-size: 13px; padding: 3px 9px; background: var(--panel); border: 1px solid var(--border-soft); }
.tag.ok, .pill { background: var(--up-soft); color: var(--up); }
.tag.bad { background: var(--down-soft); color: var(--down); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.accent { background: var(--accent-soft); color: var(--accent-strong); }
.pill { margin-left: 5px; vertical-align: 1px; }

/* ---------- notices ---------- */

.warn-strip, .scope {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
}
.warn-strip {
  background: var(--warn-soft);
  color: var(--warn);
}
.warn-strip b { color: var(--text); }
.warn-strip .sub { color: var(--text-2); }
code {
  font-family: var(--mono);
  font-size: 11.8px;
  background: rgba(255, 255, 255, .06);
  padding: 1px 5px;
  border-radius: var(--r-xs);
  color: var(--text-2);
}
.scope {
  align-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.scope b { font-size: 13.5px; font-weight: 600; color: var(--text); }

.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  text-wrap: pretty;
}
.empty b { color: var(--text); }
.err { color: var(--down); font-size: 13px; }

/* ---------- tooltip & toast ---------- */

.tip {
  position: fixed;
  z-index: var(--z-tip);
  pointer-events: none;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  font-size: 12px;
  box-shadow: var(--shadow-3);
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.tip.on { opacity: 1; transform: translateY(0); }
.tip b { font-variant-numeric: tabular-nums; }

.toast {
  position: fixed; bottom: 18px; left: 50%; z-index: var(--z-tip);
  transform: translate(-50%, 6px);
  max-width: 90vw; padding: 9px 14px;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-3); font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity 180ms, transform 180ms;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- loading ---------- */

.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-3) 37%, var(--panel-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* Cascade in rather than appearing all at once */
.stagger > * { animation: rise 320ms cubic-bezier(.2, .7, .3, 1) backwards; }
.stagger > *:nth-child(2) { animation-delay: 40ms; }
.stagger > *:nth-child(3) { animation-delay: 80ms; }
.stagger > *:nth-child(4) { animation-delay: 120ms; }
.stagger > *:nth-child(5) { animation-delay: 160ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 1100px) {
  header.app { gap: 16px; }
  header.app nav a { padding: 7px 10px; }
}

@media (max-width: 860px) {
  header.app { flex-wrap: wrap; padding: 10px 14px; gap: 10px 12px; }
  header.app .brand-name { display: none; }
  header.app nav { flex: 1; overflow-x: auto; scrollbar-width: none; }
  header.app .menu-wrap { order: 2; margin-left: 0; }
  header.app .right { order: 3; width: 100%; margin-left: 0; text-align: left; }
  main.app { padding: 18px 16px 40px; }
  input[type="search"] { min-width: 0; flex: 1; }
  .hide-sm { display: none; }
}
