/* Public status page (/status): one narrow column on top of the console's look (expanse.css + themes.css). */

body { min-height: 100vh; }
.status-wrap { max-width: 760px; margin: 0 auto; padding: 28px 16px 40px; }
.status-wrap > main { padding: 0; margin: 0; max-width: none; }  /* the console's main padding doesn't apply here */
.status-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.status-logo { width: 56px; height: 56px; object-fit: contain; flex-shrink: 0; }
.status-name { font-size: 24px; line-height: 1.15; overflow-wrap: anywhere; }
.status-tagline { color: var(--muted); font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; margin-top: 4px; }
.status-wrap .panel + .panel { margin-top: 16px; }
.status-wrap .state-big .label { font-size: 34px; }
.status-wrap .readouts { margin-top: 6px; }
.status-players { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.status-address { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.status-address code { font-size: 20px; color: var(--accent-ink); user-select: all; overflow-wrap: anywhere; }
.status-wrap a.btn { margin-top: 4px; }
/* several servers: a row each; the ones that are not up stay in the background */
.status-list { display: flex; flex-direction: column; }
.status-row { display: grid; grid-template-columns: 14px minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.status-row:first-child { border-top: 0; padding-top: 2px; }
.status-row:not(.up) { opacity: 0.6; }
.status-row .sr-name { font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; overflow-wrap: anywhere; }
.status-row .sr-state { font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.status-row.up .sr-state { color: var(--green); }
.status-row .sr-players { font-family: var(--font-mono); }
.status-row .sr-map { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* recent mission plays: when, mission · map, how long, players, replay */
.play-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto auto auto; gap: 12px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--line); text-align: left; }
.play-row:first-child { border-top: 0; padding-top: 2px; }
.play-row .pr-name { font-weight: 700; overflow-wrap: anywhere; }
.play-row .pr-num { font-family: var(--font-mono); }
.status-next { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; }
.status-next .sn-task { color: var(--text-dim); }
.status-join { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.status-join p:last-child { margin-bottom: 0; }
.status-foot { margin-top: 18px; text-align: center; }
.status-resv a { margin-left: 8px; }

/* operations calendar (/calendar): a month grid or a list, and an operation's public card */
/* Readable first: 16px text, titles that wrap instead of being cut, wide enough for a month of seven columns. */
.cal-wrap { max-width: 1240px; font-size: 16px; }
.cal-wrap .small { font-size: 14px; }
.cal-wrap .status-name { font-size: 30px; }
.cal-wrap .panel h2 { font-size: 15px; }
.cal-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-toolbar .row { display: flex; align-items: center; gap: 8px; }
.cal-toolbar button { font-size: 15px; padding: 7px 14px; }
.cal-toolbar > b, .cal-month { font-size: 22px; margin-left: 8px; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { padding: 8px 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-dim);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 128px; padding: 6px 7px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cal-day.other { opacity: 0.55; }
.cal-day.other .cal-chip { opacity: 1; }
.cal-date { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--text-dim); }
.cal-num { display: inline-grid; place-items: center; min-width: 30px; height: 30px; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--accent); color: var(--on-accent, #fff); font-weight: 700; }
.cal-wday { display: none; }
.cal-ops { display: flex; flex-direction: column; gap: 6px; }
.cal-op-link { text-decoration: none; color: inherit; min-width: 0; }
.cal-chip { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.3; padding: 6px 8px;
  border-left: 4px solid var(--accent); border-radius: 3px; background: color-mix(in srgb, var(--accent) 14%, var(--panel, transparent));
  overflow-wrap: anywhere; }
.cal-time { font-weight: 700; font-size: 14px; }
.cal-title { font-weight: 600; color: var(--text); }
.cal-kind { font-size: 12.5px; color: var(--text-dim); }
.cal-chip.kind-guest { border-left-color: var(--amber, #c90); background: color-mix(in srgb, var(--amber, #c90) 14%, var(--panel, transparent)); }
.cal-chip.kind-hosted { border-left-color: var(--green, #4a4); background: color-mix(in srgb, var(--green, #4a4) 14%, var(--panel, transparent)); }
.cal-chip.kind-zeus, .cal-chip.kind-training { border-left-color: var(--violet, var(--muted)); background: color-mix(in srgb, var(--violet, #888) 14%, var(--panel, transparent)); }
.cal-chip.ended, .cal-row.ended { opacity: 0.6; }
.cal-op-link:hover .cal-chip, .cal-op-link:focus-visible .cal-chip { outline: 2px solid var(--accent); }
.cal-empty { margin: 12px 0 0; }
.cal-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2.2fr) auto; gap: 16px; align-items: baseline;
  padding: 14px 0; border-top: 1px solid var(--line); }
.cal-row:first-child { border-top: 0; padding-top: 4px; }
.cal-when { font-size: 15px; color: var(--text-dim); }
.cal-what { overflow-wrap: anywhere; font-size: 17px; }
.cal-slots { font-family: var(--font-mono); font-size: 14px; }
.cal-back { margin: 0 0 14px; font-size: 16px; }
.cal-banner { display: block; width: 100%; max-height: 320px; object-fit: cover; margin-bottom: 16px; }
.cal-image { display: block; max-width: 100%; height: auto; }
/* On its own the page takes the whole window (in another site's frame it keeps the column above). */
.cal-wrap.cal-full { max-width: 1840px; padding-left: clamp(16px, 3vw, 48px); padding-right: clamp(16px, 3vw, 48px); }
/* an operation's card: every value whole (they wrap, never "…") */
.cal-wrap .readouts { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 18px; }
.cal-wrap .readout .k { font-size: 12.5px; }
.cal-wrap .readout .v { font-size: 18px; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; line-height: 1.3; }
.cal-wrap .readout.wide { grid-column: 1 / -1; }  /* a mission's file name: the whole row */
/* the OPORD beside the modset and how to join; the ORBAT across below */
.cal-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; margin-top: 16px; }
.cal-columns.single { grid-template-columns: minmax(0, 1fr); }
.cal-main, .cal-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cal-side { position: sticky; top: 16px; }
.status-wrap .cal-columns .panel + .panel { margin-top: 0; }
.status-wrap .cal-columns + .panel { margin-top: 16px; }
.cal-opord { font-size: 16px; line-height: 1.6; }
.cal-opord h3 { font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; margin: 20px 0 8px; }
.cal-opord h3:first-child { margin-top: 0; }
/* the ORBAT: a card per squad, a bar of how full it is, an icon per role */
.cal-orbat-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cal-orbat-count { font-size: 18px; color: var(--text-dim); white-space: nowrap; }
.cal-orbat-count b { font-size: 30px; color: var(--accent-ink); }
.cal-orbat-head .cal-fill { flex: 1 1 200px; height: 10px; }
.cal-fill { height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.cal-fill > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.cal-orbat-hint { margin: -6px 0 14px; }
/* the tree: a squad under the one it is under, joined by lines (the bus and the drops), centred; wide ones scroll */
.cal-tree { overflow-x: auto; padding: 4px 0 12px; }
.cal-tree ul { display: flex; justify-content: center; margin: 0; padding: 24px 0 0; position: relative; list-style: none; }
.cal-tree > ul { padding-top: 0; width: max-content; min-width: 100%; }
.cal-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 24px 8px 0; }
.cal-tree > ul > li { padding-top: 0; }
.cal-tree li::before, .cal-tree li::after { content: ""; position: absolute; top: 0; right: 50%; width: 50%; height: 24px;
  border-top: 1.5px solid var(--line-strong); }
.cal-tree li::after { right: auto; left: 50%; border-left: 1.5px solid var(--line-strong); }
.cal-tree li:first-child::before, .cal-tree li:last-child::after { border-top: 0; }
.cal-tree li:last-child::before { border-right: 1.5px solid var(--line-strong); }
.cal-tree li:last-child::after { border-left: 0; }
.cal-tree li:only-child::before { border: 0; }
.cal-tree li:only-child::after { border-top: 0; border-left: 1.5px solid var(--line-strong); }
.cal-tree > ul > li::before, .cal-tree > ul > li::after { display: none; }
.cal-tree ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 24px; border-left: 1.5px solid var(--line-strong); }
/* a unit: its NATO symbol in the theme's colours, its name and how full it is; one with slots is a button */
.cal-unit { all: unset; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 104px; max-width: 200px; padding: 6px 8px; border-radius: 4px; text-align: center; color: var(--text); }
button.cal-unit { cursor: pointer; }
button.cal-unit:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
button.cal-unit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button.cal-unit[aria-expanded="true"] { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.cal-sym { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cal-marks { display: block; width: 48px; height: 14px; overflow: visible; color: var(--text); }
.cal-marks .orbat-mark { fill: currentColor; stroke: currentColor; stroke-width: 1.8; }
.cal-marks .orbat-mark.hollow { fill: none; }
.cal-frame { display: block; width: 60px; height: 40px; overflow: visible; }
.cal-frame-box { fill: color-mix(in srgb, var(--accent) 22%, var(--bg)); stroke: var(--accent-ink); stroke-width: 1.6; }
.cal-frame-glyph * { fill: none; stroke: var(--accent-ink); stroke-width: 1.6; }
.cal-frame-glyph .orbat-fill { fill: var(--accent-ink); }
.cal-frame-glyph .orbat-glyph-text { fill: var(--accent-ink); stroke: none; font: 700 12px var(--font-ui); text-anchor: middle; }
.cal-frame.full .cal-frame-box { fill: color-mix(in srgb, var(--accent) 50%, var(--bg)); }
.cal-frame.theirs .cal-frame-box { fill: transparent; stroke: var(--text-dim); stroke-dasharray: 4 3; }
.cal-frame.theirs .cal-frame-glyph * { stroke: var(--text-dim); }
.cal-frame.theirs .cal-frame-glyph .orbat-fill { fill: var(--text-dim); }
.cal-unit-text { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 100%; }
.cal-unit-name { font-weight: 700; font-size: 15px; letter-spacing: 0.06em; text-transform: uppercase; overflow-wrap: break-word; max-width: 100%; }
.cal-top .cal-unit-name { font-size: 16px; }
.cal-unit-count { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
button.cal-unit .cal-unit-count::after { content: " ▾"; }
button.cal-unit[aria-expanded="true"] .cal-unit-count::after { content: " ▴"; }
.cal-squad-group { font-size: 12.5px; padding: 1px 8px; border: 1px solid var(--line-strong, var(--line)); border-radius: 99px; color: var(--text-dim); }
/* a squad's slots, unfolded under it (the line to the squads under it runs on behind the card) */
.cal-roster { position: relative; padding-top: 8px; display: flex; justify-content: center; }
.cal-roster[hidden] { display: none; }
.cal-tree li.parent > .cal-roster::before { content: ""; position: absolute; left: 50%; top: 0; bottom: -1px; border-left: 1.5px solid var(--line-strong); }
.cal-roster-card { position: relative; z-index: 1; min-width: 260px; max-width: 340px; padding: 4px 12px; text-align: left;
  border: 1px solid var(--line-strong, var(--line)); border-radius: 4px; background: linear-gradient(var(--panel-2), var(--panel-2)), var(--bg); }
.cal-slot-list { display: flex; flex-direction: column; }
.cal-slot { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 0;
  border-top: 1px solid var(--line); font-size: 15px; }
.cal-slot:first-child { border-top: 0; }
.cal-slot-name { overflow-wrap: anywhere; }
.cal-slot.lead .cal-slot-name { font-weight: 700; }
.cal-ico { display: inline-grid; place-items: center; width: 26px; height: 26px; color: var(--text-dim); }
.cal-ico svg { width: 20px; height: 20px; }
.cal-slot.taken .cal-ico, .cal-slot.lead .cal-ico { color: var(--accent-ink); }
.cal-slot.lead .ico-leader svg { fill: color-mix(in srgb, var(--accent) 35%, transparent); }
.ico-medic { color: var(--red, #c33) !important; }
.cal-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; justify-content: flex-end; text-align: right; }
.cal-avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--accent); color: var(--on-accent, #fff); font-size: 13px; font-weight: 700; }
.cal-holder { font-weight: 700; overflow-wrap: anywhere; }
.cal-free { display: inline-block; padding: 2px 10px; border: 1px dashed var(--accent-ink); border-radius: 99px; color: var(--accent-ink);
  font-size: 13px; font-weight: 600; white-space: nowrap; }
.cal-closed { color: var(--muted); font-size: 13px; }
.cal-closed .cal-ico { width: 18px; height: 18px; color: var(--muted); }
.cal-closed .cal-ico svg { width: 16px; height: 16px; }
.cal-slot.closed .cal-slot-name { color: var(--muted); }
@media (max-width: 1000px) {
  .cal-columns { grid-template-columns: minmax(0, 1fr); }
  .cal-side { position: static; }
}
@media (max-width: 700px) {  /* phones: the same tree, indented down the page */
  .cal-tree > ul { width: auto; min-width: 0; }
  .cal-tree ul { display: block; padding: 0 0 0 18px; margin-left: 30px; border-left: 1.5px solid var(--line-strong); }
  .cal-tree > ul { margin-left: 0; padding-left: 0; border-left: 0; }
  .cal-tree li { align-items: stretch; padding: 10px 0 0; }
  .cal-tree > ul > li { padding-top: 0; }
  .cal-tree li::after, .cal-tree ul ul::before, .cal-tree li.parent > .cal-roster::before { display: none; }
  .cal-tree li::before, .cal-tree li:last-child::before, .cal-tree li:first-child::before { display: block; border: 0;
    border-top: 1.5px solid var(--line-strong); width: 14px; height: 0; left: -18px; right: auto; top: 50px; }
  .cal-tree li:only-child::before { border-top: 1.5px solid var(--line-strong); }
  .cal-tree > ul > li::before { display: none; }
  .cal-unit { flex-direction: row; max-width: none; width: 100%; text-align: left; gap: 12px; }
  .cal-unit-text { align-items: flex-start; }
  .cal-roster { justify-content: stretch; padding-left: 4px; }
  .cal-roster-card { min-width: 0; max-width: none; width: 100%; }
}
.cal-unlock { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-unlock input { flex: 1 1 220px; min-width: 0; font-size: 16px; }
.cal-error { color: var(--red, #c33); min-height: 1em; margin: 8px 0 0; }
@media (max-width: 900px) {  /* a narrow month: time and title only */
  .cal-day { min-height: 100px; padding: 4px; }
  .cal-chip { padding: 4px 5px; font-size: 13px; }
  .cal-kind { display: none; }
}
@media (max-width: 640px) {  /* phones: the month as an agenda of the days that have operations */
  .cal-grid { display: flex; flex-direction: column; border: 0; gap: 10px; }
  .cal-dow, .cal-day:not(.busy) { display: none; }
  .cal-day { min-height: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; flex-direction: row; gap: 12px; }
  .cal-day.other { opacity: 0.7; }
  .cal-date { flex-direction: column; align-items: flex-start; gap: 2px; width: 92px; flex-shrink: 0; }
  .cal-num { font-size: 26px; min-width: 0; height: auto; border-radius: 0; place-items: start; }
  .cal-day.today .cal-num { background: none; color: var(--accent-ink); }
  .cal-wday { display: block; font-size: 13px; font-weight: 500; text-transform: capitalize; }
  .cal-ops { flex: 1; min-width: 0; }
  .cal-chip { font-size: 15px; padding: 8px 10px; }
  .cal-kind { display: block; }
  .cal-row { grid-template-columns: minmax(0, 1fr) auto; }
  .cal-row .cal-when { grid-column: 1 / -1; }
  .cal-toolbar > b, .cal-month { font-size: 19px; }
}
@media (max-width: 520px) {
  .status-row { grid-template-columns: 14px minmax(0, 1fr) auto auto; }
  .status-row .sr-map { display: none; }
  .play-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .play-row .pr-when { grid-column: 1 / -1; }
  .status-wrap { padding: 16px 12px 28px; }
  .status-name { font-size: 20px; }
  .status-wrap .state-big .label { font-size: 26px; }
}
