/* MedNet – Arida Medical Services. Colours, type and spacing match the MedNet design canvas. */
:root {
  --bg: #0B1220;
  --panel: #111A2E;
  --panel-2: #16213A;
  --panel-3: #0F182A;
  --line: #22304D;
  --line-2: #2F3F60;
  --text: #E6E8EC;
  --text-2: #D5D8DE;
  --text-3: #C9CDD5;
  --muted: #9AA1AD;
  --white: #FFFFFF;
  --red: #D23A45;
  --red-dark: #B23A3A;
  --link: #FF7A84;
  --link-hover: #FFB8BE;
  --green: #2E8B57;
  --green-dot: #3FC27A;
  --sel-bg: #2B1520;
  --display: 'Barlow Condensed', sans-serif;
  --body: Inter, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.6; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
img { max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--link-hover); outline-offset: 2px; }
.sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* ----- Header ----- */
.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: 12px; padding-bottom: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); }
.brand:hover { text-decoration: none; color: var(--white); }
.brand img { width: 34px; height: 40px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: .5px; }
.brand-sub { font-size: 11px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.main-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; font-weight: 500; font-size: 14px; }
.main-nav a { color: var(--text-3); }
.main-nav a[aria-current="page"] { color: var(--white); }
.header-tools { flex: 1 1 220px; display: flex; justify-content: flex-end; align-items: center; gap: 10px; }
.btn-clock { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 8px; background: var(--green); color: var(--white); font-size: 14px; font-weight: 600; white-space: nowrap; }
.btn-clock:hover { color: var(--white); text-decoration: none; filter: brightness(1.08); }
.btn-clock .dot { width: 8px; height: 8px; border-radius: 50%; background: #B8F5D0; }
.btn-clock.on { background: #123322; color: #7FE0A8; border: 1px solid #1F5A3A; }
.site-search { width: 100%; max-width: 300px; height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14px; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #5865F2; display: flex; align-items: center; justify-content: center; color: var(--white); font-weight: 600; font-size: 13px; flex: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu a { font-size: 13px; }
.dev-banner { background: #3A2E12; color: #F5D27A; font-size: 13px; text-align: center; padding: 6px 16px; border-bottom: 1px solid #5A4A1A; }

/* ----- Page banners ----- */
.hero-home { position: relative; height: 320px; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg); }
.hero-home img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero-home::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: linear-gradient(180deg, rgba(11,18,32,0) 0%, rgba(11,18,32,.85) 100%); }
.hero { position: relative; height: 150px; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg); }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,18,32,.94) 0%, rgba(11,18,32,.7) 50%, rgba(11,18,32,.25) 100%); }
.hero .wrap { position: relative; z-index: 1; height: 100%; display: flex; align-items: center; gap: 16px; }
.hero .patch { width: 56px; height: 66px; object-fit: contain; flex: none; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--link-hover); }
.hero h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 44px; line-height: 1.05; color: var(--white); }

main.page { max-width: 1240px; margin: 0 auto; padding: 28px 16px 64px; }
main.page.home { padding-top: 24px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.subline { font-size: 14px; color: var(--muted); margin-top: 4px; }
.lead { margin: 0 0 16px; font-size: 16px; color: var(--text-2); }
.prose { color: var(--text-2); }
.prose strong { color: var(--white); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ----- Type ----- */
.h-display { font-family: var(--display); font-weight: 700; color: var(--white); line-height: 1.1; }
h2.section { margin: 0 0 14px; font-family: var(--display); font-weight: 700; font-size: 30px; color: var(--white); border-bottom: 1px solid var(--line); padding-bottom: 6px; }
h2.block { margin: 0 0 4px; font-family: var(--display); font-weight: 700; font-size: 28px; color: var(--white); }
h2.block + p, .block-note { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
h3.card-title { margin: 0; font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--white); }

/* ----- Surfaces ----- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.card.pad { padding: 18px 20px; }
.card-head { padding: 14px 18px; background: var(--panel-2); font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--white); }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.tile .label { font-size: 13px; color: var(--muted); }
.tile .value { font-family: var(--display); font-weight: 700; font-size: 40px; line-height: 1.1; color: var(--white); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.lift { transition: border-color .15s ease, transform .15s ease; }
.lift:hover { border-color: #3B4F7A !important; transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .lift { transition: none; } .lift:hover { transform: none; } }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.grow { flex: 999 1 520px; min-width: 0; }
.side { flex: 1 1 340px; min-width: 0; }
.stack-v { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 32px; }
.mb { margin-bottom: 32px; }

/* ----- Pills and chips ----- */
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-sample { padding: 1px 8px; border-radius: 999px; background: #26324F; color: var(--text-3); font-size: 12px; font-weight: 600; }
.pill-amber { background: #3A2E12; color: #F5D27A; }
.pill-green { background: #123322; color: #7FE0A8; }
.pill-red { background: #3A1A1A; color: #FF9A9A; }
.pill-blue { background: #13283A; color: #9CC8FF; }
.pill-grey { background: #26324F; color: var(--text-3); }
.away { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #3A2E12; color: #F5D27A; font-size: 11px; font-weight: 600; letter-spacing: .3px; vertical-align: middle; white-space: nowrap; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: transparent; color: var(--text); font-size: 14px; }
.chip[aria-pressed="true"], .chip[aria-checked="true"], .chip.on { border-color: var(--red); background: var(--sel-bg); }
.chip.sm { min-height: 34px; padding: 0 10px; font-size: 13px; }
.chip-round { border-radius: 999px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.seg a, .seg button { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border: 0; border-radius: 8px; font-size: 14px; font-weight: 600; background: transparent; color: var(--text-3); text-decoration: none; }
.seg a:hover { text-decoration: none; color: var(--white); }
.seg .on, .seg [aria-selected="true"], .seg [aria-current="page"] { background: var(--red); color: var(--white); }

/* ----- Buttons ----- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 10px; border: 0; font-weight: 600; font-size: 15px; background: var(--red); color: var(--white); text-decoration: none; }
.btn:hover { color: var(--white); text-decoration: none; filter: brightness(1.08); }
.btn:disabled, .btn[aria-disabled="true"] { background: #34425F; color: var(--muted); cursor: not-allowed; filter: none; }
.btn-ghost { background: transparent; border: 1px solid var(--line-2); color: var(--text); font-weight: 500; }
.btn-outline { background: transparent; border: 1px solid var(--red); color: var(--red); }
.btn-outline.on { background: var(--red); color: var(--white); }
.btn-green { background: var(--green); }
.btn-out { background: var(--red-dark); }
.btn-danger-ghost { background: transparent; border: 1px solid #5A2A2A; color: #FF9A9A; font-weight: 500; }
.btn-big { min-width: 240px; min-height: 56px; border-radius: 12px; font-size: 18px; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-ok { min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid #1F5A3A; background: #123322; color: #BFF0D4; font-size: 13px; font-weight: 600; }
.btn-esc { min-height: 38px; padding: 0 12px; border-radius: 8px; border: 1px solid #5A2222; background: transparent; color: #FF9A9A; font-size: 13px; font-weight: 600; }

/* ----- Forms ----- */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field > .label { font-size: 13px; color: var(--muted); }
.input, .textarea, .select { min-height: 42px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg); color: var(--text); font-size: 14px; width: 100%; }
.textarea { padding: 10px 12px; resize: vertical; min-height: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.form-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 16px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.alert-ok { background: #123322; border: 1px solid #1F5A3A; color: #BFF2D6; }
.alert-bad { background: #3A1A1A; border: 1px solid #6A2A2A; color: #FFD0D0; }
.alert-info { background: #13283A; border: 1px solid #23435E; color: #CFE4FF; }
.alert-warn { background: #3A2E12; border: 1px solid #5A4A1A; color: #F5D27A; }
.error-text { font-size: 13px; color: #FF9A9A; }

/* ----- Tables ----- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead tr { background: var(--panel-2); text-align: left; }
table.data th { padding: 10px 14px; color: var(--white); font-weight: 600; }
table.data td { padding: 9px 14px; color: var(--text-3); vertical-align: middle; }
table.data tbody tr { border-top: 1px solid var(--line); }
table.data .strong { color: var(--white); font-weight: 600; }
table.data .num { font-variant-numeric: tabular-nums; }
table.data .cs { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .insig { display: block; height: 24px; width: auto; max-width: 56px; object-fit: contain; }
table.data th.group { padding: 8px 14px; text-align: left; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
@media (max-width: 640px) {
  table.stack { min-width: 0 !important; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td, table.stack th { display: block; width: auto !important; }
  table.stack tr { padding: 6px 0; }
  table.stack td { display: flex !important; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 6px 14px !important; text-align: right; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; flex: none; }
  table.stack td[data-label=""]::before { display: none; }
}

/* ----- Bars ----- */
.bar { position: relative; height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bar > span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--red); }
.bar.thin { height: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-row .bar { flex: 1; }

/* ----- Footer ----- */
.site-footer { border-top: 1px solid var(--line); background: var(--panel); padding: 28px 16px; }
.site-footer .inner { max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.site-footer .who { display: flex; align-items: center; gap: 12px; }
.site-footer .who img { width: 36px; height: 42px; object-fit: contain; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }

/* ----- Home ----- */
.home-title { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.home-title h1 { margin: 0; font-family: var(--display); font-weight: 700; font-size: 46px; line-height: 1.05; color: var(--white); }
.sync-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.sync-line .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green-dot); }
.sync-line .dot.warn { background: #E8B64A; }
.toc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; margin-bottom: 36px; max-width: 340px; }
.toc ol { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.tier { background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.tier-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.tier-head img { width: 52px; height: 60px; object-fit: contain; flex: none; }
.tier-label { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; }
.tier-arrow { display: flex; flex-direction: column; align-items: center; height: 36px; }
.tier-arrow span { width: 2px; flex: 1; background: var(--line-2); }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.person { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.person-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 26px; margin-bottom: 10px; }
.person-top img { display: block; height: 24px; width: auto; max-width: 96px; object-fit: contain; }
.person .title { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.person .name { font-weight: 600; font-size: 16px; }
.vacant { color: var(--muted); font-style: italic; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.grid-cards.wide { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.div-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.div-card .head { padding: 12px 16px; background: var(--panel-2); }
.div-card .dept { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.div-card .dept img { width: 44px; height: 52px; object-fit: contain; flex: none; }
.mem-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; background: var(--panel-2); }
.mem-head img { width: 30px; height: 36px; object-fit: contain; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.step .n { font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--red); }
.sidebar-col { flex: 1 1 300px; max-width: 360px; display: flex; flex-direction: column; gap: 16px; }
.onduty-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; background: #12261B; }
.onduty-row { padding: 9px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.onduty-row.lead { background: #1A1810; }
.onduty-row img { width: 22px; height: 22px; object-fit: contain; }
.region-mini { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; }
.region-mini span { padding: 3px 8px; border-radius: 8px; background: var(--panel-2); color: var(--text-3); }
.region-mini span.gap { background: #2A1414; border: 1px solid #5A2222; color: #FFB0B0; }
.infobox dl { margin: 0; font-size: 14px; }
.infobox dl > div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 9px 16px; border-top: 1px solid var(--line); }
.infobox dt { color: var(--muted); }
.infobox dd { margin: 0; }
.infobox-head { padding: 12px 16px; background: linear-gradient(135deg, #9E1B2C, #1E2F5E); color: var(--white); font-family: var(--display); font-weight: 700; font-size: 22px; text-align: center; }
.btn-apply { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 8px; background: linear-gradient(135deg, #1E2F5E, #9E1B2C); color: var(--white); font-weight: 600; }
.btn-apply:hover { color: var(--white); text-decoration: none; filter: brightness(1.1); }

/* ----- Duty clock ----- */
.clock-id { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.clock-id .insig { width: 52px; height: 52px; object-fit: contain; }
.clock-id .patch { width: 44px; height: 52px; object-fit: contain; }
.clock-state { padding: 32px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.clock-big { font-family: var(--display); font-weight: 700; font-size: 64px; line-height: 1; color: var(--white); font-variant-numeric: tabular-nums; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.region-btn { min-height: 44px; padding: 0 14px; border-radius: 10px; font-size: 14px; text-align: left; border: 2px solid var(--line-2); background: var(--panel-2); color: var(--white); }
.region-btn[aria-checked="true"] { border-color: var(--red); background: var(--sel-bg); }
label.region-btn, label.type-btn, label.chip { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
label.type-btn { display: block; }
label.region-btn:has(input:checked), label.type-btn:has(input:checked), label.chip:has(input:checked) { border-color: var(--red); background: var(--sel-bg); }
label.region-btn:has(input:focus-visible), label.type-btn:has(input:focus-visible), label.chip:has(input:focus-visible) { outline: 2px solid var(--link-hover); outline-offset: 2px; }
label.region-btn input, label.type-btn input, label.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.flash { margin-bottom: 18px; }
.region-btn .hint { font-size: 12px; color: var(--muted); }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.type-btn { min-height: 56px; padding: 10px 14px; text-align: left; border-radius: 10px; border: 2px solid var(--line-2); background: var(--panel-2); color: var(--white); }
.type-btn[aria-pressed="true"] { border-color: var(--red); background: var(--sel-bg); }
.type-btn .hint { font-size: 12px; color: var(--muted); }
.coverage { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cov { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.cov.gap { border-color: #5A2222; }
.cov .n { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; color: var(--white); }
.cov.gap .n { color: #FF9A9A; }
.list-row { padding: 10px 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; }

/* ----- Leaderboard ----- */
.winner { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; margin-bottom: 32px; padding: 24px; border-radius: 16px; background: #1A1610; border: 1px solid #4A3A1A; }
.winner .medal { display: flex; align-items: center; justify-content: center; width: 120px; height: 120px; border-radius: 50%; background: #2A2212; border: 3px solid #E8B64A; flex: none; }
.winner .medal img { width: 64px; height: 64px; object-fit: contain; }
.winner .stat { min-width: 110px; padding: 12px 16px; border-radius: 12px; background: #221C10; }
.winner .stat .k { font-size: 12px; color: #C9B48A; }
.winner .stat .v { font-family: var(--display); font-weight: 700; font-size: 32px; color: var(--white); line-height: 1.1; }
.top-row { display: grid; grid-template-columns: 28px minmax(120px, 190px) minmax(0, 1fr) 64px; align-items: center; gap: 10px; }
.top-row .pos { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.top-row .bar { height: 14px; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ----- Codes ----- */
.code-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.code-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); }
.code-card .code { flex: none; min-width: 64px; padding: 4px 8px; border-radius: 8px; background: var(--panel-2); color: var(--link-hover); font-family: var(--display); font-weight: 700; font-size: 22px; text-align: center; line-height: 1.2; }
.code-card.urgent { border-color: #5A2222; }
.code-card.urgent .code { background: #3A1A1A; color: #FF9A9A; }
.region-dot { width: 28px; height: 28px; border-radius: 50%; color: var(--white); font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none; }
.search-big { flex: 1 1 320px; min-height: 48px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font-size: 16px; }

/* ----- Training ----- */
.week-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.day-col { min-width: 0; background: var(--panel-3); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 220px; }
.day-col.today { border-color: var(--red); }
.day-col .head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding: 2px 4px 6px; border-bottom: 1px solid var(--line); }
.sess { border-radius: 10px; background: var(--panel-2); border-top: 3px solid var(--red); padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.sess .btn-sign { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 600; border: 1px solid var(--line-2); background: transparent; color: var(--text); }
.sess .btn-sign[aria-pressed="true"] { background: #123322; color: #7FE0A8; border-color: #1F5A3A; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ----- Command / reports ----- */
.review-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px; border-top: 1px solid var(--line); background: var(--panel); }
.review-row:first-child { border-top: 0; }
.review-row.done { background: #0F1729; }
.region-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.region-tile { padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.region-tile.gap { border-color: #5A2222; }
.region-tile .n { font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1.1; color: var(--white); }
.region-tile.gap .n { color: #FF9A9A; }
.lead-card { flex: 1 1 280px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; }
.lead-card.on { border-color: #8A6A1F; }
.lead-tag { padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .5px; background: #3A2E12; color: #F5D27A; }
.debrief-row > button { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 14px; font: inherit; text-align: left; border: 0; background: transparent; color: var(--text); }
.debrief-row { border-top: 1px solid var(--line); background: var(--panel); }
.debrief-row:first-child { border-top: 0; }
.debrief-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--text-2); }
.cmd-group { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cmd-group .row-cmd { padding: 9px 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.cmd-group code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--link-hover); }
.check-btn { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 8px 10px; border-radius: 8px; text-align: left; border: 1px solid var(--line); background: transparent; color: var(--text); width: 100%; }
.check-btn .box-mark { flex: none; width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; background: var(--line-2); color: var(--bg); }
.check-btn[aria-pressed="true"] { border-color: #1F5A3A; }
.check-btn[aria-pressed="true"] .box-mark { background: var(--green-dot); }
.rule { display: flex; gap: 10px; align-items: flex-start; padding: 5px 0; font-size: 14px; }
.rule .mark { flex: none; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--bg); }
.tri { min-width: 54px; text-align: center; padding: 4px 8px; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tri-1 { background: #2A1414; color: #FFB0B0; }
.tri-2 { background: #2A2410; color: #F5D27A; }
.tri-3 { background: #122A1A; color: #7FE0A8; }
.tri-b { background: #141C2C; color: var(--text-3); }

/* ----- Handbook and documents ----- */
.doc-nav { flex: 1 1 260px; max-width: 320px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; font-size: 14px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.doc-nav ol, .doc-nav ul { margin: 0 0 14px; padding-left: 20px; line-height: 1.9; color: var(--muted); }
details.doc { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; }
details.doc > summary { display: flex; align-items: center; gap: 12px; padding: 16px 0; cursor: pointer; list-style: none; }
details.doc > summary::-webkit-details-marker { display: none; }
details.doc > summary .chev { color: var(--link); font-size: 18px; transition: transform .15s; }
details.doc[open] > summary .chev { transform: rotate(90deg); }
details.doc > summary img { width: 40px; height: 48px; object-fit: contain; flex: none; }
.doc-title { display: block; font-family: var(--display); font-weight: 700; font-size: 26px; color: var(--white); line-height: 1.15; }
.doc-body { padding: 0 0 20px; color: var(--text-2); font-size: 14px; display: flex; flex-direction: column; gap: 12px; }
.doc-body h2, .doc-body h3, .doc-body h4 { margin: 8px 0 0; color: var(--white); }
.doc-body h2 { font-family: var(--display); font-size: 24px; }
.doc-body h3 { font-size: 16px; }
.doc-body p { margin: 0; }
.doc-body table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-body .table-wrap { border-radius: 10px; }
.doc-body th { background: var(--panel-2); color: var(--white); text-align: left; padding: 9px 12px; }
.doc-body td { padding: 8px 12px; border-top: 1px solid var(--line); }
.design-doc details > summary { cursor: pointer; list-style: none; }
.design-doc details > summary::-webkit-details-marker { display: none; }
.design-doc details[open] > summary .chev { transform: rotate(90deg); }
details.doc-section { border-top: 1px solid var(--line); }
details.doc-section > summary { display: flex; align-items: center; gap: 10px; padding: 12px 0; cursor: pointer; list-style: none; font-family: var(--display); font-weight: 700; font-size: 21px; color: var(--white); }
details.doc-section > summary::-webkit-details-marker, details.debrief-row > summary::-webkit-details-marker, details.note-form > summary::-webkit-details-marker { display: none; }
details.doc-section > summary .chev { color: var(--link); font-size: 16px; transition: transform .15s; }
details.doc-section[open] > summary .chev { transform: rotate(90deg); }
.doc-section-body { padding: 0 0 16px 26px; display: flex; flex-direction: column; gap: 10px; }
.doc-body ul, .doc-body ol { margin: 0; padding-left: 22px; }
.doc-body li { margin: 2px 0; }
.doc-body .doc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc-body .doc-table td, .doc-body .doc-table th { vertical-align: top; border-top: 1px solid var(--line); }
.doc-body .doc-table tr:first-child td, .doc-body .doc-table tr:first-child th { border-top: 0; }
.doc-img { display: block; max-width: 100%; height: auto; border-radius: 8px; margin: 4px 0; }
.db-name { color: var(--white); font-weight: 600; border-bottom: 1px dotted var(--muted); }
.doc-locked { display: flex; align-items: center; gap: 12px; padding: 16px 22px; background: #0F1729; border: 1px dashed var(--line-2); border-radius: 14px; }
.doc-locked img { width: 40px; height: 48px; object-fit: contain; flex: none; opacity: .45; }
.notice { padding: 10px 14px; border-radius: 10px; background: #2A1414; border: 1px solid #5A2222; color: #FFD0D0; }
.notice strong { color: var(--white); }
.notice-info { background: #13283A; border-color: #23435E; color: #CFE4FF; }
.command-strip { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 10px 14px; border-radius: 10px; background: var(--panel-2); font-size: 13px; color: var(--text-3); }
.command-strip strong { color: var(--white); }
.dashed { padding: 14px 18px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 14px; }

/* ----- Departments ----- */
.dept-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.dept-card .head { display: flex; gap: 14px; align-items: center; padding: 16px 18px; background: var(--panel-2); }
.dept-card .head img { width: 56px; height: 66px; object-fit: contain; }
.dept-card .body { padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.dept-card .foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.kicker { font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.dept-card ul { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 14px; }

/* ----- Login ----- */
.login-card { max-width: 520px; margin: 40px auto; }
.btn-discord { background: #5865F2; }
