/* PEAK Ski – base styles. Timer styles live in timers.css. */

:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-glow: #1a2a5c;
  --surface: #151c34;
  --surface-2: #1c2545;
  --surface-3: #252f55;
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef3ff;
  --muted: #9aa7c7;
  --faint: #6b7799;
  --accent: #5ad1ff;
  --accent-ink: #04202c;
  --amber: #ffb547;
  --sun: #ffd166;
  --danger: #ff6b7f;
  --ok: #4ade80;
  --snow: #ffffff;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --sea: #3cc9c3; /* PEAK Sun's waves (sol.css has the full palette) */

  /* Wake heatmap: blue ramp, later = brighter on dark */
  --h0: #0d366b; --h1: #104281; --h2: #184f95; --h3: #1c5cab;
  --h4: #2a78d6; --h5: #5598e7; --h6: #86b6ef; --h7: #b7d3f6;
  --h-ink-dark: #04142b; --h-ink-light: #ffffff;
  /* Wake-ups outside the blue ramp: before 05 is black, 11 or later is red. */
  --h-early: #000000; --h-late: #e5484d;
  /* Beer heatmap: amber ramp, more = brighter on dark */
  --b1: #4a2414; --b2: #7a3818; --b3: #b24d1f; --b4: #d95926; --b5: #f5a46b;
}

:root[data-theme="light"] {
  /* Ice Blue / Arctic: a cold, light twin of the dark theme – no pure white surfaces. */
  color-scheme: light;
  --bg: #d9e7f4;
  --bg-glow: #b5d2ef;
  --surface: #eaf3fb;
  --surface-2: #dce9f6;
  --surface-3: #cddff1;
  --border: rgba(16, 48, 92, 0.15);
  --text: #0b1b33;
  --muted: #425776;
  --faint: #687c9b;
  --accent: #0872ad;
  --accent-ink: #ffffff;
  --amber: #a35200;
  --sun: #b87400;
  --danger: #c02b3d;
  --ok: #12773a;
  --snow: #ffffff;
  --shadow: 0 12px 30px rgba(20, 60, 110, 0.16);
  --sea: #0e9aa0;

  /* light: earlier = lighter */
  --h0: #cde2fb; --h1: #b7d3f6; --h2: #9ec5f4; --h3: #86b6ef;
  --h4: #5598e7; --h5: #2a78d6; --h6: #1c5cab; --h7: #104281;
  --h-early: #000000; --h-late: #c62f3c;
  --b1: #fde4cf; --b2: #f9c39a; --b3: #f29a5f; --b4: #eb6834; --b5: #a8431a;
}

*,
*::before,
*::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font: 400 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, var(--bg-glow), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, color-mix(in srgb, var(--bg-glow) 60%, transparent), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

@media (min-width: 760px) {
  body { padding-bottom: 48px; }
}

h1, h2, h3 {
  font-family: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 6vw, 3rem); font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 800; }
p { margin: 0 0 0.75em; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
code { font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 6px; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.hint { color: var(--muted); font-size: 0.8rem; }
.center { text-align: center; margin: 24px 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; }
.skip-link:focus { left: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Header & navigation (the frame itself: assets/css/peak/c2.css) ---------- */

.logo-mark { width: 34px; height: 34px; color: var(--accent); }
.logo-sol { color: var(--sea); }
.logo-fest { color: var(--fest-violet, #b388ff); } /* PEAK Party's popper – its confetti has fallback colours in logo_svg() */

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface-2); color: var(--text);
  cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-3); }
.icon-btn .icon { width: 18px; height: 18px; }
.theme-toggle .icon:last-child { display: none; }
:root[data-theme="light"] .theme-toggle .icon:first-child { display: none; }
:root[data-theme="light"] .theme-toggle .icon:last-child { display: block; }

/* ---------- Avatars ---------- */

.avatar {
  --s: 36px;
  width: var(--s); height: var(--s); flex: none;
  border-radius: 50%;
  object-fit: cover;
  display: inline-grid; place-items: center;
  background: var(--c, var(--accent));
  color: #fff;
  font-weight: 800; font-size: calc(var(--s) * 0.38);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 0 2px var(--surface);
  user-select: none;
}
.avatar-xl { box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--c, var(--accent)); }

/* ---------- Cards, sections, flash ---------- */

main { padding-top: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .muted { font-weight: 500; }
.section { margin: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.section-title { font-size: 1.45rem; margin-bottom: 14px; }
.section-head .section-title { margin-bottom: 0; }
.sub-title { margin: 24px 0 10px; }
.count {
  display: inline-block; min-width: 1.6em; padding: 0 0.45em; margin-left: 6px;
  border-radius: 999px; background: var(--surface-3); color: var(--muted);
  font: 700 0.8rem/1.6 "Inter", sans-serif; text-align: center; vertical-align: middle;
}
.page-head { margin: 8px 0 20px; }
.page-head h1 { margin-bottom: 6px; }
.empty { color: var(--muted); margin: 0; }
.notice {
  padding: 12px 16px; border-radius: 14px; margin-bottom: 20px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.flash {
  padding: 12px 16px; border-radius: 14px; margin: 0 0 16px;
  background: color-mix(in srgb, var(--ok) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
  font-weight: 500;
}
.flash-error {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; margin-left: 4px;
  background: color-mix(in srgb, var(--accent) 20%, transparent); color: var(--accent);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}
.badge-muted { background: var(--surface-3); color: var(--muted); }

/* ---------- Buttons & forms ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: 12px;
  font: 700 0.95rem/1 "Inter", sans-serif;
  cursor: pointer; text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-sm { min-height: 36px; padding: 8px 12px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; font-size: 0.9rem; padding: 0; }
.field small { color: var(--muted); font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-2); color: var(--text);
  font: 16px/1.3 "Inter", sans-serif;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
input[type="file"] { min-height: 0; padding: 0; border: 0; background: none; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.form-actions { grid-column: 1 / -1; }
.code-box { font: 13px/1.4 ui-monospace, Consolas, monospace; }

/* ---------- Auth pages ---------- */

.auth-card { max-width: 440px; margin: 6vh auto 0; padding: 28px 24px; text-align: left; }
.auth-card h1 { font-size: 2rem; margin-bottom: 6px; }
.auth-hero { font-size: 3.2rem; line-height: 1; margin-bottom: 12px; }
.auth-switch { margin: 18px 0 0; color: var(--muted); }
.wobble { display: inline-block; animation: wobble 3s ease-in-out infinite; transform-origin: top center; }
@keyframes wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.install-card { max-width: 560px; }
.checklist { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 6px; }
.checklist small { display: block; color: var(--muted); margin-left: 28px; }

/* ---------- Dashboard ---------- */
.eyebrow { margin: 0 0 4px; color: var(--accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; }
.timers { display: grid; gap: 16px; margin-bottom: 20px; }
@media (min-width: 980px) { .timers { grid-template-columns: 1fr 1fr; } }
/* Phones only: the two timers sit side by side in a swipe carousel (dots below, dashboard.js). */
.timer-dots { display: none; }
@media (max-width: 640px) {
  .timers {
    display: flex; gap: 12px; margin: 0 -16px 10px; padding: 0 16px 2px;
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .timers::-webkit-scrollbar { display: none; }
  .timers > .countdown { flex: 0 0 calc(100% - 20px); scroll-snap-align: start; scroll-snap-stop: always; }
  .timers > .countdown:last-child { scroll-snap-align: end; }
  .timer-dots { display: flex; justify-content: center; gap: 8px; margin: 0 0 18px; }
  .timer-dots button {
    width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--surface-3); transition: width 0.25s ease, background-color 0.25s ease;
  }
  .timer-dots button[aria-current="true"] { width: 24px; background: var(--accent); }
}
@media (max-width: 640px) and (prefers-reduced-motion: no-preference) { .timers { scroll-behavior: smooth; } }

.dash-grid { display: grid; gap: 16px; }
@media (min-width: 900px) {
  .dash-grid { grid-template-columns: 1fr 1fr; align-items: start; }
}

.who { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.who-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px 4px 4px; min-height: 36px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  font: 600 0.88rem "Inter", sans-serif; cursor: pointer;
}
.who-chip[aria-checked="true"] {
  background: color-mix(in srgb, var(--c) 22%, var(--surface-2));
  border-color: var(--c);
  box-shadow: 0 0 0 1px var(--c);
}

.log-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.big-btn {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 116px; padding: 14px 10px;
  border: 0; border-radius: 18px; cursor: pointer;
  font: 800 1.05rem/1.15 "Bricolage Grotesque", sans-serif; color: #2b1600;
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.big-btn:active { transform: scale(0.96); }
.big-btn[disabled] { opacity: 0.7; }
.big-btn.is-done { opacity: 0.55; cursor: default; filter: saturate(0.6); }
.big-emoji { font-size: 2.4rem; line-height: 1; transition: transform 0.3s cubic-bezier(.3, 1.6, .5, 1); }
.big-btn:hover .big-emoji { transform: scale(1.12) rotate(-6deg); }
.big-label { text-align: center; overflow-wrap: anywhere; }
.btn-sun {
  background: radial-gradient(120% 120% at 30% 0%, #fff2b8, #ffd166 45%, #ff9f43);
  box-shadow: 0 10px 26px rgba(255, 170, 60, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}
.btn-beer {
  background: linear-gradient(180deg, #fffaf0 0 18%, #ffcf5a 18% 22%, #f7a51c 22%, #d9790a);
  box-shadow: 0 10px 26px rgba(240, 150, 20, 0.35), inset 0 -4px 0 rgba(0, 0, 0, 0.15);
}
.bubble {
  position: absolute; bottom: -10px; width: var(--d, 8px); height: var(--d, 8px);
  border-radius: 50%; background: rgba(255, 255, 255, 0.75);
  animation: rise var(--t, 1.2s) ease-in forwards; pointer-events: none;
}
@keyframes rise {
  to { transform: translate(var(--x, 0), -150px) scale(0.4); opacity: 0; }
}
.sun-ray {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.9), transparent 55%);
  animation: flash 0.7s ease-out forwards;
}
@keyframes flash { from { opacity: 1; transform: scale(0.4); } to { opacity: 0; transform: scale(1.6); } }

.today-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.today-list li {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px;
  padding: 8px; border-radius: 12px;
}
.today-list li:nth-child(odd) { background: var(--surface-2); }
.today-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-wake { font-variant-numeric: tabular-nums; font-weight: 600; }
.today-wake.is-asleep { opacity: 0.7; }
.today-beers { text-align: right; font-variant-numeric: tabular-nums; min-width: 72px; }
.today-beers b { font-size: 1.15rem; }
.today-beers small { display: block; color: var(--muted); font-size: 0.72rem; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.feed-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: 0; }
.feed-body p { margin: 0; font-size: 0.93rem; }
.feed-body time { color: var(--faint); font-size: 0.78rem; }
.feed-thumb img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.undo-btn { width: 30px; height: 30px; opacity: 0.6; }
.undo-btn:hover { opacity: 1; }
.feed-item.is-new { animation: pop-in 0.5s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pop-in { from { transform: translateY(-8px) scale(0.98); opacity: 0; } }

.link-more { font-weight: 600; font-size: 0.9rem; text-decoration: none; }

/* ---------- Toasts & confetti ---------- */

.toasts {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 60;
  display: grid; gap: 8px; width: min(92vw, 420px); transform: translateX(-50%);
  pointer-events: none;
}
@media (min-width: 760px) { .toasts { bottom: 28px; } }
.toast {
  padding: 12px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg);
  font-weight: 600; box-shadow: var(--shadow);
  animation: toast-in 0.35s cubic-bezier(.3, 1.4, .5, 1);
}
.toast.error { background: var(--danger); color: #fff; }
.toast.out { animation: toast-out 0.3s ease-in forwards; }
@keyframes toast-in { from { transform: translateY(20px) scale(0.95); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(10px); opacity: 0; } }

/* ---------- Overview ---------- */

.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 8px; }
@media (min-width: 760px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; display: grid; gap: 2px; }
.stat-label { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.stat-value { font: 800 2rem/1.1 "Bricolage Grotesque", sans-serif; }

.people-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.person-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 16px;
}
.person-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--c);
}
.person-top { display: flex; align-items: center; gap: 12px; }
.person-top h3 { font-size: 1.15rem; }
.person-top p { margin: 0; }
.titles { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.titles li {
  padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  background: color-mix(in srgb, var(--sun) 18%, transparent); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--sun) 40%, transparent);
}
.person-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 14px 0 0; }
.person-stats div { background: var(--surface-2); border-radius: 10px; padding: 6px 4px; text-align: center; }
.person-stats dt { color: var(--muted); font-size: 0.68rem; font-weight: 600; }
.person-stats dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); }
.heat { border-collapse: separate; border-spacing: 2px; width: 100%; font-variant-numeric: tabular-nums; }
.heat th, .heat td { padding: 0; text-align: center; white-space: nowrap; }
.heat thead th { padding: 8px 6px; font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.heat thead th.is-today { color: var(--accent); }
.day-n { display: block; font-weight: 800; color: var(--text); }
.is-today .day-n { color: var(--accent); }
.day-d { display: block; }
.heat tbody th, .heat tfoot th { text-align: left; padding: 4px 10px 4px 6px; font-weight: 600; font-size: 0.9rem; }
.sticky-col { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.row-person { display: inline-flex; align-items: center; gap: 8px; }
.heat td { min-width: 58px; height: 40px; border-radius: 8px; background: var(--surface-2); font-weight: 700; font-size: 0.9rem; }
.heat td.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
/* Each day's first up: the same ice glow as an Iskrystal trophy. */
.heat td.is-first-up, .ramp-legend i.is-first-up {
  position: relative; z-index: 1;
  box-shadow: inset 0 0 0 2px #5fd4f5, 0 0 10px color-mix(in srgb, #5fd4f5 45%, transparent);
  animation: first-up-glow 3s ease-in-out infinite;
}
@keyframes first-up-glow { 50% { box-shadow: inset 0 0 0 2px #5fd4f5, 0 0 18px color-mix(in srgb, #5fd4f5 75%, transparent); } }
@media (prefers-reduced-motion: reduce) { .heat td.is-first-up, .ramp-legend i.is-first-up { animation: none; } }
.legend-first { display: inline-flex; align-items: center; gap: 6px; margin-left: 12px; }
/* Each day's top drinker: a golden glow, like a Guld trophy. */
.heat td.is-top-beer, .ramp-legend i.is-top-beer {
  position: relative; z-index: 1;
  box-shadow: inset 0 0 0 2px #e2b53c, 0 0 10px color-mix(in srgb, #ffd166 45%, transparent);
  animation: top-beer-glow 3s ease-in-out infinite;
}
@keyframes top-beer-glow { 50% { box-shadow: inset 0 0 0 2px #ffd166, 0 0 18px color-mix(in srgb, #ffd166 75%, transparent); } }
@media (prefers-reduced-motion: reduce) { .heat td.is-top-beer, .ramp-legend i.is-top-beer { animation: none; } }
.ramp-legend > .legend-first:first-child { margin-left: 0; }
.heat .avg-cell { background: transparent; color: var(--text); padding: 0 10px; }
.heat tfoot td { background: transparent; color: var(--muted); font-weight: 700; }
.cell-btn {
  width: 100%; height: 40px; border: 0; background: transparent; color: inherit;
  font: inherit; cursor: pointer; border-radius: 8px;
}
.cell-btn:hover { box-shadow: inset 0 0 0 2px var(--text); }
.h-none { color: var(--faint); }
.h-0 { background: var(--h-early) !important; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); }
.h-1 { background: var(--h1) !important; color: var(--h-ink-light); }
.h-2 { background: var(--h2) !important; color: var(--h-ink-light); }
.h-3 { background: var(--h3) !important; color: var(--h-ink-light); }
.h-4 { background: var(--h4) !important; color: var(--h-ink-light); }
.h-5 { background: var(--h5) !important; color: var(--h-ink-dark); }
.h-6 { background: var(--h6) !important; color: var(--h-ink-dark); }
.h-7 { background: var(--h-late) !important; color: #fff; }
:root[data-theme="light"] .h-1, :root[data-theme="light"] .h-2, :root[data-theme="light"] .h-3 { color: #04142b; }
:root[data-theme="light"] .h-4, :root[data-theme="light"] .h-5, :root[data-theme="light"] .h-6 { color: #fff; }
.b-0 { color: var(--faint); }
.b-1 { background: var(--b1) !important; color: #fff; }
.b-2 { background: var(--b2) !important; color: #fff; }
.b-3 { background: var(--b3) !important; color: #fff; }
.b-4 { background: var(--b4) !important; color: #fff; }
.b-5 { background: var(--b5) !important; color: #2b1600; }
:root[data-theme="light"] .b-1, :root[data-theme="light"] .b-2 { color: #2b1600; }
:root[data-theme="light"] .b-5 { color: #fff; }
.ramp-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 10px; color: var(--muted); font-size: 0.8rem; }
.ramp-legend i { width: 22px; height: 12px; border-radius: 3px; }
.ramp-legend small { flex-basis: 100%; color: var(--faint); }

.beer-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .beer-layout { grid-template-columns: 2fr 3fr; } }
.leaderboard { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.leaderboard li { display: grid; grid-template-columns: 28px auto minmax(84px, 1fr) minmax(48px, 1fr) auto; align-items: center; gap: 8px; }
.rank { text-align: center; font-weight: 800; color: var(--muted); }
.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar { height: 14px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.lb-bar span {
  display: block; height: 100%; width: var(--w); border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, var(--b3), var(--amber));
  transform-origin: left; animation: grow 1s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes grow { from { transform: scaleX(0); } }
.lb-val { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.lb-val b { font-size: 1.1rem; }
.lb-val small { color: var(--muted); }

.chart { position: relative; min-height: 240px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5;
  padding: 8px 10px; border-radius: 10px; min-width: 120px;
  background: var(--surface-3); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: 0.82rem; line-height: 1.35;
}
.chart-tip b { display: block; margin-bottom: 2px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 0.82rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; cursor: default; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; }

/* ---------- Gallery ---------- */

.uploader { margin-bottom: 20px; }
.drop-zone {
  position: relative; display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 26px 16px; border: 2px dashed var(--border); border-radius: 16px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop-zone:hover, .drop-zone.is-over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.drop-zone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon .icon { width: 34px; height: 34px; color: var(--accent); }
.drop-hint { color: var(--muted); font-size: 0.8rem; }
.upload-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 14px; }
.upload-preview img,
.upload-ph { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.upload-ph { display: grid; place-items: center; background: var(--surface-2); font-size: 1.6rem; }
.caption-field { margin-top: 14px; }
.upload-actions { display: flex; gap: 8px; margin-top: 14px; }
.upload-progress { margin-top: 14px; }
.upload-progress .bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.upload-progress .bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
.upload-progress .status { margin: 6px 0 0; color: var(--muted); font-size: 0.85rem; }

.gallery { columns: 2 160px; column-gap: 12px; }
@media (min-width: 760px) { .gallery { columns: 3 220px; } }
.photo {
  break-inside: avoid; margin: 0 0 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden;
}
.photo.is-new { animation: pop-in 0.5s cubic-bezier(.3, 1.4, .5, 1); }
.photo-open { display: block; width: 100%; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; }
.photo-open img { width: 100%; height: auto; object-fit: cover; }
.photo figcaption { padding: 10px 12px 12px; }
.photo-meta { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.photo-meta time { display: block; color: var(--faint); font-size: 0.75rem; }
.photo-caption { margin: 8px 0 0; font-size: 0.92rem; }
.photo-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.skaal-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text);
  font: 600 0.85rem "Inter", sans-serif; cursor: pointer;
}
.skaal-btn[aria-pressed="true"] {
  background: color-mix(in srgb, var(--amber) 22%, var(--surface-2));
  border-color: var(--amber);
}
.skaal-btn.pop span { animation: clink 0.5s ease; }
@keyframes clink { 30% { transform: rotate(-20deg) scale(1.3); } 60% { transform: rotate(12deg) scale(1.2); } }
.photo-actions .icon-btn { width: 34px; height: 34px; }

dialog { color: var(--text); }
dialog::backdrop { background: rgba(4, 8, 20, 0.82); backdrop-filter: blur(4px); }
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; }
.lightbox-inner { position: relative; display: grid; grid-template-rows: 1fr auto; height: 100%; }
.lightbox img { max-width: 100%; max-height: 100%; margin: auto; object-fit: contain; align-self: center; justify-self: center; min-height: 0; }
.lightbox-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(4, 8, 20, 0.7); color: #fff; }
.lightbox-caption { flex: 1; margin: 0; }
.lightbox-caption small { display: block; opacity: 0.7; }
.lightbox-actions { display: flex; gap: 8px; }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, 0.14); color: #fff; cursor: pointer; display: grid; place-items: center;
}
.lightbox-nav.prev { left: 12px; }
.lightbox-nav.next { right: 12px; }
.lightbox-nav .icon { width: 26px; height: 26px; }

.modal {
  width: min(92vw, 400px); padding: 22px; border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); box-shadow: var(--shadow);
}
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Admin & profile ---------- */

.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.admin-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.admin-list li:last-child { border-bottom: 0; }
.admin-who { flex: 1 1 180px; min-width: 0; }
.admin-who .small { display: block; overflow: hidden; text-overflow: ellipsis; }
.admin-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-actions form { display: flex; flex-wrap: wrap; gap: 6px; }
.inline-field select { min-height: 36px; padding: 6px 10px; font-size: 0.85rem; width: auto; }
.add-guest { margin-top: 18px; }

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  position: relative; width: 28px; height: 28px; border-radius: 50%; padding: 0; cursor: pointer;
  background: var(--c); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
}
.swatch[aria-checked="true"], .swatch:has(input:checked) { box-shadow: 0 0 0 2px var(--text); }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; min-height: 0; cursor: pointer; }

.avatar-edit { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Trip switcher ---------- */

.trip-switch { position: relative; min-width: 0; }
.trip-switch summary {
  list-style: none; display: flex; align-items: center; gap: 6px;
  max-width: min(42vw, 260px); padding: 7px 12px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; font-weight: 600; font-size: 0.85rem;
}
.trip-switch summary::-webkit-details-marker { display: none; }
.trip-switch[open] summary { border-color: var(--accent); }
.trip-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-switch-caret { color: var(--muted); font-size: 0.75rem; }
.trip-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  display: grid; gap: 2px; min-width: 260px; max-width: 90vw; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.trip-menu a { display: grid; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; }
.trip-menu a:hover { background: var(--surface-2); }
.trip-menu a[aria-current] { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.trip-menu small { color: var(--muted); font-size: 0.78rem; }
.trip-menu .trip-new { color: var(--accent); font-weight: 700; }
@media (max-width: 440px) {
  .trip-switch summary { padding: 7px 10px; }
}

/* ---------- Admin: trips ---------- */

.trip-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.trip-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.trip-list li:last-child { border-bottom: 0; }
.trip-route {
  font: 700 0.95rem/1 "Oswald", sans-serif; letter-spacing: 0.06em;
  padding: 8px 10px; border-radius: 10px; background: var(--surface-2); white-space: nowrap;
}
.code-input { max-width: 90px; text-transform: uppercase; font-family: "Oswald", sans-serif; letter-spacing: 0.08em; }
.members-field { grid-column: 1 / -1; }
.member-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.member-check {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 4px; min-height: 36px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2);
  cursor: pointer; font-weight: 600; font-size: 0.88rem;
}
.member-check input { width: auto; min-height: 0; margin: 0 2px 0 6px; accent-color: var(--accent); }
.member-check:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 20%, var(--surface-2)); }
.danger-zone { margin: 8px 0 32px; }
.input-row select { width: auto; }

/* ---------- Profile: travel history ---------- */

/* ---------- Boarding pass ---------- */

.bpass-wrap {
  container-type: inline-size;
  max-width: 860px; margin: 4px 0 28px;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.35));
  animation: bp-in 0.7s cubic-bezier(.2, .9, .3, 1.15) both;
}
@keyframes bp-in { from { transform: translateY(26px) rotate(-1.2deg); opacity: 0; } }
.bpass-wrap.is-standby .bpass { filter: grayscale(0.85); }

.bpass {
  --stub: 230px;
  --notch: 15px;
  --paper: #fbf8f1;
  --ink: #14203f;
  --ink-2: #5d6886;
  --rule: rgba(20, 32, 63, 0.16);
  display: grid; grid-template-columns: minmax(0, 1fr) var(--stub);
  border-radius: 22px; overflow: hidden;
  background: var(--paper); color: var(--ink);
  -webkit-mask:
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, #0000 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 0, #0000 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at calc(100% - var(--stub)) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  transition: transform 0.3s ease;
}
.bpass-wrap:hover .bpass { transform: translateY(-3px) rotate(-0.4deg); }

.bp-main { display: grid; min-width: 0; }
.bp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px;
  background: linear-gradient(120deg, var(--c), color-mix(in srgb, var(--c) 55%, #0b1020));
  color: #fff;
}
.bp-airline {
  display: flex; align-items: center; gap: 8px;
  font: 500 0.95rem/1 "Bricolage Grotesque", sans-serif; text-transform: uppercase; letter-spacing: 0.08em;
}
.bp-airline b { font-weight: 800; }
.bp-airline .logo-mark { width: 26px; height: 26px; color: #fff; --snow: var(--c); }
.bp-type { font: 700 0.72rem/1 "Inter", sans-serif; text-transform: uppercase; letter-spacing: 0.16em; opacity: 0.9; }

.bp-route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; padding: 18px 22px 6px; }
.bp-city { display: grid; }
.bp-to { text-align: right; }
.bp-code { font: 800 clamp(2.4rem, 9cqi, 4rem)/0.95 "Bricolage Grotesque", sans-serif; letter-spacing: 0.02em; }
.bp-cityname { color: var(--ink-2); font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.bp-flightpath { position: relative; width: 200px; height: 60px; justify-self: center; }
.bp-flightpath .bp-arc { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bp-arc path { fill: none; stroke: var(--ink-2); stroke-width: 2; stroke-dasharray: 3 6; stroke-linecap: round; opacity: 0.55; vector-effect: non-scaling-stroke; }
.bp-arc .bp-flown {
  stroke: var(--c); opacity: 1; stroke-width: 3; stroke-dasharray: var(--p) 100;
  animation: bp-trail 2.2s cubic-bezier(.4, 0, .2, 1) both 0.3s;
}
@keyframes bp-trail { from { stroke-dasharray: 0 100; } }
.bp-plane {
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; fill: var(--c);
  offset-path: path("M4 52 Q100 -18 196 52");
  offset-distance: var(--progress);
  offset-rotate: auto;
  animation: bp-fly 2.2s cubic-bezier(.4, 0, .2, 1) both 0.3s;
  filter: drop-shadow(0 2px 0 var(--paper));
}
@keyframes bp-fly { from { offset-distance: 0%; } }

.bp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin: 0; padding: 14px 22px; }
.bp-grid .bp-wide { grid-column: 1 / -1; }
.bp-grid dt, .bp-stats dt, .bp-stub-grid dt {
  color: var(--ink-2); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
}
.bp-grid dd, .bp-stub-grid dd {
  margin: 2px 0 0; font: 700 1.15rem/1.15 "Oswald", sans-serif; letter-spacing: 0.04em; text-transform: uppercase;
  overflow-wrap: anywhere;
}
.bp-grid .bp-wide dd { font-size: 1.45rem; }
.bp-grid dd small { font: 500 0.95rem "Inter", sans-serif; text-transform: none; color: var(--ink-2); letter-spacing: 0; }
.bp-grid dd.bp-class { text-transform: none; font-size: 1rem; }

.bp-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0;
  padding: 12px 22px; background: color-mix(in srgb, var(--c) 12%, var(--paper));
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.bp-stats dd { margin: 0; font: 800 1.5rem/1.1 "Bricolage Grotesque", sans-serif; font-variant-numeric: tabular-nums; }
.bp-stats dd small { font-size: 0.8rem; color: var(--ink-2); }

.bp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 22px 16px; }
.bp-status {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 0.82rem;
}
.bp-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-badges span { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--rule); font-size: 0.78rem; font-weight: 700; }

.bp-stub {
  position: relative; overflow: hidden;
  display: grid; align-content: space-between; gap: 12px;
  padding: 18px 20px; border-left: 2px dashed var(--rule);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 9%, var(--paper)), var(--paper) 40%);
}
.bp-stub-top { display: flex; align-items: center; gap: 12px; }
.bp-avatar { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--c); }
.bp-stub-route { font: 800 1.3rem/1 "Bricolage Grotesque", sans-serif; }
.bp-stub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin: 0; }
.bp-stub-grid dd { font-size: 1rem; }
.bp-stub-grid div:first-child { grid-column: 1 / -1; }
.bp-barcode { width: 100%; height: 56px; fill: var(--ink); }
.bp-holo {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: conic-gradient(from 0deg, #ff9ad5, #9ad5ff, #b6ffb0, #fff59a, #ff9ad5);
  opacity: 0.75; mix-blend-mode: multiply;
  animation: holo 6s linear infinite;
}
@keyframes holo { to { filter: hue-rotate(360deg); transform: rotate(360deg); } }

@container (max-width: 620px) {
  .bpass {
    --stub-h: 168px;
    grid-template-columns: minmax(0, 1fr);
    -webkit-mask:
      radial-gradient(circle var(--notch) at 0 calc(100% - var(--stub-h)), #0000 98%, #000) left / 51% 100% no-repeat,
      radial-gradient(circle var(--notch) at 100% calc(100% - var(--stub-h)), #0000 98%, #000) right / 51% 100% no-repeat;
    mask:
      radial-gradient(circle var(--notch) at 0 calc(100% - var(--stub-h)), #0000 98%, #000) left / 51% 100% no-repeat,
      radial-gradient(circle var(--notch) at 100% calc(100% - var(--stub-h)), #0000 98%, #000) right / 51% 100% no-repeat;
  }
  .bp-stub {
    height: var(--stub-h); border-left: 0; border-top: 2px dashed var(--rule);
    grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; align-content: stretch; padding: 16px 18px;
  }
  .bp-stub-top { grid-row: 1 / 3; flex-direction: column; align-items: flex-start; }
  .bp-stub-grid { align-self: start; }
  .bp-stub-grid div:nth-child(n + 4) { display: none; }
  .bp-barcode { align-self: end; height: 44px; }
  .bp-flightpath { width: 120px; height: 36px; }
  .bp-plane { width: 24px; height: 24px; offset-path: path("M2 32 Q60 -10 118 32"); }
  .bp-head { padding: 12px 16px; }
  .bp-type { display: none; }
  .bp-route, .bp-grid, .bp-stats, .bp-foot { padding-left: 16px; padding-right: 16px; }
  .bp-grid dd { font-size: 1rem; }
  .bp-grid .bp-wide dd { font-size: 1.2rem; }
  .bp-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The sun stamp (edition 'pass.stamp' = 'sun', PEAK Sun) instead of the hologram: stamped on in sunset ink. */
.bp-stamp {
  position: absolute; top: 10px; right: 10px; width: 54px; height: 54px;
  color: #e4572e; stroke: currentColor; opacity: 0.8; mix-blend-mode: multiply;
  transform: rotate(-14deg);
  animation: bp-stamp 0.45s cubic-bezier(.3, 1.5, .5, 1) both 0.9s;
}
.bp-stamp-sun { fill: currentColor; stroke: none; }
@keyframes bp-stamp { from { transform: rotate(-30deg) scale(1.9); opacity: 0; } }
.bp-best dd small, .bp-today dd small { font-family: "Inter", sans-serif; font-weight: 700; }

/* ---------- The group's trip pass on the dashboard (feature 'trip_pass') ---------- */

.tpass-wrap { max-width: none; margin: 0 0 20px; }
.tpass { --c: #0b7f88; } /* a deep sea – white on the band and on paper both read well, in either theme */
.tpass-crew { padding: 4px 22px 14px; }
.tpass-crew-label {
  margin: 0 0 8px; color: var(--ink-2); font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
}
.tpass-crew-label .count { background: color-mix(in srgb, var(--c) 16%, var(--paper)); color: var(--ink); }
.tpass-avatars { list-style: none; display: flex; flex-wrap: wrap; margin: 0; padding: 0 0 0 8px; }
.tpass-avatars li { margin-left: -8px; }
.tpass-avatars .avatar { box-shadow: 0 0 0 3px var(--paper); }
.tpass-more {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: var(--ink); color: var(--paper); font-weight: 800; font-size: 0.8rem; box-shadow: 0 0 0 3px var(--paper);
}
.tpass .bp-foot { border-top: 1px solid var(--rule); }
.tpass-note { color: var(--ink-2); font-size: 0.82rem; font-style: italic; }
.tpass-count { display: grid; gap: 2px; padding-right: 48px; }
.tpass-count b { font: 800 3.6rem/0.9 "Bricolage Grotesque", sans-serif; font-variant-numeric: tabular-nums; color: var(--c); }
.tpass-count span { color: var(--ink-2); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }
@container (max-width: 620px) {
  .tpass .tpass-count { grid-row: 1 / 3; align-self: start; padding-right: 0; }
  .tpass-count b { font-size: 3rem; }
  .tpass-crew { padding-left: 16px; padding-right: 16px; }
  .bp-stamp { width: 40px; height: 40px; top: auto; bottom: 66px; right: 10px; }
}

/* ---------- Vacation mode on the dashboard (feature 'vacation_mode') ---------- */
.today-list.is-league li { grid-template-columns: 1.6em auto 1fr auto; }
.today-place { font-size: 1.3rem; line-height: 1; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.person-link { color: inherit; text-decoration: none; }
.person-link::after { content: ""; position: absolute; inset: 0; }
.person-link:hover { color: var(--accent); }

/* ---------- Nicknames ---------- */

.nick-layout { display: grid; gap: 16px; align-items: start; }
@media (min-width: 860px) { .nick-layout { grid-template-columns: 1fr 1fr; } }
.nick-rule { font-weight: 600; margin-bottom: 4px; }
.nick-list { display: grid; gap: 8px; }
.nick-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nick-history li {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: stretch;
  padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
}
.nick-main { display: grid; gap: 2px; justify-items: start; min-width: 0; }
.nick-main .nick-name { overflow-wrap: anywhere; }
.nick-tools { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 30px; }
.nick-tools form { margin: 0; }
.nick-tools form:first-child { margin-bottom: auto; }
.nick-history .icon-btn { width: 30px; height: 30px; }
.nick-tools .report-btn { font-size: 0.95rem; padding: 2px 6px; }
.nick-name { font: 800 1.05rem "Bricolage Grotesque", sans-serif; }
.nick-history li.is-current { border-color: var(--sun); background: color-mix(in srgb, var(--sun) 10%, var(--surface)); }
.nick-history li.is-current .nick-name { font-size: 1.35rem; }
.nick-history li:not(.is-current) .nick-name { color: var(--muted); }
.nick-vote {
  margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 3px 11px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  font: inherit; font-size: 0.85rem; cursor: pointer;
}
.nick-vote b { color: var(--text); font-variant-numeric: tabular-nums; }
.nick-vote:hover { border-color: var(--accent); }
.nick-vote[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); color: var(--text); }
.nick-vote:disabled { opacity: 0.6; cursor: progress; }
.nick-more summary { cursor: pointer; padding: 6px 2px; color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.nick-more summary:hover { color: var(--text); }
.nick-more[open] summary { margin-bottom: 6px; }

/* ---------- Propaganda board (bullshit.php) ---------- */

.bs-hero { display: grid; gap: 20px; align-items: center; margin: 8px 0 12px; }
@media (min-width: 760px) { .bs-hero { grid-template-columns: 1fr auto; } }
.bs-hero h1 { margin-bottom: 6px; }

.debt-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.debt-card {
  display: grid; gap: 12px; padding: 16px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 5px solid var(--amber);
}
.debt-who { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.debt-person { display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.debt-person b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.debt-person small { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }
.debt-arrow { font-size: 1.6rem; color: var(--amber); }
.debt-beers { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px; font-size: 1.4rem; }
.debt-beers strong { flex-basis: 100%; text-align: center; font: 800 1.1rem "Bricolage Grotesque", sans-serif; }

.bet-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.bet-card {
  position: relative; overflow: hidden;
  display: grid; gap: 10px; align-content: start;
  padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
}
.bet-card.is-open { border: 2px dashed color-mix(in srgb, var(--amber) 60%, transparent); }
.bet-card blockquote { margin: 0; font: 800 1.15rem/1.3 "Bricolage Grotesque", sans-serif; }
.bet-parties { display: grid; gap: 6px; margin: 0; font-size: 0.88rem; color: var(--muted); }
.bet-parties span { display: flex; align-items: center; gap: 6px; }
.bet-parties b { color: var(--text); }
.bet-verdict { display: grid; gap: 8px; }
.btn-verdict { width: 100%; border: 1px solid var(--border); color: var(--text); justify-content: flex-start; }
.btn-verdict.is-true { background: color-mix(in srgb, var(--ok) 16%, var(--surface-2)); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.btn-verdict.is-false { background: color-mix(in srgb, var(--danger) 16%, var(--surface-2)); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.btn-verdict:hover { filter: brightness(1.12); }
.bet-foot { display: flex; align-items: center; justify-content: space-between; color: var(--faint); font-size: 0.78rem; }
.bet-result { margin: 0; font-size: 0.88rem; }
.bet-result .ok { color: var(--ok); font-weight: 700; }
.bet-result .warn { color: var(--amber); font-weight: 700; }
.bet-card.is-true blockquote, .bet-card.is-false blockquote { padding-right: 70px; }
.stamp {
  position: absolute; top: 16px; right: -6px;
  padding: 4px 12px; border: 3px solid currentColor; border-radius: 8px;
  font: 400 0.95rem/1 "Bungee", sans-serif; letter-spacing: 0.04em;
  transform: rotate(14deg); opacity: 0.85;
}
.is-true .stamp { color: var(--ok); }
.is-false .stamp { color: var(--danger); }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font: inherit; text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--danger); }

.score-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.score-table th, .score-table td { padding: 10px 12px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--border); }
.score-table thead th { color: var(--muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.score-table tbody th { text-align: left; font-weight: 600; }
.score-table tbody tr:last-child > * { border-bottom: 0; }
.score-table .pos { color: var(--ok); font-weight: 800; }
.score-table .neg { color: var(--danger); font-weight: 800; }
.mini-title {
  display: inline-block; margin: 4px 4px 0 0; padding: 1px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--sun) 16%, transparent); font-size: 0.72rem; font-weight: 700;
}

.bet-dialog { width: min(94vw, 560px); }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px 3px 3px; min-height: 34px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); font-weight: 600; font-size: 0.85rem;
}
.pick-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.pick-chip:has(input:checked) { border-color: var(--c); background: color-mix(in srgb, var(--c) 24%, var(--surface-2)); box-shadow: 0 0 0 1px var(--c); }
.pick-chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.pick-chip.is-disabled { opacity: 0.35; cursor: not-allowed; }

/* ---------- Groups ---------- */

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.trip-switch-name b { font-weight: 800; }
.trip-menu { max-height: min(70vh, 520px); overflow-y: auto; }
.trip-menu-group { display: grid; gap: 2px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.trip-menu-group:last-of-type { border-bottom: 0; }
.trip-menu .trip-menu-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted);
}
.trip-menu-group.is-current .trip-menu-head { color: var(--accent); }
.trip-menu .trip-menu-head .icon { width: 16px; height: 16px; }
.trip-menu-group > a:not(.trip-menu-head) { padding-left: 34px; }
/* Many trips: a search field on top, status labels, the active trip marked; the menu scrolls on its own. */
.trip-menu { overscroll-behavior: contain; padding-top: 0; }
.trip-menu-search { position: sticky; top: 0; z-index: 1; padding: 8px 2px 6px; background: var(--surface); }
.trip-menu-search input {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 0.9rem;
}
.trip-menu-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.trip-menu-empty { margin: 6px 12px 10px; color: var(--muted); font-size: 0.88rem; }
.trip-menu-label {
  margin: 6px 0 0 34px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint);
}
.trip-menu .trip-item.is-ongoing b::before { content: '● '; color: var(--ok); }
.trip-menu .trip-item.is-past { opacity: 0.8; }
.trip-menu .trip-item[aria-current] { box-shadow: inset 3px 0 0 var(--accent); opacity: 1; }
.trip-item-check { margin-left: 6px; font-size: 0.72rem; font-weight: 700; color: var(--accent); }
.trip-menu-foot { display: grid; gap: 2px; padding-top: 4px; border-top: 1px solid var(--border); }
.trip-menu [hidden] { display: none !important; }
@media (max-width: 640px) {
  /* Phones: the menu is a sheet under the header, full width, its own scroll. */
  .trip-switch[open] .trip-menu {
    position: fixed; top: calc(env(safe-area-inset-top, 0px) + 64px); left: 8px; right: 8px;
    min-width: 0; max-width: none; max-height: calc(100dvh - 140px);
  }
  .trip-menu a { padding: 12px; }
}
.new-trips { display: flex; flex-wrap: wrap; gap: 8px; }
.group-grid, .invite-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.group-card {
  display: grid; gap: 6px; padding: 16px; border-radius: 18px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.group-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.group-card.is-current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.group-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 1.15rem; }
.group-card-top b { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; }
.group-card-trip { font-size: 0.88rem; color: var(--accent); }
.invite-card {
  display: grid; gap: 4px; padding: 18px; border-radius: 18px;
  background: color-mix(in srgb, var(--amber) 10%, var(--surface)); border: 2px dashed color-mix(in srgb, var(--amber) 60%, transparent);
}
.invite-card h3 { font-size: 1.4rem; }
.invite-text { margin: 0; color: var(--muted); }
.invite-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.empty-state { text-align: center; display: grid; justify-items: center; gap: 6px; padding: 28px 18px; }

.group-head .inline-rename { max-width: 420px; margin-top: 10px; }
.search-form { margin-bottom: 12px; }
.search-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.search-results li { display: flex; align-items: center; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.search-results li:last-child { border-bottom: 0; }
.sr-who { flex: 1; display: grid; min-width: 0; }
.sr-who small { color: var(--muted); }
.person-name { color: inherit; text-decoration: none; }
.person-name:hover { color: var(--accent); }
.merge-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.merge-form .input-row { align-items: center; flex-wrap: wrap; }
.danger-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ---------- Roles & tiers ---------- */

.role-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px;
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.02em; vertical-align: middle;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.role-admin { background: color-mix(in srgb, var(--accent) 22%, var(--surface-2)); border-color: var(--accent); }
.role-skiguide { background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.role-member { background: color-mix(in srgb, var(--amber) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.person-role { margin: 4px 0 0; }
.tier-badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 800;
  background: var(--surface-3); color: var(--muted);
}
.tier-badge.is-premium { background: color-mix(in srgb, var(--sun) 22%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--sun) 55%, transparent); }

/* ---------- Storage meters ---------- */

.storage-meter { display: grid; gap: 6px; margin: 4px 0 8px; }
.storage-text { display: flex; justify-content: space-between; gap: 8px; font-size: 0.88rem; }
.storage-text span { color: var(--muted); }
.storage-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.storage-bar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.4s ease; }
.storage-meter.is-warn .storage-bar span { background: var(--amber); }
.storage-meter.is-full .storage-bar span { background: var(--danger); }
.notice .storage-meter { margin-bottom: 6px; }
.notice-error {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

/* ---------- Usernames & account ---------- */
.delete-account { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

/* ---------- Ranks ---------- */

.role-minister { background: color-mix(in srgb, var(--accent) 26%, var(--surface-2)); border-color: var(--accent); }
.role-guide { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.role-ambassador { background: color-mix(in srgb, #b18cff 18%, var(--surface-2)); border-color: color-mix(in srgb, #b18cff 55%, transparent); }
.title-bummert { background: color-mix(in srgb, #ff6b9a 18%, var(--surface-2)); border-color: color-mix(in srgb, #ff6b9a 55%, transparent); }
.rank-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rank-legend li { display: grid; grid-template-columns: minmax(170px, auto) 1fr; gap: 10px; align-items: center; }
@media (max-width: 520px) { .rank-legend li { grid-template-columns: 1fr; gap: 2px; } }
.rank-form { display: flex; gap: 6px; align-items: center; }
.rank-form select { min-height: 36px; padding: 6px 10px; font-size: 0.85rem; width: auto; }

/* ---------- Dagens hub ---------- */

.dagens-tabs {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 18px; padding: 4px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); width: fit-content; max-width: 100%;
}
.dagens-tabs::-webkit-scrollbar { display: none; }
.dagens-tabs a {
  flex: none; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 0.9rem; text-decoration: none;
}
.dagens-tabs a:hover { color: var(--text); background: var(--surface-3); }
.dagens-tabs a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
@media (max-width: 420px) { .dagens-tabs { gap: 2px; } .dagens-tabs a { padding: 7px 10px; font-size: 0.84rem; } .dagens-tabs a > span { display: none; } }

/* ---------- Dagens Bummert ---------- */

.bm-hero { display: grid; gap: 20px; align-items: center; margin: 8px 0 12px; }
@media (min-width: 760px) { .bm-hero { grid-template-columns: 1fr minmax(260px, 340px); } }
.bm-hero h1 { margin-bottom: 6px; }
.bm-hero .btn { margin-top: 10px; }
.bm-holder { display: flex; align-items: center; gap: 16px; border: 2px solid color-mix(in srgb, #ff4f8b 55%, transparent); }
.bm-holder-avatar { padding-top: 26px; }
.bm-holder-name { margin: 0; font: 800 1.4rem/1.1 "Bricolage Grotesque", sans-serif; }
.bm-holder .small { margin: 4px 0 0; }

.has-clown-hat { position: relative; display: inline-grid; flex: none; }
.clown-hat {
  position: absolute; left: 50%; bottom: 72%; width: calc(var(--s) * 0.78); height: calc(var(--s) * 0.78);
  transform: translateX(-38%) rotate(14deg); pointer-events: none; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
}
.clown-hat svg, .bm-reveal-hat svg { width: 100%; height: 100%; display: block; }
.row-person .has-clown-hat, .bm-nominee .has-clown-hat { margin-top: 14px; }

.bm-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.bm-card {
  position: relative; overflow: hidden; display: grid; gap: 10px; align-content: start;
  padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border);
}
.bm-card.is-won { border: 2px solid #ff4f8b; background: color-mix(in srgb, #ff4f8b 8%, var(--surface)); }
.bm-card.is-lost { opacity: 0.78; }
.bm-nominee { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; }
.bm-title { margin: 0; font: 800 1.2rem/1.25 "Bricolage Grotesque", sans-serif; }
.bm-card.is-won .bm-title { padding-right: 96px; }
.bm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bm-actions { display: flex; align-items: center; gap: 12px; }
.bm-vote {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: 700 1rem "Inter", sans-serif;
}
.bm-vote[aria-pressed="true"] { background: color-mix(in srgb, #ff4f8b 22%, var(--surface-2)); border-color: #ff4f8b; }
.bm-vote:hover:not(:disabled) { filter: brightness(1.1); }
.bm-vote:disabled { cursor: not-allowed; opacity: 0.6; }
.bm-vote.is-bump { animation: clink 0.5s ease; }
.bm-decide { margin-top: 14px; display: flex; justify-content: center; }
.bm-tie { border: 2px dashed #ff4f8b; }
.bm-tie h2 { margin-bottom: 6px; }
.bm-pick { padding-right: 14px; }

.hof-wrap { display: grid; gap: 14px; }
@media (min-width: 860px) { .hof-wrap { grid-template-columns: 280px 1fr; align-items: start; } }
.hof-tally { list-style: none; margin: 0; display: grid; gap: 10px; }
.hof-tally li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 6px; }
.hof-place { color: var(--faint); font-weight: 800; }
.hof-n { font-weight: 800; white-space: nowrap; }
.hof-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.hof-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px; }
.hof-item p { margin: 0 0 4px; }
.hof-day { color: var(--faint); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.hof-title { font: 800 1.05rem/1.3 "Bricolage Grotesque", sans-serif; }

/* The crowning overlay */
.bm-reveal {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, #0b1020 72%, transparent); backdrop-filter: blur(6px); overflow: hidden;
}
.bm-reveal[hidden] { display: none; }
.has-reveal { overflow: hidden; }
.bm-reveal-card {
  position: relative; width: min(92vw, 380px); padding: 26px 22px; border-radius: 24px; text-align: center;
  background: var(--surface); border: 2px solid #ff4f8b; box-shadow: var(--shadow); animation: pop-in 0.4s ease both;
}
.bm-reveal-card h2 { margin: 10px 0 4px; font-size: 1.8rem; }
.bm-reveal-why { margin: 0 0 16px; color: var(--muted); font-style: italic; }
.bm-reveal-stage { position: relative; display: grid; place-items: center; padding-top: 70px; }
.bm-reveal-stage .avatar { box-shadow: 0 0 0 5px var(--surface), 0 0 0 8px #ff4f8b; }
.bm-reveal-hat {
  position: absolute; top: 0; left: 50%; width: 96px; height: 96px; margin-left: -40px;
  animation: hat-drop 1.1s cubic-bezier(.3, 1.5, .5, 1) 0.35s both;
}
@keyframes hat-drop {
  0% { transform: translateY(-260px) rotate(-40deg); opacity: 0; }
  60% { transform: translateY(14px) rotate(18deg); opacity: 1; }
  80% { transform: translateY(4px) rotate(10deg); }
  100% { transform: translateY(8px) rotate(14deg); }
}
.confetti {
  position: absolute; top: -12px; left: var(--x); width: 9px; height: 14px; border-radius: 2px; pointer-events: none;
  animation: confetti-fall var(--d) ease-in var(--delay) both;
}
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(var(--r)); } }
@media (prefers-reduced-motion: reduce) {
  .bm-reveal-hat, .bm-reveal-card { animation: none; }
  .bm-reveal-hat { transform: translateY(8px) rotate(14deg); }
}

/* ---------- Missions ---------- */

.ms-hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ms-layout { display: grid; gap: 4px 20px; }
@media (min-width: 980px) { .ms-layout { grid-template-columns: 1fr 300px; align-items: start; } .ms-layout > aside { position: sticky; top: 84px; } }
.ms-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ms-card {
  display: grid; gap: 10px; align-content: start; padding: 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent);
}
.ms-card.is-done { border-top-color: var(--ok); }
.ms-card.is-pending { border-top-color: var(--sun); }
.ms-card.is-rejected, .ms-card.is-missed { border-top-color: var(--danger); opacity: 0.85; }
.ms-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.ms-sf { padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--sun) 18%, transparent); color: var(--text); white-space: nowrap; }
.ms-title { margin: 0; font: 800 1.2rem/1.25 "Bricolage Grotesque", sans-serif; }
.ms-desc { margin: 0; color: var(--muted); }
.ms-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ms-tags li { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 0.78rem; font-weight: 600; }
.ms-progress { position: relative; height: 26px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.ms-progress span { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--ok))); animation: grow 0.8s ease both; transform-origin: left; }
.ms-progress b { position: relative; display: block; text-align: center; font-size: 0.8rem; line-height: 24px; }
.ms-status { margin: 0; font-weight: 700; }
.ms-status.ok { color: var(--ok); }
.ms-status.warn { color: var(--amber); }
.ms-status.bad { color: var(--danger); }
.ms-file { display: grid; gap: 4px; font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.ms-foot { display: flex; gap: 14px; align-items: center; }
.ms-foot form { margin: 0; }
.ms-review { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sf-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sf-board li { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 6px; }
.sf-place { font-weight: 800; color: var(--faint); text-align: center; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); font-weight: 600; font-size: 0.9rem;
}
.seg label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); }
.seg input { width: auto; min-height: 0; margin: 0; accent-color: var(--accent); }
.form-row { display: grid; gap: 12px; grid-template-columns: 110px 1fr; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.check input { width: auto; min-height: 0; margin: 0; accent-color: var(--accent); }
.ms-dialog { width: min(94vw, 480px); }
.ms-dialog [hidden] { display: none; }

/* ---------- Sommerbingo (bingo.php, PEAK Sun) ---------- */

.bingo-phase {
  width: fit-content; max-width: 100%; margin: 10px 0 0; padding: 8px 12px; border-radius: 12px; font-size: 0.9rem; font-weight: 600;
  background: color-mix(in srgb, var(--sun) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sun) 40%, transparent);
}
.bingo-phase.is-after { background: var(--surface-2); border-color: var(--border); color: var(--muted); }
.bingo-layout { display: grid; gap: 16px; grid-template-areas: "card" "side" "pool"; }
.bingo-card { grid-area: card; padding: 12px; min-width: 0; }
.bingo-side { grid-area: side; display: grid; gap: 16px; align-content: start; min-width: 0; }
.bingo-pool-card { grid-area: pool; min-width: 0; }
[data-bingo-panel] { scroll-margin-top: 84px; }
@media (min-width: 480px) { .bingo-card { padding: 18px; } }
@media (min-width: 980px) {
  .bingo-layout { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "card side" "pool side"; align-items: start; }
  .bingo-side { position: sticky; top: 84px; }
}
.bingo-card-head { margin-bottom: 10px; }
.bingo-score { font-size: 0.85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.bingo-score b { color: var(--text); }
.bingo-score.is-full { color: var(--ok); font-weight: 800; }

.bingo-players { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 0 12px; padding: 2px; }
.bingo-players::-webkit-scrollbar { display: none; }
.bingo-chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-size: 0.85rem; font-weight: 600; text-decoration: none;
}
.bingo-chip:hover { background: var(--surface-3); }
.bingo-chip[aria-current] { border-color: var(--c, var(--accent)); box-shadow: inset 0 0 0 1px var(--c, var(--accent)); background: color-mix(in srgb, var(--c, var(--accent)) 16%, var(--surface-2)); }
.bingo-chip b { padding: 0 6px; border-radius: 999px; font-size: 0.75rem; background: color-mix(in srgb, var(--ok) 28%, transparent); }

/* The card: 5 × 5 still fits at 320 px – the labels shrink with the screen and the sheet holds the whole text. */
.bingo-grid {
  list-style: none; margin: 0 auto; padding: 0; max-width: 560px;
  display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: clamp(3px, 1.1vw, 8px);
}
.bingo-grid > li { min-width: 0; }
.bingo-cell {
  position: relative; width: 100%; aspect-ratio: 1; min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 3px;
  border: 1px solid var(--border); border-radius: clamp(8px, 2vw, 14px); background: var(--surface-2); color: var(--text);
  font: 600 clamp(0.55rem, 2.25vw, 0.78rem)/1.1 "Inter", sans-serif; text-align: center; cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease;
}
.bingo-cell:hover { background: var(--surface-3); }
.bingo-cell:active { transform: scale(0.95); }
.bingo-emoji { font-size: clamp(1rem, 5.2vw, 1.7rem); line-height: 1.1; }
.bingo-label {
  max-width: 100%; overflow: hidden; overflow-wrap: anywhere; hyphens: auto; line-height: 1.2; padding-bottom: 1px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.bingo-grid[style*="--n:3"] .bingo-label, .bingo-grid[style*="--n:4"] .bingo-label { -webkit-line-clamp: 3; line-clamp: 3; }
.bingo-cell::after { position: absolute; top: 2px; right: 4px; font-size: 0.85em; font-weight: 800; line-height: 1; }
.bingo-cell.is-free {
  border-color: color-mix(in srgb, var(--sun) 65%, transparent);
  background: linear-gradient(140deg, color-mix(in srgb, var(--sun) 50%, var(--surface-2)), color-mix(in srgb, var(--amber) 30%, var(--surface-2)));
}
.bingo-cell.is-approved { background: color-mix(in srgb, var(--ok) 22%, var(--surface-2)); border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.bingo-cell.is-approved::after { content: '✓'; color: var(--ok); }
.bingo-cell.is-pending { background: color-mix(in srgb, var(--sun) 14%, var(--surface-2)); border: 1px dashed color-mix(in srgb, var(--amber) 75%, transparent); }
.bingo-cell.is-pending::after { content: '⏳'; font-weight: 400; }
.bingo-cell.is-rejected { border-color: color-mix(in srgb, var(--danger) 65%, transparent); }
.bingo-cell.is-rejected::after { content: '✗'; color: var(--danger); }
.bingo-cell.in-line { box-shadow: inset 0 0 0 2px var(--ok), 0 0 12px color-mix(in srgb, var(--ok) 35%, transparent); }
.bingo-cell.is-approved.in-line { background: color-mix(in srgb, var(--ok) 36%, var(--surface-2)); }
.bingo-grid.is-blank .bingo-cell { display: grid; place-items: center; cursor: default; font-size: 1.2rem; opacity: 0.55; }
.bingo-empty { margin: 14px 0 0; text-align: center; color: var(--muted); }
.bingo-note { margin: 0 0 12px; font-size: 0.9rem; }
.bingo-tap-hint { margin: 10px 0 0; text-align: center; }

/* The field sheet: a bottom sheet on phones, a dialog on bigger screens. */
.bingo-sheet { width: min(94vw, 440px); max-height: 92vh; overflow-y: auto; }
.bingo-sheet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bingo-sheet-emoji { font-size: 2.6rem; line-height: 1; }
.bingo-sheet h2 { margin: 8px 0 6px; font-size: 1.3rem; }
.bingo-sheet-status { margin: 0 0 12px; font-weight: 700; color: var(--muted); }
.bingo-sheet-status.is-approved, .bingo-sheet-status.is-free { color: var(--ok); }
.bingo-sheet-status.is-pending { color: var(--amber); }
.bingo-sheet-status.is-rejected { color: var(--danger); }
.bingo-sheet-proof { margin: 0 0 12px; }
.bingo-sheet-proof img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; }
.bingo-sheet-proof figcaption { margin-top: 6px; color: var(--muted); font-style: italic; }
.bingo-sheet-form { padding-top: 12px; border-top: 1px dashed var(--border); }
.bingo-sheet .ms-review { margin-top: 4px; }
@media (max-width: 560px) {
  .bingo-sheet {
    width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; border-bottom: 0;
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }
  .bingo-sheet[open] { animation: sheet-up 0.25s ease both; }
}
@keyframes sheet-up { from { transform: translateY(48px); } }

.bingo-reviews { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bingo-review { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.bingo-review-proof img { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; }
.bingo-review-body p { margin: 0 0 6px; }
.bingo-review-who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.85rem; }
.bingo-review-who time { color: var(--faint); font-size: 0.78rem; }
.bingo-review-field { font-weight: 700; }
.bingo-review-note { color: var(--muted); font-size: 0.88rem; font-style: italic; }
.bingo-review > .ms-review { grid-column: 1 / -1; }
.bingo-review .btn-verdict, .bingo-sheet .btn-verdict { justify-content: center; }

.bingo-board-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.bingo-board-list li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 12px; }
.bingo-board-list li.is-me { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.bingo-board-list .row-person { min-width: 0; color: var(--text); text-decoration: none; }
.bingo-board-list .row-person b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bingo-board-list .row-person:hover b { color: var(--accent); }

.bingo-pool > summary { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; cursor: pointer; list-style: none; }
.bingo-pool > summary::-webkit-details-marker { display: none; }
.bingo-pool > summary h2::after { content: ' ▾'; color: var(--muted); font-size: 0.9em; }
.bingo-pool[open] > summary h2::after { content: ' ▴'; }
.bingo-pool[open] > summary { margin-bottom: 10px; }
.bingo-add { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: 8px 10px; align-items: end; margin: 12px 0 16px; }
.bingo-add .btn { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 640px) { .bingo-add { grid-template-columns: 90px minmax(0, 1fr) auto; } .bingo-add .btn { grid-column: auto; min-height: 44px; } }
.bingo-pool-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.bingo-pool-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); font-size: 0.9rem; }
.bingo-pool-emoji { flex: none; font-size: 1.3rem; }
.bingo-pool-text { flex: 1; min-width: 0; }
.bingo-pool-text small { display: block; color: var(--muted); }
.bingo-pool-list .link-btn { flex: none; font-size: 0.82rem; }
.bingo-pool-list.is-removed li { opacity: 0.7; }

/* The dashboard's card (index.php) */

/* BINGO! / FULDT HUS! (assets/js/bingo.js) – full screen, so the confetti can fall across it. */
.bingo-cheer {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 16px;
  border: 0; background: transparent; place-items: center; overflow: hidden;
}
.bingo-cheer[open] { display: grid; }
.bingo-cheer::backdrop { background: rgba(4, 18, 28, 0.72); backdrop-filter: blur(5px); }
.bingo-cheer-card {
  position: relative; z-index: 1; width: min(92vw, 380px); padding: 26px 22px; border-radius: 24px; text-align: center;
  background: var(--surface); color: var(--text); border: 2px solid var(--sun); box-shadow: var(--shadow);
  animation: cheer-in 0.5s cubic-bezier(.3, 1.5, .5, 1) both;
}
.bingo-cheer.is-full .bingo-cheer-card { border: 3px solid var(--ok); }
.bingo-cheer-balls { margin: 0; font-size: 2.4rem; letter-spacing: 0.12em; }
.bingo-cheer h2 { margin: 8px 0; font: 400 clamp(2.4rem, 13vw, 3.6rem)/1 "Bungee", "Bricolage Grotesque", sans-serif; color: var(--sun); }
.bingo-cheer.is-full h2 { font-size: clamp(2rem, 10vw, 3rem); color: var(--ok); }
.bingo-cheer-card p:not(.bingo-cheer-balls) { margin: 0 0 18px; color: var(--muted); }
@keyframes cheer-in { from { transform: scale(0.6) rotate(-4deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bingo-cheer-card, .bingo-sheet[open] { animation: none; }
  .bingo-cell { transition: none; }
}

/* ---------- Achievements ---------- */
/* Four rows before it scrolls (fitScrollList in app.js); a roomier cap until the script has measured. */
@keyframes holo-glow { 50% { box-shadow: inset 0 0 0 2px #5fd4f5, 0 0 16px color-mix(in srgb, #5fd4f5 60%, transparent); } }
/* One column on a phone: compact rows – smaller medal, one-line description, pips and progress side by side. */
@media (max-width: 520px) {
  /* "1 til Bronze på turen" sits after the bar; "Fuldendt" / "Kræver …" right after the pips. */
}
.award-box { margin-top: 14px; }
.award-box summary { cursor: pointer; font-weight: 700; }
.award-box form { margin-top: 14px; }
.award-box .form-row { grid-template-columns: 80px 1fr; }

/* ---------- Pisteavisen ---------- */
/* Three typefaces, three jobs: blackletter masthead, Playfair Display headlines, Source Serif 4 text.
   Meta and labels use the app's own Inter, small and tracked, so they read as secondary. */

.paper {
  --ink: #1b1915;
  --ink-soft: #3d3830;
  --faded: #776d60;
  --rule: #2a2520;
  --hair: #d8ccb6;
  --paper: #f7f2e7;
  --red: #b3261e;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --display: "Playfair Display", Georgia, serif;
  --meta: "Inter", system-ui, sans-serif;
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px) clamp(16px, 4.5vw, 48px) 20px;
  color: var(--ink);
  border-radius: 4px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(140% 120% at 50% 100%, rgba(170, 140, 90, 0.10), transparent 55%),
    var(--paper);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 0 0 1px rgba(60, 45, 20, 0.08), 0 24px 50px -18px rgba(0, 0, 0, 0.45);
  font-family: var(--serif);
}
/* A whisper of paper fibre – barely there, never a filter look. */
.paper::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.paper > * { position: relative; }

/* Masthead */
.paper-mast { text-align: center; margin-bottom: clamp(18px, 3vw, 28px); }
.paper-ears { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.paper-ear {
  display: grid; gap: 2px; margin: 0; padding: 6px 10px; text-align: left;
  border: 1px solid var(--hair); font: 500 0.68rem/1.35 var(--meta); color: var(--faded);
  letter-spacing: 0.08em; text-transform: uppercase; max-width: 46%;
}
.paper-ear b { color: var(--ink); font-weight: 700; }
.paper-ear-right { text-align: right; }
.paper-name {
  margin: clamp(6px, 1.5vw, 12px) 0 0;
  font: 400 clamp(2.8rem, 11vw, 5.8rem)/0.95 "UnifrakturMaguntia", "Old English Text MT", serif;
  color: var(--ink); letter-spacing: 0.005em;
}
.paper-motto { margin: 6px 0 12px; font: italic 500 clamp(0.85rem, 2vw, 1rem)/1.3 var(--display); color: var(--ink-soft); }
.paper-dateline {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0;
  padding: 7px 0; border-top: 3px double var(--rule); border-bottom: 1px solid var(--rule);
  font: 600 0.72rem/1.3 var(--meta); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft);
}
.paper-live { color: var(--red); }
.paper-live span { display: inline-block; animation: paper-blink 1.6s ease-in-out infinite; }
@keyframes paper-blink { 50% { opacity: 0.25; } }

/* Shared story parts */
.paper-kicker {
  display: inline-block; margin: 0 0 8px; padding: 3px 8px 2px;
  font: 700 0.66rem/1.2 var(--meta); letter-spacing: 0.14em; text-transform: uppercase;
  color: #fff; background: var(--red);
}
.paper-body { margin: 0; font-size: 1.04rem; line-height: 1.62; color: var(--ink); text-wrap: pretty; hyphens: auto; }
.paper-deck { margin: 0 0 12px; font: italic 500 clamp(1.05rem, 2.4vw, 1.3rem)/1.35 var(--display); color: var(--ink-soft); }
.paper-deck-sm { font-size: 0.98rem; margin-bottom: 8px; }
.paper-byline {
  margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--hair);
  font: 600 0.68rem/1.3 var(--meta); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faded);
}

/* Front: lead story + numbers box */
.paper-front { display: grid; gap: clamp(18px, 3vw, 30px); padding-bottom: clamp(18px, 3vw, 26px); border-bottom: 2px solid var(--rule); }
@media (min-width: 820px) { .paper-front:not(.is-solo) { grid-template-columns: minmax(0, 1fr) 240px; } }
.paper-headline {
  margin: 0 0 10px; font: 900 clamp(2rem, 6.2vw, 3.6rem)/1.02 var(--display);
  letter-spacing: -0.015em; color: var(--ink); text-wrap: balance;
}
.paper-photo { margin: 0 0 16px; }
.paper-photo img { display: block; width: 100%; max-height: 440px; object-fit: cover; filter: saturate(0.88) contrast(1.02); }
.paper-photo figcaption {
  margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--hair);
  font: italic 400 0.86rem/1.45 var(--serif); color: var(--ink-soft);
}
.paper-photo figcaption b { font-style: normal; font-weight: 600; }
.paper-photo figcaption span { font: 600 0.68rem var(--meta); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faded); font-style: normal; }
.paper-drop::first-letter {
  float: left; margin: 4px 8px 0 0; font: 900 3.9rem/0.78 var(--display); color: var(--ink);
}
@media (min-width: 640px) { .paper-lead .paper-body { font-size: 1.1rem; } }

.paper-numbers { align-self: start; border-top: 4px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0 12px; }
.paper-numbers h3 {
  margin: 0 0 10px; font: 700 0.72rem/1 var(--meta); letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink);
}
.paper-numbers dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0; }
.paper-numbers div { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--hair); }
.paper-numbers div:first-child { border-top: 0; }
.paper-numbers dt { font: 900 2.1rem/1 var(--display); color: var(--ink); font-variant-numeric: lining-nums tabular-nums; }
.paper-numbers dd { margin: 0; font: 500 0.78rem/1.3 var(--meta); color: var(--faded); }
@media (min-width: 820px) { .paper-numbers dl { grid-template-columns: 1fr; } }
@media (max-width: 819px) { .paper-numbers div { padding-right: 10px; } .paper-numbers div:nth-child(2) { border-top: 0; } }
.paper-source { margin: 10px 0 0; font: italic 400 0.75rem/1.35 var(--serif); color: var(--faded); }

/* More stories: a ruled grid that reflows from 3 columns to 1 */
.paper-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0 28px; padding-top: 18px;
}
.paper-story { padding: 4px 0 20px; border-bottom: 1px solid var(--hair); }
.paper-story h3 { margin: 0 0 6px; font: 800 clamp(1.2rem, 2.4vw, 1.45rem)/1.12 var(--display); color: var(--ink); text-wrap: balance; }
.paper-story .paper-body { font-size: 0.98rem; line-height: 1.55; }
.paper-story .paper-kicker { background: none; color: var(--red); padding: 0; letter-spacing: 0.16em; }
@media (min-width: 820px) {
  .paper-story.is-wide { grid-column: span 2; }
  .paper-story.is-wide h3 { font-size: 1.85rem; }
}

/* Short news */
.paper-briefs { margin-top: 18px; padding: 12px 16px 14px; background: rgba(42, 37, 32, 0.045); border-left: 4px solid var(--red); }
.paper-briefs h3 { margin: 0 0 8px; font: 700 0.72rem/1 var(--meta); letter-spacing: 0.16em; text-transform: uppercase; }
.paper-briefs ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.paper-briefs li { font-size: 0.95rem; line-height: 1.45; }
.paper-briefs li b { font: 700 0.68rem var(--meta); letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); }

/* A quiet day's gallery photos (PEAK, newspaper_facts()) */
.paper-gallery { margin-top: 18px; padding-top: 10px; border-top: 4px solid var(--rule); }
.paper-gallery h3 { margin: 0 0 10px; font: 700 0.72rem/1 var(--meta); letter-spacing: 0.16em; text-transform: uppercase; }
.paper-gallery ul { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 820px) { .paper-gallery ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.paper-gallery figure { margin: 0; }
.paper-gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: saturate(0.88) contrast(1.02); }
.paper-gallery figcaption {
  margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--hair);
  font: italic 400 0.84rem/1.4 var(--serif); color: var(--ink-soft); overflow-wrap: anywhere;
}
.paper-gallery figcaption span { display: block; font: 600 0.66rem var(--meta); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faded); font-style: normal; }

/* Quiet day */
.paper-quiet { text-align: center; padding: clamp(18px, 4vw, 34px) 0 clamp(20px, 4vw, 32px); border-bottom: 2px solid var(--rule); }
.paper-quiet .paper-deck, .paper-quiet .paper-body { max-width: 54ch; margin-left: auto; margin-right: auto; }
.paper-quiet .paper-body { color: var(--ink-soft); }
/* The AI edition is late (PEAK): the newsroom's apology in the paper's own voice, rotating like the pre-trip remarks */
.paper-late .paper-late-text { max-width: 40ch; margin: 8px auto 10px; font-style: italic; font-weight: 600; }

/* Footer */
.paper-foot {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: 18px; padding-top: 10px;
  border-top: 3px double var(--rule); font: 600 0.78rem var(--meta);
}
.paper-foot a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.paper-fine { text-align: center; font: italic 400 0.82rem/1.4 var(--serif); color: var(--faded); }
@media (max-width: 560px) {
  .paper-ears { flex-direction: column; align-items: stretch; gap: 6px; }
  .paper-ear { max-width: none; display: flex; justify-content: space-between; gap: 8px; }
  .paper-ear-right { text-align: left; }
  .paper-dateline { justify-content: center; text-align: center; }
  .paper-foot { grid-template-columns: 1fr 1fr; }
  .paper-fine { grid-column: 1 / -1; order: 3; }
  .paper-foot a:last-child { text-align: right; }
}
@media (prefers-reduced-motion: reduce) { .paper-live span { animation: none; } }

.paper-archive { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.paper-archive a {
  display: grid; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.88rem;
}
.paper-archive a small { color: var(--muted); }
.paper-archive a[aria-current="page"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

/* ---------- Front page and overview: Dagens ---------- */
.glory-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: start; }
.ach-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ach-recent li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: center; font-size: 0.9rem; }
.ach-recent small { display: block; color: var(--faint); font-size: 0.75rem; }
.ach-emoji { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--border); }
.ach-emoji.tier-1 { box-shadow: inset 0 0 0 2px #c27a3a; }
.ach-emoji.tier-2 { box-shadow: inset 0 0 0 2px #a9b4c4; }
.ach-emoji.tier-3 { box-shadow: inset 0 0 0 2px #e2b53c; }
.ach-emoji.tier-4 { box-shadow: inset 0 0 0 2px #5fd4f5; }
.ach-emoji.tier-0 { box-shadow: inset 0 0 0 2px #b18cff; }

/* ---------- Scroll lists (max 8 visible: feed, members, missions) ---------- */

.scroll-list {
  position: relative;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 45%, transparent) transparent;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}
/* Before the script has measured (or without it): a sensible cap. */
.scroll-list:not([style*="max-height"]) { max-height: 20rem; }
.scroll-list.is-scrollable { padding-right: 4px; }
.scroll-list.has-more {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
}
.scroll-list::-webkit-scrollbar { width: 8px; }
.scroll-list::-webkit-scrollbar-track { background: transparent; }
.scroll-list::-webkit-scrollbar-thumb {
  border: 2px solid transparent; border-radius: 999px; background-clip: padding-box;
  background-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.scroll-list::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--accent) 65%, transparent); }
/* Card grids keep room for their shadows and focus rings inside the scroll box. */
.ms-grid.scroll-list { padding: 4px 6px 6px 2px; margin: -4px -6px -6px -2px; }

/* ---------- +1 øl: instant feedback ---------- */

.big-btn.is-sending .big-emoji { animation: beer-wobble 0.5s ease-in-out infinite alternate; }
@keyframes beer-wobble { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
.plus-one {
  position: absolute; left: calc(50% + var(--x, 0px)); top: 34%; z-index: 2; pointer-events: none;
  font: 800 1.35rem/1 "Bricolage Grotesque", sans-serif; color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  animation: plus-one 0.9s ease-out forwards;
}
@keyframes plus-one {
  from { opacity: 0; transform: translate(-50%, 6px) scale(0.7); }
  20% { opacity: 1; transform: translate(-50%, -6px) scale(1.1); }
  to { opacity: 0; transform: translate(-50%, -48px) scale(1); }
}
.today-list li.is-bumped .today-beers b { display: inline-block; animation: count-pop 0.45s ease; }
@keyframes count-pop { 40% { transform: scale(1.45); color: var(--amber); } }

/* ---------- Language links ---------- */

.lang-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; margin-top: 10px; font-size: 0.82rem; }
.lang-links a { color: var(--muted); text-decoration: none; padding: 2px 4px; border-radius: 6px; }
.lang-links a:hover { color: var(--text); }
.lang-links a[aria-current] { color: var(--accent); font-weight: 700; }
.card .lang-links { justify-content: flex-start; margin: 0 0 12px; }

/* ---------- Trophy tiers that need a longer trip, and the history list ---------- */
.ach-history { margin-top: 14px; }
.ach-history summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.ach-history ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.ach-history li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 0.9rem; }
.ach-history li small { color: var(--muted); flex-basis: 100%; }
@media (min-width: 640px) { .ach-history li small { flex-basis: auto; margin-left: auto; } }

/* ---------- Alibi dialog (Dagens Bummert) ---------- */

.alibi-dialog { width: min(94vw, 520px); }
.alibi-dialog textarea { font: italic 500 1.02rem/1.5 "Source Serif 4", Georgia, serif; }
.alibi-dialog textarea.is-fresh { animation: alibi-fresh 0.5s ease; }
@keyframes alibi-fresh { from { opacity: 0.2; transform: translateY(4px); } }
.paper-quote { margin: 16px 0 0; padding: 12px 0 12px 18px; border-left: 3px solid var(--red); }
.paper-quote p { margin: 0; font: italic 600 clamp(1.05rem, 2.3vw, 1.3rem)/1.4 var(--display); color: var(--ink); }
.paper-quote cite { display: block; margin-top: 6px; font: 600 0.68rem var(--meta); font-style: normal; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faded); }
.paper-quote-sm p { font-size: 0.98rem; }

/* ---------- Terms, privacy and reports ---------- */

.accept-terms { align-items: flex-start; font-weight: 500; line-height: 1.4; }
.accept-terms input { margin-top: 3px; }
.auth-legal { margin: 10px 0 0; text-align: center; font-size: 0.8rem; color: var(--muted); }
.auth-legal a { color: var(--muted); }
.legal { max-width: 46rem; margin: 0 auto; display: grid; gap: 18px; }
.legal h1 { margin-bottom: 4px; }
.legal h2 { font-size: 1.15rem; margin: 6px 0 0; }
.legal p, .legal ul, .legal ol { margin: 0; color: var(--text); max-width: 65ch; }
.legal ul, .legal ol { padding-left: 1.2em; display: grid; gap: 4px; }
.legal .updated { color: var(--muted); font-size: 0.85rem; }
.legal-accept { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--accent); display: grid; gap: 10px; }
.report-btn { color: var(--faint); }
.report-btn:hover { color: var(--danger); }
.report-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.report-list li { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.report-list .report-meta { font-size: 0.82rem; color: var(--muted); }
.report-list form { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.report-dialog { width: min(94vw, 420px); }
.report-dialog .pick-row { gap: 6px; }

/* File inputs dressed as buttons (file_picker() in app/views.php) */
.file-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.file-pick .file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.file-pick-name { color: var(--muted); font-size: 0.85rem; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.file-pick-name.has-files { color: var(--text); }

/* ---------- Tidsmaskine (local dev only, app/devclock.php) ---------- */

.dev-clock {
  position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60;
  max-width: min(92vw, 420px); font-size: 0.82rem;
}
.dev-clock summary {
  list-style: none; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; padding: 7px 12px;
  border-radius: 999px; background: var(--surface-2); border: 1px dashed var(--border); color: var(--muted);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.25);
}
.dev-clock summary::-webkit-details-marker { display: none; }
.dev-clock summary b { color: var(--text); }
.dev-clock.is-shifted summary { border: 1px solid var(--sun); background: color-mix(in srgb, var(--sun) 16%, var(--surface-2)); }
.dev-clock.is-shifted summary span { color: var(--sun); font-weight: 700; }
.dev-clock-panel {
  margin-top: 8px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  display: grid; gap: 8px; box-shadow: 0 12px 30px rgb(0 0 0 / 0.35);
}
.dev-clock-note { margin: 0; color: var(--muted); font-size: 0.78rem; }
.dev-clock-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.dev-clock-row button, .dev-clock-reset {
  font: inherit; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); cursor: pointer;
}
.dev-clock-row button:hover, .dev-clock-reset:hover:not(:disabled) { border-color: var(--accent); }
.dev-clock-row input { flex: 1; min-width: 0; min-height: 0; padding: 5px 8px; font-size: 0.82rem; }
.dev-clock-reset:disabled { opacity: 0.5; cursor: default; }

/* ---------- First Class (abonnement.php) ---------- */

.tier-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tier-line a { font-size: 0.85rem; font-weight: 600; }
.sub-page { max-width: 960px; margin: 0 auto; display: grid; gap: 28px; }
.sub-hero h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; margin: 2px 0 10px; }
.sub-hero p { max-width: 60ch; margin: 0; }
.sub-first {
  background: linear-gradient(100deg, var(--sun), color-mix(in srgb, var(--sun) 55%, var(--accent)));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub-status {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
}
.sub-status p { margin: 0; flex: 1 1 260px; }
.sub-status.is-first { border-color: color-mix(in srgb, var(--sun) 55%, transparent); background: color-mix(in srgb, var(--sun) 8%, var(--surface)); }

/* Each plan is a small boarding pass: coloured band, paper body, perforated stub. */
.sub-ticket {
  --band: var(--accent);
  --paper: #fbf8f1; --ink: #14203f; --ink-2: #5d6886;
  --notch: 13px;
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 74px; grid-template-rows: auto 1fr;
  border-radius: 18px; overflow: hidden; cursor: pointer; color: var(--ink); background: var(--paper);
  -webkit-mask:
    radial-gradient(circle var(--notch) at calc(100% - 74px) 0, #0000 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at calc(100% - 74px) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  mask:
    radial-gradient(circle var(--notch) at calc(100% - 74px) 0, #0000 98%, #000) top / 100% 51% no-repeat,
    radial-gradient(circle var(--notch) at calc(100% - 74px) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  box-shadow: var(--shadow); transition: transform 0.2s ease, filter 0.2s ease, outline-color 0.2s ease;
  outline: 3px solid transparent; outline-offset: 3px; filter: saturate(0.75);
}
.sub-ticket.is-best { --band: var(--sun); }
.sub-ticket input { position: absolute; opacity: 0; pointer-events: none; }
.sub-ticket:hover { transform: translateY(-2px); filter: none; }
.sub-ticket:has(input:checked) { filter: none; transform: translateY(-3px); }
.sub-ticket:has(input:focus-visible) { outline-color: var(--accent); }
.sub-ticket-head {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px;
  background: linear-gradient(120deg, var(--band), color-mix(in srgb, var(--band) 55%, #0b1020)); color: #fff;
}
.sub-ticket-airline { font: 700 0.72rem/1 "Inter", sans-serif; text-transform: uppercase; letter-spacing: 0.16em; }
.sub-best { font: 800 0.7rem/1 "Inter", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #6b4500; }
.sub-ticket-body { display: grid; gap: 4px; align-content: start; padding: 16px 16px 18px; }
.sub-plan-name { font: 700 0.75rem/1 "Inter", sans-serif; text-transform: uppercase; letter-spacing: 0.12em; color: var(--ink-2); }
.sub-price { font-family: "Bricolage Grotesque", sans-serif; }
.sub-price b { font-size: clamp(2.2rem, 7vw, 2.8rem); font-weight: 800; line-height: 1; }
.sub-price small { font-size: 1rem; color: var(--ink-2); font-weight: 600; }
.sub-note { font-size: 0.85rem; color: var(--ink-2); }
.sub-save { justify-self: start; margin-top: 6px; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: #e7f6ec; color: #136c35; }
.sub-save.is-muted { background: rgba(20, 32, 63, 0.07); color: var(--ink-2); font-weight: 600; }
.sub-ticket-stub {
  grid-row: 2; grid-column: 2; display: grid; place-items: center; align-content: center; gap: 10px; padding: 12px 6px;
  border-left: 2px dashed rgba(20, 32, 63, 0.2); font: 700 0.62rem/1.2 "Inter", sans-serif; letter-spacing: 0.1em; color: var(--ink-2);
  writing-mode: vertical-rl; text-orientation: mixed;
}
.sub-check {
  writing-mode: horizontal-tb; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid rgba(20, 32, 63, 0.25); color: transparent; font-size: 1rem; transition: all 0.2s ease;
}
.sub-ticket:has(input:checked) .sub-check { background: var(--band); border-color: var(--band); color: #fff; }
.sub-ticket:has(input:checked) { box-shadow: inset 0 0 0 3px var(--band), var(--shadow); }

.sub-summary {
  margin-top: 18px; display: grid; gap: 10px; justify-items: start; padding: 16px 18px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border);
}
.sub-summary p { margin: 0; }
.sub-buy { min-width: 220px; }
.sub-buy:disabled { opacity: 1; cursor: not-allowed; box-shadow: none; background: var(--surface-3); color: var(--muted); border: 1px dashed var(--border); }
.sub-soon { margin: 0; font-size: 0.85rem; color: var(--muted); }

.sub-section { display: grid; gap: 4px; }
.sub-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 680px) { .sub-perks { grid-template-columns: 1fr 1fr; } }
.sub-perks li { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.sub-perks li > span { font-size: 1.4rem; line-height: 1.2; }
.sub-perks small, .sub-ranks small { display: block; color: var(--muted); font-size: 0.85rem; }
.sub-compare { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 14px; overflow: hidden; }
.sub-compare th, .sub-compare td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.sub-compare thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.sub-compare td { text-align: center; white-space: nowrap; }
.sub-compare td[colspan] { white-space: normal; color: var(--muted); }
.sub-compare td small { color: var(--muted); }
.sub-compare tbody th { font-weight: 600; }
.sub-ranks { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
@media (min-width: 680px) { .sub-ranks { grid-template-columns: 1fr 1fr; } }
.sub-ranks li { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); }
.sub-ranks li > span { grid-row: 1 / 3; font-size: 1.3rem; }

.sub-page .table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }

/* Business (one app) and First Class (both apps): which apps the account has, its subscriptions, the choice. */
.sub-apps { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 100%; margin: 0; }
.sub-app {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px dashed var(--border);
}
.sub-app.is-on { color: var(--text); border-style: solid; border-color: color-mix(in srgb, var(--ok) 60%, transparent); background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.sub-locked { margin: 0; }
.sub-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sub-list li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
}
.sub-list small { display: block; color: var(--muted); font-size: 0.85rem; }
.sub-class-name { display: flex; align-items: center; gap: 8px; font: 700 0.75rem/1 "Inter", sans-serif; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); }
.sub-slogan { font: 800 clamp(1.25rem, 4vw, 1.6rem)/1.1 "Bricolage Grotesque", sans-serif; text-transform: uppercase; letter-spacing: 0.01em; }
.sub-both { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-both span { padding: 4px 10px; border-radius: 999px; font-weight: 700; font-size: 0.9rem; background: var(--surface-2); }

/* Four tickets, one choice: a row per class with its heading, 1 month left and 1 year right (stacked on a phone). */
.sub-grid { display: grid; gap: 14px 16px; }
@media (min-width: 680px) { .sub-grid { grid-template-columns: 1fr 1fr; } }
.sub-row-head { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; }
.sub-row-head:first-child { margin-top: 0; }
.sub-row-head small { flex: 1 1 100%; color: var(--muted); font-size: 0.85rem; }
.sub-row-head .sub-best { background: var(--sun); color: #3d2600; }
.sub-row-title { font: 800 1.15rem/1.2 "Bricolage Grotesque", sans-serif; }

/* First Class has nothing to buy: the tickets behind "Se billetterne", to look at only. */
.sub-preview > summary { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 700; background: var(--surface); border: 1px solid var(--border); list-style: none; }
.sub-preview > summary::-webkit-details-marker { display: none; }
.sub-preview > summary::after { content: "▾"; transition: transform .2s ease; }
.sub-preview[open] > summary::after { transform: rotate(180deg); }
.sub-preview[open] { display: grid; gap: 12px; }
.sub-preview .sub-ticket { cursor: default; filter: none; }
.sub-preview .sub-ticket:hover { transform: none; }

/* First Class: a black boarding pass with gold – a blue edge for a month, a gold one for a year. Same in both
   themes and on both sites: it's the top of the range. */
.sub-ticket.is-first {
  --gold: #d8b45c; --gold-2: #f3dc94; --edge: #5fb0ff;
  --ink: #f4ecd8; --ink-2: #bcb093;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(216, 180, 92, 0.16), transparent 55%),
    linear-gradient(150deg, #1d1d23 0%, #0c0c0f 55%, #19150b 100%);
  filter: none;
  box-shadow: inset 0 0 0 2px var(--edge), 0 10px 28px rgba(0, 0, 0, 0.32);
}
.sub-ticket.is-first.is-yearly { --edge: var(--gold); }
.sub-ticket.is-first > span { position: relative; z-index: 1; }
.sub-ticket.is-first .sub-ticket-head { background: none; color: var(--gold-2); border-bottom: 1px solid rgba(216, 180, 92, 0.32); padding: 12px 16px; }
.sub-ticket.is-first .sub-ticket-airline { display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; letter-spacing: 0.24em; }
.sub-plane-mini { width: 16px; height: 16px; color: var(--gold); transform: rotate(45deg); }
/* A foil gleam across the pass on hover and when it's picked. */
.sub-ticket.is-first::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(243, 220, 148, 0.16) 45%, transparent 60%);
  transform: translateX(-100%); transition: transform 0.9s ease;
}
.sub-ticket.is-first:hover::before, .sub-ticket.is-first:has(input:checked)::before { transform: translateX(100%); }
@media (prefers-reduced-motion: reduce) { .sub-ticket.is-first::before { display: none; } }
.sub-pass-label { font: 700 0.64rem/1 "Inter", sans-serif; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-2); }
.sub-ticket.is-first .sub-best { background: linear-gradient(120deg, var(--gold-2), var(--gold)); color: #2b1e00; }
.sub-ticket.is-first .sub-plan-name { color: var(--gold); }
.sub-ticket.is-first .sub-price b {
  background: linear-gradient(100deg, var(--gold-2), var(--gold) 70%); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub-ticket.is-first .sub-save { background: rgba(216, 180, 92, 0.16); color: var(--gold-2); }
.sub-ticket.is-first .sub-save.is-muted { background: rgba(255, 255, 255, 0.08); color: var(--ink-2); }
.sub-fields { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(216, 180, 92, 0.32); }
.sub-fields > span { display: grid; gap: 3px; }
.sub-fields small { font: 700 0.58rem/1 "Inter", sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }
.sub-fields b { font: 700 0.85rem/1.1 "Inter", sans-serif; letter-spacing: 0.04em; color: var(--ink); }
.sub-plane { position: absolute; right: 84px; top: 44px; width: 104px; height: 104px; color: var(--gold); opacity: 0.1; transform: rotate(45deg); pointer-events: none; }
.sub-ticket.is-first .sub-ticket-stub { border-left-color: rgba(216, 180, 92, 0.45); color: var(--gold); }
.sub-ticket.is-first .sub-check { border-color: rgba(216, 180, 92, 0.5); }
.sub-ticket.is-first:has(input:checked) .sub-check { background: var(--edge); border-color: var(--edge); color: #0c0c0f; }
.sub-ticket.is-first:has(input:checked) {
  box-shadow: inset 0 0 0 3px var(--edge), 0 0 0 1px var(--edge), 0 14px 36px color-mix(in srgb, var(--edge) 38%, transparent);
}
.test-checkout { max-width: 560px; margin: 24px auto; display: grid; gap: 10px; border: 2px dashed var(--amber); }
.test-checkout h1 { margin: 0; }
.test-checkout .row-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cell-btn.is-locked { cursor: default; }

/* ---------- Settings (indstillinger.php) and News (nyheder.php) ---------- */
.settings-page, .news-page { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; }
.settings-hero h1 { margin: 4px 0 6px; }
.settings-hero p { margin: 0; }
.settings-card { display: grid; gap: 12px; }
.settings-card .card-head h2 { font-size: 1.05rem; }
.settings-options { display: flex; flex-wrap: wrap; gap: 10px; }
.settings-option {
  display: grid; gap: 2px; min-width: 130px; padding: 12px 16px; border-radius: 14px; text-align: left; cursor: pointer;
  background: var(--surface-2); color: var(--text); border: 2px solid var(--border); font: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.settings-option:hover { transform: translateY(-1px); }
.settings-option[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.settings-option small { color: var(--accent); font-weight: 700; font-size: 0.78rem; }
.settings-toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.settings-toggle input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.settings-toggle small { display: block; color: var(--muted); font-size: 0.85rem; }
.settings-version { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.settings-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.settings-links a { display: inline-flex; align-items: center; gap: 6px; }
.settings-links .icon { width: 16px; height: 16px; }
/* Notifications (push.js) */
.push-device { display: grid; gap: 10px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.push-status { margin: 0; font-weight: 600; }
.push-card[data-push-state="on"] .push-status::before { content: "🔔 "; }
.push-card[data-push-state="off"] .push-status::before { content: "🔕 "; }
.push-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.push-actions:not(:has(button:not([hidden]))) { display: none; }
.push-sub { margin: 6px 0 0; font-size: 0.95rem; }
.push-kinds { display: grid; gap: 12px; }
.push-devices { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.push-devices li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.push-devices li:first-child { border-top: 0; }
.push-devices small { display: block; color: var(--muted); font-size: 0.82rem; }
.push-devices form { margin: 0; }
.news-dot { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--sun); vertical-align: middle; }
.news-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
  color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--sun) 22%, var(--surface-2)); border: 1px solid var(--sun);
}
.release { display: grid; gap: 6px; }
.release.is-latest { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.release-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 0.88rem; }
.release-version { font: 800 1.05rem/1 "Bricolage Grotesque", sans-serif; color: var(--text); }
.release h2 { margin: 2px 0 4px; font-size: 1.2rem; }
.release-kind { margin: 10px 0 2px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.release-list { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
@media (max-width: 440px) { .news-chip { padding: 4px 8px; } }

/* What a beer counts for right now (app/periods.php) – top of the logger card. */
.period-line { margin: 0 0 10px; font-size: 0.85rem; color: var(--muted); }
.period-chip {
  display: inline-block; margin-right: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase; background: var(--surface-3); color: var(--text);
}
.period-line.is-warmup .period-chip { background: color-mix(in srgb, var(--amber) 30%, var(--surface-2)); }
.period-line.is-trip .period-chip { background: color-mix(in srgb, var(--ok) 30%, var(--surface-2)); }

/* Before the trip / on the trip (bummerts, propaganda). */
.phase-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 6px; }
.phase-tabs a { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 600; font-size: 0.88rem; border: 1px solid var(--border); }
.phase-tabs a[aria-current] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.phase-chip { justify-self: start; display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; background: var(--surface-3); color: var(--muted); }
.phase-chip.is-before { background: color-mix(in srgb, var(--amber) 25%, var(--surface-2)); color: var(--text); }
.phase-chip.is-trip { background: color-mix(in srgb, var(--ok) 25%, var(--surface-2)); color: var(--text); }
.phase-note { margin: 6px 0 10px; font-size: 0.88rem; color: var(--muted); }

/* Konkurrencemissioner (app/contests.php). */
.ms-card.is-contest { border-color: color-mix(in srgb, var(--sun) 45%, var(--border)); }
.contest-board { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.contest-board li { display: grid; grid-template-columns: 2.2em 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.contest-board li.is-lead { background: color-mix(in srgb, var(--sun) 18%, var(--surface-2)); box-shadow: inset 3px 0 0 var(--sun); }
.contest-board li.is-me b { color: var(--accent); }
.cb-place { text-align: center; font-weight: 800; color: var(--muted); }

/* ---------- Gruppechat (chat.php) ---------- */
.chat { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: calc(100dvh - 230px); min-height: 380px; padding-bottom: 12px; }
@media (min-width: 760px) { .chat { height: calc(100dvh - 200px); } }
.chat-title { font-size: 1.15rem; margin: 0; }
.chat-scroll { overflow-y: auto; overscroll-behavior: contain; padding: 4px 2px 8px; }
.chat-older { display: block; margin: 0 auto 10px; }
.chat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chat-day { justify-self: center; margin: 10px 0 4px; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.chat-day::first-letter { text-transform: uppercase; }
.chat-msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.chat-msg.is-mine { margin-left: auto; flex-direction: row-reverse; }
.chat-bubble { padding: 8px 12px; border-radius: 16px 16px 16px 6px; background: var(--surface-2); border: 1px solid var(--border); min-width: 0; }
.chat-msg.is-mine .chat-bubble { border-radius: 16px 16px 6px 16px; background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.chat-name { display: block; font-size: 0.78rem; color: var(--accent); margin-bottom: 2px; }
.chat-text { margin: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.chat-text a { color: inherit; text-decoration: underline; }
.chat-msg.is-deleted .chat-text { color: var(--muted); }
.chat-form { display: flex; gap: 8px; align-items: flex-end; padding-top: 8px; border-top: 1px solid var(--border); }
.chat-form textarea {
  flex: 1; min-height: 42px; max-height: 160px; resize: none; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; line-height: 1.35;
}
/* Pictures, GIFs and stickers (app/chat_media.php): round tools left of the field – while you type only "+" stays –
   the pickers and the picture waiting to be sent above it, and the media inside the bubbles. */
.chat-tools { display: flex; gap: 6px; align-items: flex-end; flex: none; }
.chat-tool { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; list-style: none; }
.chat-tool::-webkit-details-marker { display: none; }
.chat-tool .icon { width: 20px; height: 20px; }
.chat-tool-gif span { font: 800 0.72rem/1 "Inter", sans-serif; letter-spacing: 0.02em; padding: 3px 4px; border: 2px solid currentColor; border-radius: 6px; }
.chat-tool:focus-visible, label.chat-tool:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.chat-tool[aria-expanded="true"] { background: var(--text); color: var(--surface); }
.chat-form:has(textarea:not(:placeholder-shown)) .chat-tools > :not(.chat-more) { display: none; }
@media (max-width: 600px) {
  .chat-form:has(textarea:focus) .chat-tools > :not(.chat-more), .chat-tool-image { display: none; } /* "+" holds them all */
}
.chat-form:has(.chat-tools) textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-more { position: relative; }
.chat-more-menu { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 5; display: grid; gap: 2px; min-width: 190px; padding: 6px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
.chat-more-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border: 0; border-radius: 10px; background: none;
  color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.chat-gif-mark { font: 800 0.62rem/1 "Inter", sans-serif; padding: 2px 3px; border: 2px solid currentColor; border-radius: 5px; }
.chat-more-item:hover, .chat-more-item:focus-within, .chat-more-item:focus-visible { background: var(--surface-2); outline: none; }
.chat-more-item .icon { width: 20px; height: 20px; }
.chat-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); grid-auto-rows: max-content; gap: 4px; max-height: 236px; overflow-y: auto;
  margin-top: 8px; padding: 8px; border-radius: 14px; background: var(--surface-2); overscroll-behavior: contain; }
.chat-picker-gif { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); }
.chat-pick { display: grid; place-items: center; min-height: 44px; padding: 4px; border: 0; border-radius: 12px; background: none; cursor: pointer; }
.chat-pick img { display: block; width: 64px; height: 64px; }
.chat-picker-gif .chat-pick img { width: 120px; height: 90px; border-radius: 8px; }
.chat-pick:hover, .chat-pick:focus-visible { background: var(--surface); }
.chat-attach { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 8px; border-radius: 14px; background: var(--surface-2); font-size: 0.85rem; }
.chat-attach img { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 10px; }
.chat-attach span { flex: 1; min-width: 0; color: var(--muted); }
.chat-msg.is-sticker .chat-bubble { padding: 0; border: 0; background: none; }
.chat-msg.is-sticker .chat-name { padding-left: 4px; }
.chat-sticker { display: block; width: 120px; height: 120px; }
.chat-msg.is-gif .chat-bubble, .chat-msg.is-image .chat-bubble { padding: 4px; }
.chat-msg.is-gif .chat-name, .chat-msg.is-image .chat-name { padding: 2px 6px 4px; }
.chat-msg.is-image .chat-text { padding: 6px 8px 2px; }
.chat-gif { display: block; width: 240px; max-width: 100%; height: auto; border-radius: 12px; }
.chat-photo { display: block; }
.chat-photo img { display: block; width: 280px; max-width: 100%; height: auto; border-radius: 12px; background: var(--surface-2); }
@media (max-width: 420px) { .chat-tool { width: 36px; height: 36px; } .chat-tools { gap: 4px; } .chat-picker { max-height: 200px; } }

/* Chat backgrounds (app/chat.php CHAT_BACKGROUNDS): the message area gets a picture or a colour; the bubbles
   stay solid so the text reads the same. In the dark theme the pictures are dimmed a little. */
.chat-bg-btn { margin-left: auto; font-size: 1.05rem; }
.chat .card-head { flex-wrap: wrap; }
.chat-wall { --wall-dim: 0; background-color: var(--wall-color, transparent); }
:root[data-theme="dark"] .chat-wall { --wall-dim: .28; }
.chat-wall:not(.chat-wall--standard) { border-radius: 14px; padding: 10px 8px; }
.chat-wall[class*="chat-wall--"]:not(.chat-wall--standard) .chat-bubble { box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.chat-wall:not(.chat-wall--standard) .chat-day,
.chat-wall:not(.chat-wall--standard) .chat-empty,
.chat-wall:not(.chat-wall--standard) .chat-older { background: var(--surface); color: var(--text); border-radius: 999px; padding: 4px 12px; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); }
.chat-wall:not(.chat-wall--standard) .chat-empty { justify-self: center; max-width: 34ch; text-align: center; border-radius: 14px; margin: 24px auto; }
.chat-wall--pool, .chat-wall--beach, .chat-wall--party, .chat-wall--summit, .chat-wall--forest, .chat-wall--apres, .chat-wall--foam {
  background-image: linear-gradient(rgba(4, 10, 20, var(--wall-dim)), rgba(4, 10, 20, var(--wall-dim))), var(--wall-img);
  background-size: cover; background-position: center;
}
.chat-wall--pool { --wall-img: url("/assets/img/chat/pool.svg"); --wall-color: #45c6d4; }
.chat-wall--beach { --wall-img: url("/assets/img/chat/beach.svg"); --wall-color: #f4d9a7; background-position: center top; }
.chat-wall--party { --wall-img: url("/assets/img/chat/party.svg"); --wall-color: #141c3a; }
.chat-wall--summit { --wall-img: url("/assets/img/chat/summit.svg"); --wall-color: #fbd7a6; }
.chat-wall--forest { --wall-img: url("/assets/img/chat/forest.svg"); --wall-color: #9fc0c4; }
.chat-wall--apres { --wall-img: url("/assets/img/chat/apres.svg"); --wall-color: #8cc1f2; }
.chat-wall--foam { --wall-img: url("/assets/img/chat/foam.svg"); --wall-color: #f7b416; background-position: center top; }
.chat-wall--beer {
  --wall-color: #ead8a0;
  background-image: linear-gradient(rgba(4, 10, 20, var(--wall-dim)), rgba(4, 10, 20, var(--wall-dim))), url("/assets/img/chat/beer.svg");
  background-size: auto, 220px; background-repeat: repeat;
}
.chat-wall--night { --wall-color: #101b30; }
.chat-wall--sea { --wall-color: #0e5e6f; }
.chat-wall--pine { --wall-color: #1f4d36; }
.chat-wall--sunset { --wall-color: #e8775a; }
.chat-wall--sand { --wall-color: #eedcb6; }
.chat-wall--heather { --wall-color: #7b6cc4; }
.chat-wall--slate { --wall-color: #3b4250; }
.chat-wall--rose { --wall-color: #d6618a; }
.chat-bg-swatch.chat-wall--standard { --wall-color: var(--surface-2); }

.chat-bg-dialog { width: min(560px, calc(100vw - 24px)); max-height: min(88dvh, 760px); overflow-y: auto; }
.chat-bg-dialog h2 { margin: 0; }
.chat-bg-set { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.chat-bg-set legend { font: 700 0.75rem/1 "Inter", sans-serif; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 8px; }
.chat-bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.chat-bg-option { position: relative; display: grid; gap: 4px; justify-items: center; cursor: pointer; }
.chat-bg-option input { position: absolute; opacity: 0; pointer-events: none; }
.chat-bg-swatch { display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 12px; border: 2px solid var(--border); padding: 0; --wall-dim: 0; transition: transform 0.15s ease, border-color 0.15s ease; }
.chat-bg-swatch.chat-wall--beer { background-size: auto, 90px; }
.chat-bg-option:hover .chat-bg-swatch { transform: translateY(-2px); }
.chat-bg-option input:checked + .chat-bg-swatch { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.chat-bg-option input:focus-visible + .chat-bg-swatch { outline: 3px solid var(--accent); outline-offset: 2px; }
.chat-bg-name { font-size: 0.8rem; font-weight: 600; text-align: center; }
.chat-bg-option input:checked ~ .chat-bg-name { color: var(--accent); }

.chat-new-pill {
  position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); padding: 6px 14px; border-radius: 999px; border: 0;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: var(--shadow); cursor: pointer;
}
.live-pill {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 70px); transform: translateX(-50%); z-index: 80;
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--accent); background: var(--surface); color: var(--text);
  font-weight: 700; box-shadow: var(--shadow); cursor: pointer;
}

/* Find a group (grupper.php) and requests (gruppe.php). */
.group-results { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.group-results li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.group-results small { display: block; color: var(--muted); font-size: 0.82rem; }
.group-results .row-person { display: flex; align-items: center; gap: 10px; }

/* Pisteavisen before the trip: the editors' rotating remarks. */
.paper-pretrip { margin: 0 0 18px; padding: 14px 18px; border-top: 3px double currentColor; border-bottom: 1px solid currentColor; text-align: center; }
.paper-pretrip .paper-kicker { justify-content: center; }
.paper-pretrip-text { margin: 4px auto 0; max-width: 46ch; font: italic 600 clamp(1.05rem, 3.4vw, 1.35rem)/1.45 "Playfair Display", Georgia, serif; min-height: 4.3em; }
[data-rotate] { transition: opacity 0.45s ease, transform 0.45s ease; }
[data-rotate].is-swapping { opacity: 0; transform: translateY(4px); }
@media (prefers-reduced-motion: reduce) { [data-rotate] { transition: none; } }

/* Wrapped (app/wrapped.php): the link on Oversigt once the trip's last evening has come.
   The stories themselves are in wrapped.css (loaded only on /wrapped). */
.wrapped-link { margin-top: 4px; }

/* ---------- Solkulør – the Tan Tracker (PEAK Sun; app/tan.php) ----------
   One sun scale for everyone – sand, gold, bronze, copper – read as "how much changed", never as a skin colour.
   Each step is clearly lighter/darker than the next, so it reads without colour vision too; a day without a log
   is the neutral colour with a dot. "Red or sore skin" is a small coral mark, only on your own days. */
:root {
  --tan-0: #3b5563; --tan-1: #f6dba4; --tan-2: #e9b04c; --tan-3: #c1763a; --tan-4: #8a4622; --tan-none: #2a3d48;
  --tan-sore: #ff6f6f;
}
:root[data-theme="light"] { --tan-0: #e4dccd; --tan-none: #efe8da; --tan-sore: #d93a3a; }
.t-0 { --t: var(--tan-0); } .t-1 { --t: var(--tan-1); } .t-2 { --t: var(--tan-2); }
.t-3 { --t: var(--tan-3); } .t-4 { --t: var(--tan-4); } .t-none { --t: var(--tan-none); }

.btn-tan {
  background: radial-gradient(120% 120% at 30% 0%, #fff7dc, color-mix(in srgb, var(--tan, var(--tan-2)) 60%, #ffd166) 55%, #f0a24a);
  box-shadow: 0 10px 26px rgba(230, 150, 50, 0.3), inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}
.btn-tan.has-log .big-emoji { filter: drop-shadow(0 0 6px rgba(255, 190, 60, 0.9)); }

.heat-tan td { min-width: 46px; height: 40px; background: transparent; }
.heat-tan td.is-today { box-shadow: none; }
.heat-tan td.is-today .tan-cell { outline: 2px solid var(--accent); outline-offset: -2px; }
.tan-cell { background: var(--t); color: var(--faint); position: relative; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.tan-cell.t-none { box-shadow: none; }
.tan-cell.t-future { background: transparent; box-shadow: inset 0 0 0 1px var(--border); cursor: default; }
.tan-cell.is-sore::after, .tan-legend i.is-sore::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--tan-sore); box-shadow: 0 0 0 2px var(--surface);
}
.heat-tan tr.is-mine th { color: var(--accent); }
.tan-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; color: var(--muted); font-size: 0.8rem; }
.tan-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tan-legend i { position: relative; width: 22px; height: 14px; border-radius: 4px; background: var(--t); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.tan-legend i.t-none, .tan-detail-line i.t-none { background: radial-gradient(circle, var(--faint) 1.4px, var(--t) 1.8px); }
.tan-legend i.is-sore::after { top: -3px; right: -3px; width: 7px; height: 7px; }
.tan-note { margin-top: 8px; }

.tan-strip { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 12px; }
.tan-strip li { display: grid; justify-items: center; gap: 4px; width: 64px; text-align: center; }
.tan-strip small { font-size: 0.72rem; color: var(--muted); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tan-ring { display: grid; place-items: center; padding: 4px; border-radius: 50%; background: var(--t); }
.tan-strip .t-none .tan-ring { background: transparent; box-shadow: inset 0 0 0 2px var(--tan-none), 0 0 0 1px color-mix(in srgb, var(--faint) 40%, transparent); }
.tan-advice { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 0.88rem; background: color-mix(in srgb, var(--tan-sore) 12%, var(--surface-2)); border-left: 4px solid var(--tan-sore); }

.tan-dialog { width: min(94vw, 440px); }
.tan-scale { display: grid; gap: 6px; }
.tan-scale legend { font-weight: 600; margin-bottom: 4px; }
.tan-choice { display: grid; grid-template-columns: auto 34px 1fr; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--border); cursor: pointer; }
.tan-choice input { width: auto; min-height: 0; margin: 0; accent-color: var(--accent); }
.tan-choice i { width: 34px; height: 24px; border-radius: 6px; background: var(--t); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.tan-choice span { display: grid; }
.tan-choice small, .tan-sore small { color: var(--muted); font-weight: 400; }
.tan-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tan-sore { align-items: flex-start; }
.tan-sore span { display: grid; }
.tan-detail-line { display: flex; align-items: center; gap: 12px; margin: 0; }
.tan-detail-line i { width: 44px; height: 32px; border-radius: 8px; background: var(--t); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }
.tan-detail-line span { display: grid; }
.tan-detail-line small { color: var(--muted); }

/* ---------- ☀️ Sun Timer on the dashboard (PEAK Sun; app/sun.php) ---------- */
.sun-dash { padding: 14px 16px; }
.sun-dash-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.sun-dash-icon { font-size: 2rem; line-height: 1; }
.sun-dash-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.sun-dash-text small { color: var(--muted); }
.sun-dash.is-running { border-color: color-mix(in srgb, var(--sun, #ffc857) 55%, var(--border)); }
.sun-dash.is-alarm .sun-dash-text small { color: var(--amber); font-weight: 700; }

/* ---------- 📅 Kalender (kalender.php; app/calendar.php) ---------- */
.cal-dialog { width: min(94vw, 440px); }
.cal-when { border: 0; padding: 0; margin: 0; }
.cal-when legend { font-weight: 600; margin-bottom: 6px; }
.cal-when-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 8px; }
.cal-when-row input[hidden] { display: none; }
.cal-when-row:has(input[hidden]) { grid-template-columns: 1fr; }

/* ---------- Feedback on every site (app/feedback.php, assets/js/feedback.js) ---------- */
/* The button: small and quiet in the corner (the dev clock and toasts sit on the other side), above the phone menu. */
.feedback-fab {
  position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 25;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; line-height: 1;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow);
  opacity: 0.72; cursor: pointer; transition: opacity 0.15s, transform 0.15s;
}
.feedback-fab:hover, .feedback-fab:focus-visible { opacity: 1; transform: translateY(-1px); }
.feedback-fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
@media print { .feedback-fab { display: none; } }

.feedback-dialog { width: min(94vw, 520px); max-height: min(92vh, 860px); overflow: auto; }
.fb-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fb-dialog-head h2 { margin: 0; }
.fb-kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.fb-kind-pick { padding: 10px; border-radius: 14px; }
.fb-kind-pick span { display: grid; gap: 2px; }
.fb-kind-pick small { color: var(--muted); font-size: 0.75rem; font-weight: 400; }
.fb-kind-pick.is-bug { --c: var(--danger); }
.fb-kind-pick.is-improvement { --c: var(--amber); }
.fb-kind-pick.is-suggestion { --c: var(--accent); }
@media (max-width: 420px) { .fb-kinds { grid-template-columns: 1fr; } }
.fb-bug-help, .fb-sent-with { border: 1px dashed var(--border); border-radius: 12px; padding: 8px 12px; }
.fb-bug-help[open] { display: grid; gap: 10px; }
.fb-bug-help summary, .fb-sent-with summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.fb-env { margin: 6px 0 0; padding-left: 18px; color: var(--muted); word-break: break-word; }
.fb-error { margin: 0; color: var(--danger); font-weight: 600; }

/* The admin's unread chip in the header */
.fb-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 0.8rem;
  color: var(--text); text-decoration: none; background: color-mix(in srgb, var(--danger) 18%, var(--surface-2)); border: 1px solid var(--danger);
}

/* The inbox (admin_feedback.php) */
.fb-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.fb-filter {
  display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; font-size: 0.85rem;
  text-decoration: none; color: var(--text); background: var(--surface); border: 1px solid var(--border);
}
.fb-filter b { color: var(--muted); font-weight: 700; }
.fb-filter.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.fb-filter-sep { width: 1px; background: var(--border); margin: 2px 4px; }
.fb-list { list-style: none; margin: 0; padding: 0; display: grid; }
.fb-list li { border-bottom: 1px solid var(--border); }
.fb-list li:last-child { border-bottom: 0; }
.fb-row { display: flex; align-items: center; gap: 12px; padding: 12px 6px; color: inherit; text-decoration: none; }
.fb-row:hover { background: var(--surface-2); }
.fb-row-main { display: grid; gap: 2px; flex: 1; min-width: 0; }
.fb-row-main b { overflow-wrap: anywhere; }
.fb-row-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.fb-list li.is-unseen .fb-row-main b { color: var(--accent); }
.fb-new { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.fb-kind { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; }
.fb-row .fb-kind { font-size: 1.3rem; }
.fb-status {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; white-space: nowrap;
  background: var(--surface-3); color: var(--text);
}
.fb-status.is-new { background: color-mix(in srgb, var(--accent) 26%, var(--surface-2)); }
.fb-status.is-planned, .fb-status.is-in_progress { background: color-mix(in srgb, var(--amber) 26%, var(--surface-2)); }
.fb-status.is-resolved { background: color-mix(in srgb, var(--ok) 26%, var(--surface-2)); }
.fb-status.is-rejected { color: var(--muted); }
.fb-pick.is-new { --c: var(--accent); }
.fb-pick.is-reviewed { --c: var(--muted); }
.fb-pick.is-planned, .fb-pick.is-in_progress { --c: var(--amber); }
.fb-pick.is-resolved { --c: var(--ok); }
.fb-pick.is-rejected { --c: var(--danger); }
.fb-back { margin: 0 0 8px; }
.fb-report { display: grid; gap: 12px; }
.fb-report-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.fb-title { margin: 0; font-size: 1.4rem; overflow-wrap: anywhere; }
.fb-body { white-space: normal; overflow-wrap: anywhere; }
.fb-bug, .fb-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.fb-bug dt, .fb-meta dt { color: var(--muted); font-weight: 600; }
.fb-bug dd, .fb-meta dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .fb-bug, .fb-meta { grid-template-columns: 1fr; } .fb-bug dt, .fb-meta dt { margin-top: 6px; } }
.fb-ua { color: var(--muted); }
.fb-shot img { display: block; max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); }
.fb-status-form { display: grid; gap: 12px; }
.fb-prompt-text { width: 100%; font: 0.82rem/1.45 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; white-space: pre; overflow: auto; }
.fb-prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
