/* ============================================================
   STREAM EMPIRE — shared design system
   ONE stylesheet. Every vertical in the network renders from it.
   packages/design-tokens + packages/ui, expressed as plain CSS
   for the mockup.
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* surface ramp (dark-first) */
  --se-bg:        #0a0d0f;
  --se-bg-2:      #0e1316;
  --se-surface:   #141a1e;
  --se-surface-2: #1b2328;
  --se-line:      #263138;
  --se-line-soft: #1a2227;

  /* ink */
  --se-ink:       #e9e6df;
  --se-ink-dim:   #9aa7ae;
  --se-ink-faint: #64737c;

  /* accents — gold = collectible, mint = live, coral = urgent */
  --se-gold:      #ffc857;
  --se-gold-deep: #f5a623;
  --se-mint:      #35e0a1;
  --se-coral:     #ff5f56;
  --se-violet:    #9d7bff;

  /* rarity scale — shared across drops, badges, emotes */
  --se-r-common:    #8b9aa3;
  --se-r-uncommon:  #35e0a1;
  --se-r-rare:      #48a9ff;
  --se-r-epic:      #9d7bff;
  --se-r-legendary: #ffc857;

  /* type */
  --se-display: "Bricolage Grotesque", "Archivo", sans-serif;
  --se-body:    "Instrument Sans", system-ui, sans-serif;
  --se-mono:    "JetBrains Mono", ui-monospace, monospace;

  /* space + form */
  --se-r-sm: 4px;
  --se-r-md: 8px;
  --se-r-lg: 14px;
  --se-maxw: 1220px;
  --se-glow: 0 0 0 1px rgba(255, 200, 87, .28), 0 8px 34px -12px rgba(255, 200, 87, .34);
}

[data-theme="light"] {
  --se-bg:        #f4f1ea;
  --se-bg-2:      #efebe2;
  --se-surface:   #fffdf8;
  --se-surface-2: #f6f2e9;
  --se-line:      #ddd5c5;
  --se-line-soft: #e7e0d2;
  --se-ink:       #16191c;
  --se-ink-dim:   #55606a;
  --se-ink-faint: #8b959d;
  --se-gold-deep: #b97e05;
  --se-glow: 0 0 0 1px rgba(185, 126, 5, .3), 0 8px 30px -14px rgba(185, 126, 5, .38);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --se-bg:        #f4f1ea;
    --se-bg-2:      #efebe2;
    --se-surface:   #fffdf8;
    --se-surface-2: #f6f2e9;
    --se-line:      #ddd5c5;
    --se-line-soft: #e7e0d2;
    --se-ink:       #16191c;
    --se-ink-dim:   #55606a;
    --se-ink-faint: #8b959d;
    --se-gold-deep: #b97e05;
  }
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--se-bg);
  color: var(--se-ink);
  font-family: var(--se-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* atmosphere: vignette + faint grain */
  background-image:
    radial-gradient(1200px 620px at 78% -8%, rgba(255,200,87,.07), transparent 60%),
    radial-gradient(900px 520px at 8% 4%, rgba(53,224,161,.05), transparent 55%);
  background-attachment: fixed;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .035;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--se-display);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.08;
  margin: 0;
}

.se-wrap { max-width: var(--se-maxw); margin: 0 auto; padding: 0 22px; }
.se-mono { font-family: var(--se-mono); }

/* ---------- 3. NETWORK BAR — the "empire" spine ---------- */
.se-netbar {
  background: var(--se-bg-2);
  border-bottom: 1px solid var(--se-line-soft);
  font-family: var(--se-mono);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(8px);
}
.se-netbar-in {
  max-width: var(--se-maxw);
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  overflow-x: auto;
  scrollbar-width: none;
}
.se-netbar-in::-webkit-scrollbar { display: none; }
.se-netbar .lbl { color: var(--se-ink-faint); margin-right: 10px; white-space: nowrap; }
.se-netlink {
  padding: 4px 10px;
  color: var(--se-ink-dim);
  border: 1px solid transparent;
  border-radius: var(--se-r-sm);
  white-space: nowrap;
  transition: .16s;
}
.se-netlink:hover { color: var(--se-ink); border-color: var(--se-line); }
.se-netlink[aria-current="page"] {
  color: var(--se-bg);
  background: var(--se-gold);
  font-weight: 600;
}
.se-netlink.soon { opacity: .42; pointer-events: none; }

/* ---------- 4. SITE HEADER ---------- */
.se-head {
  border-bottom: 1px solid var(--se-line-soft);
  background: linear-gradient(180deg, var(--se-bg-2), transparent);
}
.se-head-in {
  max-width: var(--se-maxw);
  margin: 0 auto;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.se-brand { display: flex; align-items: center; gap: 11px; }
.se-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--se-r-md);
  background: linear-gradient(145deg, var(--se-gold), var(--se-gold-deep));
  color: #10131500;
  position: relative;
  flex: none;
  box-shadow: 0 4px 16px -6px rgba(255,200,87,.6);
}
.se-mark::after {
  content: attr(data-mark);
  font-family: var(--se-display);
  font-weight: 800;
  font-size: 16px;
  color: #0a0d0f;
}
.se-brand-name {
  font-family: var(--se-display);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.se-brand-name .tld { color: var(--se-ink-faint); font-weight: 500; }
.se-nav { display: flex; gap: 3px; margin-left: auto; flex-wrap: wrap; }
.se-nav a {
  padding: 7px 13px;
  border-radius: var(--se-r-sm);
  font-size: 13.5px;
  color: var(--se-ink-dim);
  transition: .16s;
}
.se-nav a:hover { color: var(--se-ink); background: var(--se-surface); }
.se-nav a.on { color: var(--se-ink); background: var(--se-surface-2); }

/* ---------- 5. CHIPS / LABELS ---------- */
.se-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--se-mono);
  font-size: 10.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--se-line);
  color: var(--se-ink-dim);
  white-space: nowrap;
}
.se-chip.live { color: var(--se-mint); border-color: rgba(53,224,161,.4); background: rgba(53,224,161,.09); }
.se-chip.urgent { color: var(--se-coral); border-color: rgba(255,95,86,.42); background: rgba(255,95,86,.09); }
.se-chip.gold { color: var(--se-gold); border-color: rgba(255,200,87,.42); background: rgba(255,200,87,.09); }
.se-chip.soon { color: var(--se-violet); border-color: rgba(157,123,255,.4); background: rgba(157,123,255,.09); }

.se-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.se-chip.live .se-dot { animation: sePulse 1.9s infinite; }
@keyframes sePulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* rarity chip — SHARED across drops / badges / emotes */
.se-rarity {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--se-mono); font-size: 10.5px;
  letter-spacing: .06em; text-transform: uppercase;
}
.se-rarity::before {
  content: ""; width: 8px; height: 8px; flex: none;
  transform: rotate(45deg);
  background: var(--r, var(--se-r-common));
  box-shadow: 0 0 9px -1px var(--r, var(--se-r-common));
}
.r-common    { --r: var(--se-r-common);    color: var(--se-r-common); }
.r-uncommon  { --r: var(--se-r-uncommon);  color: var(--se-r-uncommon); }
.r-rare      { --r: var(--se-r-rare);      color: var(--se-r-rare); }
.r-epic      { --r: var(--se-r-epic);      color: var(--se-r-epic); }
.r-legendary { --r: var(--se-r-legendary); color: var(--se-r-legendary); }

/* ---------- 6. HERO ---------- */
.se-hero { padding: 54px 0 30px; position: relative; }
.se-kicker {
  font-family: var(--se-mono);
  font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--se-gold);
  margin-bottom: 14px;
}
.se-hero h1 {
  font-size: clamp(34px, 5.4vw, 62px);
  max-width: 17ch;
  margin-bottom: 16px;
}
.se-hero h1 em { font-style: normal; color: var(--se-gold); }
.se-sub {
  color: var(--se-ink-dim);
  font-size: 17px;
  max-width: 60ch;
  line-height: 1.65;
}

/* stat strip */
.se-stats {
  display: flex; flex-wrap: wrap; gap: 0;
  border: 1px solid var(--se-line);
  border-radius: var(--se-r-lg);
  overflow: hidden;
  margin-top: 30px;
  background: var(--se-surface);
}
.se-stat { padding: 15px 22px; flex: 1 1 130px; border-right: 1px solid var(--se-line-soft); }
.se-stat:last-child { border-right: 0; }
.se-stat b {
  display: block; font-family: var(--se-display);
  font-size: 27px; font-weight: 700; letter-spacing: -.02em;
}
.se-stat span {
  font-family: var(--se-mono); font-size: 10.5px;
  letter-spacing: .09em; text-transform: uppercase; color: var(--se-ink-faint);
}
.se-stat.hot b { color: var(--se-coral); }
.se-stat.live b { color: var(--se-mint); }
.se-stat.gold b { color: var(--se-gold); }

/* ---------- 7. SECTION ---------- */
.se-sec { padding: 30px 0; }
.se-sec-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 18px; flex-wrap: wrap;
  border-bottom: 1px solid var(--se-line-soft);
  padding-bottom: 12px;
}
.se-sec-head h2 { font-size: 21px; }
.se-sec-head .count {
  font-family: var(--se-mono); font-size: 11px;
  color: var(--se-ink-faint); letter-spacing: .06em;
}
.se-sec-head .more { margin-left: auto; font-size: 13px; color: var(--se-gold); }
.se-sec-head .more:hover { text-decoration: underline; }

/* filter row */
.se-filters { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 20px; }
.se-filter {
  font-family: var(--se-mono); font-size: 11px;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--se-line); color: var(--se-ink-dim);
  cursor: pointer; background: none; transition: .16s;
}
.se-filter:hover { color: var(--se-ink); border-color: var(--se-ink-faint); }
.se-filter.on { background: var(--se-ink); color: var(--se-bg); border-color: var(--se-ink); font-weight: 600; }

/* ---------- 8. ENTITY GRID + CARD (the workhorse) ---------- */
.se-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.se-grid.wide { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.se-grid.tight { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); }

.se-card {
  background: var(--se-surface);
  border: 1px solid var(--se-line);
  border-radius: var(--se-r-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s, box-shadow .18s;
  animation: seRise .5s both;
}
.se-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255,200,87,.42);
  box-shadow: var(--se-glow);
}
@keyframes seRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.se-thumb {
  aspect-ratio: 16 / 9;
  background: var(--se-surface-2) center/cover no-repeat;
  position: relative;
  border-bottom: 1px solid var(--se-line-soft);
}
.se-thumb.tall { aspect-ratio: 3 / 4; }
.se-thumb img { width: 100%; height: 100%; object-fit: cover; }
.se-thumb-tag { position: absolute; top: 9px; left: 9px; z-index: 2; }
.se-thumb-tag.right { left: auto; right: 9px; }
.se-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(10,13,15,.82));
  pointer-events: none;
}
[data-theme="light"] .se-thumb::after { background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.42)); }

.se-card-body { padding: 13px 14px 14px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.se-card h3 { font-size: 15.5px; letter-spacing: -.01em; line-height: 1.25; }
.se-card .pub {
  font-family: var(--se-mono); font-size: 10.5px;
  color: var(--se-ink-faint); letter-spacing: .04em; text-transform: uppercase;
}
.se-card-foot {
  margin-top: auto; padding-top: 10px;
  border-top: 1px dashed var(--se-line-soft);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--se-mono); font-size: 11px; color: var(--se-ink-dim);
}
.se-card-foot .sep { color: var(--se-ink-faint); }

/* stagger */
.se-grid > *:nth-child(1){animation-delay:.02s} .se-grid > *:nth-child(2){animation-delay:.05s}
.se-grid > *:nth-child(3){animation-delay:.08s} .se-grid > *:nth-child(4){animation-delay:.11s}
.se-grid > *:nth-child(5){animation-delay:.14s} .se-grid > *:nth-child(6){animation-delay:.17s}
.se-grid > *:nth-child(7){animation-delay:.2s}  .se-grid > *:nth-child(8){animation-delay:.23s}

/* ---------- 9. REWARD / COLLECTIBLE ROW ---------- */
.se-rewards { display: flex; flex-direction: column; gap: 8px; }
.se-reward {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 13px;
  background: var(--se-surface);
  border: 1px solid var(--se-line);
  border-radius: var(--se-r-md);
  transition: .16s;
  position: relative;
}
.se-reward:hover { border-color: rgba(255,200,87,.4); background: var(--se-surface-2); }
.se-reward-img {
  width: 46px; height: 46px; flex: none;
  border-radius: var(--se-r-sm);
  background: var(--se-surface-2);
  border: 1px solid var(--se-line-soft);
  object-fit: contain; padding: 3px;
}
.se-reward-main { flex: 1; min-width: 0; }
.se-reward-main b { display: block; font-size: 14.5px; font-weight: 600; }
.se-reward-main small {
  font-family: var(--se-mono); font-size: 11px; color: var(--se-ink-faint);
}
.se-req {
  font-family: var(--se-mono); font-size: 12px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--se-bg-2); border: 1px solid var(--se-line);
  color: var(--se-gold); white-space: nowrap; flex: none;
}
.se-req.sub { color: var(--se-violet); }

/* chain connector — drop step sequences */
.se-chain { position: relative; padding-left: 26px; }
.se-chain::before {
  content: ""; position: absolute; left: 9px; top: -8px; bottom: -8px;
  width: 2px; background: linear-gradient(180deg, transparent, var(--se-line) 12%, var(--se-line) 88%, transparent);
}
.se-chain .se-step {
  position: absolute; left: 2px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--se-bg); border: 2px solid var(--se-line);
  display: grid; place-items: center;
  font-family: var(--se-mono); font-size: 9px; color: var(--se-ink-faint);
  z-index: 2;
}
.se-chain.done .se-step { border-color: var(--se-mint); color: var(--se-mint); }

/* ---------- 10. DATA TABLE ---------- */
.se-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.se-table th {
  text-align: left; font-family: var(--se-mono);
  font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--se-ink-faint); font-weight: 500;
  padding: 9px 12px; border-bottom: 1px solid var(--se-line);
}
.se-table td { padding: 11px 12px; border-bottom: 1px solid var(--se-line-soft); }
.se-table tr:hover td { background: var(--se-surface); }

/* ---------- 11. PANEL / CALLOUT ---------- */
.se-panel {
  background: var(--se-surface);
  border: 1px solid var(--se-line);
  border-radius: var(--se-r-lg);
  padding: 20px 22px;
}
.se-panel.gold {
  border-color: rgba(255,200,87,.34);
  background: linear-gradient(160deg, rgba(255,200,87,.07), transparent 62%), var(--se-surface);
}
.se-panel h3 { font-size: 16px; margin-bottom: 9px; }
.se-panel p { color: var(--se-ink-dim); margin: 0 0 10px; font-size: 14px; }
.se-panel p:last-child { margin-bottom: 0; }

/* cross-vertical link — the graph made visible */
.se-xlink {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px;
  border: 1px dashed rgba(255,200,87,.45);
  border-radius: var(--se-r-md);
  background: rgba(255,200,87,.05);
  transition: .16s;
}
.se-xlink:hover { background: rgba(255,200,87,.1); border-style: solid; }
.se-xlink .ico { font-size: 19px; flex: none; }
.se-xlink b { display: block; font-size: 14px; }
.se-xlink small { font-family: var(--se-mono); font-size: 11px; color: var(--se-ink-faint); }
.se-xlink .go { margin-left: auto; color: var(--se-gold); font-family: var(--se-mono); font-size: 12px; }

/* ---------- 12. BREADCRUMB + FAQ ---------- */
.se-crumb {
  font-family: var(--se-mono); font-size: 11px;
  color: var(--se-ink-faint); letter-spacing: .04em;
  padding: 16px 0 4px; display: flex; gap: 7px; flex-wrap: wrap;
}
.se-crumb a:hover { color: var(--se-gold); }

.se-faq { border-top: 1px solid var(--se-line-soft); }
.se-faq details { border-bottom: 1px solid var(--se-line-soft); }
.se-faq summary {
  padding: 14px 0; cursor: pointer; font-weight: 600;
  font-size: 14.5px; list-style: none;
  display: flex; align-items: center; gap: 10px;
}
.se-faq summary::-webkit-details-marker { display: none; }
.se-faq summary::before {
  content: "+"; font-family: var(--se-mono); color: var(--se-gold);
  font-size: 15px; flex: none; transition: .2s;
}
.se-faq details[open] summary::before { transform: rotate(45deg); }
.se-faq p { color: var(--se-ink-dim); padding: 0 0 15px 24px; margin: 0; font-size: 14px; }

/* ---------- 13. FOOTER ---------- */
.se-foot {
  margin-top: 54px;
  border-top: 1px solid var(--se-line-soft);
  background: var(--se-bg-2);
  padding: 34px 0 40px;
}
.se-foot-grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  margin-bottom: 26px;
}
.se-foot h4 {
  font-family: var(--se-mono); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--se-ink-faint); margin: 0 0 11px; font-weight: 500;
}
.se-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.se-foot li a { font-size: 13.5px; color: var(--se-ink-dim); }
.se-foot li a:hover { color: var(--se-gold); }
.se-disc {
  font-size: 12px; color: var(--se-ink-faint);
  border-top: 1px solid var(--se-line-soft); padding-top: 18px; line-height: 1.7;
}

/* ---------- 14. MOCKUP ANNOTATION (review only — not shipped) ---------- */
.se-note {
  position: relative;
  border-left: 3px solid var(--se-violet);
  background: rgba(157,123,255,.08);
  padding: 11px 15px; border-radius: 0 var(--se-r-md) var(--se-r-md) 0;
  font-size: 13px; color: var(--se-ink-dim); margin: 16px 0;
}
.se-note b { color: var(--se-violet); font-family: var(--se-mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; display: block; margin-bottom: 3px; }

/* ---------- 15. COLLECTIBLE TILE (badges / emotes) ----------
   Same component family as the drop reward row — a collectible is a
   collectible, whichever vertical renders it. */
.se-tile {
  background: var(--se-surface);
  border: 1px solid var(--se-line);
  border-radius: var(--se-r-lg);
  padding: 16px 13px 13px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  position: relative;
  transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s, box-shadow .18s;
  animation: seRise .5s both;
}
.se-tile:hover { transform: translateY(-3px); border-color: rgba(255,200,87,.42); box-shadow: var(--se-glow); }
.se-tile.owned { border-color: rgba(53,224,161,.45); }
.se-tile.owned::after {
  content: "✓"; position: absolute; top: 9px; right: 10px;
  color: var(--se-mint); font-size: 13px; font-weight: 700;
}
.se-tile.locked { opacity: .58; }
.se-tile.locked:hover { opacity: 1; }

.se-badge-art {
  width: 58px; height: 58px; border-radius: 13px;
  display: grid; place-items: center;
  font-size: 27px; line-height: 1; flex: none;
  border: 1px solid var(--se-line-soft);
  background: var(--se-surface-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.se-badge-art img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.se-badge-art.lg { width: 92px; height: 92px; font-size: 44px; border-radius: 20px; }

.se-tile b { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.se-tile .how {
  font-family: var(--se-mono); font-size: 10.5px;
  color: var(--se-ink-faint); letter-spacing: .03em;
}

/* collection progress */
.se-progress {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: var(--se-surface-2); border: 1px solid var(--se-line-soft);
}
.se-progress i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--se-gold-deep), var(--se-gold));
  box-shadow: 0 0 12px -2px var(--se-gold);
}

/* ---------- 16. MOBILE APP SHELL (@se/mobile-shell) ----------
   Bottom tab bar in thumb reach, safe-area aware, PWA-ready.
   Appears under 768px; desktop keeps the top nav. */
.se-tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
  display: none;
  background: color-mix(in srgb, var(--se-bg-2) 86%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--se-line);
  padding: 5px max(10px, env(safe-area-inset-left))
           calc(5px + env(safe-area-inset-bottom))
           max(10px, env(safe-area-inset-right));
}
.se-tabbar-in {
  display: grid; grid-template-columns: repeat(5, 1fr);
  max-width: 520px; margin: 0 auto;
}
.se-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; min-height: 50px;
  color: var(--se-ink-faint);
  font-family: var(--se-mono); font-size: 9.5px;
  letter-spacing: .05em; text-transform: uppercase;
  border-radius: var(--se-r-md);
  transition: .15s;
}
.se-tab .ic { font-size: 20px; line-height: 1; position: relative; }
.se-tab.on { color: var(--se-gold); }
.se-tab:active { transform: scale(.94); }
.se-tab .ic[data-n]::after {
  content: attr(data-n);
  position: absolute; top: -5px; right: -10px;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px;
  background: var(--se-coral); color: #fff;
  font-size: 9px; font-weight: 700;
  display: grid; place-items: center;
  font-family: var(--se-mono);
}

@media (max-width: 768px) {
  .se-tabbar { display: block; }
  body { padding-bottom: 84px; }
  .se-nav a { display: none; }               /* nav moves to tab bar */
  .se-nav .se-theme-btn { display: inline-block; }
  .se-head-in { padding: 14px 18px; }
  .se-hero { padding: 34px 0 22px; }
  .se-stat { padding: 12px 16px; flex: 1 1 105px; }
  .se-stat b { font-size: 22px; }
}

/* swipeable card rail on mobile — snap scrolling instead of stacking */
@media (max-width: 700px) {
  .se-grid.rail-m {
    display: grid; grid-auto-flow: column;
    grid-auto-columns: min(78%, 300px);
    overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-padding-left: 4px; padding-bottom: 6px;
    scrollbar-width: none;
  }
  .se-grid.rail-m::-webkit-scrollbar { display: none; }
  .se-grid.rail-m > * { scroll-snap-align: start; }
}

/* ---------- 17. TRACK MODULE (@se/track) ---------- */
.se-track {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--se-mono); font-size: 11px;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 7px 13px; min-height: 34px;
  border-radius: 999px;
  border: 1px solid var(--se-line);
  background: var(--se-bg-2);
  color: var(--se-ink-dim);
  cursor: pointer; transition: .16s;
}
.se-track:hover { border-color: rgba(255,200,87,.5); color: var(--se-ink); }
.se-track::before { content: "☆"; font-size: 13px; }
.se-track.on {
  border-color: rgba(255,200,87,.55);
  background: rgba(255,200,87,.12);
  color: var(--se-gold);
}
.se-track.on::before { content: "★"; }
.se-track.sm { padding: 5px 10px; min-height: 28px; font-size: 10px; }

/* ---------- 18. PLANNER MODULE (@se/planner) ---------- */
.se-plan { display: flex; flex-direction: column; gap: 10px; }
.se-plan-row { display: flex; align-items: center; gap: 11px; }
.se-plan-row .lbl {
  font-family: var(--se-mono); font-size: 11px;
  color: var(--se-ink-dim); min-width: 118px;
}
.se-plan-row .lbl b { color: var(--se-ink); }
.se-plan-bar { flex: 1; }
.se-plan-bar .se-progress { height: 9px; }
.se-plan-row .val {
  font-family: var(--se-mono); font-size: 11px;
  color: var(--se-gold); min-width: 52px; text-align: right;
}
.se-plan-hint {
  font-size: 12.5px; color: var(--se-ink-dim);
  border-top: 1px dashed var(--se-line-soft); padding-top: 10px;
}
.se-plan-hint b { color: var(--se-mint); }

/* ---------- 19. ALERTS MODULE (@se/alerts) ---------- */
.se-switchrow {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 0; border-bottom: 1px solid var(--se-line-soft);
}
.se-switchrow:last-child { border-bottom: 0; }
.se-switchrow .ic { font-size: 16px; width: 22px; text-align: center; flex: none; }
.se-switchrow .txt { flex: 1; min-width: 0; }
.se-switchrow .txt b { display: block; font-size: 13.5px; }
.se-switchrow .txt small { font-family: var(--se-mono); font-size: 10.5px; color: var(--se-ink-faint); }
.se-switch {
  width: 40px; height: 23px; flex: none;
  border-radius: 999px; border: 1px solid var(--se-line);
  background: var(--se-surface-2);
  position: relative; cursor: pointer; transition: .18s;
}
.se-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--se-ink-faint); transition: .18s;
}
.se-switch[aria-checked="true"] {
  background: rgba(53,224,161,.18); border-color: rgba(53,224,161,.5);
}
.se-switch[aria-checked="true"]::after { left: 19px; background: var(--se-mint); }

/* ---------- 20. UTIL ---------- */
.se-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.se-split { display: grid; gap: 22px; grid-template-columns: minmax(0,1.65fr) minmax(0,1fr); }
@media (max-width: 860px) { .se-split { grid-template-columns: 1fr; } }
.se-mt { margin-top: 22px; }
.se-theme-btn {
  background: none; border: 1px solid var(--se-line); color: var(--se-ink-dim);
  border-radius: var(--se-r-sm); padding: 6px 10px; cursor: pointer;
  font-family: var(--se-mono); font-size: 11px; transition: .16s;
}
.se-theme-btn:hover { color: var(--se-ink); border-color: var(--se-ink-faint); }
