/* MTF portalas · Taktikos Fortas brandbook: #F42C04 / #020101 / #F5F1ED · The Neue Black, Michroma, Metrophobic */

@font-face { font-family: "The Neue"; src: url("../fonts/TheNeue-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }
/* Michroma € looks like an O – let € fall back to Metrophobic */
@font-face { font-family: "Michroma"; src: url("../fonts/Michroma-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-20AB, U+20AD-FFFF; }
@font-face { font-family: "Metrophobic"; src: url("../fonts/Metrophobic-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ink: #020101;
  --paper: #F5F1ED;
  --signal: #F42C04;
  --s1: #15110F;
  --s2: #201B18;
  --s3: #2C2622;
  --line: rgba(245, 241, 237, .13);
  --line-2: rgba(245, 241, 237, .24);
  --mute: #ABA49C;
  --dim: #79726B;
  --ok: #4CC35E;
  --warn: #EDB233;
  --signal-soft: rgba(244, 44, 4, .14);
  --f-display: "The Neue", "Metrophobic", "Arial Black", sans-serif;
  --f-wide: "Michroma", "Metrophobic", "Arial", sans-serif;
  --f-body: "Metrophobic", "Segoe UI", system-ui, sans-serif;
  --rail: 236px;
  --r: 2px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--paper); font: 15px/1.55 var(--f-body); }
img, svg { display: block; max-width: 100%; }
a { color: var(--paper); text-decoration-color: rgba(244, 44, 4, .7); text-underline-offset: 3px; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0 0 .7em; }
small { font-size: 12.5px; }
code { font-family: var(--f-wide); font-size: 12px; background: var(--s2); padding: 2px 6px; border-radius: var(--r); word-break: break-all; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--signal); color: var(--ink); padding: 8px 12px; }
.skip:focus { left: 8px; }
.ic { width: 18px; height: 18px; flex: none; }
.ic-xl { width: 56px; height: 56px; }
.muted { color: var(--mute); }
.hint { color: var(--mute); font-size: 13.5px; }
.hint-warn { color: var(--warn); display: flex; gap: 6px; align-items: center; }
.empty { color: var(--mute); }
.is-faded { opacity: .5; }
.neg { color: var(--signal); }

/* ---------- shell ---------- */
.rail { position: fixed; inset: 0 auto 0 0; width: var(--rail); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--ink); padding: 20px 14px; z-index: 20; overflow-y: auto; }
.rail-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 6px 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.rail-brand b { font-family: var(--f-display); font-size: 26px; letter-spacing: .02em; display: block; line-height: 1; }
.rail-brand small { font-family: var(--f-wide); font-size: 8.5px; color: var(--mute); display: block; margin-top: 5px; letter-spacing: .04em; }
.rail-nav, .rail-sub { display: flex; flex-direction: column; gap: 2px; }
.rail-sub { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.rail-nav a, .rail-sub a, .rail-sub button { display: flex; align-items: center; gap: 12px; padding: 10px 10px; text-decoration: none; color: var(--mute); border: 0; background: none; width: 100%; text-align: left; cursor: pointer; border-left: 2px solid transparent; position: relative; }
.rail-nav a { font-family: var(--f-wide); font-size: 12.5px; letter-spacing: .02em; }
.rail-nav a:hover, .rail-sub a:hover, .rail-sub button:hover { color: var(--paper); background: var(--s1); }
.rail-nav a.is-active, .rail-sub a.is-active { color: var(--paper); border-left-color: var(--signal); background: var(--s1); }
.rail-nav a.is-active .ic { color: var(--signal); }
.rail-sub span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-foot { padding: 16px 8px 0; font-size: 12px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.rail-foot a { color: var(--dim); }
.rail-foot img { width: 120px; height: auto; opacity: .8; margin-bottom: 6px; flex-basis: 100%; }
.badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; background: var(--signal); color: var(--ink); font: 700 11px/20px var(--f-body); text-align: center; font-style: normal; border-radius: 10px; }
.badge[hidden] { display: none; }

.topbar { display: none; }
.tabbar { display: none; }
.main { margin-left: var(--rail); padding: 36px clamp(20px, 4vw, 52px) 64px; max-width: calc(1240px + var(--rail)); }
.main:focus { outline: none; }

/* ---------- page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 20px; margin-bottom: 28px; }
.page-head .page-sub { flex-basis: 100%; order: 3; }
.page-head .btn { margin-left: auto; }
.page-title { font-family: var(--f-display); font-size: clamp(40px, 6vw, 72px); line-height: .9; text-transform: uppercase; letter-spacing: -.005em; }
.page-title-sm { font-size: clamp(30px, 4.2vw, 46px); }
.page-sub { color: var(--mute); margin: 6px 0 0; max-width: 68ch; }
.back { display: inline-block; font-family: var(--f-wide); font-size: 12px; color: var(--mute); text-decoration: none; margin-bottom: 18px; }
.back::before { content: "‹ "; color: var(--signal); }

/* ---------- panels ---------- */
.panel { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; margin-bottom: 18px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.panel-head .panel-title { margin-bottom: 0; }
.panel-title { font-family: var(--f-wide); font-size: 13.5px; letter-spacing: .02em; margin-bottom: 14px; color: var(--paper); }
.panel-title-gap { margin-top: 26px; }
.more { margin-left: auto; font-size: 13px; color: var(--mute); }
.mini-title { font-family: var(--f-wide); font-size: 11.5px; color: var(--mute); margin: 16px 0 8px; letter-spacing: .02em; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; align-items: start; }
.cols-event { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }

.flash { padding: 12px 16px; border-left: 3px solid var(--ok); background: var(--s1); margin-bottom: 18px; }
.flash-error { border-color: var(--signal); }
.alert { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border: 1px solid var(--line-2); margin-bottom: 18px; color: var(--paper); text-decoration: none; }
.alert .ic { color: var(--warn); }
.alert-action { border-color: var(--signal); background: var(--signal-soft); }
.alert-action .ic { color: var(--signal); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border: 1px solid var(--line-2); background: var(--s2); color: var(--paper); text-decoration: none; cursor: pointer; border-radius: var(--r); font-family: var(--f-wide); font-size: 12px; letter-spacing: .02em; }
.btn:hover { border-color: var(--paper); color: var(--paper); }
.btn-primary { background: var(--signal); border-color: var(--signal); color: var(--paper); }
.btn-primary:hover { background: #ff3d14; border-color: #ff3d14; }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: var(--signal); color: var(--signal); }
.btn-danger:hover { background: var(--signal); color: var(--paper); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 11px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 8px; }
.link { background: none; border: 0; padding: 0; color: var(--mute); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13.5px; }
.link:hover { color: var(--signal); }
.icon-btn { background: none; border: 0; color: var(--dim); cursor: pointer; padding: 6px; }
.icon-btn .ic { width: 18px; min-width: 18px; height: 18px; }
.icon-btn:hover { color: var(--signal); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 13px; color: var(--mute); }
.field > span i { font-style: normal; color: var(--dim); }
input[type=text], input[type=number], input[type=datetime-local], input[type=email], select, textarea {
  width: 100%; background: var(--ink); border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px 12px; min-height: 42px; color: var(--paper);
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--signal); outline: none; box-shadow: 0 0 0 1px var(--signal); }
input[type=file] { font-size: 13px; color: var(--mute); max-width: 100%; }
input[type=file]::file-selector-button { font: 11px var(--f-wide); background: var(--s2); color: var(--paper); border: 1px solid var(--line-2); padding: 8px 12px; margin-right: 10px; cursor: pointer; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--signal); flex: none; }
.check.is-error span { color: var(--signal); }
.form-row { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.form-row .field { margin-bottom: 0; flex: 1 1 180px; }
.form-row .field-wide { flex: 3 1 280px; }
.form-error { color: var(--signal); }
.inline { display: inline; }

/* ---------- avatars, tags, pills ---------- */
.av { border-radius: 50%; object-fit: cover; background: var(--s3); flex: none; }
.av-ph { display: inline-grid; place-items: center; font-family: var(--f-wide); color: var(--mute); }
.av-xs { width: 22px; height: 22px; font-size: 8px; }
.av-sm { width: 30px; height: 30px; font-size: 10px; }
.av-md { width: 42px; height: 42px; font-size: 12px; }
.av-lg { width: 64px; height: 64px; font-size: 16px; }
.av-xl { width: 104px; height: 104px; font-size: 24px; border: 2px solid var(--signal); }
.callsign { font-family: var(--f-wide); font-size: 14px; letter-spacing: .03em; text-decoration: none; color: var(--paper); }
a.callsign:hover { color: var(--signal); }
.callsign-xl { font-size: clamp(26px, 4vw, 40px); }
.callsign-open { color: var(--mute); }
.tag { display: inline-block; font-family: var(--f-wide); font-size: 10.5px; padding: 2px 6px; border: 1px solid; border-radius: var(--r); }
.tag-alfa { color: var(--signal); }
.tag-bravo { color: var(--paper); }
.rank { display: inline-block; font-size: 11.5px; color: var(--mute); border: 1px solid var(--line-2); padding: 0 6px; margin-left: 6px; border-radius: 10px; vertical-align: 2px; }
.rank-vet { color: var(--warn); border-color: rgba(237, 178, 51, .45); }
.pill { display: inline-block; font-size: 12px; padding: 1px 9px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--mute); white-space: nowrap; }
.pill-ok { color: var(--ok); border-color: rgba(76, 195, 94, .4); }
.pill-warn { color: var(--warn); border-color: rgba(237, 178, 51, .4); }
.pill-btn { background: none; cursor: pointer; font: 12px var(--f-body); padding: 3px 10px; border-radius: 10px; border: 1px solid; }
.pill-btn.pill-ok { color: var(--ok); }
.pill-btn.pill-warn { color: var(--warn); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.dot-paid { background: var(--ok); }
.dot-unpaid { background: var(--warn); }
.dot-reg { background: var(--paper); }
.dot-planned { border: 1.5px dashed var(--mute); }
.dot-live { background: var(--signal); box-shadow: 0 0 0 4px var(--signal-soft); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { display: inline-flex; align-items: center; gap: 6px; background: var(--s2); padding: 3px 10px 3px 4px; border-radius: 14px; font-size: 13px; }
.chips-dim li { padding: 3px 10px; color: var(--mute); }

/* ---------- activity meter ---------- */
.act { display: flex; align-items: center; gap: 10px; }
.act-bar { position: relative; flex: 1; height: 6px; background: var(--s3); min-width: 60px; }
.act-bar i { position: absolute; inset: 0 auto 0 0; background: var(--mute); }
.act-bar b { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--paper); opacity: .5; }
.act-ok .act-bar i { background: var(--ok); }
.act-warn .act-bar i { background: var(--warn); }
.act-low .act-bar i { background: var(--signal); }
.act-num { font-family: var(--f-wide); font-size: 13px; min-width: 42px; text-align: right; }
.act-num small { color: var(--dim); font-size: 10px; }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}
.l-0{left:0}.l-5{left:5%}.l-10{left:10%}.l-15{left:15%}.l-20{left:20%}.l-25{left:25%}.l-30{left:30%}.l-35{left:35%}.l-40{left:40%}.l-45{left:45%}.l-50{left:50%}

/* ---------- dashboard ---------- */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); grid-template-rows: auto 1fr auto; grid-template-areas: "me events" "mine events" "order chat"; gap: 18px; align-items: start; }
.dash .panel { margin: 0; }
.dash-me { grid-area: me; }
.dash-events { grid-area: events; }
.dash-mine { grid-area: mine; }
.dash-order { grid-area: order; }
.dash-chat { grid-area: chat; }
.me-card { display: flex; gap: 16px; align-items: center; margin-bottom: 8px; }
.me-card .callsign { font-size: 20px; display: block; margin-bottom: 4px; }
.me-role { color: var(--mute); font-size: 13.5px; margin: 0; }
.big-line { font-family: var(--f-wide); font-size: 15px; margin-bottom: 4px; }
.order-sum { margin: 12px 0 16px; }
.order-sum b { font-family: var(--f-wide); font-size: 18px; color: var(--paper); }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.plain-list li:last-child { border-bottom: 0; }
.plain-list.small li { font-size: 13.5px; padding: 7px 0; }
.plain-list li.is-error { color: var(--signal); }
.chat-peek { list-style: none; margin: 0; padding: 0; }
.chat-peek li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.chat-peek li:last-child { border: 0; }
.chat-peek b { font-family: var(--f-wide); font-size: 12px; font-weight: 400; }
.chat-peek p { margin: 2px 0 0; color: var(--mute); font-size: 13.5px; overflow-wrap: anywhere; }
.sync-note { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12.5px; margin: 14px 0 0; }
.sync-note .ic { width: 14px; height: 14px; }

/* ---------- events ---------- */
.ev-list { display: flex; flex-direction: column; }
.ev { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ev:last-child { border-bottom: 0; }
.ev-date { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-decoration: none; padding-top: 2px; border-top: 2px solid var(--line-2); }
.ev-tf .ev-date { border-top-color: var(--signal); }
.ev-dow { font-family: var(--f-wide); font-size: 10.5px; color: var(--mute); margin-top: 6px; }
.ev-day { font-family: var(--f-display); font-size: 36px; line-height: 1; }
.ev-mon { font-family: var(--f-wide); font-size: 10.5px; color: var(--mute); }
.ev-title { font-family: var(--f-wide); font-size: 15px; line-height: 1.35; margin-bottom: 6px; }
.ev-title a { text-decoration: none; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--mute); font-size: 13.5px; margin-bottom: 10px; }
.ev-meta span { display: inline-flex; align-items: center; gap: 5px; }
.ev-meta .ic { width: 14px; height: 14px; color: var(--dim); }
.ev-org { color: var(--dim); }
.ev-squad { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ev-squad li { display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 3px; border-radius: 18px; background: var(--s2); font-family: var(--f-wide); font-size: 11px; border: 1px solid transparent; }
.ev-squad li.is-paid { border-color: rgba(76, 195, 94, .5); }
.ev-squad li.is-unpaid { border-color: rgba(237, 178, 51, .5); }
.ev-squad li.is-reg { border-color: var(--line-2); }
.ev-squad li.is-planned { border: 1px dashed var(--line-2); background: transparent; color: var(--mute); }
.ev-count { font-size: 13px; color: var(--mute); margin: 0; }
.ev-count b { color: var(--paper); font-family: var(--f-wide); font-weight: 400; }
.ev-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.ev-when { font-family: var(--f-wide); font-size: 11.5px; color: var(--paper); white-space: nowrap; }
.ev-total { font-size: 12.5px; color: var(--dim); white-space: nowrap; }
.ev-compact { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; padding: 12px 0; }
.ev-compact .ev-day { font-size: 28px; }
.ev-compact .ev-title { font-size: 13.5px; }
.ev-compact .ev-meta { margin-bottom: 6px; }
.rsvp { display: inline-flex; margin-top: auto; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.rsvp button { background: transparent; border: 0; border-left: 1px solid var(--line-2); padding: 7px 11px; font-size: 12.5px; cursor: pointer; color: var(--mute); }
.rsvp button:first-of-type { border-left: 0; }
.rsvp button:hover { color: var(--paper); background: var(--s2); }
.rsvp button.on { background: var(--paper); color: var(--ink); }
.rsvp button.on[value="clear"]:first-of-type { background: var(--signal); color: var(--paper); }
.rsvp-lg { align-items: center; }
.rsvp-lg .rsvp-q { padding: 0 12px; color: var(--mute); font-size: 13px; }
.rsvp-lg button { padding: 10px 16px; font-size: 13.5px; border-left: 1px solid var(--line-2) !important; }

.seg { display: inline-flex; border: 1px solid var(--line-2); margin-bottom: 14px; flex-wrap: wrap; }
.seg a { padding: 9px 16px; text-decoration: none; font-family: var(--f-wide); font-size: 11.5px; color: var(--mute); border-left: 1px solid var(--line-2); }
.seg a:first-child { border-left: 0; }
.seg a.is-on { background: var(--paper); color: var(--ink); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--mute); font-size: 12.5px; margin-bottom: 22px; }
.legend span { display: inline-flex; align-items: center; }
.timeline { position: relative; }
.tl-week { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 20px; border-top: 1px solid var(--line-2); padding-top: 4px; }
.tl-label { position: sticky; top: 16px; align-self: start; padding-top: 16px; }
.tl-label span { font-family: var(--f-wide); font-size: 13px; display: block; }
.tl-label small { color: var(--dim); font-size: 11.5px; }
.empty-block { border: 1px dashed var(--line-2); padding: 28px; text-align: left; color: var(--mute); margin-bottom: 18px; }
.empty-block .btn { margin-top: 8px; }

.event-head { border-left: 3px solid var(--line-2); padding: 4px 0 4px 22px; margin-bottom: 26px; }
.event-head-tf { border-left-color: var(--signal); }
.event-date { font-family: var(--f-wide); font-size: 12.5px; color: var(--signal); margin-bottom: 8px; }
.event-title { font-family: var(--f-display); font-size: clamp(30px, 4.5vw, 54px); line-height: .95; text-transform: uppercase; margin-bottom: 18px; overflow-wrap: anywhere; }
.event-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 24px; margin: 0 0 20px; }
.event-facts dt { font-size: 12px; color: var(--dim); }
.event-facts dd { margin: 2px 0 0; font-size: 14px; }
.event-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.roster { list-style: none; margin: 0; padding: 0; }
.roster li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.roster li:last-child { border: 0; }
.roster li > a { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 1 auto; min-width: 140px; }
.roster .act { flex: 1; max-width: 220px; margin-left: auto; }

/* ---------- ORBAT ---------- */
.sym { width: 66px; height: 45px; flex: none; }
.sym rect, .sym path { fill: none; stroke: currentColor; stroke-width: 2.4; }
.sym .sym-ech circle { fill: currentColor; stroke: none; }
.sym .sym-ech path { stroke-width: 2.6; }
.sym text { display: none; }
.orbat { margin-bottom: 30px; }
.orbat-hq { display: flex; gap: 18px; align-items: center; justify-content: center; text-align: left; padding: 6px 0 0; color: var(--paper); }
.orbat-hq .sym { width: 92px; height: 62px; color: var(--paper); }
.orbat-unit { font-family: var(--f-display); font-size: 30px; line-height: 1; text-transform: uppercase; margin: 0 0 6px; }
.orbat-cmd { margin: 0 0 2px; color: var(--mute); }
.orbat-wire { position: relative; height: 44px; margin: 0 25%; border-bottom: 1px solid var(--line-2); }
.orbat-wire::before { content: ""; position: absolute; left: 50%; top: 10px; bottom: 0; border-left: 1px solid var(--line-2); }
.orbat-squads { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.squad { position: relative; padding-top: 22px; }
.squad::before { content: ""; position: absolute; left: 50%; top: 0; height: 22px; border-left: 1px solid var(--line-2); }
.squad-head { display: flex; gap: 14px; align-items: center; justify-content: center; margin-bottom: 8px; }
.squad-alfa .squad-head { color: var(--signal); }
.squad-name { font-family: var(--f-display); font-size: 28px; line-height: 1; text-transform: uppercase; color: var(--paper); }
.squad-job { font-family: var(--f-wide); font-size: 11.5px; margin: 4px 0 0; }
.squad-alfa .squad-job { color: var(--signal); }
.squad-bravo .squad-job { color: var(--mute); }
.squad-desc { text-align: center; color: var(--mute); font-size: 13.5px; max-width: 46ch; margin: 0 auto 16px; }
.slots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.slot { display: grid; grid-template-columns: 52px minmax(0, 1fr); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); }
.slot-code { display: grid; place-items: center; font-family: var(--f-display); font-size: 22px; border-right: 1px solid var(--line); background: var(--s2); }
.squad-alfa .slot-code { color: var(--signal); }
.slot-main { padding: 14px 16px; min-width: 0; }
.slot-who { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.slot-who > div { min-width: 0; }
.slot-role { margin: 3px 0 0; font-size: 13.5px; color: var(--mute); }
.slot-open { border-style: dashed; background: transparent; }
.slot-backup, .slot-next { font-size: 13px; color: var(--mute); margin: 8px 0 0; }
.slot-next .ic { width: 14px; height: 14px; display: inline; vertical-align: -2px; margin-right: 4px; }
.slot-more { margin-top: 10px; font-size: 13.5px; }
.slot-more summary { cursor: pointer; color: var(--mute); font-size: 13px; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.slot-more summary::-webkit-details-marker { display: none; }
.slot-more summary::before { content: "+"; font-family: var(--f-wide); color: var(--signal); width: 12px; }
.slot-more[open] summary::before { content: "–"; }
.slot-more h4 { font-family: var(--f-wide); font-size: 11px; color: var(--dim); margin: 12px 0 4px; }
.slot-more p { color: var(--paper); opacity: .88; margin: 0; }
.roster-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 18px; align-items: start; }

.profile-head { display: flex; gap: 24px; align-items: center; margin-bottom: 28px; }
.profile-head .page-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ---------- chat ---------- */
.chat-wrap { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 22px; height: calc(100vh - 72px); height: calc(100dvh - 72px); }
.chat-side { overflow-y: auto; }
.chat-side .page-title { margin-bottom: 20px; }
.chan-list { display: flex; flex-direction: column; gap: 2px; }
.chan-list a { padding: 8px 10px; text-decoration: none; color: var(--mute); border-left: 2px solid transparent; display: flex; align-items: baseline; gap: 6px; font-size: 14px; }
.chan-list a small { color: var(--dim); margin-left: auto; font-size: 11px; }
.chan-list a:hover { background: var(--s1); color: var(--paper); }
.chan-list a.is-active { border-left-color: var(--signal); color: var(--paper); background: var(--s1); }
.chan-list a.has-unread { color: var(--paper); font-weight: 700; }
.chan-list a.has-unread::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); margin-left: auto; align-self: center; flex: none; }
.chan-hash { color: var(--signal); font-family: var(--f-wide); }
.chan-date { font-family: var(--f-wide); font-size: 10.5px; color: var(--dim); }
.chat { display: flex; flex-direction: column; min-height: 0; }
.chat-main { background: var(--s1); border: 1px solid var(--line); }
.chat-head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.chat-head h2 { font-family: var(--f-wide); font-size: 15px; }
.chat-head p { margin: 0; font-size: 13px; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 2px; overscroll-behavior: contain; }
.chat-embed { min-height: 520px; max-height: 80vh; }
.chat-embed .chat-log { padding: 8px 0; min-height: 280px; }
.chat-loading { color: var(--dim); margin: auto; }
.msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 6px 0; }
.msg-cont { padding-top: 0; }
.msg-cont .msg-av, .msg-cont .msg-head { visibility: hidden; height: 0; }
.msg-head { display: flex; gap: 10px; align-items: baseline; }
.msg-head b { font-family: var(--f-wide); font-size: 12px; font-weight: 400; }
.msg-mine .msg-head b { color: var(--signal); }
.msg-head time { color: var(--dim); font-size: 11.5px; }
.msg-body { overflow-wrap: anywhere; }
.msg-body .mention { color: var(--signal); }
.msg-body a { word-break: break-all; }
.msg-img { margin-top: 6px; max-width: min(360px, 100%); border-radius: var(--r); border: 1px solid var(--line); cursor: zoom-in; height: auto; }
.msg-del { color: var(--dim); font-style: italic; font-size: 13px; }
.msg-tools { opacity: 0; margin-left: auto; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { opacity: 1; }
.msg-tools button { background: none; border: 0; color: var(--dim); cursor: pointer; font-size: 12px; }
.msg-tools button:hover { color: var(--signal); }
.day-sep { display: flex; align-items: center; gap: 12px; color: var(--dim); font-family: var(--f-wide); font-size: 10.5px; margin: 14px 0 6px; }
.day-sep::before, .day-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.chat-more { align-self: center; margin-bottom: 10px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat-embed .chat-form { padding: 12px 0 0; }
.chat-input { flex: 1; min-width: 0; }
.chat-input textarea { max-height: 160px; min-height: 44px; }
.chat-preview { font-size: 12.5px; color: var(--mute); margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.chat-attach, .chat-send { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-2); background: var(--s2); cursor: pointer; flex: none; border-radius: var(--r); color: var(--mute); }
.chat-attach input { display: none; }
.chat-attach:hover { color: var(--paper); }
.chat-send { background: var(--signal); border-color: var(--signal); color: var(--paper); }
.chat-error { color: var(--signal); font-size: 13px; padding: 0 16px 10px; margin: 0; }

/* ---------- orders ---------- */
.batch-banner { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; border: 1px solid var(--signal); background: linear-gradient(90deg, var(--signal-soft), transparent 70%); padding: 18px 22px; margin-bottom: 18px; flex-wrap: wrap; }
.batch-state { font-family: var(--f-wide); font-size: 11.5px; color: var(--signal); display: flex; align-items: center; margin-bottom: 6px; }
.batch-title { font-family: var(--f-display); font-size: 30px; line-height: 1; text-transform: uppercase; margin-bottom: 8px; }
.order-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 0 18px; align-items: start; }
.preview { border: 1px solid var(--line); margin: -4px 0 14px; }
.preview-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.preview-row:last-child { border: 0; }
.preview-row .pr { text-align: right; white-space: nowrap; font-family: var(--f-wide); font-size: 12.5px; }
.preview-row .pr s { color: var(--dim); font-family: var(--f-body); margin-right: 6px; }
.preview-row.is-missing { color: var(--warn); }
.shot-form { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; align-items: flex-start; }
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 400; color: var(--dim); font-size: 12px; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 11px 10px 11px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td small { display: block; margin-top: 2px; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .code, .code { font-family: var(--f-wide); font-size: 11px; color: var(--mute); }
.tbl tr.row-pending td { background: rgba(237, 178, 51, .05); }
.tbl-doc td { font-size: 13.5px; }
.qty-form input { width: 64px; min-height: 34px; padding: 4px 8px; text-align: right; }
.inline-edit { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.inline-edit input { min-height: 34px; padding: 6px 10px; flex: 1 1 140px; }
.thumb { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--mute); margin-top: 4px; }
.thumb .ic { width: 14px; height: 14px; }
.totals { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 18px 0 10px; }
.totals dt { font-size: 12.5px; color: var(--dim); }
.totals dd { margin: 3px 0 0; font-family: var(--f-wide); font-size: 16px; }
.totals .total-main { font-family: var(--f-display); font-size: 30px; line-height: 1; }
.totals .total-save { color: var(--ok); }
.admin-zone { border-style: dashed; }
.status-steps { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-2); margin-bottom: 8px; }
.status-steps button { flex: 1 1 140px; background: transparent; border: 0; border-left: 1px solid var(--line-2); padding: 12px 10px; font-size: 13px; color: var(--mute); cursor: pointer; display: flex; gap: 8px; align-items: center; text-align: left; }
.status-steps button:first-child { border-left: 0; }
.status-steps button span { font-family: var(--f-wide); font-size: 11px; color: var(--dim); }
.status-steps button.is-on { background: var(--signal); color: var(--paper); }
.status-steps button.is-on span { color: var(--paper); }
.person-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-bottom: 10px; }
.person-head form { margin-left: auto; }
.tbl-admin input { min-height: 34px; padding: 5px 8px; font-size: 13px; }
.tbl-admin .in-wide { min-width: 220px; }
.tbl-admin .in-code { width: 130px; margin-top: 4px; }
.tbl-admin .in-num { width: 84px; text-align: right; }
.tbl-admin td a .ic { display: inline; width: 15px; height: 15px; vertical-align: -3px; margin: 0 2px; }
.copy-src { width: 100%; font-size: 13px; margin: 8px 0; }

/* ---------- admin ---------- */
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.toc a { padding: 7px 12px; border: 1px solid var(--line-2); text-decoration: none; font-size: 13px; color: var(--mute); }
.toc a:hover { color: var(--paper); border-color: var(--paper); }
.steps { padding-left: 20px; }
.steps li { margin-bottom: 6px; }
.token-box { border: 1px solid var(--ok); padding: 14px; margin: 12px 0; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.token-box p { flex-basis: 100%; margin: 0; }
.token-box code { font-size: 13px; padding: 8px 10px; }
.slot-edit { display: grid; grid-template-columns: 52px repeat(4, minmax(0, 1fr)); gap: 0 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.slot-edit .slot-code { grid-row: span 2; border: 1px solid var(--line); align-self: start; height: 52px; }
.slot-edit .field-wide { grid-column: span 2; }
.squad-edit fieldset { border: 1px solid var(--line); }
.squad-edit legend { padding: 0 8px; }
.sticky-save { position: sticky; bottom: 16px; display: flex; justify-content: flex-end; }
.kv { margin: 0; }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; text-align: right; }
.danger-form { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 10px; }

/* ---------- documents ---------- */
.doc { max-width: 76ch; }
.doc h2 { font-family: var(--f-wide); font-size: 15px; margin: 30px 0 10px; }
.doc ol, .doc ul { padding-left: 22px; }
.doc li { margin-bottom: 8px; }
.doc-legal .tbl-doc { margin: 8px 0 12px; min-width: 640px; }
.doc .table-wrap { max-width: 100%; }
.motto { margin: 0 0 10px; padding: 18px 22px; border-left: 3px solid var(--signal); background: var(--s1); font-family: var(--f-wide); font-size: 14px; line-height: 1.6; }

/* ---------- gate (login, consent) ---------- */
.bare { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--ink) radial-gradient(ellipse 80% 55% at 50% -10%, rgba(244, 44, 4, .16), transparent 70%); }
.bare-main { flex: 1; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; }
.bare-main > .flash { width: 100%; max-width: 560px; }
.bare-main > .doc, .bare-main > .page-head, .bare-main > .cols-2 { width: 100%; max-width: 1000px; }
.bare-foot { display: flex; flex-wrap: wrap; gap: 6px 20px; justify-content: center; padding: 20px; color: var(--dim); font-size: 12.5px; border-top: 1px solid var(--line); }
.bare-foot a { color: var(--dim); }
.gate { width: 100%; max-width: 520px; text-align: center; display: flex; flex-direction: column; align-items: center; margin: auto 0; }
.gate-wide { max-width: 640px; text-align: left; align-items: stretch; }
.gate-mark img { width: 112px; height: 112px; margin-bottom: 18px; }
.gate-mark-pulse { color: var(--signal); margin-bottom: 18px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.gate-title { font-family: var(--f-display); font-size: clamp(54px, 13vw, 104px); line-height: .86; text-transform: uppercase; margin-bottom: 20px; }
.gate-title-sm { font-size: clamp(34px, 8vw, 52px); }
.gate-code { font-family: var(--f-display); font-size: 120px; line-height: 1; color: var(--signal); margin: 0; }
.gate-lead { color: var(--mute); font-size: 16px; max-width: 46ch; margin: 0 auto 28px; }
.gate-wide .gate-lead { margin-left: 0; }
.gate-actions { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; align-items: stretch; margin-bottom: 26px; }
.btn-auth { min-height: 50px; font-size: 12.5px; background: var(--s1); }
.btn-auth .ic { width: 20px; height: 20px; }
.btn-auth:hover { border-color: var(--signal); }
.gate-fine { font-size: 12.5px; color: var(--dim); max-width: 44ch; }
.gate-fine a { color: var(--mute); }
.note { color: var(--mute); font-size: 13.5px; }
.or-sep { color: var(--dim); font-size: 12.5px; margin: 4px 0; display: flex; align-items: center; gap: 10px; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.email-login { text-align: left; display: flex; flex-direction: column; gap: 8px; }
.email-login .field { margin: 0; }
.dev-login { border: 1px dashed var(--warn); padding: 10px; display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; font-size: 13px; color: var(--warn); }
.consent-summary { list-style: none; padding: 16px 18px; margin: 0 0 18px; background: var(--s1); border: 1px solid var(--line); }
.consent-summary li { padding: 5px 0; color: var(--mute); font-size: 14px; }
.consent-summary b { color: var(--paper); font-weight: 400; font-family: var(--f-wide); font-size: 12px; }
.consent-actions { margin-top: 14px; }
.consent-actions .btn { width: 100%; min-height: 50px; }
.consent-cancel { margin-top: 12px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "me mine" "events events" "order chat"; }
}
@media (max-width: 960px) {
  .rail { display: none; }
  .topbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: rgba(2, 1, 1, .94); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
  .topbar-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
  .topbar-brand img { width: 30px; height: 30px; }
  .topbar-brand b { font-family: var(--f-display); font-size: 22px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 20; background: var(--ink); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; text-decoration: none; color: var(--dim); font-size: 10.5px; position: relative; border-top: 2px solid transparent; }
  .tabbar a.is-active { color: var(--paper); border-top-color: var(--signal); }
  .tabbar a.is-active .ic { color: var(--signal); }
  .tabbar .ic { width: 22px; height: 22px; }
  .tabbar .badge { position: absolute; top: 3px; left: 54%; margin: 0; min-width: 17px; height: 17px; font-size: 10px; line-height: 17px; padding: 0 4px; }
  .main { margin-left: 0; padding: 20px 16px 96px; }
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "me" "events" "mine" "order" "chat"; }
  .cols-2, .cols-event, .order-grid { grid-template-columns: minmax(0, 1fr); }
  .chat-wrap { grid-template-columns: minmax(0, 1fr); height: auto; gap: 10px; }
  .chat-side .page-title { display: none; }
  .chat-side .chan-list { flex-direction: row; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .chat-side .chan-list a { border: 1px solid var(--line-2); white-space: nowrap; padding: 6px 12px; }
  .chat-side .chan-list a.is-active { border-color: var(--signal); }
  .chat-side .mini-title { margin: 6px 0 4px; }
  .view-chat .main { height: calc(100vh - 118px); height: calc(100dvh - 118px - env(safe-area-inset-bottom)); padding-bottom: 0; display: flex; flex-direction: column; }
  .view-chat .chat-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .chat-main { flex: 1; min-height: 0; margin: 0 -16px; border-left: 0; border-right: 0; border-bottom: 0; }
  .tl-week { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .tl-label { position: static; padding-top: 12px; display: flex; gap: 10px; align-items: baseline; }
  .orbat-squads { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .orbat-wire { margin: 0 auto; width: 1px; border: 0; height: 22px; background: var(--line-2); }
  .orbat-wire::before { display: none; }
  .squad::before { display: none; }
  .squad { padding-top: 0; }
  .slot-edit { grid-template-columns: 52px minmax(0, 1fr); }
  .slot-edit .slot-code { grid-row: span 6; }
  .slot-edit .field-wide { grid-column: auto; }
}
@media (max-width: 600px) {
  .ev { grid-template-columns: 50px minmax(0, 1fr); gap: 12px; }
  .ev-side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 12px; text-align: left; }
  .ev-side .rsvp { margin: 0 0 0 auto; }
  .ev-day { font-size: 30px; }
  .page-head .btn { margin-left: 0; }
  .profile-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .panel { padding: 16px; }
  .batch-title { font-size: 24px; }
  .roster .act { max-width: 140px; }
  .totals .total-main { font-size: 26px; }
  .rsvp-lg { width: 100%; }
  .rsvp-lg button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
