/* Household Hub — TV-first styles. 1rem = 16px on a 1920×1080 screen and scales with the display. */

:root {
  --bg: #07101e;
  --bg-2: #0c1a31;
  --surface: rgba(130, 168, 235, 0.055);
  --surface-2: rgba(130, 168, 235, 0.09);
  --line: rgba(150, 186, 246, 0.13);
  --ink: #eef4fd;
  --ink-2: #a9b8d1;
  --ink-3: #6c7f9e;
  --today: #d9e8ff;
  --focus: #ffd27a;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --demo: #c084fc;
  --display: "Bricolage Grotesque", "Segoe UI", Roboto, system-ui, sans-serif;
  --ui: "Figtree", "Segoe UI", Roboto, system-ui, sans-serif;
  --r-panel: 1.6rem;
  --r-cell: 0.85rem;
  --fade: 1.2s;
  color-scheme: dark;
}
html[data-theme="charcoal"] {
  --bg: #0f1114; --bg-2: #191c21; --surface: rgba(255, 255, 255, 0.045); --surface-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.1); --ink-2: #b3b9c3; --ink-3: #737b88;
}
html[data-theme="midnight"] {
  --bg: #03060c; --bg-2: #060c18; --surface: rgba(110, 150, 230, 0.04); --surface-2: rgba(110, 150, 230, 0.07);
  --line: rgba(130, 170, 240, 0.1);
}

* { box-sizing: border-box; }
html {
  font-size: min(0.8333vw, 1.4815vh);
  height: 100%;
  background: var(--bg);
}
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--ui);
  color: var(--ink);
  background:
    radial-gradient(70rem 42rem at 8% -14%, rgba(78, 118, 210, 0.2), transparent 62%),
    radial-gradient(60rem 40rem at 104% 112%, rgba(126, 86, 214, 0.13), transparent 60%),
    linear-gradient(180deg, var(--bg-2), var(--bg) 70%);
  -webkit-font-smoothing: antialiased;
  cursor: default;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; }
button { font: inherit; color: inherit; }
svg { display: block; }

/* ------------------------------------------------------------------ shared controls */
.btn, .icon-btn, .seg-btn, .switch, .mini, .tab {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  cursor: pointer;
  outline: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.4rem; font-size: 1.1rem; font-weight: 600; text-decoration: none; }
.btn.sm { padding: 0.5rem 1.1rem; font-size: 1rem; }
.btn.primary { background: #dbe8ff; color: #0a1a33; border-color: transparent; }
.btn.danger { color: #fecaca; border-color: rgba(248, 113, 113, 0.4); }
.btn.ghost { background: transparent; }
.btn:hover, .icon-btn:hover, .seg-btn:hover, .mini:hover, .tab:hover { background: var(--surface-2); }
.btn.primary:hover { background: #fff; }
.icon-btn { width: 3.6rem; height: 3.6rem; display: grid; place-items: center; padding: 0; }
.icon-btn.sm { width: 2.9rem; height: 2.9rem; }
.icon-btn svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.active { background: rgba(167, 139, 250, 0.22); border-color: rgba(167, 139, 250, 0.5); }
.inp {
  font: inherit; font-size: 1.1rem; color: var(--ink); background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line); border-radius: 0.8rem; padding: 0.75rem 1rem; outline: none; min-width: 0;
}
.inp.wide { width: 100%; }
.inp::placeholder { color: var(--ink-3); }

/* Remote focus: a bright, unmistakable ring visible from across the room. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
body.using-remote :focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem var(--focus), 0 0 0 0.55rem rgba(255, 210, 122, 0.22), 0 0 2.2rem rgba(255, 210, 122, 0.25);
}
body:not(.using-remote) :focus:not(:focus-visible) { outline: none; }

.pill { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.55rem 1rem; border-radius: 999px; font-size: 1rem; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.pill i { width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--ink-3); flex: none; }
.pill-ok i { background: var(--good); box-shadow: 0 0 0.6rem var(--good); }
.pill-warn i { background: var(--warn); box-shadow: 0 0 0.6rem var(--warn); }
.pill-err { color: #fecaca; border-color: rgba(248, 113, 113, 0.35); }
.pill-err i { background: var(--bad); box-shadow: 0 0 0.6rem var(--bad); }
.pill-demo { color: #f3e8ff; border-color: rgba(192, 132, 252, 0.5); background: rgba(192, 132, 252, 0.14); }
.pill-demo i { background: var(--demo); }
.chip { position: relative; display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--ink); isolation: isolate; }
.chip::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--c, var(--ink-3)); opacity: 0.25; z-index: -1; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.ic-moon { width: 1em; height: 1em; flex: none; color: #c4b5fd; }

/* ------------------------------------------------------------------ views */
.view { position: fixed; inset: 0; }
.view-dashboard { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 1.3rem; padding: 1.5rem 2rem 1.75rem; }

/* header */
.hdr { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.hdr-time { display: flex; align-items: center; gap: 1.5rem; min-width: 0; }
.emblem { height: 6.2rem; width: auto; flex: none;
  -webkit-mask-image: radial-gradient(ellipse 62% 70% at 50% 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 70% at 50% 50%, #000 55%, transparent 100%); }
.tz, .hud-frame, .map-hud { display: none; }
.hdr-date { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.date-day { font-family: var(--display); font-size: 1.9rem; font-weight: 650; line-height: 1.1; }
.date-row { display: flex; align-items: baseline; gap: 0.8rem; margin-top: 0.25rem; }
.date { font-size: 1.3rem; color: var(--ink-2); }
.hdr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 0.6rem; }
.hdr-tabs { display: flex; gap: 0.6rem; }
.tab-hud { position: relative; display: inline-flex; align-items: center; gap: 0.65rem; padding: 0.75rem 1.4rem; font-size: 1.12rem; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; outline: none; isolation: isolate; }
.tab-hud svg { width: 1.45rem; height: 1.45rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tab-hud.on { background: var(--surface-2); border-color: rgba(219, 232, 255, 0.5); }
.tab-hud.active { color: #c4b5fd; }
.hdr-status { display: flex; align-items: center; gap: 1rem; }
.weather { display: flex; align-items: center; gap: 0.6rem; }
.weather svg { width: 2.2rem; height: 2.2rem; color: #ffe2a8; }
.weather b { font-family: var(--display); font-size: 1.5rem; font-weight: 650; }
.weather div { display: flex; align-items: baseline; gap: 0.6rem; }
.weather span { color: var(--ink-2); font-size: 0.95rem; }
.weather small { display: none; }

/* board layout: calendar | big slot | shift column, with Today/Tomorrow and a small slot underneath.
   The map and photos swap between the big and small slots (Settings → Family map). */
.board {
  display: grid; gap: 1.1rem; min-height: 0;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 0.86fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 11.5rem);
  grid-template-areas: "cal big side" "days small side";
}
.cal-panel { grid-area: cal; }
.day-panels { grid-area: days; display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; min-height: 0; }
.col-side { grid-area: side; }
.col { display: flex; flex-direction: column; gap: 1.1rem; min-height: 0; }
.fam-panel, .photo-tile { min-height: 0; }
.board[data-layout="map-big"] .fam-panel, .board[data-layout="map-only"] .fam-panel { grid-area: big; }
.board[data-layout="map-big"] .photo-tile { grid-area: small; }
.board[data-layout="photo-big"] .photo-tile, .board[data-layout="photo-only"] .photo-tile { grid-area: big; }
.board[data-layout="photo-big"] .fam-panel { grid-area: small; }
.board:is([data-layout="photo-only"], [data-layout="none"]) .fam-panel,
.board:is([data-layout="map-only"], [data-layout="none"]) .photo-tile { display: none; }
.board:is([data-layout="photo-only"], [data-layout="map-only"]) { grid-template-areas: "cal big side" "days days side"; }
.board[data-layout="none"] { grid-template-columns: minmax(0, 1.9fr) minmax(0, 0.86fr); grid-template-areas: "cal side" "days side"; }
.board[data-show-today="0"] .day-panels { display: none; }
.board[data-show-today="0"] { grid-template-areas: "cal big side" "cal small side"; }
.board[data-show-today="0"]:is([data-layout="photo-only"], [data-layout="map-only"]) { grid-template-areas: "cal big side" "cal big side"; }
.board[data-show-today="0"][data-layout="none"] { grid-template-areas: "cal side" "cal side"; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 1.25rem 1.35rem; min-height: 0; }
.panel h3 { display: flex; align-items: center; gap: 0.65rem; font-family: var(--display); font-size: 1.4rem; color: var(--ink); margin-bottom: 0.8rem; }
.panel h3 svg { width: 1.5rem; height: 1.5rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* calendar */
.cal-panel { display: flex; flex-direction: column; padding: 1.25rem 1.25rem 1rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; padding: 0 0.3rem; }
.cal-head h2 { font-family: var(--display); font-size: 2.3rem; font-weight: 750; letter-spacing: -0.02em; }
.cal-head h2 span { color: var(--ink-3); font-weight: 500; }
.cal-nav { display: flex; gap: 0.6rem; align-items: center; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.45rem; padding: 0 0.1rem 0.45rem; }
.cal-dow span { font-size: 1rem; color: var(--ink-3); padding-left: 0.6rem; font-weight: 600; }
.cal-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 0.45rem; }
.day {
  position: relative; display: flex; flex-direction: column; gap: 0.28rem; min-height: 0; overflow: hidden;
  padding: 0.45rem 0.5rem 0.4rem; border-radius: var(--r-cell);
  background: rgba(255, 255, 255, 0.025); border: 1px solid transparent; cursor: pointer; outline: none;
  transition: transform 0.15s, background 0.2s;
}
.day:hover { background: rgba(255, 255, 255, 0.05); }
.day-num { font-size: 1.2rem; font-weight: 650; line-height: 1.2; padding-left: 0.2rem; font-variant-numeric: tabular-nums; }
.day.past .day-num { color: var(--ink-3); }
.day.past .day-evs { opacity: 0.55; }
.day.other-month { opacity: 0.35; }
.day.today { background: rgba(160, 196, 255, 0.1); border-color: rgba(217, 232, 255, 0.55); box-shadow: 0 0 1.6rem rgba(140, 180, 255, 0.22), inset 0 0 1.2rem rgba(140, 180, 255, 0.08); }
.day.today .day-num { color: #0b1a33; background: var(--today); border-radius: 999px; align-self: flex-start; padding: 0 0.55rem; }
body.using-remote .day:focus { transform: scale(1.045); z-index: 2; background: rgba(255, 255, 255, 0.07); }
.day-evs { display: flex; flex-direction: column; gap: 0.22rem; min-height: 0; }
.ev { position: relative; display: flex; align-items: center; gap: 0.3rem; padding: 0.14rem 0.4rem; border-radius: 0.45rem; font-size: 0.95rem; line-height: 1.25; white-space: nowrap; overflow: hidden; isolation: isolate; }
.ev::before { content: ""; position: absolute; inset: 0; background: var(--c); opacity: 0.2; z-index: -1; }
.ev-shift { box-shadow: inset 0.22rem 0 0 var(--c); font-weight: 600; }
.ev-appt::before { opacity: 0; }
.ev-appt { color: var(--ink-2); padding-left: 0.25rem; }
.ev-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--c); flex: none; }
.ev-shift .ev-dot { display: none; }
.ev-night::before { opacity: 0.32; }
.ev-t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ev-time { margin-left: auto; font-size: 0.82rem; color: var(--ink-2); font-weight: 500; font-variant-numeric: tabular-nums; flex: none; }
.ev.no-time .ev-time { display: none; }
.ev-more { font-size: 0.85rem; color: var(--ink-3); padding-left: 0.45rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; padding: 0.8rem 0.4rem 0; }
.lg { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.92rem; color: var(--ink-2); }
.lg i { width: 0.75rem; height: 0.75rem; border-radius: 0.2rem; background: var(--c); }

/* photo tile */
.photo-tile { position: relative; min-height: 0; border-radius: var(--r-panel); overflow: hidden; background: #050a14; border: 1px solid var(--line); box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, 0.35); }
.slides { position: absolute; inset: 0; overflow: hidden; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity var(--fade) ease-in-out; will-change: opacity; }
.slide.show { opacity: 1; }
.slide-backdrop { position: absolute; inset: -10%; background: center / cover no-repeat; filter: blur(2.2rem) brightness(0.5) saturate(1.15); display: none; }
.slide[data-fit="fit"] .slide-backdrop { display: block; }
.slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 36%; }
.slide[data-fit="fit"] .slide-img { object-fit: contain; object-position: center; }
.photo-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 2rem; color: var(--ink-3); font-size: 1.15rem; background: radial-gradient(circle at 50% 40%, rgba(120, 160, 230, 0.1), transparent 70%); }
.ph-nav { position: absolute; top: 50%; z-index: 4; width: 3rem; height: 3rem; margin-top: -1.5rem; display: grid; place-items: center; border: 0; background: rgba(2, 7, 11, 0.45); color: #fff; border-radius: 50%; cursor: pointer; outline: none; opacity: 0.85; }
.ph-nav svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ph-nav.prev { left: 0.8rem; }
.ph-nav.next { right: 0.8rem; }
.photo-tile.empty .ph-nav { display: none; }
.ph-dots { position: absolute; left: 0; right: 0; bottom: 0.7rem; z-index: 4; display: flex; justify-content: center; gap: 0.45rem; pointer-events: none; }
.ph-dots i { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: rgba(255, 255, 255, 0.4); }
.ph-dots i.on { background: #fff; box-shadow: 0 0 0.5rem rgba(56, 214, 245, 0.9); }
.photo-night-msg { display: none; position: absolute; inset: 0; place-items: center; color: var(--ink-3); font-size: 1.1rem; }

/* today + notes */
.day-panels .panel { overflow: hidden; }
.day-panels h3 { display: flex; align-items: center; gap: 0.7rem; }
.t-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.t-list li { display: flex; gap: 0.9rem; font-size: 1.12rem; align-items: baseline; }
.t-time { color: var(--ink-2); min-width: 4.4rem; font-variant-numeric: tabular-nums; position: relative; padding-left: 0.9rem; }
.t-time::before { content: ""; position: absolute; left: 0; top: 0.45em; width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--c); }
.t-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-none { margin: 0; color: var(--ink-3); font-size: 1.05rem; }
.notes p { margin: 0; font-size: 1.05rem; color: var(--ink-2); line-height: 1.45; }

/* next shift — the one bold element: it glows in the colour of the coming shift */
.next-card {
  --c: #60a5fa;
  position: relative; isolation: isolate; overflow: hidden; flex: none;
  padding: 1.35rem 1.5rem 1.4rem; border-radius: var(--r-panel);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
}
.next-card::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 120%; height: 150%; background: radial-gradient(closest-side, var(--c), transparent); opacity: 0.32; z-index: -1; }
.next-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--c); opacity: 0.45; pointer-events: none; }
.next-card.is-night::before { opacity: 0.5; animation: nightGlow 6s ease-in-out infinite alternate; }
.next-card.is-on::after { opacity: 0.9; }
.next-card.is-empty::before { opacity: 0.16; }
@keyframes nightGlow { from { transform: translate(0, 0) scale(1); } to { transform: translate(-6%, 4%) scale(1.08); } }
.next-label { font-size: 1.05rem; font-weight: 600; color: var(--ink-2); }
.next-card.is-on .next-label { color: var(--c); }
.next-type { display: flex; align-items: center; gap: 0.7rem; font-family: var(--display); font-size: 3rem; font-weight: 750; letter-spacing: -0.02em; line-height: 1.05; margin: 0.4rem 0 0.6rem; }
.next-type.muted { font-size: 2rem; color: var(--ink-2); }
.next-type .ic-moon { width: 0.8em; height: 0.8em; }
.next-when, .next-times { display: flex; align-items: center; gap: 0.75rem; font-size: 1.3rem; }
.next-times { color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: 0.35rem; }
.next-card .ic { width: 1.45rem; height: 1.45rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--ink-2); }
.next-help { margin: 0.4rem 0 0; color: var(--ink-2); font-size: 1.1rem; line-height: 1.4; }

.summary-card { flex: none; padding-bottom: 1.1rem; }
.countdown { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.cd-label { font-size: 1.05rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.cd-values { display: flex; align-items: baseline; gap: 0.9rem; }
.cd { display: inline-flex; align-items: baseline; gap: 0.3rem; }
.cd b { font-family: var(--display); font-size: 2.6rem; font-weight: 650; line-height: 1; font-variant-numeric: tabular-nums; }
.cd small { font-size: 0.95rem; color: var(--ink-2); text-transform: uppercase; }
.shift-bar { position: relative; height: 0.85rem; margin-top: 0.9rem; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0 1.1rem, transparent 1.1rem 1.4rem); transform: skewX(-25deg); }
.shift-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(90deg, var(--c) 0 1.1rem, transparent 1.1rem 1.4rem); filter: drop-shadow(0 0 0.35rem var(--c)); }
.next-foot { margin-top: 0.7rem; font-size: 1.05rem; color: var(--good); }

/* next seven days */
.up-panel { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
.up-list { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 0.4rem; flex: 1; min-height: 0; }
.up-row { position: relative; isolation: isolate; display: grid; grid-template-columns: 3.4rem minmax(0, 1fr) auto; align-items: center; gap: 0.8rem; padding: 0.35rem 0.8rem 0.35rem 0.9rem; border-radius: 0.9rem; min-height: 0; overflow: hidden; }
.up-row::before { content: ""; position: absolute; inset: 0; background: var(--c, transparent); opacity: 0.1; z-index: -1; }
.up-row::after { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 0.25rem; border-radius: 0 0.2rem 0.2rem 0; background: var(--c, transparent); }
.up-row.is-off::before, .up-row.is-off::after { display: none; }
.up-row.is-night::before { opacity: 0.26; }
.up-row.is-night { box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.45); }
.up-date { display: flex; flex-direction: column; line-height: 1.1; }
.up-date span { font-size: 0.9rem; color: var(--ink-3); }
.up-date b { font-size: 1.45rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.up-main { min-width: 0; display: grid; gap: 0.1rem; }
.up-line { display: flex; flex-direction: column; min-width: 0; }
.up-title { display: flex; align-items: center; gap: 0.4rem; font-size: 1.18rem; font-weight: 650; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.up-time { font-size: 0.98rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.up-row.is-off .up-title { color: var(--ink-3); font-weight: 500; }
.up-row.is-rest .up-title { color: var(--c); }
.up-count { font-size: 0.98rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.up-count.live { color: var(--c); font-weight: 700; }
.up-empty { color: var(--ink-3); font-size: 1.05rem; }

/* day detail */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(2, 6, 14, 0.72); }
.modal-card { width: min(46rem, 92vw); max-height: 84vh; overflow: auto; padding: 2rem 2.2rem; border-radius: var(--r-panel); background: var(--bg-2); border: 1px solid var(--line); box-shadow: 0 2rem 5rem rgba(0, 0, 0, 0.5); }
.modal-card h2 { font-family: var(--display); font-size: 2.1rem; margin-bottom: 1.2rem; }
.day-list { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; gap: 0.7rem; }
.day-list li { display: grid; grid-template-columns: 9rem 1fr; gap: 0.2rem 1.2rem; padding: 0.8rem 1rem; border-radius: 0.9rem; background: var(--surface); box-shadow: inset 0.3rem 0 0 var(--c); }
.day-list li.is-night { background: rgba(167, 139, 250, 0.14); }
.d-time { grid-row: span 2; color: var(--ink-2); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.d-title { display: flex; gap: 0.5rem; align-items: center; font-size: 1.3rem; font-weight: 650; }
.d-cal { color: var(--ink-3); font-size: 1rem; }
.d-empty { color: var(--ink-3); font-size: 1.15rem; }

/* full-screen photo frame */
.view-frame { background: #000; z-index: 20; }
.frame-stage { position: absolute; inset: 0; }
.frame-clock { position: absolute; right: 2.6rem; bottom: 2rem; font-family: var(--display); font-size: 3.6rem; font-weight: 650; color: rgba(255, 255, 255, 0.88); text-shadow: 0 0.2rem 1.5rem rgba(0, 0, 0, 0.65); font-variant-numeric: tabular-nums; }
.frame-exit { position: absolute; left: 2rem; bottom: 2rem; opacity: 0; padding: 0.7rem 1.3rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 1.05rem; }
body.using-remote .frame-exit:focus { opacity: 1; }
.view-frame.frame-night-clock .frame-stage { visibility: hidden; }
.view-frame.frame-night-clock .frame-clock { inset: 0; display: grid; place-items: center; font-size: 9rem; color: rgba(220, 228, 245, 0.55); text-shadow: none; }

/* login */
.view-login { display: grid; place-items: center; padding: 2rem; overflow: auto; }
.login-card { width: min(34rem, 100%); padding: 2.6rem; border-radius: var(--r-panel); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 1.1rem; }
.login-card h1 { font-family: var(--display); font-size: 2.6rem; font-weight: 750; }
.login-card p { margin: 0; color: var(--ink-2); font-size: 1.15rem; line-height: 1.45; }
.login-card form { display: flex; gap: 0.8rem; }
.login-card .inp { flex: 1; }
.login-card .ghost { justify-self: start; }

/* ------------------------------------------------------------------ family map */
.tmap { position: relative; overflow: hidden; background: #0a141d; }
.tmap-tiles { position: absolute; inset: 0; filter: invert(1) hue-rotate(180deg) brightness(0.82) contrast(0.92) saturate(0.45); }
.tmap-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; user-select: none; }
.tmap-tile.missing { visibility: hidden; }
.tmap-overlay { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.tmap-acc { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: var(--c); opacity: 0.14; }
.tmap-marker { position: absolute; width: 2.6rem; height: 2.6rem; transform: translate(-50%, -50%); }
.tmap-dot { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--c); color: #04121a; font-weight: 750; font-size: 1rem; box-shadow: 0 0 0 0.2rem rgba(2, 7, 11, 0.85), 0 0 1.3rem var(--c); }
.tmap-label { position: absolute; left: calc(100% + 0.5rem); top: 50%; transform: translateY(-50%); white-space: nowrap; font-size: 0.95rem; font-weight: 600; color: var(--ink); background: rgba(2, 7, 11, 0.78); padding: 0.15rem 0.55rem; border-radius: 0.3rem; }
.tmap-marker.stale .tmap-dot { background: rgba(2, 7, 11, 0.7); color: var(--c); border: 2px dashed var(--c); box-shadow: none; }
.tmap-marker.stale .tmap-label { color: var(--ink-2); }
.tmap-marker.place { width: auto; height: auto; z-index: -1; }
.tmap-place { display: block; white-space: nowrap; font-size: 0.8rem; font-weight: 600; color: #cbd5e1; background: rgba(2, 7, 11, 0.6); border: 1px solid rgba(148, 163, 184, 0.45); padding: 0.1rem 0.45rem; border-radius: 0.25rem; }
.tmap-attr { position: absolute; right: 0.4rem; bottom: 0.3rem; z-index: 3; font-size: 0.7rem; color: rgba(255, 255, 255, 0.65); background: rgba(0, 0, 0, 0.45); padding: 0.05rem 0.4rem; border-radius: 0.2rem; }

/* dashboard map panel (slot chosen by the board layout) */
.fam-panel { display: block; position: relative; border-radius: var(--r-panel); overflow: hidden; border: 1px solid var(--line); }
.fam-map { position: absolute; inset: 0; }
.fam-tag { display: none; position: absolute; left: 0.8rem; top: 0.7rem; z-index: 4; font-size: 0.95rem; font-weight: 650; color: var(--ink); background: rgba(2, 7, 11, 0.6); padding: 0.15rem 0.6rem; border-radius: 0.3rem; }
.fam-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.fam-people.compact { position: absolute; left: 0.7rem; bottom: 0.7rem; z-index: 4; max-width: calc(100% - 1.4rem); gap: 0.3rem; }
.fam-item { display: flex; align-items: center; gap: 0.7rem; text-align: left; width: 100%; }
.fam-people.compact .fam-item { background: rgba(2, 7, 11, 0.72); padding: 0.3rem 0.7rem 0.3rem 0.35rem; border-radius: 999px; width: auto; }
.fam-people.compact small, .fam-people.compact .fam-text b { display: none; }
.fam-dot { display: grid; place-items: center; flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--c); color: #04121a; font-style: normal; font-weight: 750; font-size: 0.85rem; }
.fam-people.compact .fam-dot { width: 1.7rem; height: 1.7rem; font-size: 0.7rem; }
.fam-text { display: flex; flex-direction: column; min-width: 0; }
.fam-text b { font-size: 1.15rem; }
.fam-status { font-size: 1rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fam-status.stale { color: var(--ink-3); }
.fam-text small { font-size: 0.85rem; color: var(--ink-3); }
.fam-empty { color: var(--ink-3); font-size: 1rem; }

/* full-screen map */
.view-map { z-index: 25; background: #000; }
.map-full { position: absolute; inset: 0; }
.map-side { position: absolute; right: 1.5rem; top: 1.5rem; bottom: 1.5rem; width: 27rem; z-index: 5; display: flex; flex-direction: column; gap: 1rem; padding: 1.4rem; overflow: auto; border-radius: var(--r-panel); background: rgba(4, 12, 20, 0.86); border: 1px solid var(--line); }
.map-side h2 { font-family: var(--display); font-size: 2rem; }
.map-side .fam-item { padding: 0.6rem 0.8rem; border-radius: 0.8rem; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.map-side .fam-item:disabled { opacity: 0.6; cursor: default; }
.map-note { margin: auto 0 0; font-size: 0.95rem; color: var(--ink-3); }
.setup-box { border-color: rgba(56, 214, 245, 0.45); }
.steps { margin: 0 0 0.9rem; padding-left: 1.3rem; font-size: 1.05rem; line-height: 1.5; color: var(--ink-2); }


/* start-up splash and sign-in logo */
.splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: #02080d; transition: opacity 0.8s ease; }
.splash img { width: min(78vw, 140vh); height: auto; animation: splashIn 1.2s ease-out both;
  -webkit-mask-image: radial-gradient(ellipse 60% 62% at 50% 50%, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 60% 62% at 50% 50%, #000 60%, transparent 100%); }
.splash.out { opacity: 0; pointer-events: none; }
@keyframes splashIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.login-logo { width: 100%; height: auto; margin: -0.6rem 0 0.2rem;
  -webkit-mask-image: radial-gradient(ellipse 62% 66% at 50% 50%, #000 60%, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 66% at 50% 50%, #000 60%, transparent 100%); }

/* ------------------------------------------------------------------ settings */
.view-settings { z-index: 30; background: var(--bg); }
.set-root { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 1.6rem 2.2rem 0; }
.set-head { display: flex; align-items: center; gap: 1.5rem; padding-bottom: 1.3rem; border-bottom: 1px solid var(--line); }
.set-head h1 { font-family: var(--display); font-size: 2.4rem; font-weight: 750; }
.save-state { margin-left: auto; color: var(--ink-3); font-size: 1rem; }
.set-body { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 2.2rem; min-height: 0; }
.set-tabs { display: flex; flex-direction: column; gap: 0.45rem; padding: 1.4rem 0; overflow: auto; }
.tab { text-align: left; padding: 0.85rem 1.2rem; font-size: 1.15rem; border-radius: 0.9rem; background: transparent; border-color: transparent; }
.tab.on { background: var(--surface-2); border-color: var(--line); font-weight: 650; }
.set-panel { overflow: auto; padding: 1.4rem 0.6rem 3rem; max-width: 64rem; }
.set-panel h2 { font-family: var(--display); font-size: 2rem; margin-bottom: 1rem; }
.set-panel h3 { font-size: 1.3rem; margin: 1.6rem 0 0.7rem; }
.lead { color: var(--ink-2); font-size: 1.12rem; line-height: 1.5; max-width: 50rem; margin: 0 0 1.2rem; }
.hint { color: var(--ink-3); font-size: 1rem; line-height: 1.45; margin: 0.55rem 0 0; max-width: 50rem; }
.status { color: var(--ink-2); font-size: 1.05rem; margin: 0.6rem 0 0; min-height: 1.4em; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: 1.1rem; padding: 1.1rem 1.3rem; margin-bottom: 1rem; }
.box p { margin: 0 0 0.6rem; font-size: 1.1rem; line-height: 1.45; }
.box.warn { border-color: rgba(251, 191, 36, 0.35); }
.danger-zone { border-color: rgba(248, 113, 113, 0.3); margin-top: 2rem; }
.row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.row label { display: flex; align-items: center; gap: 0.6rem; font-size: 1.1rem; color: var(--ink-2); }
.field { margin: 1.3rem 0; }
.field-label { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.55rem; display: block; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 0.4rem; }
.seg-btn { padding: 0.65rem 1.15rem; font-size: 1.05rem; }
.seg-btn.on { background: #dbe8ff; color: #0a1a33; border-color: transparent; font-weight: 650; }
.switch { display: inline-flex; align-items: center; gap: 0.7rem; padding: 0.45rem 1rem 0.45rem 0.45rem; font-size: 1.05rem; }
.switch i { width: 2.6rem; height: 1.5rem; border-radius: 999px; background: rgba(255, 255, 255, 0.15); position: relative; transition: background 0.2s; }
.switch i::after { content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.switch.on i { background: #60a5fa; }
.switch.on i::after { transform: translateX(1.1rem); }
.swatches { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.7rem 0; }
.sw { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--c); border: 2px solid transparent; cursor: pointer; outline: none; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2); }
.dot { width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--c); flex: none; }
.shift-type .inp { flex: 1; }
.cal-list { display: grid; gap: 0.2rem; }
.cal-row.off { opacity: 0.7; }
.cal-row .row + .row { margin-top: 0.7rem; }
.title-preview { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.title-preview li { display: flex; gap: 0.8rem; align-items: center; font-size: 1.05rem; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: 1rem; }
.ph { position: relative; margin: 0; border-radius: 1rem; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.ph img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ph.off img { opacity: 0.35; filter: grayscale(0.7); }
.ph-star { position: absolute; top: 0.5rem; right: 0.6rem; font-size: 1.6rem; color: #fde68a; text-shadow: 0 0.1rem 0.6rem rgba(0, 0, 0, 0.7); }
.ph figcaption { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.55rem; }
.mini { padding: 0.35rem 0.75rem; font-size: 0.95rem; border-radius: 0.6rem; }
.mini.on { color: #fde68a; border-color: rgba(253, 230, 138, 0.5); }
.mini.danger { color: #fecaca; }
.mini:disabled { opacity: 0.35; cursor: default; }
.notes-inp { width: 100%; resize: vertical; line-height: 1.5; }
code { font-size: 0.95em; background: rgba(0, 0, 0, 0.3); padding: 0.1rem 0.35rem; border-radius: 0.3rem; }

/* ================================================================== TACTICAL THEME — "Operation King" ops console
   Chamfered panels with lit cyan edges, slanted tabs, orange for "now". Pure CSS, no artwork needed. */
html[data-theme="tactical"] {
  --bg: #020a10; --bg-2: #04131c;
  --surface: rgba(8, 34, 46, 0.62); --surface-2: rgba(20, 74, 96, 0.5);
  --line: rgba(56, 214, 245, 0.3); --edge: rgba(90, 228, 255, 0.95);
  --ink: #e6f8ff; --ink-2: #9cc2d1; --ink-3: #5d8494;
  --acc: #38d6f5; --acc-dim: rgba(56, 214, 245, 0.55); --alert: #ff9b2f;
  --today: #ff9b2f; --focus: #f2fbff;
  --display: "Saira", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  --mono: "Saira", "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  --r-panel: 0; --r-cell: 0; --cut: 1.15rem;
}
[data-theme="tactical"] body {
  background:
    linear-gradient(rgba(2, 8, 13, 0.6), rgba(2, 8, 13, 0.8)),
    linear-gradient(rgba(56, 214, 245, 0.035) 1px, transparent 1px) 0 0 / 3.2rem 3.2rem,
    linear-gradient(90deg, rgba(56, 214, 245, 0.035) 1px, transparent 1px) 0 0 / 3.2rem 3.2rem,
    url("/img/tactical-bg.jpg") center / cover no-repeat,
    radial-gradient(70rem 40rem at 10% -10%, rgba(18, 110, 150, 0.35), transparent 70%),
    radial-gradient(50rem 34rem at 105% 110%, rgba(255, 140, 40, 0.1), transparent 70%),
    var(--bg);
}
[data-theme="tactical"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 899; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.2) 0 1px, transparent 1px 3px); opacity: 0.35;
}

/* ---- chamfered panels: cut top-left and bottom-right corners, lit edges ---- */
[data-theme="tactical"] :is(.panel, .next-card, .modal-card, .login-card, .box, .map-side, .fam-panel, .photo-tile) {
  border: 0; border-radius: 0;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}
[data-theme="tactical"] :is(.panel, .modal-card, .login-card, .box, .map-side),
[data-theme="tactical"] .hud-frame {
  box-shadow: inset 0 0 0 1px var(--line), inset 0 0 2.2rem rgba(56, 214, 245, 0.08);
  background:
    linear-gradient(135deg, transparent calc(50% - 1px), var(--edge) 50%, transparent calc(50% + 1px)) left top / var(--cut) var(--cut) no-repeat,
    linear-gradient(135deg, transparent calc(50% - 1px), var(--edge) 50%, transparent calc(50% + 1px)) right bottom / var(--cut) var(--cut) no-repeat,
    linear-gradient(90deg, var(--edge), transparent) var(--cut) 0 / 38% 1px no-repeat,
    linear-gradient(270deg, var(--edge), transparent) right var(--cut) bottom 0 / 38% 1px no-repeat,
    linear-gradient(180deg, var(--edge), transparent) 0 var(--cut) / 1px 30% no-repeat,
    linear-gradient(0deg, var(--edge), transparent) right 0 bottom var(--cut) / 1px 30% no-repeat,
    linear-gradient(180deg, rgba(8, 38, 52, 0.84), rgba(3, 15, 22, 0.92));
}
/* the map and photo tiles are covered by their content, so their frame is an overlay */
[data-theme="tactical"] .hud-frame { display: block; position: absolute; inset: 0; z-index: 5; pointer-events: none; background-color: transparent;
  background-image:
    linear-gradient(135deg, transparent calc(50% - 1px), var(--edge) 50%, transparent calc(50% + 1px)),
    linear-gradient(135deg, transparent calc(50% - 1px), var(--edge) 50%, transparent calc(50% + 1px)),
    linear-gradient(90deg, var(--edge), transparent), linear-gradient(270deg, var(--edge), transparent),
    linear-gradient(180deg, var(--edge), transparent), linear-gradient(0deg, var(--edge), transparent); }
[data-theme="tactical"] :is(.fam-panel, .photo-tile) { box-shadow: none; background: #030c12; }

/* ---- header ---- */
[data-theme="tactical"] .hdr { padding-bottom: 0.2rem; }
[data-theme="tactical"] .clock { font-family: var(--display); font-weight: 700; font-size: 6rem; letter-spacing: 0.01em; text-shadow: 0 0 1.6rem rgba(56, 214, 245, 0.35); }
[data-theme="tactical"] .clock-sec { color: var(--acc); }
[data-theme="tactical"] .hdr-date { border-left: 2px solid var(--acc-dim); }
[data-theme="tactical"] .date-day { text-transform: uppercase; letter-spacing: 0.12em; color: var(--acc); font-size: 1.7rem; font-weight: 600; }
[data-theme="tactical"] .date { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink); font-size: 1.25rem; }
[data-theme="tactical"] .tz { display: inline-block; font-size: 0.8rem; letter-spacing: 0.14em; color: #021018; background: var(--acc); padding: 0.05rem 0.4rem; font-weight: 700; }
[data-theme="tactical"] .tab-hud { border: 0; background: transparent; border-radius: 0; padding: 0.85rem 1.9rem; font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; font-size: 1.15rem; }
[data-theme="tactical"] .tab-hud::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: skewX(-24deg); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(10, 40, 54, 0.75), rgba(3, 14, 20, 0.85)); }
[data-theme="tactical"] .tab-hud svg { color: var(--acc); }
[data-theme="tactical"] .tab-hud.on::before { border-color: var(--acc); background: linear-gradient(180deg, rgba(56, 214, 245, 0.34), rgba(56, 214, 245, 0.08)); box-shadow: 0 0 1.3rem rgba(56, 214, 245, 0.5), inset 0 0 1rem rgba(56, 214, 245, 0.25); }
[data-theme="tactical"] .tab-hud.active::before { border-color: #a78bfa; }
[data-theme="tactical"] body.using-remote .tab-hud:focus { box-shadow: none; }
[data-theme="tactical"] body.using-remote .tab-hud:focus::before { border-color: var(--focus); box-shadow: 0 0 0 2px var(--focus), 0 0 1.6rem rgba(255, 255, 255, 0.4); }
[data-theme="tactical"] .pill { border-radius: 0; font-family: var(--display); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.12em; background: transparent; border-color: var(--line); }
[data-theme="tactical"] .pill i { border-radius: 0; }
[data-theme="tactical"] .pill-ok i { animation: hudBlink 2.4s steps(1) infinite; }
[data-theme="tactical"] :is(.pill-err, .pill-warn) { color: var(--alert); border-color: rgba(255, 155, 47, 0.5); }
@keyframes hudBlink { 0%, 70% { opacity: 1; } 71%, 100% { opacity: 0.25; } }
[data-theme="tactical"] .weather svg { color: var(--acc); }

/* ---- panel headings ---- */
[data-theme="tactical"] .panel h3 {
  font-family: var(--display); font-size: 1.3rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--acc);
  margin: -0.2rem -1.35rem 0.85rem; padding: 0 1.35rem 0.7rem; border-bottom: 1px solid var(--line);
}
[data-theme="tactical"] :is(.cal-head h2, .next-type, .modal-card h2, .set-head h1, .set-panel h2) { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }

/* ---- calendar: ruled grid, solid shift blocks, orange today ---- */
[data-theme="tactical"] .cal-head { margin-bottom: 0.6rem; }
[data-theme="tactical"] .cal-head h2 { font-size: 2.3rem; }
[data-theme="tactical"] .cal-head h2 span { color: var(--acc); font-weight: 700; }
[data-theme="tactical"] :is(.btn, .icon-btn, .seg-btn, .switch, .mini, .tab, .chip, .inp) { border-radius: 0; }
[data-theme="tactical"] .cal-nav :is(.btn, .icon-btn) { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; border-color: var(--line); background: rgba(3, 15, 22, 0.6); }
[data-theme="tactical"] .cal-dow { gap: 0; padding: 0 0 0.4rem; border-bottom: 1px solid var(--line); }
[data-theme="tactical"] .cal-dow span { padding: 0; text-align: center; font-size: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; color: var(--acc); }
[data-theme="tactical"] .cal-grid { gap: 0; }
[data-theme="tactical"] .day { background: transparent; border: 0; border-right: 1px solid rgba(56, 214, 245, 0.14); border-bottom: 1px solid rgba(56, 214, 245, 0.14); padding: 0.35rem 0.4rem; gap: 0.3rem; }
[data-theme="tactical"] .day:nth-child(7n) { border-right: 0; }
[data-theme="tactical"] .day-num { font-family: var(--display); font-size: 1.35rem; font-weight: 600; }
[data-theme="tactical"] .day.today { background: rgba(255, 155, 47, 0.08); border: 0; box-shadow: inset 0 0 0 2px var(--alert), 0 0 1.4rem rgba(255, 155, 47, 0.45); z-index: 1; }
[data-theme="tactical"] .day.today .day-num { background: none; color: var(--acc); padding: 0 0.2rem; font-weight: 700; }
[data-theme="tactical"] .ev { justify-content: center; border-radius: 0; padding: 0.22rem 0.25rem; font-size: 0.92rem; gap: 0.2rem; }
[data-theme="tactical"] .ev::before { opacity: 0.32; }
[data-theme="tactical"] .ev-shift { box-shadow: none; }
[data-theme="tactical"] .ev-night::before { opacity: 0.55; }
[data-theme="tactical"] .ev-time { margin-left: 0.2rem; font-size: 0.85rem; color: var(--ink); font-weight: 500; }
[data-theme="tactical"] .ev-appt { justify-content: flex-start; }
[data-theme="tactical"] .cal-legend { display: none; }
[data-theme="tactical"] body.using-remote .day:focus { box-shadow: inset 0 0 0 2px var(--focus), 0 0 1.4rem rgba(255, 255, 255, 0.35); transform: none; }

/* ---- next shift: tinted card with a slanted status tab ---- */
[data-theme="tactical"] .next-card { --edge: var(--c); border: 0; padding: 0 1.5rem 1.3rem; background: linear-gradient(180deg, rgba(10, 30, 40, 0.9), rgba(3, 12, 18, 0.95)); box-shadow: inset 0 0 0 1.5px var(--c), inset 0 0 2.4rem rgba(0, 0, 0, 0.3); }
[data-theme="tactical"] .next-card::before { inset: 0; width: auto; height: auto; background: linear-gradient(160deg, var(--c), transparent 75%); opacity: 0.28; animation: none; }
[data-theme="tactical"] .next-card.is-empty::before { opacity: 0.12; }
[data-theme="tactical"] .next-card::after { display: none; }
[data-theme="tactical"] .next-card .next-label, [data-theme="tactical"] .next-card.is-on .next-label { display: inline-block; margin: 0 0 0.2rem -1.5rem; padding: 0.3rem 2.2rem 0.3rem 1.6rem; background: var(--c); color: #160b02; font-family: var(--display); font-size: 1.15rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; clip-path: polygon(0 0, 100% 0, calc(100% - 1.1rem) 100%, 0 100%); }
[data-theme="tactical"] .next-card.is-empty .next-label { background: var(--acc); }
[data-theme="tactical"] .next-type { font-size: 3.3rem; }
[data-theme="tactical"] .next-card .ic { color: var(--ink); }

/* ---- shift summary ---- */
[data-theme="tactical"] .cd-label { font-family: var(--display); color: var(--ink); }
[data-theme="tactical"] .cd b { font-size: 2.8rem; font-weight: 700; text-shadow: 0 0 1rem rgba(56, 214, 245, 0.35); }
[data-theme="tactical"] .cd small { font-family: var(--display); }
[data-theme="tactical"] .shift-bar { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.1) 0 1.1rem, transparent 1.1rem 1.4rem); }

/* ---- next seven days ---- */
[data-theme="tactical"] .up-list { gap: 0.35rem; }
[data-theme="tactical"] .up-row { grid-template-columns: 2.6rem minmax(0, 1fr) auto; border-radius: 0; background: rgba(3, 16, 24, 0.55); }
[data-theme="tactical"] .up-row::before { opacity: 0.08; }
[data-theme="tactical"] .up-row::after { top: 0; bottom: 0; left: 0; width: 0.28rem; border-radius: 0; box-shadow: 0 0 0.8rem var(--c); }
[data-theme="tactical"] .up-row.is-night { box-shadow: none; }
[data-theme="tactical"] .up-row.is-night::before { opacity: 0.2; }
[data-theme="tactical"] .up-date span { display: none; }
[data-theme="tactical"] .up-date b { font-family: var(--display); font-size: 1.5rem; font-weight: 600; }
[data-theme="tactical"] .up-line { flex-direction: row; align-items: baseline; gap: 1rem; }
[data-theme="tactical"] .up-title { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.04em; font-size: 1.22rem; min-width: 6.5rem; }
[data-theme="tactical"] .up-row.is-rest .up-title { color: var(--ink); }
[data-theme="tactical"] .up-time { font-size: 1rem; color: var(--ink-2); }
[data-theme="tactical"] .up-count { font-family: var(--display); color: var(--ink); }
[data-theme="tactical"] .up-count.live { color: var(--alert); border: 1.5px solid var(--alert); padding: 0.05rem 0.55rem; text-transform: uppercase; letter-spacing: 0.06em; box-shadow: 0 0 0.8rem rgba(255, 155, 47, 0.4); }

/* ---- today / tomorrow ---- */
[data-theme="tactical"] .t-list li { font-size: 1.2rem; }
[data-theme="tactical"] .t-time { font-family: var(--display); color: var(--ink); }

/* ---- map: cyan ops map with reticle, ruler and pulsing markers ---- */
[data-theme="tactical"] .tmap::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: rgba(20, 160, 205, 0.45); mix-blend-mode: color; }
[data-theme="tactical"] .tmap-tiles { filter: invert(1) hue-rotate(180deg) brightness(0.7) contrast(1.15) saturate(0.3); }
[data-theme="tactical"] .map-hud { display: block; position: absolute; inset: 0; z-index: 3; pointer-events: none; }
[data-theme="tactical"] .hud-bars { position: absolute; left: 1.2rem; top: 1.1rem; width: 4.6rem; height: 1.6rem;
  background: linear-gradient(var(--acc-dim), var(--acc-dim)) 0 0 / 0.9rem 0.35rem no-repeat, linear-gradient(var(--acc-dim), var(--acc-dim)) 1.2rem 0 / 0.9rem 0.35rem no-repeat,
    linear-gradient(var(--acc-dim), var(--acc-dim)) 2.4rem 0 / 0.9rem 0.35rem no-repeat, linear-gradient(var(--acc-dim), var(--acc-dim)) 3.6rem 0 / 0.9rem 0.35rem no-repeat,
    linear-gradient(var(--acc), var(--acc)) 0 0.65rem / 4.5rem 0.25rem no-repeat, linear-gradient(var(--acc-dim), var(--acc-dim)) 0 1.2rem / 2.8rem 0.25rem no-repeat; }
[data-theme="tactical"] .hud-ruler { position: absolute; left: 1rem; top: 22%; bottom: 22%; width: 0.6rem; border-left: 1px solid var(--acc-dim);
  background: repeating-linear-gradient(180deg, var(--acc-dim) 0 1px, transparent 1px 0.9rem) left / 0.5rem 100% no-repeat; }
[data-theme="tactical"] .hud-reticle { position: absolute; left: 50%; top: 50%; width: 5.5rem; height: 5.5rem; transform: translate(-50%, -50%);
  --rc: rgba(90, 228, 255, 0.9);
  background:
    linear-gradient(var(--rc), var(--rc)) left top / 1.3rem 2px no-repeat, linear-gradient(var(--rc), var(--rc)) left top / 2px 1.3rem no-repeat,
    linear-gradient(var(--rc), var(--rc)) right top / 1.3rem 2px no-repeat, linear-gradient(var(--rc), var(--rc)) right top / 2px 1.3rem no-repeat,
    linear-gradient(var(--rc), var(--rc)) left bottom / 1.3rem 2px no-repeat, linear-gradient(var(--rc), var(--rc)) left bottom / 2px 1.3rem no-repeat,
    linear-gradient(var(--rc), var(--rc)) right bottom / 1.3rem 2px no-repeat, linear-gradient(var(--rc), var(--rc)) right bottom / 2px 1.3rem no-repeat;
  opacity: 0.75; }
[data-theme="tactical"] .hud-reticle::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.4rem; height: 1.4rem; transform: translate(-50%, -50%); border: 1px solid var(--rc); }
[data-theme="tactical"] .tmap-dot { position: relative; border-radius: 50%; box-shadow: 0 0 0 0.2rem rgba(2, 7, 11, 0.85), 0 0 1.4rem var(--c); }
[data-theme="tactical"] .tmap-marker:not(.stale) .tmap-dot::before,
[data-theme="tactical"] .tmap-marker:not(.stale) .tmap-dot::after { content: ""; position: absolute; inset: -0.75rem; border-radius: 50%; border: 1.5px solid var(--c); opacity: 0.55; }
[data-theme="tactical"] .tmap-marker:not(.stale) .tmap-dot::after { inset: -0.75rem; animation: ping 2.6s ease-out infinite; }
@keyframes ping { from { transform: scale(1); opacity: 0.7; } to { transform: scale(2.1); opacity: 0; } }
[data-theme="tactical"] .tmap-label, [data-theme="tactical"] .tmap-place { font-family: var(--display); text-transform: uppercase; letter-spacing: 0.06em; border-radius: 0; }
[data-theme="tactical"] .fam-people.compact .fam-item { border-radius: 0; background: rgba(2, 10, 15, 0.82); box-shadow: inset 0.2rem 0 0 var(--acc); }
[data-theme="tactical"] .fam-people.compact { left: 1rem; bottom: 1rem; }

/* ---- photos ---- */
[data-theme="tactical"] .ph-nav { border-radius: 0; background: transparent; color: var(--ink); filter: drop-shadow(0 0 0.4rem rgba(0, 0, 0, 0.9)); }
[data-theme="tactical"] .ph-dots i.on { background: var(--acc); }

/* ---- settings and other screens ---- */
[data-theme="tactical"] :is(.btn.primary, .seg-btn.on) { background: var(--acc); color: #021018; }
[data-theme="tactical"] .switch.on i { background: var(--acc); }
[data-theme="tactical"] .switch i, [data-theme="tactical"] .switch i::after { border-radius: 0; }
[data-theme="tactical"] .tab.on { box-shadow: inset 3px 0 0 var(--acc); }
[data-theme="tactical"] .frame-clock { font-family: var(--display); }
[data-theme="tactical"] body.using-remote :focus { box-shadow: 0 0 0 0.18rem var(--focus), 0 0 1.6rem rgba(255, 255, 255, 0.3); }

/* the tactical extras switch off at night */
html.night[data-theme="tactical"] body::before { display: none; }
html.night[data-theme="tactical"] .hud-frame { opacity: 0.4; }
html.night[data-theme="tactical"] .map-hud { opacity: 0.35; }

/* ------------------------------------------------------------------ dimming & night mode */
.dim-overlay { position: fixed; inset: 0; z-index: 900; pointer-events: none; background: #000; opacity: var(--base-dim, 0); transition: opacity 2.5s ease; }
html.night .dim-overlay { opacity: max(var(--night-dim, 0.55), var(--base-dim, 0)); }
html.night .view-settings:not([hidden]) ~ .dim-overlay { opacity: 0.2; }
html.night { --ink-2: #94a3bc; }
html.night .weather, html.night .notes { display: none !important; }
html.night .cal-legend { visibility: hidden; }
html.night .photo-tile::after { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.42); pointer-events: none; }
html.night[data-night-photos="hide"] .photo-tile .slides,
html.night[data-night-photos="hide"] .photo-empty { visibility: hidden; }
html.night[data-night-photos="hide"] .photo-night-msg { display: grid; }
html.night .day.today { box-shadow: none; }
html.night *:not(.slide):not(.dim-overlay) { animation: none !important; transition: none !important; }

@media (prefers-reduced-motion: reduce) {
  *:not(.dim-overlay) { animation: none !important; transition-duration: 0.01s !important; }
}

/* ------------------------------------------------------------------ phones & portrait tablets */
@media (orientation: portrait), (max-height: 520px) {
  html { font-size: 15px; }
  body { overflow: auto; }
  .view { position: static; min-height: 100%; }
  .view-frame, .view-settings, .view-map { position: fixed; }
  .view-dashboard { display: block; padding: 1rem; }
  .hdr { flex-direction: column; align-items: stretch; gap: 0.8rem; margin-bottom: 1rem; }
  .hdr-time { flex-wrap: wrap; gap: 0.8rem 1rem; }
  .emblem { height: 4.2rem; }
  .clock, [data-theme="tactical"] .clock { font-size: 3.4rem; }
  .date-day { font-size: 1.3rem; }
  .hdr-right { align-items: stretch; }
  .hdr-tabs { overflow-x: auto; padding: 0.2rem 0.6rem; gap: 0.4rem; }
  .tab-hud, [data-theme="tactical"] .tab-hud { padding: 0.6rem 1rem; font-size: 0.95rem; flex: none; }
  .hdr-status { justify-content: flex-start; flex-wrap: wrap; }
  .board, .board[data-layout], .board[data-show-today] {
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto;
    grid-template-areas: "side" "cal" "days" "big" "small";
  }
  .day-panels { grid-template-columns: minmax(0, 1fr); }
  .col-side { display: grid; gap: 1rem; }
  .up-list { grid-auto-rows: auto; }
  .up-row { padding: 0.6rem 0.8rem; }
  .cal-grid { grid-template-rows: repeat(6, minmax(4.4rem, auto)); }
  .ev { font-size: 0.72rem; padding: 0.1rem 0.2rem; }
  .ev-time { display: none; }
  .cal-head h2, [data-theme="tactical"] .cal-head h2 { font-size: 1.5rem; }
  .board .photo-tile, .board .fam-panel { height: 22rem; }
  .set-root { padding: 1rem 1rem 0; }
  .set-head h1 { font-size: 1.7rem; }
  .set-head { flex-wrap: wrap; gap: 0.6rem; }
  .set-body { grid-template-columns: minmax(0, 1fr); gap: 0; grid-template-rows: auto minmax(0, 1fr); }
  .set-tabs { flex-direction: row; overflow-x: auto; padding: 0.8rem 0; }
  .tab { white-space: nowrap; padding: 0.6rem 0.9rem; font-size: 1rem; }
  .set-panel { padding-top: 0.6rem; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
  .login-card form { flex-direction: column; }
  .frame-clock { font-size: 2.4rem; }
  .map-side { left: 0.8rem; right: 0.8rem; top: auto; bottom: 0.8rem; width: auto; max-height: 50%; }
}
