/* ============================================================
   FIELD MANUAL — cheatsheet engine styles
   Concept: an operator's field manual. Ink base, per-section
   accent system (color = information), IBM Plex engineered type.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* dark (default) */
  --bg:        #080b11;
  --bg-2:      #0b0f17;
  --panel:     #11151f;
  --panel-2:   #151b28;
  --panel-3:   #1a2130;
  --glass:     rgba(15, 20, 30, 0.74);
  --border:    #222b3d;
  --border-soft:#1a2130;
  --text:      #e7ebf3;
  --text-dim:  #9aa6bd;
  --text-faint:#67738d;
  --code-bg:   #070a10;
  --code-border:#1d2535;
  --code-text: #dfe6f2;
  --ok:        #5bd97b;
  --warn:      #ffb454;
  --danger:    #ff6b6b;
  --accent:    #58a6ff;          /* overridden per-section via inline --accent */
  --accent-ink:#0a0d14;
  --shadow:    0 18px 40px -22px rgba(0,0,0,.75);
  --shadow-sm: 0 6px 18px -12px rgba(0,0,0,.7);
  --radius:    14px;
  --radius-sm: 9px;
  --maxw:      1180px;
}

:root[data-theme="light"] {
  --bg:        #eef1f7;
  --bg-2:      #e7ebf4;
  --panel:     #ffffff;
  --panel-2:   #f6f8fc;
  --panel-3:   #eef2f9;
  --glass:     rgba(255,255,255,0.82);
  --border:    #d7deec;
  --border-soft:#e6ebf4;
  --text:      #10151f;
  --text-dim:  #4c5a73;
  --text-faint:#7b89a2;
  --code-bg:   #0b0f18;   /* terminal blocks stay dark in both themes */
  --code-border:#1c2434;
  --code-text: #dfe6f2;
  --shadow:    0 18px 40px -26px rgba(20,30,60,.28);
  --shadow-sm: 0 6px 18px -12px rgba(20,30,60,.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); color: var(--text); }

/* ---------- utility ---------- */
.wrap { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }
.mono { font-family: var(--font-mono); }
.ic { display: inline-flex; align-items: center; justify-content: center; }
.ic svg { width: 15px; height: 15px; }
.hide { display: none !important; }
.visually-hidden { position: absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip: rect(0 0 0 0); white-space:nowrap; border:0; }

/* ============================================================
   TOP BAR (sticky, appears after hero)
   ============================================================ */
#topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  display: flex; align-items: center; gap: .9rem;
  padding: .55rem clamp(.8rem, 3vw, 1.4rem);
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
  transform: translateY(-110%);
  transition: transform .34s cubic-bezier(.22,.7,.3,1);
}
#topbar.show { transform: translateY(0); }
#topbar .brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
#topbar .brand .dot { width: 11px; height: 11px; border-radius: 3px; background: conic-gradient(from 210deg, #58a6ff, #b392f0, #ff7b72, #7ee787, #58a6ff); box-shadow: 0 0 12px rgba(120,160,255,.55); }
#topbar .brand b { font-size: .98rem; }
#topbar .grow { flex: 1; }

.searchbox {
  position: relative; display: flex; align-items: center;
  flex: 1 1 auto; max-width: 440px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 999px; padding: .34rem .6rem .34rem .85rem;
  transition: border-color .18s, box-shadow .18s;
}
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.searchbox svg { width: 15px; height: 15px; color: var(--text-faint); flex: none; }
.searchbox input { flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .92rem; padding: .15rem .4rem; outline: none; }
.searchbox kbd { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); border: 1px solid var(--border); border-radius: 5px; padding: .05rem .35rem; background: var(--panel-2); }
.searchbox .clearbtn { display: none; border:0; background:transparent; color: var(--text-faint); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 .2rem; }
.searchbox.has-value .clearbtn { display: block; }
.searchbox.has-value kbd { display: none; }

.iconbtn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--panel); color: var(--text-dim); cursor: pointer;
  transition: color .16s, border-color .16s, background .16s, transform .12s;
}
.iconbtn:hover { color: var(--text); border-color: var(--accent); }
.iconbtn:active { transform: translateY(1px); }
.iconbtn svg { width: 17px; height: 17px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { position: relative; min-height: 94vh; display: flex; align-items: center; overflow: hidden; border-bottom: 1px solid var(--border); }
#rain { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .5; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(70% 55% at 18% 8%, color-mix(in srgb, #58a6ff 16%, transparent), transparent 60%),
    radial-gradient(60% 50% at 92% 90%, color-mix(in srgb, #b392f0 15%, transparent), transparent 62%),
    linear-gradient(180deg, transparent 55%, var(--bg) 99%);
}
.hero-inner { position: relative; z-index: 2; padding: clamp(5rem, 9vh, 7rem) 0 3.2rem; width: 100%; }

.eyebrow-live {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .02em;
  color: var(--text-dim); background: var(--glass);
  border: 1px solid var(--border); border-radius: 999px; padding: .32rem .7rem .32rem .55rem;
  backdrop-filter: blur(6px);
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 70%, transparent); animation: pulse 2.2s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--ok) 60%,transparent);} 70%{box-shadow:0 0 0 9px transparent;} 100%{box-shadow:0 0 0 0 transparent;} }

.hero-title {
  font-weight: 700; letter-spacing: -.035em; line-height: .95;
  font-size: clamp(2.7rem, 9.5vw, 6.4rem);
  margin: 1.1rem 0 .2rem;
  text-wrap: balance;
}
.hero-title .scr { font-family: var(--font-mono); }
.hero-title .l2 { display: block; background: linear-gradient(92deg, #58a6ff, #8b9dff 32%, #b392f0 60%, #ff7b9c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: clamp(1rem, 2.3vw, 1.3rem); color: var(--text-dim); max-width: 46ch; margin: .2rem 0 1.6rem; }
.hero-sub b { color: var(--text); font-weight: 600; }

.brief {
  display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin-bottom: 1.8rem;
  font-family: var(--font-mono); font-size: .82rem; color: var(--text-dim);
}
.brief span { display: inline-flex; align-items: center; gap: .4rem; }
.brief span b { color: var(--text); font-weight: 600; }
.brief .sep { color: var(--text-faint); }

.hero-cta { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  border-radius: 10px; padding: .7rem 1.15rem; border: 1px solid transparent;
  transition: transform .12s, box-shadow .18s, background .18s, border-color .18s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #4b93ff, #2f6fe0); color: #fff; box-shadow: 0 10px 26px -12px rgba(60,120,255,.8); }
.btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(60,120,255,.9); text-decoration: none; }
.btn-ghost { background: var(--glass); border-color: var(--border); color: var(--text); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--accent); text-decoration: none; }

/* universal first-moves terminal in hero */
.triage {
  margin-top: 2.4rem; max-width: 720px;
  background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 12px;
  box-shadow: var(--shadow); overflow: hidden;
}
.triage .bar { display: flex; align-items: center; gap: .5rem; padding: .55rem .8rem; border-bottom: 1px solid var(--code-border); background: rgba(255,255,255,.015); }
.triage .bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.triage .bar i:nth-child(1){ background:#ff5f56;} .triage .bar i:nth-child(2){ background:#ffbd2e;} .triage .bar i:nth-child(3){ background:#27c93f;}
.triage .bar span { margin-left: .4rem; font-family: var(--font-mono); font-size: .76rem; color: var(--text-faint); }
.triage pre { margin: 0; padding: .95rem 1rem; font-family: var(--font-mono); font-size: .83rem; line-height: 1.75; color: var(--code-text); overflow-x: auto; }
.triage .c { color: #6b7793; }      /* comment */
.triage .p { color: #5bd97b; }      /* prompt $ */
.triage .k { color: #79c0ff; }      /* command */

/* category launcher grid */
.launch { margin-top: 2.6rem; }
.launch h3 { font-size: .8rem; text-transform: none; color: var(--text-faint); font-family: var(--font-mono); margin: 0 0 .8rem; }
.launch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .6rem; }
.launch-tile {
  display: flex; flex-direction: column; gap: .3rem;
  padding: .75rem .85rem; border-radius: 11px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--text); position: relative; overflow: hidden;
  transition: transform .14s, border-color .16s, background .16s;
}
.launch-tile::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--accent); }
.launch-tile:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; }
.launch-tile .lt-top { display:flex; align-items:center; gap:.5rem; }
.launch-tile .lt-dot { width: 9px; height: 9px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex:none; }
.launch-tile b { font-size: .92rem; font-weight: 600; letter-spacing: -.01em; }
.launch-tile small { color: var(--text-faint); font-family: var(--font-mono); font-size: .72rem; }

/* ============================================================
   SHELL LAYOUT (rail + main)
   ============================================================ */
.shell { display: grid; grid-template-columns: 1fr; gap: 0; }
@media (min-width: 1040px) {
  .shell { grid-template-columns: 248px minmax(0,1fr); align-items: start; width: min(100% - 2rem, var(--maxw)); margin-inline: auto; gap: 2.2rem; }
}

/* left rail */
#rail { display: none; }
@media (min-width: 1040px) {
  #rail { display: block; position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 92px); overflow-y: auto; padding: 1.4rem 0 2rem; scrollbar-width: thin; }
  #rail::-webkit-scrollbar { width: 7px; } #rail::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
}
.rail-group { margin-bottom: 1.1rem; }
.rail-group > h4 { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; color: var(--text-faint); margin: 0 0 .45rem .2rem; }
.rail-link {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .4rem .55rem; border-radius: 8px; cursor: pointer;
  color: var(--text-dim); border: 1px solid transparent; background: transparent;
  font: inherit; font-size: .88rem; text-align: left;
  transition: color .15s, background .15s;
}
.rail-link:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.rail-link .rl-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; opacity: .75; }
.rail-link.active { color: var(--text); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.rail-link.active .rl-dot { opacity: 1; box-shadow: 0 0 9px var(--accent); }
.rail-link .rl-count { margin-left: auto; font-family: var(--font-mono); font-size: .7rem; color: var(--text-faint); }

/* mobile chip nav */
#chipnav { display: flex; }
@media (min-width: 1040px) { #chipnav { display: none; } }
#chipnav {
  position: sticky; top: 56px; z-index: 40;
  gap: .4rem; overflow-x: auto; padding: .6rem clamp(.8rem,3vw,1.4rem);
  background: var(--glass); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
#chipnav::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: .4rem; padding: .34rem .7rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); color: var(--text-dim); font-size: .8rem; white-space: nowrap; cursor: pointer; }
.chip .rl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.chip.active { color: var(--text); border-color: var(--accent); }

/* ---------- main ---------- */
main { padding: 2.2rem 0 5rem; min-width: 0; }
@media (max-width: 1039px){ main { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; } }

#searchmeta { display: none; margin: 0 0 1.4rem; font-family: var(--font-mono); font-size: .82rem; color: var(--text-dim); }
#searchmeta.show { display: block; }
#searchmeta b { color: var(--accent); }

.noresult { display:none; text-align:center; padding: 4rem 1rem; color: var(--text-dim); }
.noresult.show { display:block; }
.noresult .big { font-size: 2.4rem; margin-bottom:.4rem; }

/* ---------- section ---------- */
.section { scroll-margin-top: 80px; margin-bottom: 2.7rem; }
.section-head {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem 0 .9rem; margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border); cursor: pointer; position: relative;
}
.section-head::before { content:""; position:absolute; left:0; bottom:-1px; height:2px; width:64px; background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.section-head .tag { font-family: var(--font-mono); font-size: .72rem; color: var(--accent-ink); background: var(--accent); padding: .2rem .5rem; border-radius: 6px; font-weight: 600; flex: none; }
.section-head h2 { font-size: clamp(1.3rem, 3.2vw, 1.85rem); margin: 0; letter-spacing: -.02em; font-weight: 700; }
.section-head .count { font-family: var(--font-mono); font-size: .76rem; color: var(--text-faint); }
.section-head .chev { margin-left: auto; color: var(--text-faint); transition: transform .22s; flex:none; }
.section.collapsed .chev { transform: rotate(-90deg); }
.section.collapsed .section-body { display: none; }
.section-overview { color: var(--text-dim); max-width: 78ch; margin: -.3rem 0 1.3rem; font-size: .96rem; }

/* quick wins */
.quickwins { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 1rem 1.15rem; margin-bottom: 1.4rem; }
.quickwins h5 { margin: 0 0 .6rem; font-size: .82rem; font-family: var(--font-mono); color: var(--accent); letter-spacing: .02em; display:flex; align-items:center; gap:.5rem; }
.quickwins ol { margin: 0; padding-left: 1.3rem; display: grid; gap: .4rem; }
.quickwins li { color: var(--text); font-size: .9rem; }
.quickwins li code { font-family: var(--font-mono); font-size: .84em; background: var(--code-bg); color: var(--code-text); padding: .06em .4em; border-radius: 5px; border: 1px solid var(--code-border); }

/* pattern card grid */
.cards { display: grid; gap: .9rem; grid-template-columns: 1fr; }
@media (min-width: 680px){ .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px){ .cards.wide { grid-template-columns: 1fr; } }

.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.05rem 1.1rem; position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background: var(--accent); opacity:.85; }
.card h3 { margin: 0 0 .55rem; font-size: 1rem; font-weight: 600; letter-spacing: -.01em; padding-right: .5rem; }
.field { margin: .5rem 0; font-size: .88rem; }
.field .lab { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em; color: var(--text-faint); display: block; margin-bottom: .18rem; }
.field.recognize .lab { color: var(--accent); }
.field .val { color: var(--text-dim); }
.field.recognize .val { color: var(--text); }

/* code block */
.code {
  position: relative; margin: .55rem 0 0;
  background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 9px;
}
.code pre { margin: 0; padding: .6rem .8rem; padding-right: 2.4rem; overflow-x: auto; font-family: var(--font-mono); font-size: .8rem; line-height: 1.65; color: var(--code-text); scrollbar-width: thin; }
.code pre::-webkit-scrollbar { height: 7px; } .code pre::-webkit-scrollbar-thumb { background: #223; border-radius: 4px; }
.code .copy {
  position: absolute; top: 5px; right: 5px;
  border: 1px solid var(--code-border); background: rgba(255,255,255,.04); color: var(--text-faint);
  border-radius: 6px; width: 26px; height: 26px; display: grid; place-items: center; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s; opacity: 0;
}
.code:hover .copy, .code:focus-within .copy { opacity: 1; }
.code .copy:hover { color: var(--ok); border-color: var(--ok); }
.code .copy.done { color: var(--ok); border-color: var(--ok); opacity:1; }
.code .copy svg { width: 14px; height: 14px; }

.gotcha { margin-top: .7rem; font-size: .82rem; color: var(--warn); background: color-mix(in srgb, var(--warn) 9%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 24%, transparent); border-radius: 8px; padding: .5rem .7rem; display: flex; gap: .5rem; }
.gotcha svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.access { margin-top: .55rem; font-size: .78rem; color: var(--text-faint); font-family: var(--font-mono); }

/* command-group tables (linux sections) */
.grouptable { margin-bottom: 1.5rem; }
.grouptable > h4 { font-size: 1rem; margin: 0 0 .2rem; display: flex; align-items: center; gap: .5rem; }
.grouptable > h4 .bar { width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.grouptable .gnote { color: var(--text-faint); font-size: .83rem; margin: 0 0 .7rem; }
.rows { display: grid; gap: .5rem; }
.row {
  display: grid; gap: .3rem .9rem; grid-template-columns: 1fr;
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 10px; padding: .6rem .75rem;
}
@media (min-width: 760px){ .row { grid-template-columns: minmax(0,0.9fr) minmax(0,1.1fr); align-items: start; } }
.row .rcmd { position: relative; }
.row .rcmd code { display: block; font-family: var(--font-mono); font-size: .82rem; color: var(--code-text); background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 7px; padding: .4rem 2rem .4rem .6rem; overflow-x: auto; white-space: pre; }
.row .rcmd .copy { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border:1px solid var(--code-border); background: rgba(255,255,255,.03); color: var(--text-faint); border-radius: 6px; display:grid; place-items:center; cursor:pointer; opacity:0; transition: opacity .15s, color .15s; }
.row:hover .rcmd .copy { opacity: 1; }
.row .rcmd .copy:hover { color: var(--ok); }
.row .rcmd .copy.done { color: var(--ok); opacity:1; }
.row .rcmd .copy svg { width:13px; height:13px; }
.row .rdesc { color: var(--text-dim); font-size: .86rem; }
.row .rdesc .ex { display:block; margin-top:.25rem; font-family: var(--font-mono); font-size: .76rem; color: var(--text-faint); }
.row .rdesc .ex::before { content:"e.g. "; color: var(--accent); }

/* tools table */
.tools { margin-top: 1.4rem; }
.tools h4 { font-size: .9rem; font-family: var(--font-mono); color: var(--text-dim); margin: 0 0 .7rem; }
.toolgrid { display: grid; gap: .55rem; grid-template-columns: 1fr; }
@media (min-width: 720px){ .toolgrid { grid-template-columns: repeat(2,1fr); } }
.tool {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 10px; padding: .65rem .8rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.tool .tname { font-weight: 600; font-size: .9rem; display:flex; align-items:center; gap:.45rem; }
.tool .tname a { color: var(--text); }
.tool .tname a:hover { color: var(--accent); }
.tool .tname .ext { width: 12px; height: 12px; color: var(--text-faint); flex:none; }
.tool .tuse { color: var(--text-dim); font-size: .82rem; }
.tool .twhen { color: var(--text-faint); font-size: .78rem; }
.tool .tmeta { margin-top:.15rem; display:flex; flex-wrap:wrap; gap:.3rem; }
.tool .pill { font-family: var(--font-mono); font-size: .68rem; padding: .1rem .45rem; border-radius: 5px; border: 1px solid var(--border); color: var(--text-faint); }
.tool .pill.acc { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

.notes { margin-top: 1.4rem; background: var(--panel-2); border: 1px dashed var(--border); border-radius: 10px; padding: .85rem 1rem; }
.notes h4 { margin: 0 0 .5rem; font-size: .82rem; font-family: var(--font-mono); color: var(--text-dim); }
.notes ul { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; }
.notes li { font-size: .85rem; color: var(--text-dim); }
.notes li code { font-family: var(--font-mono); font-size: .82em; color: var(--code-text); background: var(--code-bg); padding: .05em .35em; border-radius: 4px; border: 1px solid var(--code-border); }

/* ---------- tool index ---------- */
.idx-controls { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.idx-filter { font: inherit; font-size: .8rem; cursor: pointer; padding: .3rem .7rem; border-radius: 999px; background: var(--panel); border: 1px solid var(--border); color: var(--text-dim); }
.idx-filter.active { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.idxgrid { display: grid; gap: .55rem; grid-template-columns: 1fr; }
@media (min-width: 640px){ .idxgrid { grid-template-columns: repeat(2,1fr); } }
@media (min-width: 1040px){ .idxgrid { grid-template-columns: repeat(2,1fr); } }
.idxcard { background: var(--panel); border: 1px solid var(--border-soft); border-radius: 10px; padding: .7rem .85rem; display: flex; flex-direction: column; gap: .25rem; }
.idxcard .ix-top { display: flex; align-items: center; gap: .5rem; }
.idxcard .ix-cat { font-family: var(--font-mono); font-size: .66rem; padding: .1rem .4rem; border-radius: 5px; background: var(--panel-3); color: var(--text-dim); flex: none; }
.idxcard a.ix-name { font-weight: 600; font-size: .92rem; color: var(--text); display:flex; align-items:center; gap:.35rem; }
.idxcard a.ix-name:hover { color: var(--accent); }
.idxcard .ix-use { color: var(--text-dim); font-size: .82rem; }
.idxcard .ix-when { color: var(--text-faint); font-size: .78rem; }
.idxcard .ix-when b { color: var(--text-dim); font-weight:600; }
.idxcard .ix-inst { font-family: var(--font-mono); font-size: .72rem; color: var(--text-faint); }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--border); padding: 2.4rem 0 3rem; color: var(--text-faint); font-size: .83rem; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
footer a { color: var(--text-dim); }
footer .disc { max-width: 62ch; line-height: 1.6; }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.in { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s cubic-bezier(.2,.7,.3,1); }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; transition: none !important; } .pulse { animation: none; } }

/* ---------- back to top ---------- */
#totop { position: fixed; right: 18px; bottom: 18px; z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s, transform .2s; transform: translateY(8px); }
#totop.show { opacity: 1; pointer-events: auto; transform: none; }

/* ---------- print ---------- */
@media print {
  #topbar, #rail, #chipnav, #rain, #totop, .hero-cta, .searchbox, .idx-controls { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { min-height: auto; border: none; }
  .section.collapsed .section-body { display: block !important; }
  .card, .row, .tool, .idxcard, .quickwins { break-inside: avoid; border-color: #ccc; }
  .code, .triage { background: #f4f4f4; } .code pre, .triage pre { color: #111; }
  a { color: #000; text-decoration: underline; }
}
