/* ================================================================
   ARMS · style.css  v6.0
   Government-grade refinement · Solid, sober, robust
   Deep emerald accent · Softened neutrals · Determinate splash
   ================================================================ */

/* ── Design tokens — light (default) ───────────────────────────── */
:root {
  /* Surfaces */
  --bg:           #ffffff;
  --panel:        #f7f7f9;
  --raised:       #ededef;
  --card:         #ffffff;
  --input-bg:     #ededef;
  --overlay:      rgba(0,0,0,0.42);

  /* Interactive states */
  --hover:        rgba(0,0,0,0.04);
  --hover-strong: rgba(0,0,0,0.06);
  --sel:          rgba(21,88,64,0.07);
  --pressed:      rgba(0,0,0,0.08);

  /* Separators */
  --sep:          #d6d6d9;
  --sep-soft:     #e8e8eb;

  /* Text — institutional hierarchy */
  --tx-hi:        #1d1d1f;
  --tx-md:        #6e6e73;
  --tx-lo:        #86868b;
  --tx-faint:     #aeaeb2;

  /* Accent — deep emerald (sober, institutional, distinct from blue) */
  --accent:       #155840;
  --accent-h:     #0e3e2c;
  --accent-soft:  rgba(21,88,64,0.10);

  /* Status */
  --ok:           #1d8348;
  --warn:         #a06a14;
  --err:          #b3261e;

  /* Typography — Apple system stack */
  --f-display:    -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --f-body:       -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --f-mono:       ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, "Cascadia Mono", Consolas, monospace;

  /* Layout */
  --topbar-h:     58px;
  --toolbar-h:    44px;
  --thhd-h:       30px;
  --row-h:        36px;
  --si-h:         26px;
  --sidebar-w:    220px;
  --detail-w:     330px;
  --statusbar-h:  26px;

  /* Radii */
  --r-xs:         3px;
  --r-sm:         5px;
  --r-md:         7px;
  --r-lg:         10px;
  --r-xl:         14px;
  --r-pill:       999px;

  /* Shadows — only for floating elements */
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.06);
  --shadow-modal: 0 20px 50px rgba(0,0,0,0.18), 0 6px 18px rgba(0,0,0,0.10);

  /* Transitions */
  --t-fast:       100ms cubic-bezier(0.4,0,0.2,1);
  --t-base:       180ms cubic-bezier(0.4,0,0.2,1);
}

/* ── Dark theme — softened neutrals, less stark ────────────────── */
html.dark {
  --bg:           #1c1c1e;
  --panel:        #141416;
  --raised:       #28282b;
  --card:         #1c1c1e;
  --input-bg:     #28282b;
  --overlay:      rgba(0,0,0,0.55);

  --hover:        rgba(255,255,255,0.04);
  --hover-strong: rgba(255,255,255,0.07);
  --sel:          rgba(95,167,138,0.12);
  --pressed:      rgba(255,255,255,0.10);

  --sep:          #2e2e31;
  --sep-soft:     #232326;

  --tx-hi:        #e8e8ea;
  --tx-md:        #98989c;
  --tx-lo:        #6e6e73;
  --tx-faint:     #48484a;

  --accent:       #5fa78a;
  --accent-h:     #79bea0;
  --accent-soft:  rgba(95,167,138,0.12);

  --ok:           #4caf80;
  --warn:         #d4a76a;
  --err:          #e07065;

  --shadow-md:    0 6px 18px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.35);
  --shadow-modal: 0 28px 64px rgba(0,0,0,0.65), 0 8px 22px rgba(0,0,0,0.42);
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; width: 100%; overflow: hidden;
  background: var(--bg); color: var(--tx-hi);
  font-family: var(--f-body);
  font-size: 13px; font-weight: 400; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.003em;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--f-body); cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: var(--f-body); }
[hidden] { display: none !important; }

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

::-webkit-scrollbar            { width: 8px; height: 8px; }
::-webkit-scrollbar-track      { background: transparent; }
::-webkit-scrollbar-thumb      { background: transparent; border-radius: 4px; transition: background var(--t-base); }
*:hover > ::-webkit-scrollbar-thumb,
*:hover::-webkit-scrollbar-thumb { background: var(--sep); }
::-webkit-scrollbar-thumb:hover{ background: var(--tx-faint); }

.material-symbols-outlined {
  font-variation-settings: 'opsz' 24, 'wght' 400, 'FILL' 0;
  user-select: none;
  vertical-align: middle;
}

/* ================================================================
   SPLASH — sober, determinate, institutional
   ================================================================ */
.splash {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
  transition: opacity 480ms cubic-bezier(0.4,0,0.2,1);
}
.splash.hide { opacity: 0; pointer-events: none; }

.splash-content {
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  animation: splashIn 700ms cubic-bezier(0.4,0,0.2,1) both;
}
@keyframes splashIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.splash-org {
  font-family: var(--f-display);
  font-size: 11px; font-weight: 500;
  color: var(--tx-md);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.splash-rule {
  width: 44px; height: 1px;
  background: var(--sep);
  margin: 14px auto 16px;
}
.splash-system {
  font-family: var(--f-display);
  font-size: 22px; font-weight: 500;
  color: var(--tx-hi);
  letter-spacing: -0.014em;
  margin-bottom: 44px;
  max-width: 460px;
  line-height: 1.25;
}
.splash-loader {
  width: 240px; height: 1px;
  background: var(--sep);
  position: relative;
  overflow: hidden;
}
.splash-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  animation: splashFill 1100ms cubic-bezier(0.65,0,0.35,1) forwards;
}
@keyframes splashFill {
  from { width: 0; }
  to   { width: 100%; }
}

/* ================================================================
   SHELL
   ================================================================ */
.app      { display: flex; flex-direction: column; height: 100vh; width: 100vw; }
.body     { display: flex; flex: 1; overflow: hidden; }
.main-col { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.hidden   { display: none !important; }

/* ================================================================
   TOPBAR
   ================================================================ */
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  display: grid; grid-template-columns: 1fr 1.6fr 1fr; align-items: center;
  padding: 0 18px;
  background: var(--panel);
  border-bottom: 1px solid var(--sep);
}

.topbar-brand {
  display: flex; align-items: center;
  min-width: 0;
}
.brand-text {
  display: flex; flex-direction: column;
  line-height: 1.1; min-width: 0;
}
.brand-name {
  font-family: var(--f-display);
  font-size: 13.5px; font-weight: 600;
  letter-spacing: -0.012em;
  color: var(--tx-hi);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.brand-org {
  font-size: 10.5px; font-weight: 500;
  color: var(--tx-md);
  letter-spacing: 0.06em;
  margin-top: 3px;
  text-transform: uppercase;
}

/* Search — pill-shaped, more rounded */
.topbar-center { display: flex; justify-content: center; }
.search-box {
  position: relative;
  width: 100%; max-width: 480px;
  height: 34px;
  display: flex; align-items: center;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 0 14px;
  transition: border-color var(--t-base), background var(--t-base);
}
.search-box:focus-within {
  border-color: var(--accent);
  background: var(--bg);
}
.search-ico { font-size: 17px; color: var(--tx-md); margin-right: 8px; }
.search-in {
  flex: 1; height: 100%;
  background: transparent; border: none; outline: none;
  color: var(--tx-hi); font-size: 12.5px;
}
.search-in::placeholder { color: var(--tx-md); }
.search-in::-webkit-search-cancel-button { display: none; }

.search-clear {
  width: 22px; height: 22px;
  display: none; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--tx-md);
  margin-right: 2px;
}
.search-clear:hover { background: var(--hover-strong); color: var(--tx-hi); }
.search-clear .material-symbols-outlined { font-size: 14px; }
.search-box.has-value .search-clear { display: flex; }
.search-box.has-value .kbd { display: none; }

.kbd {
  font-family: var(--f-mono); font-size: 10px; font-weight: 500;
  color: var(--tx-md);
  padding: 1px 6px;
  background: var(--bg);
  border: 1px solid var(--sep);
  border-radius: var(--r-xs);
  white-space: nowrap;
}

/* Right buttons */
.topbar-right { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }

.icon-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  color: var(--tx-md);
  transition: background var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { background: var(--hover); color: var(--tx-hi); }
.icon-btn .material-symbols-outlined { font-size: 19px; }

.ghost-btn {
  height: 32px; padding: 0 12px;
  display: flex; align-items: center; gap: 6px;
  border-radius: var(--r-md);
  color: var(--tx-md);
  font-size: 12px; font-weight: 500;
  transition: all var(--t-fast);
}
.ghost-btn:hover { background: var(--hover); color: var(--tx-hi); }
.ghost-btn .material-symbols-outlined { font-size: 17px; }

/* ================================================================
   SIDEBAR (compact)
   ================================================================ */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--panel);
  border-right: 1px solid var(--sep);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.sidebar-body {
  flex: 1; overflow-y: auto;
  padding: 12px 8px;
}
.nav-group { margin-bottom: 16px; }
.nav-group:last-child { margin-bottom: 0; }
.nav-lbl {
  font-size: 10px; font-weight: 700;
  color: var(--tx-md);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0 10px 6px;
}

.si {
  height: var(--si-h);
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px;
  border-radius: var(--r-sm);
  color: var(--tx-md);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  user-select: none;
  font-size: 12px;
}
.si:hover { background: var(--hover); color: var(--tx-hi); }
.si.active {
  background: var(--hover-strong);
  color: var(--tx-hi);
  font-weight: 500;
}
.si .material-symbols-outlined { font-size: 16px; flex-shrink: 0; }
.si-lbl { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-cnt {
  font-size: 10.5px; font-family: var(--f-mono); font-weight: 500;
  color: var(--tx-lo);
  min-width: 18px; text-align: right;
}
.si.active .si-cnt { color: var(--tx-md); }

.sidebar-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--sep);
}
.copy {
  font-size: 10.5px; line-height: 1.55;
  color: var(--tx-lo);
}
.copy a { color: var(--tx-md); }
.copy a:hover { color: var(--accent); }

/* ================================================================
   TOOLBAR
   ================================================================ */
.toolbar {
  height: var(--toolbar-h); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--sep);
}
.toolbar-left { display: flex; align-items: baseline; gap: 12px; }
.breadcrumb {
  font-family: var(--f-display);
  font-size: 14px; font-weight: 600;
  color: var(--tx-hi);
  letter-spacing: -0.008em;
}
.res-count {
  font-size: 11px; font-family: var(--f-mono);
  color: var(--tx-md);
}
.toolbar-right { display: flex; align-items: center; gap: 4px; }

.chip {
  height: 26px; padding: 0 11px;
  border-radius: var(--r-pill);
  background: transparent;
  border: 1px solid var(--sep);
  color: var(--tx-md);
  font-size: 11.5px; font-weight: 500;
  transition: all var(--t-fast);
}
.chip:hover { border-color: var(--tx-faint); color: var(--tx-hi); }
.chip.active {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.vdiv { width: 1px; height: 16px; background: var(--sep); margin: 0 6px; }

.view-btn {
  width: 28px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  color: var(--tx-md);
  transition: all var(--t-fast);
}
.view-btn:hover { background: var(--hover); color: var(--tx-hi); }
.view-btn.active { background: var(--hover-strong); color: var(--tx-hi); }
.view-btn .material-symbols-outlined { font-size: 17px; }

/* ================================================================
   CONTENT ROW
   ================================================================ */
.content-row { flex: 1; display: flex; overflow: hidden; }
.file-section {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--bg);
  overflow: hidden;
}

.thhd {
  height: var(--thhd-h); flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(220px,1.8fr) 1fr 1fr 130px 80px 100px;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--sep);
  background: var(--bg);
  position: sticky; top: 0; z-index: 5;
}
.th {
  font-size: 10.5px; font-weight: 700;
  color: var(--tx-md);
  text-transform: uppercase; letter-spacing: 0.06em;
  user-select: none;
  display: flex; align-items: center; gap: 4px;
}
.th.r { justify-content: flex-end; }
.th.sortable { cursor: pointer; transition: color var(--t-fast); }
.th.sortable:hover { color: var(--tx-hi); }
.th.sort-asc, .th.sort-desc { color: var(--tx-hi); }
.sort-arrow { width: 8px; height: 12px; display: inline-block; position: relative; }
.sort-arrow::before, .sort-arrow::after {
  content: ''; position: absolute; left: 50%;
  width: 0; height: 0;
  border-left: 3px solid transparent;
  border-right: 3px solid transparent;
}
.sort-arrow::before { top: 1px;    transform: translateX(-50%); border-bottom: 3px solid currentColor; opacity: 0.25; }
.sort-arrow::after  { bottom: 1px; transform: translateX(-50%); border-top:    3px solid currentColor; opacity: 0.25; }
.th.sort-asc  .sort-arrow::before { opacity: 1; }
.th.sort-desc .sort-arrow::after  { opacity: 1; }

.file-area { flex: 1; overflow-y: auto; padding-bottom: 12px; }

/* List rows */
.list-body { display: flex; flex-direction: column; }
.frow {
  height: var(--row-h);
  display: grid;
  grid-template-columns: minmax(220px,1.8fr) 1fr 1fr 130px 80px 100px;
  align-items: center;
  padding: 0 18px;
  border-bottom: 1px solid var(--sep-soft);
  cursor: pointer;
  transition: background var(--t-fast);
}
.frow:hover { background: var(--hover); }
.frow.sel {
  background: var(--sel);
  box-shadow: inset 2px 0 0 var(--accent);
}
.fcell { overflow: hidden; min-width: 0; display: flex; align-items: center; }
.fcell.r { justify-content: flex-end; }
.fname {
  font-weight: 500; font-size: 12.5px;
  color: var(--tx-hi);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fsubj, .fdtype {
  font-size: 12px; color: var(--tx-md);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.flangs {
  font-family: var(--f-mono);
  font-size: 11px; font-weight: 500;
  color: var(--tx-md);
  letter-spacing: 0.05em;
  display: flex; gap: 5px;
  overflow: hidden;
}
.flangs .flang { text-transform: uppercase; }
.fsize, .fdate {
  font-family: var(--f-mono); font-size: 11px;
  color: var(--tx-md);
}

/* Grid view */
.grid-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; padding: 14px 18px;
}
.gcard {
  background: var(--card);
  border: 1px solid var(--sep);
  border-radius: var(--r-md);
  padding: 14px;
  cursor: pointer;
  transition: border-color var(--t-base), background var(--t-fast);
  display: flex; flex-direction: column;
  position: relative;
}
.gcard:hover { border-color: var(--tx-faint); }
.gcard.sel {
  border-color: var(--accent);
  background: var(--sel);
}
.gcard-prev {
  height: 80px;
  display: flex; align-items: center; justify-content: center;
  background: var(--raised);
  border-radius: var(--r-sm);
  margin-bottom: 11px;
}
.gcard-prev .material-symbols-outlined {
  font-size: 30px; color: var(--tx-md);
  font-variation-settings: 'opsz' 32, 'wght' 300, 'FILL' 0;
}
.gcard-name {
  font-weight: 600; font-size: 12.5px;
  color: var(--tx-hi);
  margin-bottom: 4px; line-height: 1.35;
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.gcard-sub {
  font-size: 11.5px; color: var(--tx-md);
  margin-bottom: 8px;
  line-height: 1.4;
}
.gcard-langs {
  font-family: var(--f-mono);
  font-size: 10.5px; font-weight: 500;
  color: var(--tx-lo);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: auto;
}

/* Empty / no-results state */
.empty-state {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px;
  color: var(--tx-md);
  text-align: center;
}
.empty-state .material-symbols-outlined {
  font-size: 44px; color: var(--tx-faint); margin-bottom: 14px;
  font-variation-settings: 'opsz' 48, 'wght' 200, 'FILL' 0;
}
.empty-state .empty-title {
  font-family: var(--f-display);
  font-weight: 600; font-size: 16px;
  color: var(--tx-hi);
  margin-bottom: 5px;
  letter-spacing: -0.008em;
}
.empty-state .empty-sub { font-size: 12.5px; max-width: 320px; }
.empty-state em {
  color: var(--tx-hi); font-style: normal;
  font-family: var(--f-mono); font-size: 11.5px;
}

/* ================================================================
   DETAIL PANEL — text-first
   ================================================================ */
.detail-panel {
  width: var(--detail-w); flex-shrink: 0;
  background: var(--panel);
  border-left: 1px solid var(--sep);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.detail-hd {
  height: var(--toolbar-h); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--sep);
}
.detail-hd-lbl {
  font-size: 10.5px; font-weight: 700;
  color: var(--tx-md);
  text-transform: uppercase; letter-spacing: 0.08em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-close {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--tx-md);
  transition: all var(--t-fast);
}
.detail-close:hover { background: var(--hover-strong); color: var(--tx-hi); }
.detail-close .material-symbols-outlined { font-size: 15px; }

.detail-body { flex: 1; overflow-y: auto; }

/* Empty state */
.detail-empty {
  height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.detail-empty .empty-title {
  font-family: var(--f-display);
  font-weight: 600; font-size: 15px;
  color: var(--tx-hi);
  margin-bottom: 6px;
  letter-spacing: -0.008em;
}
.detail-empty .empty-sub {
  font-size: 12px;
  color: var(--tx-md);
  max-width: 240px;
  line-height: 1.55;
}

.detail-content { display: flex; flex-direction: column; }

/* Hero */
.d-hero {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--sep);
}
.d-title {
  font-family: var(--f-display);
  font-weight: 600; font-size: 17px;
  line-height: 1.25; letter-spacing: -0.012em;
  color: var(--tx-hi);
  margin-bottom: 5px;
  word-break: break-word;
}
.d-subtitle { font-size: 12px; color: var(--tx-md); }
.d-subtitle .d-version {
  margin-left: 6px;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--tx-lo);
}

/* Sections */
.d-section {
  padding: 14px 20px;
  border-bottom: 1px solid var(--sep);
}
.d-section:last-of-type { border-bottom: none; }
.d-section-lbl {
  font-size: 10px; font-weight: 700;
  color: var(--tx-md);
  text-transform: uppercase; letter-spacing: 0.10em;
  margin-bottom: 7px;
}
.d-value {
  font-size: 13px;
  color: var(--tx-hi);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.003em;
}
.d-abstract {
  font-size: 12.5px; line-height: 1.6;
  color: var(--tx-md);
}

/* Available languages — plain text with subtle bullets */
.d-langs {
  font-size: 13px;
  color: var(--tx-hi);
  display: flex; flex-wrap: wrap; gap: 4px 14px;
}
.d-langs .d-lang {
  display: inline-flex; align-items: center; gap: 6px;
}
.d-langs .d-lang::before {
  content: ''; width: 4px; height: 4px;
  background: var(--tx-faint);
  border-radius: 50%;
}

/* Details mini-table */
.d-meta { display: flex; flex-direction: column; gap: 6px; }
.d-meta-row {
  display: grid; grid-template-columns: 90px 1fr; align-items: baseline;
  font-size: 12.5px;
}
.d-meta-row > span:first-child {
  color: var(--tx-md);
  font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 500;
}
.d-meta-row > span:last-child {
  color: var(--tx-hi);
  font-family: var(--f-mono);
  font-size: 11.5px;
}

/* Footer */
.detail-foot {
  flex-shrink: 0;
  display: flex; gap: 8px;
  padding: 12px 14px;
  background: var(--panel);
  border-top: 1px solid var(--sep);
}
.d-btn {
  flex: 1; height: 34px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-md);
  font-size: 12.5px; font-weight: 600;
  transition: all var(--t-fast);
  letter-spacing: 0.005em;
}
.d-btn .material-symbols-outlined { font-size: 16px; }
.d-btn-primary {
  background: var(--accent);
  color: white;
}
.d-btn-primary:hover { background: var(--accent-h); }
.d-btn-ghost {
  background: var(--raised);
  color: var(--tx-hi);
  border: 1px solid var(--sep);
}
.d-btn-ghost:hover { background: var(--hover-strong); }

/* ================================================================
   STATUSBAR
   ================================================================ */
.statusbar {
  height: var(--statusbar-h); flex-shrink: 0;
  display: flex; align-items: center; gap: 4px;
  padding: 0 14px;
  background: var(--panel);
  border-top: 1px solid var(--sep);
  font-size: 10.5px; color: var(--tx-md);
}
.sb { display: flex; align-items: center; gap: 4px; }
.sb-sep { color: var(--tx-lo); margin: 0 4px; }
.sb-kbd {
  font-family: var(--f-mono); font-size: 9.5px;
  padding: 1px 4px;
  background: var(--bg);
  border: 1px solid var(--sep);
  border-radius: 2px;
  color: var(--tx-md);
}

/* ================================================================
   MODAL
   ================================================================ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 20px;
  animation: bdIn 180ms cubic-bezier(0.4,0,0.2,1);
}
@keyframes bdIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  position: relative;
  width: 100%; max-width: 520px;
  max-height: calc(100vh - 40px);
  background: var(--card);
  border: 1px solid var(--sep);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-modal);
  overflow-y: auto;
  animation: modalIn 220ms cubic-bezier(0.34,1.2,0.64,1);
}
.modal-narrow { max-width: 440px; }
.modal-wide   { max-width: 880px; }

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--tx-md);
  transition: all var(--t-fast);
  z-index: 2;
}
.modal-close:hover { background: var(--hover-strong); color: var(--tx-hi); }
.modal-close .material-symbols-outlined { font-size: 16px; }

.modal-hd {
  padding: 24px 26px 14px;
  border-bottom: 1px solid var(--sep);
}
.modal-wide .modal-hd {
  padding: 26px 36px 16px;
}
.modal-title {
  font-family: var(--f-display);
  font-weight: 600; font-size: 18px;
  letter-spacing: -0.012em;
  color: var(--tx-hi);
  margin-bottom: 5px;
}
.modal-sub {
  font-size: 12.5px; line-height: 1.5;
  color: var(--tx-md);
  max-width: 460px;
}

.modal-foot {
  padding: 14px 26px;
  display: flex; justify-content: flex-end;
  border-top: 1px solid var(--sep);
}

/* Language picker options */
.lang-options {
  padding: 12px;
  display: flex; flex-direction: column; gap: 4px;
}
.lang-option {
  display: grid; grid-template-columns: 32px 1fr auto;
  align-items: center; gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: transparent;
  border: 1px solid transparent;
  color: var(--tx-hi);
  text-align: left;
  transition: all var(--t-fast);
  cursor: pointer;
}
.lang-option:hover {
  background: var(--hover);
  border-color: var(--sep);
}
.lang-option .lo-code {
  font-family: var(--f-mono);
  font-size: 11px; font-weight: 600;
  color: var(--tx-md);
  letter-spacing: 0.04em;
}
.lang-option .lo-name {
  font-size: 13.5px; font-weight: 500;
  color: var(--tx-hi);
}
.lang-option .lo-meta {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--tx-md);
}

/* ================================================================
   CONTRIBUTE MODAL — tutorial + form
   ================================================================ */

/* Tutorial section */
.ctb-tutorial {
  padding: 28px 36px 12px;
}
.ctb-eyebrow {
  font-size: 10.5px; font-weight: 700;
  color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.10em;
  margin-bottom: 12px;
}
.ctb-headline {
  font-family: var(--f-display);
  font-weight: 600; font-size: 26px;
  letter-spacing: -0.018em;
  color: var(--tx-hi);
  margin-bottom: 12px;
  line-height: 1.22;
}
.ctb-lede {
  font-size: 13.5px; line-height: 1.65;
  color: var(--tx-md);
  margin-bottom: 24px;
  max-width: 680px;
}

/* 2x2 cards explaining the philosophy */
.ctb-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 22px;
}
.ctb-card {
  display: flex; flex-direction: column;
  padding: 18px 20px;
  background: transparent;
  border: 1px solid var(--sep);
  border-radius: var(--r-md);
}
.ctb-card-ico {
  font-size: 22px;
  color: var(--accent);
  margin-bottom: 10px;
  font-variation-settings: 'opsz' 24, 'wght' 400, 'FILL' 0;
}
.ctb-card-title {
  font-family: var(--f-display);
  font-weight: 600; font-size: 14px;
  color: var(--tx-hi);
  letter-spacing: -0.008em;
  margin-bottom: 6px;
}
.ctb-card-body {
  font-size: 12.5px; line-height: 1.55;
  color: var(--tx-md);
}

/* Skip-tutorial button */
.ctb-skip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 16px;
  background: transparent;
  border: 1px solid var(--sep);
  border-radius: var(--r-pill);
  color: var(--tx-md);
  font-size: 12px; font-weight: 500;
  margin-bottom: 4px;
  transition: all var(--t-fast);
}
.ctb-skip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.ctb-skip .material-symbols-outlined { font-size: 14px; }

/* Divider between tutorial and form */
.ctb-divider {
  border: none;
  height: 1px;
  background: var(--sep);
  margin: 24px 0 0;
}

/* Form */
.ctb-form { padding: 26px 36px 6px; }

.ctb-form-title {
  font-family: var(--f-display);
  font-weight: 600; font-size: 17px;
  color: var(--tx-hi);
  letter-spacing: -0.012em;
  margin-bottom: 18px;
  scroll-margin-top: 18px;
}

.ctb-section {
  font-size: 11px; font-weight: 700;
  color: var(--tx-md);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 22px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--sep);
}
.ctb-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }

.ctb-field { margin-bottom: 14px; }

.ctb-label-strong {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--tx-hi);
  margin-bottom: 12px;
  letter-spacing: -0.005em;
}

/* Type selector — radio cards */
.ctb-types {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.ctb-type {
  position: relative;
  display: block;
  cursor: pointer;
}
.ctb-type input {
  position: absolute; opacity: 0; pointer-events: none;
}
.ctb-type-card {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center; gap: 14px;
  padding: 14px 16px;
  background: transparent;
  border: 1px solid var(--sep);
  border-radius: var(--r-md);
  transition: all var(--t-fast);
}
.ctb-type:hover .ctb-type-card {
  border-color: var(--tx-faint);
}
.ctb-type input:checked + .ctb-type-card {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.ctb-type-ico {
  font-size: 24px;
  color: var(--tx-md);
  font-variation-settings: 'opsz' 24, 'wght' 400, 'FILL' 0;
  transition: color var(--t-fast);
}
.ctb-type input:checked + .ctb-type-card .ctb-type-ico {
  color: var(--accent);
}
.ctb-type-text {
  display: flex; flex-direction: column;
  min-width: 0;
}
.ctb-type-name {
  font-size: 13.5px; font-weight: 600;
  color: var(--tx-hi);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
}
.ctb-type-desc {
  font-size: 12px; line-height: 1.45;
  color: var(--tx-md);
}

/* Conditional field groups */
.ctb-conditional {
  animation: ctbFade 220ms cubic-bezier(0.4,0,0.2,1);
}
@keyframes ctbFade {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Verification notice — important info banner with left accent rule */
.ctb-notice {
  display: flex; gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  background: var(--input-bg);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  font-size: 12px; line-height: 1.6;
  color: var(--tx-md);
}
.ctb-notice strong {
  font-weight: 600;
  color: var(--tx-hi);
}
.ctb-notice-ico {
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
  font-variation-settings: 'opsz' 20, 'wght' 400, 'FILL' 0;
}

/* Hint at bottom */
.ctb-hint {
  display: flex; gap: 12px;
  margin-top: 22px;
  padding: 14px 16px;
  background: var(--input-bg);
  border-radius: var(--r-md);
  font-size: 12px; line-height: 1.55;
  color: var(--tx-md);
}
.ctb-hint-ico {
  font-size: 17px;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 1px;
  font-variation-settings: 'opsz' 20, 'wght' 400, 'FILL' 0;
}
.ctb-email {
  font-family: var(--f-mono);
  color: var(--tx-hi);
}

/* Modal footer for contribute (matches form padding) */
.ctb-foot {
  padding: 16px 36px;
  margin-top: 6px;
  display: flex; gap: 12px; justify-content: flex-end;
}

/* Tighter on narrow viewports */
@media (max-width: 760px) {
  .ctb-cards { grid-template-columns: 1fr; }
  .ctb-tutorial, .ctb-form, .ctb-foot { padding-left: 22px; padding-right: 22px; }
}

/* ================================================================
   FEEDBACK FORM — shared input/button styles (reused by contribute)
   ================================================================ */
.fb-form { padding: 20px 26px 22px; }
.fb-field { margin-bottom: 16px; }
.fb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.fb-row > .fb-field { margin-bottom: 0; }

.fb-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  color: var(--tx-hi);
  text-transform: uppercase; letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.fb-opt {
  font-weight: 400; text-transform: none;
  letter-spacing: 0; font-size: 11px;
  color: var(--tx-md); font-style: italic;
}
.fb-req {
  font-weight: 500; text-transform: none;
  letter-spacing: 0; font-size: 10.5px;
  color: var(--err);
}

.fb-input {
  width: 100%;
  padding: 9px 11px;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  color: var(--tx-hi);
  font-size: 12.5px;
  outline: none;
  transition: all var(--t-fast);
}
.fb-input::placeholder { color: var(--tx-md); }
.fb-input:focus {
  border-color: var(--accent);
  background: var(--bg);
}
.fb-input.invalid { border-color: var(--err); }
.fb-textarea { resize: vertical; min-height: 100px; line-height: 1.55; font-family: var(--f-body); }

.fb-counter {
  text-align: right;
  font-family: var(--f-mono); font-size: 10.5px;
  color: var(--tx-md);
  margin-top: 4px;
}

.fb-radios {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.fb-radio { position: relative; cursor: pointer; }
.fb-radio input { position: absolute; opacity: 0; pointer-events: none; }
.fb-radio > span {
  display: flex; align-items: center; justify-content: center;
  padding: 8px 6px;
  background: transparent;
  border: 1px solid var(--sep);
  border-radius: var(--r-md);
  color: var(--tx-md);
  font-size: 12px; font-weight: 500;
  transition: all var(--t-fast);
  text-align: center;
}
.fb-radio:hover > span { border-color: var(--tx-faint); color: var(--tx-hi); }
.fb-radio input:checked + span {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

.fb-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 18px;
}
.fb-btn {
  height: 36px; padding: 0 16px;
  display: flex; align-items: center; gap: 6px;
  border-radius: var(--r-md);
  font-size: 12.5px; font-weight: 600;
  transition: all var(--t-fast);
}
.fb-btn .material-symbols-outlined { font-size: 16px; }
.fb-btn-ghost {
  background: transparent;
  color: var(--tx-md);
  border: 1px solid var(--sep);
}
.fb-btn-ghost:hover { color: var(--tx-hi); border-color: var(--tx-faint); }
.fb-btn-primary {
  background: var(--accent);
  color: white;
}
.fb-btn-primary:hover { background: var(--accent-h); }
.fb-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.fb-hint {
  display: block;
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--input-bg);
  border-radius: var(--r-md);
  font-size: 11.5px; line-height: 1.5;
  color: var(--tx-md);
}
.fb-email-display { font-family: var(--f-mono); color: var(--tx-hi); }

/* ================================================================
   TOAST
   ================================================================ */
.toast {
  position: fixed; bottom: 50px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 200;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px;
  background: var(--card);
  border: 1px solid var(--sep);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  font-size: 12px; font-weight: 500;
  color: var(--tx-hi);
  opacity: 0;
  transition: all 220ms cubic-bezier(0.34,1.3,0.64,1);
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast .material-symbols-outlined { font-size: 16px; color: var(--ok); }
.toast.err .material-symbols-outlined { color: var(--err); }

/* ================================================================
   MOBILE NOTICE
   ================================================================ */
.mobile-notice {
  display: none;
  position: fixed; inset: 0; z-index: 1100;
  background: var(--bg);
  align-items: center; justify-content: center;
  padding: 32px;
}
.mobile-notice-inner { text-align: center; max-width: 360px; }
.mobile-notice-icon {
  font-size: 42px; color: var(--tx-md);
  margin-bottom: 16px;
  font-variation-settings: 'opsz' 48, 'wght' 300, 'FILL' 0;
}
.mobile-notice-title {
  font-family: var(--f-display);
  font-weight: 600; font-size: 18px;
  color: var(--tx-hi);
  margin-bottom: 10px;
  letter-spacing: -0.008em;
}
.mobile-notice-text {
  font-size: 13px; color: var(--tx-md);
  line-height: 1.55; margin-bottom: 14px;
}
.mobile-notice-hint {
  font-size: 11.5px; color: var(--tx-lo);
  line-height: 1.55;
}

@media (max-width: 880px) {
  .app, .modal-backdrop, .toast, .splash { display: none !important; }
  .mobile-notice { display: flex; }
}

/* Narrow desktop */
@media (max-width: 1180px) {
  :root {
    --sidebar-w: 200px;
    --detail-w: 300px;
  }
  .thhd, .frow {
    grid-template-columns: minmax(180px,1.7fr) 0.9fr 0.9fr 110px 70px 90px;
  }
}
