/* Wakizashi 脇差 — console theme. Dark-only by design (a console, like Katana / Tantō).
   Layout: desktop = header layer tabs + tool rail; mobile = compact header + bottom tactical dock. */
:root {
  --bg: #060a0f;
  --surface: #0a0f16;
  --surface-hi: #0d141e;
  --surface-2: #101826;
  --line: #1b2634;
  --line-2: #26354b;
  --text: #e7eef7;
  --dim: #8a9db2;
  --faint: #56677b;
  --brand: #2fd6cf;          /* Wakizashi seafoam — matches Katana's default mark */
  --brand-hi: #7ff0ea;
  --acc: var(--brand);       /* current layer accent; set via body[data-layer] */
  --acc-rgb: 47, 214, 207;
  --crit: #ff5a5f; --high: #ff9f43; --med: #ffd93d; --low: #4d8bff; --info: #7fb4ff; --ok: #41d392;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Noto Sans JP", sans-serif;
  --r: 4px;
  --header-h: 56px;
  --dock-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"] { color-scheme: dark; }

body[data-layer="yumi"]       { --acc: #2fd6cf; --acc-rgb: 47, 214, 207; }
body[data-layer="yoroi"]      { --acc: #4d8bff; --acc-rgb: 77, 139, 255; }
body[data-layer="naginata"]   { --acc: #ff4b5c; --acc-rgb: 255, 75, 92; }
body[data-layer="kemuridama"] { --acc: #a855f7; --acc-rgb: 168, 85, 247; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 80% -10%, rgba(var(--acc-rgb), .06), transparent 60%),
                    linear-gradient(rgba(255,255,255,.012) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.012) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  color: var(--text);
  font: 14px/1.5 var(--sans);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: rgba(var(--acc-rgb), .35); }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, kbd, .mono { font-family: var(--mono); }
code { font-size: .92em; background: rgba(255,255,255,.05); padding: 1px 5px; border-radius: 3px; word-break: break-all; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* ----------------------------------------------------------------- header */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  height: calc(var(--header-h) + var(--safe-t)); padding: var(--safe-t) 14px 0;
  background: rgba(8, 12, 18, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--acc-rgb), .7), transparent); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; color: var(--brand); flex: none; filter: drop-shadow(0 0 6px rgba(47,214,207,.45)); }
.brand-text { font: 700 15px/1 var(--mono); letter-spacing: .22em; white-space: nowrap; }
.brand-text b { color: var(--brand); font-weight: 700; }
.brand-kanji { height: 17px; width: auto; color: var(--brand); opacity: .9; flex: none; filter: drop-shadow(0 0 5px rgba(47,214,207,.5)); }
.brand-by { display: block; font: 600 9px/1 var(--mono); letter-spacing: .2em; color: var(--faint); margin-top: 4px; }

.ltabs { display: flex; gap: 2px; margin-left: 18px; }
.ltab {
  display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 1px solid transparent; border-radius: var(--r); background: none; cursor: pointer;
  color: var(--dim); font: 600 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}
.ltab svg { width: 18px; height: 18px; }
.ltab small { display: block; font: 500 9px/1 var(--mono); letter-spacing: .12em; color: var(--faint); margin-top: 3px; text-transform: none; }
.ltab:hover { color: var(--text); background: rgba(255,255,255,.03); }
.ltab.on { color: var(--lc); border-color: color-mix(in srgb, var(--lc) 45%, transparent); background: color-mix(in srgb, var(--lc) 10%, transparent); }
.grow { flex: 1; }
.ibtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 10px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--dim); cursor: pointer;
  font: 600 11px/1 var(--mono); letter-spacing: .1em;
}
.ibtn:hover { color: var(--text); border-color: var(--line-2); }
.ibtn svg { width: 18px; height: 18px; }
.case-pill { max-width: 240px; min-width: 0; justify-content: flex-start; }
.case-pill span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-pill svg { flex: none; }

/* ----------------------------------------------------------------- frame */
.frame { display: flex; min-height: calc(100vh - var(--header-h)); min-height: calc(100dvh - var(--header-h) - var(--safe-t)); }
.rail {
  width: 232px; flex: none; position: sticky; top: calc(var(--header-h) + var(--safe-t));
  height: calc(100dvh - var(--header-h) - var(--safe-t)); overflow-y: auto;
  border-right: 1px solid var(--line); background: rgba(8, 12, 18, .6); padding: 14px 10px 30px;
}
.rail-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.rail-head svg { width: 24px; height: 24px; color: var(--acc); }
.rail-head b { display: block; font: 700 13px/1.1 var(--mono); letter-spacing: .2em; color: var(--acc); }
.rail-head > div { min-width: 0; }
.rail-head small { display: block; font: 500 10px/1.3 var(--mono); letter-spacing: .1em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-head .lk { margin-left: auto; white-space: nowrap; font-size: 16px; color: var(--acc); opacity: .75; font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif; }
.rail a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: var(--r);
  color: var(--dim); font: 600 11.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  border-left: 2px solid transparent;
}
.rail a svg { width: 17px; height: 17px; flex: none; }
.rail a:hover { color: var(--text); background: rgba(255,255,255,.03); }
.rail a.on { color: var(--acc); background: rgba(var(--acc-rgb), .09); border-left-color: var(--acc); }
.rail .sep { height: 1px; background: var(--line); margin: 10px 4px; }

#view { flex: 1; min-width: 0; padding: 22px 26px 60px; outline: none; }
.wrap { max-width: 1180px; margin: 0 auto; }

/* ----------------------------------------------------------------- dock (mobile bottom nav) */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none; height: calc(var(--dock-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(10, 15, 22, .97); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.dock button {
  flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 0; background: none; color: var(--dim); cursor: pointer; padding: 6px 2px;
  font: 700 9.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
}
.dock button svg { width: 22px; height: 22px; }
.dock button::before { content: ""; position: absolute; top: 0; left: 18%; right: 18%; height: 3px; border-radius: 0 0 3px 3px; background: transparent; }
.dock button.on { color: var(--lc); background: color-mix(in srgb, var(--lc) 10%, transparent); }
.dock button.on::before { background: var(--lc); box-shadow: 0 0 10px var(--lc); }

.backbar { display: none; align-items: center; gap: 8px; margin: -6px 0 14px; }
.backbar a { display: inline-flex; align-items: center; gap: 6px; font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 8px 0; }
.backbar svg { width: 16px; height: 16px; }

@media (max-width: 959px) {
  .ltabs, .rail { display: none; }
  .dock { display: flex; }
  .backbar { display: flex; }
  #view { padding: 16px 16px calc(var(--dock-h) + var(--safe-b) + 28px); }
  .brand-by, .hide-sm { display: none !important; }
  .case-pill { max-width: 120px; }
}
@media (max-width: 420px) {
  .brand-text { letter-spacing: .14em; font-size: 14px; }
  .brand-kanji { display: none; }
  .ibtn { min-width: 40px; padding: 0 8px; }
}

/* scanlines — purely cosmetic */
.scan { pointer-events: none; position: fixed; inset: 0; z-index: 60;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.10) 0, rgba(0,0,0,.10) 1px, transparent 1px, transparent 3px); opacity: .5; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ----------------------------------------------------------------- view head */
.vhead { margin: 0 0 18px; }
.vhead h1 { margin: 0; font: 700 21px/1.15 var(--mono); letter-spacing: .2em; text-transform: uppercase; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.vhead h1 .vcode { color: var(--acc); }
.vhead h1 .vbar { width: 1px; height: 20px; background: var(--line-2); }
.vhead p { margin: 8px 0 0; color: var(--dim); max-width: 760px; }
@media (max-width: 959px) { .vhead h1 { font-size: 17px; letter-spacing: .14em; } }

/* ----------------------------------------------------------------- layer home */
.hero {
  display: flex; align-items: center; gap: 16px; padding: 18px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 6px;
  background: linear-gradient(120deg, rgba(var(--acc-rgb), .10), transparent 55%), var(--surface);
}
.hero svg.hm { width: 46px; height: 46px; color: var(--acc); flex: none; filter: drop-shadow(0 0 10px rgba(var(--acc-rgb), .5)); }
.hero h1 { margin: 0; font: 700 22px/1 var(--mono); letter-spacing: .24em; color: var(--acc); }
.hero p { margin: 6px 0 0; color: var(--dim); font-size: 13px; }
.hero .hk { margin-left: auto; font: 400 40px/1 "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif; color: var(--acc); opacity: .35; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tile {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 6px; min-height: 84px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; position: relative;
}
.tile:hover { text-decoration: none; border-color: rgba(var(--acc-rgb), .55); background: var(--surface-hi); }
.tile svg { width: 26px; height: 26px; color: var(--acc); flex: none; margin-top: 2px; }
.tile b { display: block; font: 700 12px/1.2 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.tile span { display: block; color: var(--dim); font-size: 12.5px; margin-top: 5px; line-height: 1.4; }
@media (max-width: 559px) { .tiles { grid-template-columns: 1fr 1fr; } .tile { flex-direction: column; gap: 8px; min-height: 0; } .tile span { font-size: 12px; } .hero .hk { display: none; } }

/* ----------------------------------------------------------------- panels + controls */
.panel { position: relative; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); padding: 16px; margin-bottom: 14px; min-width: 0; }
.panel h2, .ptitle { margin: 0 0 12px; font: 700 11px/1.2 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--dim); display: flex; align-items: center; gap: 8px; }
.panel h2::before, .ptitle::before { content: ""; width: 6px; height: 6px; background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 959px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) { .g2, .g3 { grid-template-columns: minmax(0, 1fr); } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.spacer { height: 10px; }
.lbl { display: block; font: 600 10px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin: 0 0 6px; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=url], input[type=email], input:not([type]), select, textarea {
  width: 100%; min-height: 42px; padding: 9px 11px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: #070b11; color: var(--text); outline: none;
  font-size: 16px; /* >=16px stops iOS zoom-on-focus */
}
@media (min-width: 960px) { input, select, textarea { font-size: 13.5px !important; } }
textarea { font-family: var(--mono); line-height: 1.45; resize: vertical; min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .14); }
select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--acc); }
input[type=range] { width: 100%; accent-color: var(--acc); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--dim); font-size: 13px; min-height: 32px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 15px; border-radius: var(--r); cursor: pointer; text-decoration: none !important;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font: 700 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
}
.btn:hover { border-color: var(--acc); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }
.btn.pri { background: var(--acc); border-color: var(--acc); color: #04080c; box-shadow: 0 0 14px rgba(var(--acc-rgb), .35); }
.btn.pri:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(255,90,95,.5); color: var(--crit); background: transparent; }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 10px; }
.btn.block { width: 100%; }
label.btn input[type=file] { display: none; }
@media (max-width: 959px) { .btn { min-height: 44px; } .btn.sm { min-height: 36px; } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 0; background: none; cursor: pointer; padding: 11px 14px; color: var(--dim);
  font: 700 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--acc); border-bottom-color: var(--acc); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: none; color: var(--dim); padding: 8px 12px; cursor: pointer; font: 700 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; min-height: 36px; }
.seg button.on { background: rgba(var(--acc-rgb), .15); color: var(--acc); }

/* ----------------------------------------------------------------- data display */
.badge { display: inline-flex; align-items: center; gap: 4px; font: 700 9.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase;
  padding: 4px 7px; border-radius: 3px; border: 1px solid var(--line-2); color: var(--dim); white-space: nowrap; }
.badge.crit, .badge.critical, .badge.bad { color: var(--crit); border-color: rgba(255,90,95,.55); }
.badge.high { color: var(--high); border-color: rgba(255,159,67,.55); }
.badge.med, .badge.medium, .badge.warn { color: var(--med); border-color: rgba(255,217,61,.5); }
.badge.low { color: var(--low); border-color: rgba(77,139,255,.55); }
.badge.info { color: var(--info); border-color: rgba(127,180,255,.45); }
.badge.ok, .badge.good { color: var(--ok); border-color: rgba(65,211,146,.55); }
.badge.acc { color: var(--acc); border-color: rgba(var(--acc-rgb), .55); }
.badge.fill.crit, .badge.fill.critical, .badge.fill.bad { background: var(--crit); color: #1a0004; }
.badge.fill.high { background: var(--high); color: #1a0d00; }
.badge.fill.ok, .badge.fill.good { background: var(--ok); color: #001a0d; }
.badge.fill.acc { background: var(--acc); color: #04080c; }
.chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 8px; margin: 2px 4px 2px 0; border-radius: 3px;
  background: rgba(var(--acc-rgb), .08); border: 1px solid rgba(var(--acc-rgb), .3); color: var(--text); font: 12px/1.3 var(--mono); word-break: break-all; cursor: default; }
button.chip { cursor: pointer; }
.muted { color: var(--dim); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }
.c-crit { color: var(--crit); } .c-high { color: var(--high); } .c-med { color: var(--med); } .c-ok { color: var(--ok); } .c-acc { color: var(--acc); }

pre.out {
  margin: 0; padding: 12px; border-radius: var(--r); border: 1px solid var(--line); background: #05080c; color: #cfe0f2;
  font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; overflow: auto; max-height: 460px;
}
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { position: sticky; top: 0; background: var(--surface-hi); text-align: left; font: 700 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--dim); padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid rgba(27,38,52,.6); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.mono, .tbl td code { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.kv { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--dim); font: 600 10.5px/1.6 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.kv dd { margin: 0; word-break: break-word; }
.stat { text-align: left; }
.stat .n { font: 700 26px/1 var(--mono); color: var(--text); }
.stat .n.acc { color: var(--acc); }
.stat .l { margin-top: 6px; font: 600 10px/1.2 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.meter { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
.bars .b { display: grid; grid-template-columns: minmax(80px, 34%) 1fr auto; gap: 8px; align-items: center; font-size: 12px; margin: 5px 0; }
.bars .b span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); }
.bars .b i { display: block; height: 6px; border-radius: 3px; background: var(--acc); }

.callout { padding: 11px 13px; border-radius: var(--r); border: 1px solid rgba(var(--acc-rgb), .35); background: rgba(var(--acc-rgb), .07); font-size: 13px; }
.callout.warn { border-color: rgba(255,159,67,.45); background: rgba(255,159,67,.07); }
.callout.bad { border-color: rgba(255,90,95,.5); background: rgba(255,90,95,.07); }
.callout.ok { border-color: rgba(65,211,146,.45); background: rgba(65,211,146,.07); }
.empty { padding: 30px 16px; text-align: center; color: var(--dim); }
.empty b { display: block; font: 700 12px/1 var(--mono); letter-spacing: .22em; color: var(--faint); margin-bottom: 8px; }
.loader { font: 700 11px/1 var(--mono); letter-spacing: .2em; color: var(--acc); }
.loader i { animation: blink 1s steps(2) infinite; font-style: normal; }
@keyframes blink { 50% { opacity: 0; } }

.finding { border: 1px solid var(--line); border-left: 3px solid var(--dim); border-radius: var(--r); padding: 11px 13px; margin: 0 0 8px; background: var(--surface-hi); }
.finding.critical, .finding.crit { border-left-color: var(--crit); }
.finding.high { border-left-color: var(--high); }
.finding.medium, .finding.med { border-left-color: var(--med); }
.finding.low { border-left-color: var(--low); }
.finding.info { border-left-color: var(--info); }
.finding.ok { border-left-color: var(--ok); }
.finding header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.finding h3 { margin: 0; font-size: 13.5px; font-weight: 600; flex: 1; min-width: 160px; }
.finding .det { color: var(--dim); font-size: 12.5px; margin-top: 6px; }

.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; cursor: pointer;
  min-height: 130px; padding: 18px; border: 1px dashed var(--line-2); border-radius: 6px; color: var(--dim); background: rgba(255,255,255,.012); }
.drop svg { width: 28px; height: 28px; color: var(--acc); }
.drop.over, .drop:hover { border-color: var(--acc); color: var(--text); background: rgba(var(--acc-rgb), .05); }
.drop input { display: none; }

/* ----------------------------------------------------------------- overlays */
#toast { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 520px); }
@media (max-width: 959px) { #toast { bottom: calc(var(--dock-h) + var(--safe-b) + 14px); } }
.toast { pointer-events: auto; padding: 10px 14px; border-radius: var(--r); background: #0f1722; border: 1px solid rgba(var(--acc-rgb), .5); box-shadow: 0 8px 30px rgba(0,0,0,.5); font-size: 13px; max-width: 100%; animation: tin .18s ease-out; }
.toast.err { border-color: rgba(255,90,95,.6); color: #ffd1d3; }
@keyframes tin { from { opacity: 0; transform: translateY(6px); } }
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(2, 4, 8, .72); backdrop-filter: blur(4px); }
.modal-box { position: relative; width: min(760px, 100%); max-height: min(88vh, 900px); overflow: auto; padding: 20px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal-x { position: absolute; top: 10px; right: 10px; }
.modal-box h2 { margin: 0 0 12px; font: 700 15px/1.3 var(--mono); letter-spacing: .1em; padding-right: 40px; }
@media (max-width: 639px) { .modal { align-items: flex-end; padding: 0; } .modal-box { border-radius: 12px 12px 0 0; max-height: 92vh; padding-bottom: calc(20px + var(--safe-b)); } }

/* RoE gate (Naginata) */
.gate { max-width: 640px; margin: 20px auto; }
.gate .panel { border-color: rgba(var(--acc-rgb), .5); }

footer.foot { display: flex; gap: 10px; padding: 18px 0 0; color: var(--faint); font: 600 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; flex-wrap: wrap; }

/* Settings → Tool guide */
.guide details { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
.guide details[open] { border-color: var(--acc, var(--brand)); }
.guide summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 10px 12px; min-height: 44px; }
.guide summary::-webkit-details-marker { display: none; }
.guide summary::before { content: "▸"; color: var(--acc, var(--brand)); }
.guide details[open] > summary::before { content: "▾"; }
.guide summary b { color: var(--acc, var(--brand)); font-family: var(--mono); letter-spacing: .08em; }
.guide summary .muted { flex: 1 1 200px; }
.guide .g-layer > p, .guide .g-layer > details { margin-left: 12px; margin-right: 12px; }
.guide .g-layer > details:last-child { margin-bottom: 12px; }
.guide .g-body { padding: 0 14px 12px; font-size: 14px; line-height: 1.55; }
.guide .g-sec { margin: 8px 0 4px; font: 700 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.guide ol, .guide ul { margin: 0 0 8px; padding-left: 20px; }

/* top-bar resource deck — segmented "cyberdeck" gauges (CPU = main-thread headroom, MEM = JS-heap headroom) */
.resdeck { display: flex; flex-direction: column; justify-content: center; gap: 3px; margin-right: 4px; }
.resdeck .rd-g { display: flex; align-items: center; gap: 6px; }
.resdeck small { font: 700 8.5px/1 var(--mono); letter-spacing: .12em; color: var(--faint); min-width: 24px; }
.resdeck .res-bar { position: relative; width: 58px; height: 7px; border: 1px solid var(--line); border-radius: 2px; overflow: hidden; background: var(--surface); }
.resdeck .res-bar::before { content: ""; position: absolute; inset: 0; z-index: 0; background: repeating-linear-gradient(90deg, rgba(130,160,180,.14) 0 4px, transparent 4px 5px); }
.resdeck .res-bar i { position: relative; z-index: 1; display: block; height: 100%; width: 0; background: #35c08a; transition: width .4s ease, background .4s; }
.resdeck .res-bar i.warn { background: #ffb020; }
.resdeck .res-bar i.bad { background: #ff5a5f; }
.resdeck .res-bar::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 4px, var(--surface) 4px 5px); }
.resdeck .rd-v { font: 700 10px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; min-width: 42px; }
@media (max-width: 640px) { .resdeck .res-bar { width: 46px; } }
