/* Layout: one column "field notebook" — unit header on top, orders-slip event cards, fixed bottom tab bar. Deliberately dark only (night-ops look). */
:root {
  --bg: #101417;
  --bg-raise: #161c20;
  --surface: #1c2328;
  --surface-2: #232c32;
  --line: #2c373e;
  --ink: #e8eae4;
  --ink-2: #a6b0b5;
  --ink-3: #6f7a81;
  --sand: #cdb98a;          /* accent: desert tan */
  --sand-strong: #e0cf9f;
  --sand-ink: #1b170b;
  --go: #52c08a;
  --maybe: #e3b443;
  --no: #e06a5f;
  --live: #6fb6ff;

  --font-display: "Karantina", "Secular One", "Arial Narrow", system-ui, sans-serif;
  --font-body: "IBM Plex Sans Hebrew", "Assistant", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --r-sm: 6px;
  --r: 10px;
  --tabbar-h: 62px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: 0; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.demo-banner {
  background: repeating-linear-gradient(-45deg, #2a2412 0 10px, #241f10 10px 20px);
  color: var(--sand-strong);
  font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  text-align: center; padding: 6px 16px;
}
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.emblem { width: 34px; height: 34px; color: var(--sand); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.brand-text b { font: 700 27px/0.95 var(--font-display); letter-spacing: .02em; }
.brand-text small { color: var(--ink-3); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bell { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-2); }
.bell svg { width: 23px; height: 23px; }
.bell:hover { background: var(--surface); }
.bell-dot { position: absolute; top: 8px; left: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--maybe); box-shadow: 0 0 0 2px var(--bg); }
.bell-dot.on { background: var(--go); }

/* ---------- layout ---------- */
.view { max-width: 640px; margin: 0 auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 18px; outline: none; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--ink-3); padding: 40px 0; justify-content: center; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--sand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font: 700 30px/1 var(--font-display); letter-spacing: .02em; }
.eyebrow { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: .06em; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--sand); border-color: var(--sand); color: var(--sand-ink); }
.btn-primary:hover { background: var(--sand-strong); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--no); border-color: color-mix(in srgb, var(--no) 40%, var(--line)); background: transparent; }
.btn-danger.arm { background: var(--no); color: #fff; border-color: var(--no); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.card h3 { font-size: 16px; font-weight: 700; }
.card p { margin: 0; color: var(--ink-2); }
.hint-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); border: 1px dashed color-mix(in srgb, var(--maybe) 55%, var(--line)); background: color-mix(in srgb, var(--maybe) 7%, var(--bg)); }
.hint-bar p { margin: 0; flex: 1; min-width: 0; font-size: 14px; }
.x { background: none; border: 0; color: var(--ink-3); font-size: 20px; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip-soon { background: color-mix(in srgb, var(--sand) 18%, var(--surface)); color: var(--sand-strong); }
.chip-live { background: color-mix(in srgb, var(--live) 18%, var(--surface)); color: var(--live); }
.chip-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s ease-in-out infinite; }
.chip-no { background: color-mix(in srgb, var(--no) 18%, var(--surface)); color: var(--no); }
@keyframes pulse { 50% { opacity: .3; } }
.mine { font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.mine::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.mine-go { color: var(--go); } .mine-maybe { color: var(--maybe); } .mine-no { color: var(--no); }
.mine-none { color: var(--ink-3); }
.mine-none::before { background: transparent; border: 1.5px solid currentColor; }
.role { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: var(--sand); border: 1px solid color-mix(in srgb, var(--sand) 45%, transparent); padding: 1px 7px; border-radius: 4px; }

/* ---------- event cards (orders slips) ---------- */
.ev-list { display: flex; flex-direction: column; gap: 10px; }
.ev-card {
  display: grid; grid-template-columns: 64px 1fr; gap: 14px;
  padding: 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
  transition: border-color .15s, transform .15s;
}
.ev-card:hover { border-color: color-mix(in srgb, var(--sand) 40%, var(--line)); }
.ev-card:active { transform: scale(.99); }
.ev-date { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 2px; border-inline-end: 1px dashed var(--line); padding-inline-end: 12px; }
.ev-dnum { font: 700 44px/0.9 var(--font-display); color: var(--ink); }
.ev-mon { font-size: 13px; font-weight: 600; color: var(--sand); }
.ev-wd { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.ev-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ev-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ev-title { font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.ev-meta { color: var(--ink-2); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.ev-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.is-cancelled .ev-title { text-decoration: line-through; color: var(--ink-3); }
.is-cancelled .ev-dnum { color: var(--ink-3); }
.is-past { opacity: .62; }

.tally { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface-2); gap: 2px; margin-top: 4px; }
.tally span { display: block; min-width: 0; }
.t-go { background: var(--go); } .t-maybe { background: var(--maybe); } .t-no { background: var(--no); } .t-rest { background: transparent; }
.tally-legend { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12.5px; color: var(--ink-3); }
.tally-legend b { font-weight: 600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tally-legend .go b { color: var(--go); } .tally-legend .maybe b { color: var(--maybe); }

details.past { border-top: 1px solid var(--line); padding-top: 12px; }
details.past summary { cursor: pointer; color: var(--ink-2); font-weight: 600; list-style: none; display: flex; justify-content: space-between; }
details.past summary::-webkit-details-marker { display: none; }
details.past summary::after { content: "▾"; color: var(--ink-3); }
details.past[open] summary::after { content: "▴"; }
details.past .ev-list { margin-top: 12px; }

.empty { text-align: center; padding: 36px 16px; border: 1px dashed var(--line); border-radius: var(--r); color: var(--ink-2); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.empty b { font: 700 26px/1 var(--font-display); color: var(--ink); letter-spacing: .02em; }

/* ---------- event detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-weight: 600; font-size: 14px; align-self: flex-start; }
.back::before { content: "→"; }
.ev-hero { display: flex; flex-direction: column; gap: 10px; }
.ev-hero h1 { font: 700 40px/1 var(--font-display); letter-spacing: .015em; overflow-wrap: anywhere; }
.ev-hero.is-cancelled h1 { text-decoration: line-through; color: var(--ink-3); }
.hhour {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
}
.hhour > div { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hhour > div + div { border-inline-start: 1px solid var(--line); }
.hhour .lbl { font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .05em; }
.hhour .val { font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--ink-3); font-weight: 600; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.briefing { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); margin: 0; line-height: 1.7; }
.stamp { align-self: flex-start; font: 700 22px/1 var(--font-display); letter-spacing: .08em; color: var(--no); border: 2px solid var(--no); padding: 4px 12px 2px; border-radius: 4px; transform: rotate(-3deg); }

.rsvp { position: relative; }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg-btn {
  min-height: 52px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--bg-raise);
  font-weight: 700; font-size: 15.5px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; line-height: 1.2;
  transition: background .15s, border-color .15s, color .15s;
}
.seg-btn small { font-weight: 500; font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); }
.seg-btn.go:hover { border-color: var(--go); } .seg-btn.maybe:hover { border-color: var(--maybe); } .seg-btn.no:hover { border-color: var(--no); }
.seg-btn.on.go { background: var(--go); border-color: var(--go); color: #0b1a12; }
.seg-btn.on.maybe { background: var(--maybe); border-color: var(--maybe); color: #1f1705; }
.seg-btn.on.no { background: var(--no); border-color: var(--no); color: #22090a; }
.seg-btn.on small { color: inherit; opacity: .75; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .field input, .field textarea, .field select {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg-raise); color: var(--ink);
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--sand); outline: none; }
.field small { color: var(--ink-3); font-size: 12.5px; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check { display: flex; flex-direction: row; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--sand); }

.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.slot {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: start;
  padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-raise); cursor: pointer; min-width: 0;
}
.slot b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.slot span { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.slot.free span { color: var(--go); }
.slot.taken { cursor: default; background: var(--surface); }
.slot.taken span { color: var(--ink-2); }
.slot.slot-mine { border-color: var(--go); background: color-mix(in srgb, var(--go) 12%, var(--bg-raise)); }
.slot.slot-mine span { color: var(--go); }
.slot:disabled { opacity: 1; }

.roster { display: flex; flex-direction: column; }
.roster-group { display: flex; flex-direction: column; gap: 2px; }
.roster-group + .roster-group { margin-top: 14px; }
.roster-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.roster-head i { width: 9px; height: 9px; border-radius: 50%; }
.roster-head .n { font-family: var(--font-mono); color: var(--ink-3); font-weight: 500; }
.person { display: flex; align-items: center; gap: 10px; padding: 7px 0; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.person-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-main span { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.person .tag { font-size: 12px; color: var(--ink-2); background: var(--surface-2); padding: 2px 8px; border-radius: 4px; white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
details.noanswer summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-3); padding: 6px 0; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; border-top: 1px solid var(--line); }

/* ---------- news ---------- */
.news-item { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.news-item:first-child { padding-top: 0; }
.news-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.news-meta b { color: var(--sand); font-weight: 700; }
.news-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; }

/* ---------- members ---------- */
.member-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; flex-wrap: wrap; }
.member-row:last-child { border-bottom: 0; }
.member-actions { display: flex; gap: 6px; flex-wrap: wrap; flex-basis: 100%; padding-inline-start: 42px; }
.count-pill { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); }

/* ---------- sign-in ---------- */
.gate { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 24px 0; }
.gate .emblem { width: 84px; height: 84px; }
.gate h1 { font: 700 54px/0.9 var(--font-display); letter-spacing: .02em; }
.gate p { margin: 0; color: var(--ink-2); max-width: 34ch; }
.gate .card { width: 100%; text-align: start; }
.google { background: #fff; color: #1f1f1f; border-color: #fff; }
.google:hover { background: #ececec; }
.google svg { width: 18px; height: 18px; }

/* ---------- tab bar ---------- */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(var(--tab-count, 4), minmax(0, 1fr));
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--bg-raise) 94%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.tabs a[hidden] { display: none !important; }
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ink-3); font-size: 11px; font-weight: 600; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a.on { color: var(--sand); }
.tabs a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 2px; background: var(--sand); border-radius: 0 0 2px 2px; }
.tab-badge { position: absolute; top: 7px; left: calc(50% - 20px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--no); color: #fff; font: 600 11px/17px var(--font-mono); font-style: normal; text-align: center; }

/* ---------- toasts ---------- */
/* אישורים על פעולות: למטה, מעל סרגל הלשוניות, כדי שלא יתנגשו בחלונות הקופצים שלמעלה */
.toasts { position: fixed; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 10px); left: 0; right: 0; z-index: 50; display: flex; flex-direction: column-reverse; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; width: min(100%, 440px); display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); animation: rise .25s ease-out;
}
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
.toast .emblem { width: 26px; height: 26px; }
.toast b { display: block; font-weight: 700; }
.toast p { margin: 2px 0 0; color: var(--ink-2); font-size: 13.5px; overflow-wrap: anywhere; }
@keyframes drop { from { transform: translateY(-12px); opacity: 0; } }


/* ---------- units, soldiers, management ---------- */
.form-error { margin: 0; color: var(--no); font-size: 13.5px; font-weight: 600; }
.input:focus { border-color: var(--sand); outline: none; }
.stack-tight { display: flex; flex-direction: column; gap: 4px; }
.unit { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 14px 6px; }
.unit-loose { border-style: dashed; background: transparent; }
.unit-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.unit-head h3 { font: 700 27px/1 var(--font-display); letter-spacing: .02em; }
.unit-empty { padding: 10px 0; margin: 0; }
.soldier { display: flex; align-items: center; gap: 10px; padding: 9px 0; min-width: 0; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.soldier:last-child { border-bottom: 0; }
.soldier:hover b { color: var(--sand-strong); }
.disc { font-family: var(--font-mono); font-size: 12px; text-align: end; }
.pos { flex: none; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pos-cmd { background: color-mix(in srgb, var(--sand) 20%, var(--surface)); color: var(--sand-strong); }
.go-arrow { color: var(--ink-3); font-size: 20px; flex: none; }
.profile-hero { display: flex; align-items: center; gap: 14px; min-width: 0; }
.profile-main { min-width: 0; }
.profile-hero h1 { font: 700 46px/0.95 var(--font-display); letter-spacing: .015em; overflow-wrap: anywhere; }
.hero-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--ink-2); margin-top: 6px; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.link-btn { background: none; border: 0; color: var(--sand); font-weight: 600; cursor: pointer; padding: 0 4px; font-size: 13px; }
.facts a { color: var(--sand); text-decoration: underline; text-underline-offset: 3px; }
.sub-head { display: flex; align-items: center; gap: 10px; }
.sub-head h3 { font: 700 26px/1 var(--font-display); letter-spacing: .02em; }
.req-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.quote { margin: 0; border-inline-start: 3px solid var(--sand); padding: 8px 12px; background: var(--bg-raise); border-start-end-radius: var(--r-sm); border-end-end-radius: var(--r-sm); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: var(--ink); }
.unit-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.unit-edit .input { flex: 1 1 150px; min-width: 0; width: auto; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-form .input { flex: 1 1 180px; min-width: 0; width: auto; }
.nowrap { flex-wrap: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-edit { display: inline-flex; align-items: center; gap: 2px; min-height: 30px; padding-inline: 12px 4px; border-radius: 999px; background: var(--surface-2); color: var(--ink); font-size: 13.5px; font-weight: 600; }
.chip-edit:not(:has(button)) { padding-inline-end: 12px; }
.chip-edit.pos-cmd { color: var(--sand-strong); }
.chip-edit button { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 17px; width: 24px; height: 24px; border-radius: 50%; line-height: 1; }
.chip-edit button:hover { color: var(--no); background: var(--bg-raise); }
.perm { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.perm:last-of-type { border-bottom: 0; }
.perm input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sand); flex: none; }
.perm span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.perm small { color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }
.my-unit { gap: 6px; }
.my-unit:hover { border-color: color-mix(in srgb, var(--sand) 40%, var(--line)); }
.my-unit b { color: var(--ink); font-size: 16px; }
select { appearance: auto; }

.subtabs { display: flex; gap: 6px; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 4px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtab { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raise); color: var(--ink-2); font-weight: 600; cursor: pointer; }
.subtab:hover { border-color: color-mix(in srgb, var(--sand) 45%, var(--line)); }
.subtab.on { background: var(--sand); border-color: var(--sand); color: var(--sand-ink); }
.subtab-n { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font: 600 12px/1 var(--font-mono); }
.subtab-n.hot { background: var(--no); color: #fff; }
.subtab.on .subtab-n { background: rgba(0, 0, 0, .16); color: var(--sand-ink); }
.subtab.on .subtab-n.hot { background: var(--no); color: #fff; }
.chip-contact { background: color-mix(in srgb, var(--live) 16%, var(--surface)); color: var(--live); }
.chip-go { background: color-mix(in srgb, var(--go) 16%, var(--surface)); color: var(--go); }
.req-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

/* ---------- ranks, attendance tracking, notification status ---------- */
.rank { display: inline-block; margin-inline-end: 6px; padding: 0 6px; border-radius: 4px; font-size: 11.5px; font-weight: 700; line-height: 18px; vertical-align: 1px; color: var(--sand-strong); background: color-mix(in srgb, var(--sand) 16%, transparent); border: 1px solid color-mix(in srgb, var(--sand) 35%, transparent); }
.rank-lg { font-size: 13px; line-height: 22px; padding: 0 8px; margin: 0; }
.hero-rank { display: inline-block; font-size: 13px; font-weight: 700; color: var(--sand-strong); letter-spacing: .03em; margin-bottom: 2px; }
.soldier .person-main b { display: block; }
.soldier-sub { display: flex; align-items: center; gap: 8px; min-width: 0; margin-top: 3px; }
.soldier-sub .pos { font-size: 11.5px; padding: 1px 8px; }
.soldier-sub .disc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.soldier-marks { display: flex; align-items: center; gap: 8px; flex: none; }
.att { font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.att-ok { color: var(--go); background: color-mix(in srgb, var(--go) 15%, transparent); }
.att-bad { color: #fff; background: var(--no); }
.pushmark { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.pushmark svg { width: 15px; height: 15px; }
.push-on { color: var(--go); background: color-mix(in srgb, var(--go) 14%, transparent); }
.push-off { color: var(--no); background: color-mix(in srgb, var(--no) 14%, transparent); }
.push-mute { color: var(--maybe); background: color-mix(in srgb, var(--maybe) 14%, transparent); }
.push-line { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; background: none !important; }
.push-line svg { width: 15px; height: 15px; }
.unit-sum { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--no); white-space: nowrap; }
.unit-sum.all-ok { color: var(--go); }
.track { gap: 12px; }
.track .subtabs { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
.track-sum { display: flex; flex-wrap: wrap; gap: 8px; }
.ts { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--bg-raise); border: 1px solid var(--line); }
.ts b { font-family: var(--font-mono); font-weight: 600; }
.ts svg { width: 14px; height: 14px; }
.ts-ok b { color: var(--go); } .ts-bad b { color: var(--no); } .ts-push { color: var(--ink-2); }
.section-head .btn-row { flex-wrap: wrap; justify-content: flex-end; }

/* ---------- popups ---------- */
#popups { position: relative; z-index: 60; }
.pop-stack { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 0; right: 0; z-index: 61; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 12px; pointer-events: none; }
.pop {
  pointer-events: auto; width: min(100%, 460px); display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid color-mix(in srgb, var(--sand) 45%, var(--line)); border-inline-start: 4px solid var(--sand);
  border-radius: var(--r); padding: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); animation: drop .25s ease-out;
}
.pop .emblem { width: 28px; height: 28px; }
.pop-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pop-main b { font-weight: 700; font-size: 15.5px; overflow-wrap: anywhere; }
.pop-main p { margin: 0; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.pop-actions { display: flex; gap: 8px; margin-top: 6px; }
.pop-backdrop { position: fixed; inset: 0; z-index: 62; background: rgba(5, 8, 10, .72); backdrop-filter: blur(3px); animation: fade .2s ease-out; }
.pop-modal {
  position: fixed; z-index: 63; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(calc(100% - 32px), 440px); max-height: calc(100vh - 64px); overflow: auto;
  display: flex; flex-direction: column; gap: 12px; padding: 22px 20px 18px;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--sand) 55%, var(--line)); border-top: 4px solid var(--sand); border-radius: var(--r);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .6); animation: pop .22s ease-out;
}
.pop-flag { align-self: flex-start; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--sand-ink); background: var(--sand); padding: 2px 10px; border-radius: 4px; }
.pop-modal h2 { font: 700 30px/1.05 var(--font-display); letter-spacing: .02em; }
.pop-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 16px; }
body.modal-open { overflow: hidden; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
.news-important { border-inline-start: 3px solid var(--sand); padding-inline-start: 12px; }

/* ---------- gallery ---------- */
.albums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.album { display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color .15s; }
.album:hover { border-color: color-mix(in srgb, var(--sand) 40%, var(--line)); }
.album-cover { aspect-ratio: 4 / 3; background: var(--bg-raise); display: grid; place-items: center; overflow: hidden; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-empty .emblem { width: 40px; height: 40px; color: var(--line); }
.album-info { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px 11px; min-width: 0; }
.album-info b { font-weight: 700; font-size: 14.5px; line-height: 1.3; overflow-wrap: anywhere; }
.album-info span { font-size: 12.5px; color: var(--ink-3); }
.photos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-inline: -16px; }
.ph { aspect-ratio: 1; padding: 0; border: 0; background: var(--bg-raise); cursor: pointer; overflow: hidden; display: block; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.ph:hover img { transform: scale(1.04); }
.upload-card label.btn { position: relative; overflow: hidden; cursor: pointer; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
.is-busy { pointer-events: none; opacity: .85; }
.progress { height: 6px; border-radius: 3px; background: var(--bg-raise); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--go); transition: width .3s; }
.grow { flex: 1 1 220px; }
.admin-bar .inline-form .input { min-height: 34px; padding: 6px 10px; }

.lightbox { position: fixed; inset: 0; z-index: 55; background: #050607; display: flex; flex-direction: column; color: #fff; animation: fade .15s ease-out; }
body.lb-open { overflow: hidden; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 8px; }
.lb-tools { display: flex; align-items: center; gap: 8px; }
.lb-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; font-size: 18px; cursor: pointer; }
.lb-btn svg { width: 20px; height: 20px; }
.lb-count { color: rgba(255, 255, 255, .75); font-size: 14px; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 4px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; background: center / contain no-repeat; display: block; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 64px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff; display: grid; place-items: center; cursor: pointer; }
.lb-nav svg { width: 26px; height: 26px; }
.lb-nav:disabled { opacity: .2; cursor: default; }
.lb-prev { right: 8px; } .lb-next { left: 8px; }
.lb-cap { padding: 10px 16px calc(env(safe-area-inset-bottom, 0px) + 12px); text-align: center; color: rgba(255, 255, 255, .7); font-size: 13px; }
@media (hover: none) { .lb-nav { display: none; } }

/* ---------- recruits ---------- */
.recruit-actions { align-items: flex-end; justify-content: space-between; }
.inline-select { flex: 1 1 160px; }
.inline-select select { min-height: 38px; padding: 6px 10px; }

/* six tabs on narrow phones */
@media (max-width: 400px) {
  .tabs a { font-size: 10.5px; }
  .tabs a svg { width: 22px; height: 22px; }
}

@media (min-width: 700px) {
  .albums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .photos { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-inline: 0; gap: 4px; }
  .ev-hero h1 { font-size: 52px; }
  .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
  .hhour { grid-template-columns: 1fr 1fr; }
  .hhour > div:last-child { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid var(--line); }
  .seg-btn { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
