/* ============================================================
   BLACKCOREX FIELD CONSOLE
   Extends styles.css. Same tokens, console components.
============================================================ */
:root {
  --rail: 236px;
  --top: 62px;
  --ok: #4f9e5c;
  --warn: #ff7a1a;
  --crit: #e2161f;
  --gap: 1px;
  /* Notch and home-indicator clearance. Real on an iPhone; the device preview
     injects the same values so the framed view matches the handset. */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --topfull: calc(var(--top) + var(--safe-top));
}

.app-body {
  background: var(--ink);
  overflow-x: hidden;
  font-size: 15px;
}
.app-body.is-locked { overflow: hidden; }
::selection { background: var(--blood); color: var(--bone); }

/* thin, dark scrollbars everywhere */
* { scrollbar-width: thin; scrollbar-color: #2a2d33 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-thumb { background: #2a2d33; }
*::-webkit-scrollbar-thumb:hover { background: #3a3e46; }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================
   BOOT
============================================================ */
.boot {
  position: fixed; inset: 0; z-index: 200;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
.boot.is-done { opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s ease; }
.boot__grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 10%, transparent 72%);
}
.boot__inner { position: relative; text-align: center; }
.boot__logo { width: 66px; height: 66px; object-fit: contain; margin: 0 auto 20px; opacity: .95; }
.boot__word { font-family: var(--font-display); font-size: 40px; letter-spacing: .14em; color: var(--bone); line-height: 1; }
.boot__sub { font-family: var(--font-mono); font-size: 10px; letter-spacing: .42em; color: var(--mute); margin-top: 10px; }
.boot__bar { width: 240px; height: 2px; background: var(--steel); margin: 30px auto 14px; overflow: hidden; }
.boot__bar span { display: block; height: 100%; width: 0; background: var(--blood-2); transition: width .18s linear; }
.boot__log { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: var(--mute); min-height: 14px; }

/* ============================================================
   TOP BAR
============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 70;
  height: var(--topfull);
  display: flex; align-items: center; gap: 20px;
  padding: var(--safe-top) 18px 0;
  background: rgba(5,5,5,.92);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.topbar__brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.topbar__logo { width: 28px; height: 28px; object-fit: contain; }
.topbar__word { font-family: var(--font-display); font-size: 19px; letter-spacing: .1em; color: var(--bone); }
.topbar__tag {
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .3em; color: var(--mute);
  border-left: 1px solid var(--line-strong); padding-left: 11px; margin-left: 3px;
}
.topbar__status { display: flex; gap: 18px; margin-left: 8px; }
.topbar__stat {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--mute);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.topbar__stat .dot { width: 6px; height: 6px; background: var(--ok); border-radius: 50%; animation: pulse 2.6s ease-in-out infinite; }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.topbar__search { position: relative; display: flex; align-items: center; }
.topbar__search > span { position: absolute; left: 11px; color: var(--mute); font-size: 14px; pointer-events: none; }
.topbar__search input {
  width: 260px; height: 34px; padding: 0 12px 0 30px;
  background: var(--ink-3); border: 1px solid var(--line); border-left: 2px solid var(--blood);
  color: var(--bone); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  outline: none; border-radius: 0; -webkit-appearance: none; appearance: none;
}
.topbar__search input:focus { border-color: var(--line-strong); border-left-color: var(--blood-2); background: var(--steel); }
.topbar__search input::placeholder { color: #5c5e63; }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); color: var(--bone-2);
  cursor: pointer; font-size: 14px; transition: all .18s ease; text-decoration: none;
}
.icon-btn:hover { border-color: var(--blood-2); color: var(--blood-2); background: rgba(226,22,31,.06); }
.icon-btn--exit:hover { background: var(--blood); border-color: var(--blood); color: var(--bone); }

/* Module menu. First control in the bar, deliberately far from the exit link:
   at phone width they sat 8px apart and the exit won every mis-tap. */
.app-burger {
  display: none; width: 34px; height: 34px; flex: 0 0 auto; margin: 0;
  align-items: center; justify-content: center; gap: 4px;
  flex-direction: column; padding: 0 8px;
  background: transparent; border: 1px solid var(--line); cursor: pointer;
  transition: all .18s ease;
}
.app-burger span { display: block; width: 100%; height: 2px; background: var(--bone-2); transition: background .18s ease; }
.app-burger:hover { border-color: var(--blood-2); }
.app-burger:hover span { background: var(--blood-2); }
.app-burger[aria-expanded="true"] { background: var(--blood); border-color: var(--blood); }
.app-burger[aria-expanded="true"] span { background: var(--bone); }

/* global search results */
.searchpanel {
  position: absolute; top: calc(100% + 6px); right: 0; width: 380px; max-height: 62vh; overflow: auto;
  background: var(--ink-2); border: 1px solid var(--line-strong); z-index: 90;
  box-shadow: 0 24px 60px rgba(0,0,0,.7);
}
.searchpanel__r { display: block; padding: 11px 14px; border-bottom: 1px solid var(--line); text-decoration: none; }
.searchpanel__r:hover { background: var(--ink-3); }
.searchpanel__k { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .24em; color: var(--blood-2); display: block; margin-bottom: 4px; }
.searchpanel__r b { display: block; font-size: 13.5px; color: var(--bone); font-weight: 500; }
.searchpanel__s { font-size: 11.5px; color: var(--mute); }
.searchpanel__none { padding: 16px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--mute); }

/* ============================================================
   SHELL + RAIL
============================================================ */
.shell { display: grid; grid-template-columns: var(--rail) 1fr; min-height: calc(100vh - var(--topfull)); }
.rail {
  border-right: 1px solid var(--line);
  background: var(--ink-2);
  padding: 22px 0 18px;
  position: sticky; top: var(--topfull); align-self: start;
  height: calc(100vh - var(--topfull));
  display: flex; flex-direction: column; overflow-y: auto;
}
.rail__group { margin-bottom: 24px; }
.rail__grouplabel {
  display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .3em;
  color: #5c5e63; padding: 0 20px 10px;
}
.rail__item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; text-decoration: none;
  font-family: var(--font-cond); font-size: 14px; font-weight: 600; letter-spacing: .09em;
  text-transform: uppercase; color: var(--bone-2);
  border-left: 2px solid transparent; transition: all .16s ease; position: relative;
}
.rail__item b { font-family: var(--font-mono); font-size: 10px; font-weight: 400; color: #5c5e63; letter-spacing: .1em; }
.rail__item:hover { background: var(--ink-3); color: var(--bone); }
.rail__item.is-active { border-left-color: var(--blood-2); background: var(--ink-3); color: var(--bone); }
.rail__item.is-active b { color: var(--blood-2); }
.rail__badge {
  margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; font-style: normal;
  color: var(--mute); letter-spacing: .06em;
}
.rail__badge.is-hot { color: var(--bone); background: var(--blood); padding: 1px 6px; }
.rail__foot { margin-top: auto; padding: 0 20px; }
.rail__meter-label { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .26em; color: #5c5e63; margin-bottom: 7px; }
.rail__note { font-size: 10.5px; line-height: 1.55; color: #5c5e63; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

.meter { height: 4px; background: rgba(255,255,255,.07); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); transition: width .3s ease; }
.meter--warn i { background: var(--amber); }
.meter--crit i { background: var(--blood-2); }
.meter--low i { background: var(--amber); }

/* ============================================================
   VIEW
============================================================ */
.view { padding: 34px 38px calc(90px + var(--safe-bot)); max-width: 1560px; min-width: 0; }
.view:focus { outline: none; }

.phead { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; margin-bottom: 26px; }
.phead__left { min-width: 0; flex: 1 1 380px; }
.phead__num { font-family: var(--font-mono); font-size: 10px; letter-spacing: .3em; color: var(--blood-2); display: block; margin-bottom: 12px; }
.phead__title { font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 50px); line-height: .96; letter-spacing: .005em; font-weight: 400; text-transform: uppercase; color: var(--bone); }
.phead__sub { font-size: 14px; line-height: 1.6; color: var(--bone-2); max-width: 720px; margin-top: 12px; }
.phead__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.phead__actions .btn { height: 38px; padding: 0 16px; font-size: 11px; letter-spacing: .14em; }

.backlink {
  display: inline-block; font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em;
  color: var(--mute); margin-bottom: 18px; text-decoration: none;
}
.backlink:hover { color: var(--blood-2); }

.countline { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; color: var(--mute); margin-bottom: 18px; }

/* toolbar / filters: one row above the content they scope */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.tb__search {
  height: 36px; min-width: 300px; flex: 1 1 300px; padding: 0 13px;
  background: var(--ink-3); border: 1px solid var(--line); border-left: 2px solid var(--blood);
  color: var(--bone); font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  outline: none; border-radius: 0; -webkit-appearance: none; appearance: none;
}
.tb__search:focus { border-color: var(--line-strong); background: var(--steel); }
.tb__search::placeholder { color: #5c5e63; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  background: transparent; border: 1px solid var(--line); color: var(--mute);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .14em; padding: 7px 10px;
  cursor: pointer; transition: all .16s ease;
}
.chip:hover { border-color: var(--line-strong); color: var(--bone-2); }
.chip.is-on { background: var(--blood); border-color: var(--blood); color: var(--bone); }

.tabs { display: flex; gap: 1px; background: var(--line); border: 1px solid var(--line); margin-bottom: 20px; }
.tabs__b {
  flex: 1; background: var(--ink-2); border: none; color: var(--mute); cursor: pointer;
  font-family: var(--font-cond); font-size: 12.5px; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; padding: 13px 16px; transition: all .18s ease;
}
.tabs__b:hover { background: var(--ink-3); color: var(--bone-2); }
.tabs__b.is-on { background: var(--ink-3); color: var(--bone); box-shadow: inset 0 2px 0 var(--blood-2); }

/* ============================================================
   STAT TILES / KPI
============================================================ */
.kpirow {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--gap); background: var(--line); border: 1px solid var(--line); margin-bottom: 26px;
}
.stat-tile { background: var(--ink-2); padding: 18px 20px 16px; position: relative; min-width: 0; }
.stat-tile__label { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em; color: var(--mute); text-transform: uppercase; margin-bottom: 12px; }
.stat-tile__row { display: flex; align-items: baseline; gap: 6px; }
.stat-tile__value { font-family: var(--font-mono); font-size: 27px; font-weight: 500; color: var(--bone); line-height: 1; letter-spacing: -.01em; }
.stat-tile--hero .stat-tile__value { font-size: 40px; }
.stat-tile__suffix { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--mute); }
.stat-tile__note { display: block; font-size: 11px; color: var(--mute); margin-top: 9px; line-height: 1.45; }
.stat-tile__spark { margin-top: 10px; }
.stat-tile__link { position: absolute; inset: 0; }
.stat-tile__link:hover { background: rgba(255,255,255,.02); }
.stat-tile--warn .stat-tile__value { color: var(--amber); }
.stat-tile--crit .stat-tile__value { color: var(--blood-2); }
.stat-tile--warn::before, .stat-tile--crit::before {
  content: ""; position: absolute; top: 0; left: 0; width: 26px; height: 2px; background: var(--amber);
}
.stat-tile--crit::before { background: var(--blood-2); }

/* ============================================================
   PANELS
============================================================ */
.panel { border: 1px solid var(--line); background: var(--ink-2); padding: 24px 26px; margin-bottom: 26px; }
.panel__title {
  font-family: var(--font-display); font-size: 21px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bone); font-weight: 400; margin-bottom: 18px; display: flex; align-items: center; gap: 12px;
}
.panel__num { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: var(--blood-2); }
.panel__clear { font-size: 13.5px; color: var(--bone-2); display: flex; align-items: center; gap: 10px; }
.panel__clearico { color: var(--ok); }
.panel__fine { font-size: 11.5px; line-height: 1.65; color: var(--mute); margin-top: 16px; border-left: 2px solid var(--blood); padding-left: 12px; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.btnrow .btn { height: 40px; padding: 0 16px; font-size: 11px; letter-spacing: .14em; }
.btn--danger { background: transparent; border-color: rgba(226,22,31,.5); color: var(--blood-2); }
.btn--danger:hover { background: var(--blood); border-color: var(--blood); color: var(--bone); }

.alerts { list-style: none; }
.alert { display: flex; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.alert:last-child { border-bottom: none; }
.alert__ico { flex-shrink: 0; font-size: 10px; color: var(--mute); }
.alert__kind { font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em; color: var(--mute); width: 74px; flex-shrink: 0; }
.alert__text { color: var(--bone-2); text-decoration: none; }
.alert__text:hover { color: var(--bone); text-decoration: underline; text-underline-offset: 3px; }
.alert--crit .alert__ico, .alert--crit .alert__kind { color: var(--blood-2); }
.alert--warn .alert__ico, .alert--warn .alert__kind { color: var(--amber); }

.banner { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border: 1px solid var(--line); border-left: 2px solid var(--mute); background: var(--ink-2); font-size: 13px; line-height: 1.55; color: var(--bone-2); margin-bottom: 14px; }
.banner__ico { flex-shrink: 0; font-size: 10px; }
.banner--ok { border-left-color: var(--ok); }
.banner--ok .banner__ico { color: var(--ok); }
.banner--warn { border-left-color: var(--amber); }
.banner--warn .banner__ico { color: var(--amber); }
.banner--crit { border-left-color: var(--blood-2); background: rgba(226,22,31,.05); }
.banner--crit .banner__ico { color: var(--blood-2); }

.feed { list-style: none; }
.feed li { display: flex; align-items: baseline; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.feed li:last-child { border-bottom: none; }
.feed__d { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--mute); width: 110px; flex-shrink: 0; }
.feed__t { color: var(--bone-2); text-decoration: none; }
.feed__t:hover { color: var(--blood-2); }
.feed__c { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; color: var(--mute); }

.pillrow { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 22px; }
.pill {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; text-transform: uppercase;
  padding: 5px 9px; border: 1px solid var(--line-strong); color: var(--bone-2); white-space: nowrap;
}
.pill--ok { border-color: rgba(79,158,92,.5); color: var(--ok); }
.pill--warn { border-color: rgba(255,122,26,.5); color: var(--amber); }
.pill--crit { border-color: rgba(226,22,31,.55); color: var(--blood-2); }
.pill--dead { border-color: var(--line); color: #5c5e63; }

.empty { text-align: center; padding: 70px 24px; border: 1px dashed var(--line-strong); }
.empty__mark { font-size: 30px; color: var(--steel-2); display: block; margin-bottom: 16px; }
.empty h3 { font-family: var(--font-display); font-size: 25px; letter-spacing: .07em; color: var(--bone); font-weight: 400; margin-bottom: 10px; }
.empty p { font-size: 13.5px; color: var(--mute); max-width: 480px; margin: 0 auto 22px; line-height: 1.65; }

.dangerbar {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border: 1px solid var(--line); border-top: 2px solid rgba(226,22,31,.35);
  padding: 18px 22px; margin-top: 30px; background: var(--ink-2);
}
.dangerbar span { font-size: 12px; color: var(--mute); }
.linkline { font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; color: var(--mute); margin-bottom: 18px; word-break: break-all; }
.linkline a { color: var(--blood-2); }

/* ============================================================
   FIRST RUN
============================================================ */
.firstrun { padding: 20px 0; }
.firstrun__t { font-family: var(--font-display); font-size: 32px; letter-spacing: .06em; color: var(--bone); font-weight: 400; margin-bottom: 12px; }
.firstrun__p { font-size: 14.5px; line-height: 1.7; color: var(--bone-2); max-width: 700px; margin-bottom: 34px; }
.firstrun__g { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--gap); background: var(--line); border: 1px solid var(--line); }
.startcard { background: var(--ink-2); padding: 26px 24px; text-decoration: none; display: block; position: relative; transition: background .25s ease; }
.startcard::before { content: ""; position: absolute; top: 0; left: 0; width: 30px; height: 2px; background: var(--blood-2); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.startcard:hover { background: var(--ink-3); }
.startcard:hover::before { transform: scaleX(1); }
.startcard__n { font-family: var(--font-mono); font-size: 10px; letter-spacing: .24em; color: var(--mute); display: block; margin-bottom: 16px; }
.startcard h3 { font-family: var(--font-display); font-size: 24px; letter-spacing: .04em; color: var(--bone); font-weight: 400; margin-bottom: 10px; }
.startcard p { font-size: 12.5px; line-height: 1.6; color: var(--mute); margin-bottom: 18px; }
.startcard__go { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .22em; color: var(--blood-2); }
.firstrun__demo { margin-top: 30px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.firstrun__demo p { font-size: 13px; color: var(--mute); }

/* ============================================================
   WEAPON CARDS
============================================================ */
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(285px, 1fr)); gap: var(--gap); background: var(--line); border: 1px solid var(--line); }
.wcard { background: var(--ink-2); text-decoration: none; display: flex; flex-direction: column; transition: background .25s ease; position: relative; }
.wcard:hover { background: var(--ink-3); }
.wcard__media { aspect-ratio: 16/9; background: #08080a; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.wcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.wcard:hover .wcard__media img { transform: scale(1.045); }
.wcard__noimg { font-family: var(--font-mono); font-size: 9px; letter-spacing: .26em; color: #35373d; }
.wcard__flag { position: absolute; top: 10px; left: 10px; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .2em; background: var(--blood); color: var(--bone); padding: 4px 8px; }
.wcard__body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.wcard__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.wcard__ref { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .18em; color: var(--mute); }
.wcard__name { font-family: var(--font-display); font-size: 25px; letter-spacing: .03em; color: var(--bone); font-weight: 400; line-height: 1.05; margin-bottom: 5px; }
.wcard__make { font-size: 12.5px; color: var(--bone-2); margin-bottom: 4px; }
.wcard__spec { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .05em; color: var(--mute); }
.wcard__foot { display: flex; align-items: center; gap: 12px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--mute); flex-wrap: wrap; }
.wcard__foot b { font-family: var(--font-mono); color: var(--bone); font-weight: 500; }
.wcard__role { font-family: var(--font-mono); font-size: 9px; letter-spacing: .14em; }
.wcard__val { margin-left: auto; font-family: var(--font-mono); color: var(--bone-2); }
.wcard__life { margin-top: 12px; }
.wcard__lifelab { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .2em; color: var(--mute); margin-bottom: 5px; }

/* ============================================================
   SPEC SHEET
============================================================ */
.spec { display: grid; gap: 24px; }
.spec__group { border: 1px solid var(--line); background: var(--ink-2); padding: 22px 24px; }
.spec__gtitle { font-family: var(--font-display); font-size: 19px; letter-spacing: .07em; text-transform: uppercase; color: var(--bone); font-weight: 400; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.spec__gnum { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .2em; color: var(--blood-2); }
.spec__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 34px; }
.spec__list dt { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--mute); padding: 9px 0 2px; border-top: 1px solid var(--line); }
.spec__list dd { font-size: 13.5px; color: var(--bone); padding-bottom: 9px; }
.spec__list dd.is-mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .06em; }
.spec__rtitle { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--blood-2); margin: 22px 0 10px; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 20px; }
.gallery__cell { border: 1px solid var(--line); background: #08080a; padding: 0; cursor: pointer; aspect-ratio: 4/3; overflow: hidden; }
.gallery__cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.gallery__cell:hover { border-color: var(--blood-2); }
.gallery__cell:hover img { transform: scale(1.06); }

.lb { position: relative; text-align: center; }
.lb__img { max-width: 100%; max-height: 68vh; margin: 0 auto; }
.lb__nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.6); border: 1px solid var(--line-strong); color: var(--bone); width: 42px; height: 56px; font-size: 24px; cursor: pointer; }
.lb__nav:hover { background: var(--blood); border-color: var(--blood); }
.lb__nav--p { left: 0; } .lb__nav--n { right: 0; }
.lb__cap { display: block; margin-top: 12px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; color: var(--mute); }

/* ============================================================
   DATA TABLES
============================================================ */
.dtable-wrap { overflow-x: auto; }
.dtable { width: 100%; border-collapse: collapse; font-size: 13px; }
.dtable th {
  text-align: left; font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--mute); font-weight: 400;
  padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap;
}
.dtable td { padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line); color: var(--bone-2); vertical-align: top; }
.dtable tbody tr:hover td { background: rgba(255,255,255,.018); color: var(--bone); }
.dtable a { color: var(--bone); text-decoration: none; border-bottom: 1px solid rgba(226,22,31,.45); }
.dtable a:hover { color: var(--blood-2); }
.dtable .is-mono { font-family: var(--font-mono); font-size: 12px; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.dtable .is-warn { color: var(--amber); }
.dtable--mini { font-size: 12px; }
.cellmeter { display: flex; align-items: center; gap: 8px; min-width: 90px; }
.cellmeter .meter { flex: 1; }
.cellmeter span { font-family: var(--font-mono); font-size: 11px; }

.dtable--card { font-family: var(--font-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dtable--card td { padding: 6px 13px 6px 0; }
.dtable--card th { font-size: 8.5px; }
.dtable--card tr.is-transonic td { color: var(--amber); }
.dtable--card tr.is-subsonic td { color: #6b6d72; }
.dtable--card tr.is-target td { background: rgba(226,22,31,.09); color: var(--bone); box-shadow: inset 0 0 0 1px rgba(226,22,31,.25); }
.card-sec { border: 1px solid var(--line); background: var(--ink-2); padding: 22px 24px; margin-top: 22px; }
.card-sec__head { margin-bottom: 14px; }
.card-sec__key { margin-top: 14px; font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em; color: var(--mute); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.key { display: inline-block; width: 20px; height: 8px; }
.key--target { background: rgba(226,22,31,.35); }
.key--trans { background: var(--amber); }
.key--sub { background: #6b6d72; }

/* ============================================================
   CHARTS
============================================================ */
.chartrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: var(--gap); background: var(--line); border: 1px solid var(--line); margin-bottom: 26px; }
.chart-fig { background: var(--ink-2); padding: 22px 24px; min-width: 0; }
.chart-fig__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.chart-fig__title { font-family: var(--font-cond); font-size: 14px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--bone); }
.chart-fig__sub { font-size: 11.5px; color: var(--mute); margin-top: 5px; line-height: 1.5; max-width: 46ch; }
.chart-fig__toggle { background: transparent; border: 1px solid var(--line); color: var(--mute); font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .18em; padding: 5px 9px; cursor: pointer; flex-shrink: 0; }
.chart-fig__toggle:hover { border-color: var(--line-strong); color: var(--bone-2); }
.chart-host { min-width: 0; }
.chart-empty { font-size: 12.5px; color: var(--mute); padding: 26px 0; }
.chart-note { font-size: 11px; color: var(--mute); margin-top: 12px; }
.chart { display: block; overflow: visible; }
.ctick { font-family: var(--font-mono); font-size: 9px; fill: #6b6d72; letter-spacing: .05em; }
.cval { font-family: var(--font-mono); font-size: 10px; fill: var(--bone); letter-spacing: .04em; }
.cpanel { font-family: var(--font-mono); font-size: 8.5px; fill: #6b6d72; letter-spacing: .2em; }
.cmark { font-family: var(--font-mono); font-size: 8.5px; fill: var(--amber); letter-spacing: .12em; }
.spark { display: block; overflow: visible; }

.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: minmax(88px, 168px) 1fr auto; gap: 12px; align-items: center; cursor: default; }
.hbar:focus { outline: 1px solid var(--line-strong); outline-offset: 3px; }
.hbar__label { font-size: 12px; color: var(--bone-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar__track { height: 14px; background: rgba(255,255,255,.045); position: relative; }
.hbar__fill { display: block; height: 100%; background: var(--blood-2); border-radius: 0 4px 4px 0; transition: filter .18s ease; }
.hbar:hover .hbar__fill { filter: brightness(1.22); }
.hbar__val { font-family: var(--font-mono); font-size: 11.5px; color: var(--bone); font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }

.ctip {
  position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none;
  background: rgba(8,8,10,.97); border: 1px solid var(--line-strong);
  padding: 9px 12px; min-width: 130px; opacity: 0; transition: opacity .12s ease;
  box-shadow: 0 12px 34px rgba(0,0,0,.6);
}
.ctip.is-on { opacity: 1; }
.ctip__t { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .2em; color: var(--mute); margin-bottom: 7px; text-transform: uppercase; }
.ctip__r { display: flex; align-items: baseline; gap: 8px; padding: 2px 0; }
.ctip__key { width: 10px; height: 2px; flex-shrink: 0; align-self: center; }
.ctip__v { font-family: var(--font-mono); font-size: 12.5px; color: var(--bone); font-variant-numeric: tabular-nums; }
.ctip__l { font-size: 10.5px; color: var(--mute); }

/* ============================================================
   FORMS
============================================================ */
.form { display: grid; gap: var(--gap); background: var(--line); border: 1px solid var(--line); margin-bottom: 26px; }
.fgroup { background: var(--ink-2); }
.fgroup__head {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 16px 24px;
  background: transparent; border: none; cursor: pointer; text-align: left;
}
.fgroup__head:hover { background: var(--ink-3); }
.fgroup__num { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .2em; color: var(--blood-2); }
.fgroup__title { font-family: var(--font-cond); font-size: 14.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--bone); }
.fgroup__chev { margin-left: auto; color: var(--mute); font-size: 11px; transition: transform .22s ease; }
.fgroup.is-open .fgroup__chev { transform: rotate(180deg); }
.fgroup__body { display: none; padding: 4px 24px 26px; }
.fgroup.is-open .fgroup__body { display: block; }
.fgroup__note { font-size: 12px; color: var(--mute); margin-bottom: 20px; border-left: 2px solid var(--blood); padding-left: 12px; line-height: 1.55; }

.fgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.fld { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.fld.is-hidden { display: none; }
.fld--w1 { grid-column: span 1; } .fld--w2 { grid-column: span 2; }
.fld--w3 { grid-column: span 3; } .fld--w4 { grid-column: span 4; }
.fld__label { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; color: var(--mute); text-transform: uppercase; display: flex; align-items: baseline; gap: 6px; }
.fld__unit { font-style: normal; color: #5c5e63; letter-spacing: .1em; }
.fld__req { color: var(--blood-2); font-weight: 400; }
.fld__hint { font-size: 10.5px; color: #6b6d72; line-height: 1.45; }
.fld input[type=text], .fld input[type=number], .fld input[type=date], .fld input[type=search], .fld select, .fld textarea,
.sfld input, .sfld select {
  background: var(--ink-3); border: 1px solid var(--line); border-left: 2px solid var(--blood);
  color: var(--bone); padding: 10px 12px; font-family: var(--font-body); font-size: 13.5px;
  outline: none; transition: all .18s ease; border-radius: 0; -webkit-appearance: none; appearance: none; width: 100%;
}
.fld select, .sfld select {
  background-image: linear-gradient(45deg, transparent 50%, #8a8b8e 50%), linear-gradient(135deg, #8a8b8e 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px;
}
.fld input:focus, .fld select:focus, .fld textarea:focus, .sfld input:focus, .sfld select:focus {
  border-color: var(--line-strong); border-left-color: var(--blood-2); background: var(--steel);
}
.fld input.is-bad, .fld select.is-bad, .fld textarea.is-bad { border-color: var(--blood-2); background: rgba(226,22,31,.07); }
.fld textarea { resize: vertical; min-height: 76px; line-height: 1.55; }
.fld input[type=date] { font-family: var(--font-mono); font-size: 12.5px; }
.fld input::-webkit-calendar-picker-indicator { filter: invert(.6); cursor: pointer; }

.fld--bool, .sfld--tog { gap: 7px; }
.sfld--tog { grid-column: span 2; }
.togrow { display: flex; align-items: center; gap: 10px; min-width: 0; }
.togrow__l {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em;
  color: var(--bone-2); text-transform: uppercase; line-height: 1.35;
}
.fld--bool input[type=checkbox], .sfld--tog input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.switch { width: 38px; height: 20px; background: var(--steel); border: 1px solid var(--line); position: relative; flex-shrink: 0; cursor: pointer; transition: all .2s ease; order: -1; }
.switch i { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--mute); transition: all .2s ease; }
input:checked + .switch { background: rgba(226,22,31,.22); border-color: var(--blood); }
input:checked + .switch i { left: 20px; background: var(--blood-2); }
input:focus-visible + .switch { outline: 1px solid var(--bone); outline-offset: 2px; }
.fld--bool .fld__hint, .sfld--tog .sfld__h { padding-left: 48px; }

/* photos */
.fld--photos .photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.photo { position: relative; aspect-ratio: 4/3; border: 1px solid var(--line); background: #08080a; overflow: hidden; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo__x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; background: rgba(0,0,0,.72); border: 1px solid var(--line-strong); color: var(--bone); cursor: pointer; font-size: 10px; line-height: 1; }
.photo__x:hover { background: var(--blood); border-color: var(--blood); }
.photo__lead { position: absolute; bottom: 0; left: 0; font-family: var(--font-mono); font-size: 8px; letter-spacing: .18em; background: var(--blood); color: var(--bone); padding: 3px 6px; }
.photo--add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border-style: dashed; border-color: var(--line-strong); color: var(--mute); cursor: pointer; }
.photo--add:hover { border-color: var(--blood-2); color: var(--blood-2); }
.photo--add span { font-size: 20px; line-height: 1; }
.photo--add small { font-family: var(--font-mono); font-size: 8px; letter-spacing: .2em; }

/* repeaters */
.fld--rep .rep { display: grid; gap: 8px; }
.rep__row { position: relative; border: 1px solid var(--line); border-left: 2px solid var(--steel-2); background: var(--ink-3); padding: 14px 46px 14px 14px; }
.rep__row .fgrid--rep { gap: 12px; }
.rep__x { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; background: transparent; border: 1px solid var(--line); color: var(--mute); cursor: pointer; font-size: 10px; }
.rep__x:hover { border-color: var(--blood-2); color: var(--blood-2); }
.rep__add { margin-top: 10px; background: transparent; border: 1px dashed var(--line-strong); color: var(--mute); font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em; padding: 10px 14px; cursor: pointer; width: 100%; }
.rep__add:hover { border-color: var(--blood-2); color: var(--blood-2); }

.editbar {
  position: sticky; bottom: var(--safe-bot); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  background: rgba(5,5,5,.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line); border-top: 2px solid var(--blood); padding: 14px 20px;
}
.editbar__hint { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--mute); }
.editbar__dot { width: 6px; height: 6px; background: var(--blood-2); flex-shrink: 0; }
.editbar__acts { display: flex; gap: 8px; flex-wrap: wrap; }
.editbar .btn { height: 40px; padding: 0 18px; font-size: 11px; letter-spacing: .14em; }

/* ============================================================
   SOLVER
============================================================ */
.solver { display: grid; grid-template-columns: minmax(340px, 400px) 1fr; gap: 22px; align-items: start; }
.solver__in { display: grid; gap: var(--gap); background: var(--line); border: 1px solid var(--line); position: sticky; top: calc(var(--topfull) + 18px); max-height: calc(100vh - var(--topfull) - 36px); overflow-y: auto; }
.solver__out { min-width: 0; }

.sstrip { background: var(--ink-2); padding: 16px 18px; display: grid; gap: 9px; }
.sstrip__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sstrip__l { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .24em; color: var(--mute); }
.sstrip__sel {
  width: 100%; background: var(--ink-3); border: 1px solid var(--line); border-left: 2px solid var(--steel-2);
  color: var(--bone-2); padding: 9px 11px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  outline: none; border-radius: 0; -webkit-appearance: none; appearance: none; cursor: pointer;
}
.sstrip__sel:hover { border-left-color: var(--blood); color: var(--bone); }
.segmented { display: flex; border: 1px solid var(--line); }
.segmented__b { background: transparent; border: none; color: var(--mute); font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; padding: 7px 12px; cursor: pointer; }
.segmented__b.is-on { background: var(--blood); color: var(--bone); }

.spanel { background: var(--ink-2); }
.spanel__head { width: 100%; display: flex; align-items: center; gap: 11px; padding: 13px 18px; background: transparent; border: none; cursor: pointer; text-align: left; }
.spanel__head:hover { background: var(--ink-3); }
.spanel__num { font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em; color: var(--blood-2); }
.spanel__title { font-family: var(--font-cond); font-size: 12.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--bone); }
.spanel__chev { margin-left: auto; color: var(--mute); font-size: 10px; transition: transform .22s ease; }
.spanel.is-open .spanel__chev { transform: rotate(180deg); }
.spanel__body { display: none; padding: 2px 18px 20px; }
.spanel.is-open .spanel__body { display: block; }
.spanel__note { font-size: 11px; color: var(--mute); line-height: 1.5; margin-bottom: 16px; border-left: 2px solid var(--blood); padding-left: 10px; }

.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.sfld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sfld--w1 { grid-column: span 1; } .sfld--w2 { grid-column: span 2; }
.sfld__l { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; color: var(--mute); text-transform: uppercase; display: flex; align-items: baseline; gap: 5px; }
.sfld__l i { font-style: normal; color: #5c5e63; }
.sfld input, .sfld select { padding: 9px 10px; font-size: 13px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sfld__h { font-size: 10px; color: #6b6d72; line-height: 1.4; }

.dialwrap { gap: 8px; }
.dial { position: relative; width: 100%; aspect-ratio: 1; max-width: 128px; margin: 4px auto; border: 1px solid var(--line); border-radius: 50%; background: radial-gradient(circle, var(--ink-3) 40%, var(--ink-2) 100%); }
.dial__h { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; background: transparent; border: 1px solid transparent; color: var(--mute); font-family: var(--font-mono); font-size: 9px; cursor: pointer; border-radius: 50%; }
.dial__h:hover { color: var(--bone); border-color: var(--line-strong); }
.dial__h.is-on { background: var(--blood); border-color: var(--blood); color: var(--bone); }
.dial__c { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: var(--steel-2); font-size: 11px; }
.dial__arrow { position: absolute; top: 50%; left: 50%; width: 2px; height: 34%; background: linear-gradient(180deg, var(--blood-2), transparent); transform-origin: 50% 100%; margin-top: -34%; margin-left: -1px; pointer-events: none; }

.true__out { font-size: 12px; color: var(--bone-2); line-height: 1.6; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.true__out em { color: var(--amber); font-style: normal; }
.linkbtn { background: none; border: none; color: var(--blood-2); font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

/* --- firing solution --- */
.firing { border: 1px solid var(--line); border-top: 2px solid var(--blood); background: var(--ink-2); margin-bottom: 22px; }
.firing__head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.firing__eyebrow { font-family: var(--font-mono); font-size: 9px; letter-spacing: .3em; color: var(--blood-2); }
.firing__range { font-family: var(--font-display); font-size: 22px; letter-spacing: .06em; color: var(--bone); }
.firing__meta { font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--mute); }
.firing__fail { padding: 26px 22px; font-size: 13.5px; color: var(--amber); }
.firing__dials { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--gap); background: var(--line); border-bottom: 1px solid var(--line); }
.dialb { background: var(--ink-2); padding: 20px 22px; }
.dialb__l { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .24em; color: var(--mute); margin-bottom: 11px; }
.dialb__v { display: block; font-family: var(--font-mono); font-size: 34px; font-weight: 500; color: var(--bone); line-height: 1; letter-spacing: -.015em; }
.dialb__v i { font-style: normal; font-size: 12px; color: var(--mute); margin-left: 6px; letter-spacing: .08em; }
.dialb__n { display: block; font-size: 10.5px; color: var(--mute); margin-top: 9px; }
.firing__strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--gap); background: var(--line); }
.micro { background: var(--ink-2); padding: 13px 18px; }
.micro__l { display: block; font-family: var(--font-mono); font-size: 8px; letter-spacing: .2em; color: #6b6d72; margin-bottom: 6px; }
.micro__v { display: block; font-family: var(--font-mono); font-size: 14px; color: var(--bone); font-variant-numeric: tabular-nums; }
.micro__n { display: block; font-size: 10px; color: var(--mute); margin-top: 4px; }

.diagrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: var(--gap); background: var(--line); border: 1px solid var(--line); margin-bottom: 22px; }
.diag { background: var(--ink-2); padding: 18px 20px; }
.diag__t { font-family: var(--font-mono); font-size: 9px; letter-spacing: .24em; color: var(--blood-2); margin-bottom: 13px; }
.diag__l dt { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; color: var(--mute); text-transform: uppercase; padding-top: 8px; border-top: 1px solid var(--line); }
.diag__l dt:first-child { border-top: none; padding-top: 0; }
.diag__l dd { font-size: 12.5px; color: var(--bone); padding-bottom: 8px; font-variant-numeric: tabular-nums; }

/* ============================================================
   STORES / SESSIONS / WISHLIST ROWS
============================================================ */
.lotlist, .seslist, .wishlist { display: grid; gap: var(--gap); background: var(--line); border: 1px solid var(--line); }
.lot, .wish {
  position: relative; background: var(--ink-2); padding: 18px 22px;
  display: grid; grid-template-columns: minmax(180px, 1.5fr) minmax(200px, 1.4fr) auto auto;
  gap: 22px; align-items: center; transition: background .2s ease;
}
.lot:hover, .wish:hover { background: var(--ink-3); }
.lot::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: transparent; }
.lot--ok::before { background: rgba(79,158,92,.55); }
.lot--low::before { background: var(--amber); }
.lot--crit::before, .lot--out::before { background: var(--blood-2); }
.lot__hit { position: absolute; inset: 0; z-index: 0; }
.lot > *:not(.lot__hit) { position: relative; z-index: 1; pointer-events: none; }
.lot .lot__acts, .wish .lot__acts { pointer-events: auto; }
.lot__id { min-width: 0; }
.lot__name { font-family: var(--font-cond); font-size: 16px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bone); margin-bottom: 5px; }
.lot__sub { font-size: 11.5px; color: var(--mute); line-height: 1.5; }
.lot__meter { min-width: 0; }
.lot__meterhead { display: flex; align-items: baseline; gap: 7px; margin-bottom: 7px; flex-wrap: wrap; }
.lot__meterhead b { font-family: var(--font-mono); font-size: 17px; color: var(--bone); font-variant-numeric: tabular-nums; }
.lot__meterhead span { font-size: 11px; color: var(--mute); }
.lot__pill { margin-left: auto; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; padding: 3px 7px; border: 1px solid var(--line-strong); color: var(--mute); }
.lot__pill i { font-style: normal; font-size: 7px; }
.lot__pill--ok { border-color: rgba(79,158,92,.5); color: var(--ok); }
.lot__pill--low { border-color: rgba(255,122,26,.5); color: var(--amber); }
.lot__pill--crit, .lot__pill--out { border-color: rgba(226,22,31,.55); color: var(--blood-2); }
.lot__fine { display: block; font-size: 10.5px; color: #6b6d72; margin-top: 7px; }
.lot__nums { display: flex; gap: 22px; }
.numcell span { display: block; font-family: var(--font-mono); font-size: 8px; letter-spacing: .18em; color: #6b6d72; margin-bottom: 5px; }
.numcell b { font-family: var(--font-mono); font-size: 12.5px; color: var(--bone-2); font-weight: 400; }
.lot__acts { display: flex; gap: 6px; }
.minibtn {
  background: transparent; border: 1px solid var(--line); color: var(--mute);
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .16em; padding: 7px 10px;
  cursor: pointer; text-decoration: none; transition: all .16s ease;
}
.minibtn:hover { border-color: var(--blood-2); color: var(--blood-2); }
.minibtn--x:hover { background: var(--blood); border-color: var(--blood); color: var(--bone); }

.ses { background: var(--ink-2); padding: 16px 22px; display: grid; grid-template-columns: 64px 1fr auto auto; gap: 22px; align-items: center; text-decoration: none; transition: background .2s ease; }
.ses:hover { background: var(--ink-3); }
.ses__date { text-align: center; border-right: 1px solid var(--line); padding-right: 14px; }
.ses__date b { display: block; font-family: var(--font-display); font-size: 26px; color: var(--bone); line-height: 1; }
.ses__date span { display: block; font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .18em; color: var(--blood-2); margin-top: 3px; }
.ses__date i { display: block; font-family: var(--font-mono); font-size: 8.5px; font-style: normal; color: #5c5e63; }
.ses__body { min-width: 0; }
.ses__body h3 { font-family: var(--font-cond); font-size: 16px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bone); margin-bottom: 4px; }
.ses__body p { font-size: 11.5px; color: var(--mute); line-height: 1.5; }
.ses__lesson { color: #6b6d72 !important; font-style: italic; margin-top: 4px; }
.ses__nums { display: flex; gap: 22px; }

.wish { grid-template-columns: 58px minmax(180px, 1.4fr) minmax(200px, 1.3fr) auto auto; }
.wish__media { width: 58px; height: 58px; border: 1px solid var(--line); background: #08080a; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.wish__media img { width: 100%; height: 100%; object-fit: cover; }
.wish__media span { font-family: var(--font-mono); font-size: 13px; color: var(--steel-2); letter-spacing: .1em; }
.wish__id h3 { font-family: var(--font-cond); font-size: 16px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--bone); margin-bottom: 4px; }
.wish__id p { font-size: 11.5px; color: var(--mute); margin-bottom: 8px; }
.wish__tags { display: flex; gap: 5px; flex-wrap: wrap; }
.wish__fund { min-width: 0; }
.wishlist__band { background: var(--ink); font-family: var(--font-mono); font-size: 9px; letter-spacing: .26em; color: var(--blood-2); padding: 13px 22px 10px; text-transform: uppercase; }

/* ============================================================
   MODAL
============================================================ */
.modal { position: fixed; inset: 0; z-index: 120; visibility: hidden; pointer-events: none; }
.modal.is-open { visibility: visible; pointer-events: auto; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.82); opacity: 0; transition: opacity .25s ease; backdrop-filter: blur(3px); }
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__panel {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -47%);
  width: min(660px, calc(100vw - 32px)); max-height: min(86vh, 860px);
  background: var(--ink-2); border: 1px solid var(--line-strong); border-top: 2px solid var(--blood);
  display: flex; flex-direction: column; opacity: 0; transition: all .25s ease;
  box-shadow: 0 40px 90px rgba(0,0,0,.7);
}
.modal.is-open .modal__panel { opacity: 1; transform: translate(-50%, -50%); }
.modal__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal__eyebrow { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .3em; color: var(--blood-2); display: block; margin-bottom: 8px; }
.modal__title { font-family: var(--font-display); font-size: 24px; letter-spacing: .05em; text-transform: uppercase; color: var(--bone); font-weight: 400; line-height: 1.1; }
.modal__close { width: 32px; height: 32px; background: transparent; border: 1px solid var(--line); color: var(--bone-2); cursor: pointer; flex-shrink: 0; }
.modal__close:hover { background: var(--blood); border-color: var(--blood); color: var(--bone); }
.modal__body { padding: 22px 24px; overflow-y: auto; flex: 1; }
.modal__msg { font-size: 13.5px; line-height: 1.65; color: var(--bone-2); }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 24px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal__foot .btn { height: 40px; padding: 0 18px; font-size: 11px; letter-spacing: .14em; }

.quick { display: grid; gap: 14px; }
.quick__f { display: flex; flex-direction: column; gap: 7px; }
.quick__f span { font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; color: var(--mute); text-transform: uppercase; }
.quick__f input, .quick__f select {
  background: var(--ink-3); border: 1px solid var(--line); border-left: 2px solid var(--blood);
  color: var(--bone); padding: 11px 12px; font-family: var(--font-mono); font-size: 14px;
  outline: none; border-radius: 0; -webkit-appearance: none; appearance: none; width: 100%;
}
.quick__f input:focus, .quick__f select:focus { border-color: var(--line-strong); background: var(--steel); }
.quick__note { font-size: 11.5px; color: var(--mute); line-height: 1.6; border-left: 2px solid var(--steel-2); padding-left: 11px; }

.disclose p { font-size: 12.5px; line-height: 1.7; color: var(--bone-2); padding: 10px 0; border-bottom: 1px solid var(--line); }
.disclose p:last-child { border-bottom: none; }
.code { font-family: var(--font-mono); font-size: 11px; color: var(--amber); white-space: pre-wrap; line-height: 1.6; }

.toast { z-index: 160; }
.toast--bad strong { color: var(--blood-2) !important; }
.toast--warn strong { color: var(--amber) !important; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1280px) {
  .solver { grid-template-columns: 1fr; }
  .solver__in { position: static; max-height: none; }
  .sgrid { grid-template-columns: repeat(4, 1fr); }
  .sfld--w1 { grid-column: span 2; } .sfld--w2 { grid-column: span 2; }
}
@media (max-width: 1080px) {
  .lot, .wish { grid-template-columns: 1fr 1fr; }
  .lot__nums, .ses__nums { grid-column: 1 / -1; }
  .lot__acts { grid-column: 1 / -1; }
  .ses { grid-template-columns: 58px 1fr; }
}
@media (max-width: 900px) {
  :root { --rail: 0px; }
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: fixed; top: var(--topfull); left: 0; width: 250px; z-index: 65;
    transform: translateX(-100%); transition: transform .28s ease; border-right: 1px solid var(--line-strong);
  }
  .rail.is-open { transform: translateX(0); box-shadow: 24px 0 60px rgba(0,0,0,.6); }
  .app-burger { display: flex; }
  .topbar__status { display: none; }
  .topbar__search input { width: 150px; }
  .view { padding: 24px 18px calc(80px + var(--safe-bot)); }
  .fgrid { grid-template-columns: repeat(2, 1fr); }
  .fld--w3, .fld--w4 { grid-column: span 2; }
  .searchpanel { width: min(360px, calc(100vw - 24px)); }
}
@media (max-width: 620px) {
  .topbar { gap: 10px; padding: var(--safe-top) 12px 0; }
  .topbar__tag { display: none; }
  .topbar__search input { width: 120px; }
  /* Backup lives in Config on a phone; the bar has no room for six controls. */
  #btnExport, #btnImport { display: none; }
  .fgrid, .sgrid { grid-template-columns: 1fr; }
  .fld--w1, .fld--w2, .fld--w3, .fld--w4, .sfld--w1, .sfld--w2 { grid-column: span 1; }
  .lot, .wish { grid-template-columns: 1fr; }
  .phead__title { font-size: 30px; }
  .dialb__v { font-size: 27px; }
  .stat-tile--hero .stat-tile__value { font-size: 32px; }
  .rep__row { padding: 12px 40px 12px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* high-contrast / forced-colors: keep status readable without hue */
@media (forced-colors: active) {
  .meter i, .hbar__fill { forced-color-adjust: none; }
  .pill, .lot__pill { border: 1px solid CanvasText; }
}

/* ============================================================
   PRINT: range cards and spec sheets on paper
============================================================ */
@media print {
  @page { margin: 14mm; }
  .topbar, .rail, .editbar, .toolbar, .phead__actions, .dangerbar, .chart-fig__toggle,
  .boot, .modal, .toast, .ctip, .lot__acts, .backlink, .firstrun__demo { display: none !important; }
  .app-body { background: #fff; color: #000; }
  .shell { display: block; }
  .view { padding: 0; max-width: none; }
  .panel, .spec__group, .card-sec, .firing, .chart-fig, .kpirow, .diagrid, .stat-tile, .diag, .micro, .dialb {
    background: #fff !important; border-color: #bbb !important; color: #000 !important; break-inside: avoid;
  }
  .phead__title, .spec__gtitle, .panel__title, .dialb__v, .stat-tile__value, .micro__v,
  .lot__name, .wcard__name, .diag__l dd, .spec__list dd { color: #000 !important; }
  .phead__num, .spec__gnum, .panel__num, .firing__eyebrow, .diag__t { color: #b8121a !important; }
  .dtable td, .dtable th, .spec__list dt, .diag__l dt { color: #333 !important; border-color: #ddd !important; }
  .dtable--card { font-size: 9pt; }
  .dtable--card tr.is-target td { background: #f2dede !important; }
  a { text-decoration: none; color: #000 !important; }
}

/* ============================================================
   ACCESS GATE
============================================================ */
.app-body.is-gated { overflow: hidden; }
.app-body.is-gated .topbar,
.app-body.is-gated .shell,
.app-body.is-gated .boot { visibility: hidden; }

.gate {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: #000;
  transition: opacity .4s ease, visibility .4s ease;
}
.gate.is-open { opacity: 0; visibility: hidden; }
.gate__bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(184,18,26,.16) 0%, transparent 58%),
    linear-gradient(180deg, #050505 0%, #0a0a0b 60%, #050505 100%);
}
.gate__bg::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.026) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.026) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse at center, #000 8%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 8%, transparent 70%);
}
.gate__panel {
  position: relative; width: min(470px, 100%); text-align: center;
  border: 1px solid var(--line-strong); border-top: 2px solid var(--blood);
  background: rgba(12,12,13,.94); padding: 44px 38px 34px;
  box-shadow: 0 50px 110px rgba(0,0,0,.85);
}
.gate__logo { width: 54px; height: 54px; object-fit: contain; margin: 0 auto 20px; display: block; opacity: .95; }
.gate__eyebrow { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: .32em; color: var(--blood-2); margin-bottom: 14px; }
.gate__title { font-family: var(--font-display); font-size: 34px; letter-spacing: .05em; text-transform: uppercase; color: var(--bone); font-weight: 400; line-height: 1; margin-bottom: 16px; }
.gate__text { font-size: 13.5px; line-height: 1.7; color: var(--bone-2); margin-bottom: 24px; }
.gate__actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.gate__actions .btn { height: 44px; padding: 0 20px; font-size: 11px; letter-spacing: .16em; }
.gate__fine { font-size: 11px; color: var(--mute); line-height: 1.6; margin-bottom: 24px; }
.gate__form {
  display: flex; gap: 8px; align-items: stretch;
  border-top: 1px solid var(--line); padding-top: 22px;
}
.gate__form .btn { height: 42px; padding: 0 16px; font-size: 10.5px; letter-spacing: .14em; flex: 0 0 auto; }
.gate__input {
  flex: 1; min-width: 0; height: 42px; padding: 0 13px;
  background: var(--ink-3); border: 1px solid var(--line); border-left: 2px solid var(--blood);
  color: var(--bone); font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em;
  outline: none; border-radius: 0; -webkit-appearance: none; appearance: none; text-align: center;
}
.gate__input:focus { border-color: var(--line-strong); border-left-color: var(--blood-2); background: var(--steel); }
.gate__input::placeholder { color: #4e5055; letter-spacing: .16em; }
.gate__note { display: block; min-height: 16px; margin-top: 14px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; color: var(--blood-2); }
.gate__retry {
  background: none; border: none; cursor: pointer; margin-top: 6px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .18em; color: var(--mute);
  text-decoration: underline; text-underline-offset: 4px;
}
.gate__retry:hover { color: var(--bone); }
.gate__back { display: block; margin-top: 22px; font-size: 11.5px; color: var(--mute); text-decoration: none; }
.gate__back:hover { color: var(--blood-2); }
@media (max-width: 480px) {
  .gate__panel { padding: 34px 22px 26px; }
  .gate__title { font-size: 27px; }
  .gate__form { flex-direction: column; }
}
.gate__form--lead { border-top: none; padding-top: 6px; margin-bottom: 4px; }
.gate__form--lead .gate__input { height: 48px; font-size: 13px; }
.gate__form--lead .btn { height: 48px; }
.gate__panel .gate__fine { margin: 20px 0 6px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ============================================================
   PREVIEW BANNER
============================================================ */
.previewbar {
  position: sticky; top: 0; z-index: 80;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 9px 18px;
  background: var(--amber); color: #150c04;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em;
}
.previewbar__tag {
  font-weight: 600; letter-spacing: .26em; background: #150c04; color: var(--amber);
  padding: 4px 9px; flex-shrink: 0;
}
.previewbar__txt { flex: 1; min-width: 200px; line-height: 1.5; }
.previewbar__cta {
  font-weight: 600; letter-spacing: .16em; color: #150c04; text-decoration: none;
  border-bottom: 1px solid rgba(21,12,4,.45); padding-bottom: 2px; white-space: nowrap;
}
.previewbar__cta:hover { border-bottom-color: #150c04; }
.previewbar__reset {
  background: transparent; border: 1px solid rgba(21,12,4,.4); color: #150c04;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .16em; padding: 5px 9px; cursor: pointer;
}
.previewbar__reset:hover { background: #150c04; color: var(--amber); border-color: #150c04; }
/* The bar takes the top slot, so the console chrome sits under it. */
.is-preview .topbar { top: 0; }
@media (max-width: 620px) {
  .previewbar { padding: 8px 12px; gap: 10px; }
  .previewbar__txt { font-size: 9.5px; }
}

/* ---------- sync status + conflict ---------- */
.syncpill i { width: 6px; height: 6px; border-radius: 50%; background: var(--mute); display: block; }
.syncpill--ok i    { background: var(--ok); }
.syncpill--busy i  { background: var(--amber); animation: pulse 1.1s ease-in-out infinite; }
.syncpill--warn i  { background: var(--amber); }
.syncpill--local i { background: var(--mute); }
.syncpill--warn, .syncpill--busy { color: var(--amber) !important; }
.conflict { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.conflict__side { background: var(--ink-3); padding: 16px 18px; }
.conflict__side span { display: block; font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em; color: var(--blood-2); margin-bottom: 9px; }
.conflict__side b { display: block; font-family: var(--font-mono); font-size: 17px; color: var(--bone); }
.conflict__side small { display: block; font-size: 11px; color: var(--mute); margin-top: 6px; }
.reccode {
  font-family: var(--font-mono); font-size: 19px; letter-spacing: .18em; color: var(--bone);
  background: var(--ink-3); border: 1px solid var(--line-strong); border-left: 2px solid var(--blood);
  padding: 18px 16px; text-align: center; word-break: break-all; line-height: 1.6; user-select: all;
}
.syncpill--crit i { background: var(--blood-2); animation: pulse 1s ease-in-out infinite; }
.syncpill--crit { color: var(--blood-2) !important; }
