/* ============ КОСТЁР — design system ============ */
:root {
  /* palette: forest (default) */
  --bg: #faf6ef;
  --bg-elev: #ffffff;
  --bg-soft: #f0eadd;
  --ink: #1b1f1a;
  --ink-soft: #4a5048;
  --ink-mute: #8b8f86;
  --line: #e6dfd1;
  --line-strong: #d8cfbb;
  --primary: #2d6a4f;
  --primary-soft: #d8ead8;
  --primary-ink: #ffffff;
  --accent: #e9b949;
  --accent-soft: #fbe9b0;
  --danger: #c0463a;
  --like: #e25d5d;
  --like-soft: #fbe0e0;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-1: 0 1px 0 rgba(20,20,20,.04), 0 2px 8px rgba(20,20,20,.04);
  --shadow-2: 0 1px 0 rgba(20,20,20,.04), 0 8px 24px rgba(20,20,20,.06);
  --shadow-3: 0 12px 40px rgba(20,20,20,.12);

  --font: "Onest", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* palette: sunset */
[data-palette="sunset"] {
  --bg: #fff5ef;
  --bg-elev: #ffffff;
  --bg-soft: #ffe6d8;
  --line: #f3d9c5;
  --line-strong: #e7c3a8;
  --primary: #d9533b;
  --primary-soft: #ffd9cc;
  --accent: #ffb648;
  --accent-soft: #ffe2ad;
}

/* palette: ocean */
[data-palette="ocean"] {
  --bg: #f1f6fb;
  --bg-elev: #ffffff;
  --bg-soft: #dceaf4;
  --line: #d1ddea;
  --line-strong: #b9ccdf;
  --primary: #1e5b8a;
  --primary-soft: #cfe1ee;
  --accent: #f0a93a;
  --accent-soft: #ffe1ad;
}

/* palette: berry */
[data-palette="berry"] {
  --bg: #fbf3f7;
  --bg-elev: #ffffff;
  --bg-soft: #f3e0eb;
  --line: #ebd7e2;
  --line-strong: #d9bccd;
  --primary: #8a3e6b;
  --primary-soft: #f0d4e1;
  --accent: #f0a93a;
  --accent-soft: #ffe1ad;
}

/* palette: vodoley — глубокий синий + жёлтый + бирюза */
[data-palette="vodoley"] {
  --bg: #f6f4ec;
  --bg-elev: #ffffff;
  --bg-soft: #e8edf3;
  --ink: #14192a;
  --ink-soft: #3d4660;
  --line: #dfe4ec;
  --line-strong: #c3cdd9;
  --primary: #002776;
  --primary-soft: #d9e3f3;
  --accent: #fabd2e;
  --accent-soft: #ffe8a8;
  --like: #d9533b;
  --like-soft: #fbe0d8;
}
[data-theme="dark"][data-palette="vodoley"] {
  --bg: #0e1326;
  --bg-elev: #161d35;
  --bg-soft: #1e2745;
  --line: #2a3658;
  --line-strong: #3a4870;
  --primary: #4a86d8;
  --primary-soft: #1b2d52;
  --accent: #fabd2e;
  --accent-soft: #4a3c1a;
}

/* dark theme overrides */
[data-theme="dark"] {
  --bg: #15171a;
  --bg-elev: #1f2227;
  --bg-soft: #272b31;
  --ink: #f3f0e8;
  --ink-soft: #c5c2b8;
  --ink-mute: #8a8a82;
  --line: #2e3239;
  --line-strong: #3a3f47;
  --primary-soft: #1f3a30;
  --accent-soft: #4a3c1a;
  --like-soft: #4a2727;
  --shadow-1: 0 1px 0 rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.3);
  --shadow-2: 0 1px 0 rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.4);
}
[data-theme="dark"][data-palette="sunset"] { --primary: #ff7a5c; --accent: #ffc266; }
[data-theme="dark"][data-palette="ocean"]  { --primary: #5fa9dc; --accent: #ffc266; }
[data-theme="dark"][data-palette="berry"]  { --primary: #d586b5; --accent: #ffc266; }
[data-theme="dark"]:not([data-palette]),
[data-theme="dark"][data-palette="forest"] { --primary: #4ea584; --accent: #f3c969; }

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  font-size: 15px;
  line-height: 1.45;
}
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ====== layout ====== */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.app-main {
  padding: 24px 20px 120px;
  max-width: 980px;
  width: 100%;
  margin: 0 auto;
}
@media (min-width: 780px) {
  .app-main { padding: 32px 32px 60px; }
}

/* ====== top nav ====== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-name { font-size: 17px; }
.brand-sub  { font-size: 11px; color: var(--ink-mute); font-family: var(--font-mono); letter-spacing: 0.04em; }

.nav-tabs {
  display: none;
  margin-left: 18px;
  gap: 2px;
  flex: 1;
}
@media (min-width: 780px) { .nav-tabs { display: flex; } }
.nav-tab {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  border: none;
  background: transparent;
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-tab:hover { background: var(--bg-soft); color: var(--ink); }
.nav-tab.is-active {
  background: var(--ink);
  color: var(--bg);
}
[data-theme="dark"] .nav-tab.is-active { background: var(--primary); color: var(--primary-ink); }
.nav-spacer { flex: 1; }
.nav-right { display: flex; align-items: center; gap: 8px; }

/* ====== bottom tab bar (mobile) ====== */
.tabbar {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 40;
  display: flex;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px;
  box-shadow: var(--shadow-2);
}
@media (min-width: 780px) { .tabbar { display: none; } }
.tabbar-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--ink-mute);
  font-size: 11px;
  font-weight: 500;
}
.tabbar-btn.is-active { color: var(--ink); }
.tabbar-btn.is-active .tabbar-icon {
  background: var(--ink);
  color: var(--bg);
}
[data-theme="dark"] .tabbar-btn.is-active .tabbar-icon { background: var(--primary); color: var(--primary-ink); }
.tabbar-icon {
  width: 38px; height: 32px;
  border-radius: 999px;
  display: grid; place-items: center;
  transition: background .15s ease;
}

/* ====== buttons ====== */
.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:hover { border-color: var(--ink); }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
[data-theme="dark"] .btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.btn-accent {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: var(--primary);
}
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-soft); border-color: transparent; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ====== card ====== */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.card-pad { padding: 20px; }
.card-pad-sm { padding: 14px; }

/* ====== photo placeholder ====== */
.photo {
  position: relative;
  background: var(--bg-soft);
  overflow: hidden;
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--ink-soft);
}
.photo-stripes {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    var(--photo-a, #d6cfbf) 0 14px,
    var(--photo-b, #c9c1ad) 14px 28px
  );
  opacity: .7;
}
[data-theme="dark"] .photo-stripes { opacity: .35; }
.photo-label {
  position: relative;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  background: var(--bg-elev);
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
}
.photo-16x9 { aspect-ratio: 16/9; }
.photo-4x3  { aspect-ratio: 4/3; }
.photo-1x1  { aspect-ratio: 1/1; }

/* squad color rim on photos */
.photo[data-squad="1"] { --photo-a: #b8d8c4; --photo-b: #95c0a6; }
.photo[data-squad="2"] { --photo-a: #f3c79a; --photo-b: #e5a967; }
.photo[data-squad="3"] { --photo-a: #b5cce2; --photo-b: #88aacb; }
.photo[data-squad="4"] { --photo-a: #e7b6b6; --photo-b: #d18d8d; }
.photo[data-squad="5"] { --photo-a: #d3c2dd; --photo-b: #b29ac4; }
[data-theme="dark"] .photo[data-squad="1"] { --photo-a: #2d4035; --photo-b: #1f2d27; }
[data-theme="dark"] .photo[data-squad="2"] { --photo-a: #46341f; --photo-b: #312517; }
[data-theme="dark"] .photo[data-squad="3"] { --photo-a: #20354a; --photo-b: #172538; }
[data-theme="dark"] .photo[data-squad="4"] { --photo-a: #4a2a2a; --photo-b: #341e1e; }
[data-theme="dark"] .photo[data-squad="5"] { --photo-a: #3a2d44; --photo-b: #2a2030; }

/* ====== squad badge / avatar ====== */
.squad-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.squad-badge .dot {
  width: 22px; height: 22px;
  border-radius: 999px;
  font-size: 12px;
  display: grid; place-items: center;
  color: white;
  font-family: var(--font-mono);
  font-weight: 700;
}
.squad-color-1 { background: #4d8a64; }
.squad-color-2 { background: #d18a3e; }
.squad-color-3 { background: #4a7ab0; }
.squad-color-4 { background: #b25656; }
.squad-color-5 { background: #8866a3; }

/* squad-color cycling for pk 6-10 (same 5 colors) */
.squad-color-6  { background: #4d8a64; }
.squad-color-7  { background: #d18a3e; }
.squad-color-8  { background: #4a7ab0; }
.squad-color-9  { background: #b25656; }
.squad-color-10 { background: #8866a3; }

/* ====== chip ====== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.chip.warn { background: var(--accent-soft); border-color: transparent; color: #6b4d10; }
[data-theme="dark"] .chip.warn { color: var(--accent); }
.chip.like { background: var(--like-soft); border-color: transparent; color: var(--like); }
.chip.ok   { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
[data-theme="dark"] .chip.ok { color: var(--primary); }

/* ====== headers / typography ====== */
.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.page-sub {
  color: var(--ink-mute);
  font-size: 14px;
  margin: 0 0 22px;
}
.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--ink-mute);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ====== news list ====== */
.news-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
@media (min-width: 640px) {
  .news-card.has-photo { grid-template-columns: 260px 1fr; }
}
.news-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}
.news-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
.news-body {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0;
}

/* ====== squad grid ====== */
.squad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.squad-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-align: left;
  padding: 0;
  width: 100%;
  display: block;
  color: inherit;
  font: inherit;
}
.squad-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}
.squad-card-body { padding: 14px 16px 16px; }
.squad-card-name {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: -0.01em;
}
.squad-card-motto {
  font-size: 13px;
  color: var(--ink-mute);
  margin: 0 0 12px;
  font-style: italic;
}
.squad-stats { display: flex; gap: 8px; flex-wrap: wrap; }

/* ====== squad detail ====== */
.detail-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
@media (min-width: 780px) {
  .detail-hero { grid-template-columns: 360px 1fr; align-items: end; }
}
.detail-name {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 12px 0 6px;
}
@media (min-width: 780px) { .detail-name { font-size: 44px; } }
.detail-motto {
  font-size: 17px;
  font-style: italic;
  color: var(--ink-soft);
  margin: 0 0 18px;
  text-wrap: pretty;
}
.detail-stats { display: flex; gap: 10px; flex-wrap: wrap; }

/* ====== like / comment lists ====== */
.list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 780px) {
  .list-grid { grid-template-columns: 1fr 1fr; }
}
.likes-day {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}
.likes-day:first-of-type {
  border-top: none;
  padding-top: 0;
}
.likes-day-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}
.likes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.comment {
  padding: 6px 0 0;
}
.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.comment-time {
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}
.comment-text {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  text-wrap: pretty;
}

/* ====== authorized action row ====== */
.action-row {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
}
@media (max-width: 640px) {
  .action-row { grid-template-columns: 48px 1fr; }
  .action-row .action-buttons { grid-column: 1 / -1; }
}
.action-row .photo { width: 56px; height: 56px; border-radius: 14px; }
.action-row .photo .photo-label { display: none; }
@media (max-width: 640px) {
  .action-row .photo { width: 48px; height: 48px; }
}
.action-name { font-weight: 700; font-size: 15px; }
.action-motto { font-size: 12px; color: var(--ink-mute); font-style: italic; }
.action-buttons { display: flex; gap: 8px; }

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  transition: all .15s ease;
}
.like-btn:hover { border-color: var(--like); color: var(--like); }
.like-btn.is-liked {
  background: var(--like-soft);
  border-color: transparent;
  color: var(--like);
}
.like-btn.is-liked svg { fill: var(--like); }
.like-btn[disabled] { opacity: .4; cursor: not-allowed; }

.comment-btn { /* uses .btn */ }

/* ====== quota bar ====== */
.quota-bar {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.quota-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.quota-dots { display: flex; gap: 4px; }
.quota-dot {
  width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
}
.quota-dot.is-on { background: var(--like); border-color: var(--like); }
.quota-dot.is-on.comment { background: var(--primary); border-color: var(--primary); }
.quota-label { font-size: 13px; color: var(--ink-soft); }
.quota-label strong { color: var(--ink); }

/* ====== form ====== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.input, .textarea {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color .15s ease;
}
.input:focus, .textarea:focus { border-color: var(--ink); }
.textarea { resize: vertical; min-height: 76px; }

/* comment composer */
.composer {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
}
.composer textarea {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  min-height: 60px;
}
.composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px 10px;
  border-top: 1px dashed var(--line);
  background: var(--bg);
}
.composer-count {
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}

/* ====== login ====== */
.login-wrap {
  max-width: 420px;
  margin: 32px auto 0;
}
.login-card { padding: 28px; }
.login-title { font-size: 24px; font-weight: 700; margin: 12px 0 6px; letter-spacing: -0.01em; }
.login-sub { color: var(--ink-mute); margin: 0 0 22px; }

/* ====== stats ====== */
.stats-table {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stats-row {
  display: grid;
  grid-template-columns: 50px 1fr 1fr 1fr;
  align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  gap: 10px;
}
.stats-row:first-child { border-top: none; background: var(--bg-soft); }
.stats-row.head { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); font-weight: 600; font-family: var(--font-mono); padding: 10px 18px; }
.stats-rank {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: var(--bg-soft);
  display: grid; place-items: center;
  font-weight: 700;
  font-family: var(--font-mono);
}
.stats-row .stats-rank.gold { background: #fce5a6; color: #6b4d10; }
.stats-row .stats-rank.silver { background: #e3e3e3; color: #444; }
.stats-row .stats-rank.bronze { background: #f1d2b6; color: #6b3d18; }
[data-theme="dark"] .stats-row .stats-rank.gold { background: #6b4d10; color: #fce5a6; }
[data-theme="dark"] .stats-row .stats-rank.silver { background: #444; color: #e3e3e3; }
[data-theme="dark"] .stats-row .stats-rank.bronze { background: #6b3d18; color: #f1d2b6; }
.stats-cell-mono { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }
.stats-cell-mute { color: var(--ink-mute); font-size: 13px; }

.stats-podium {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.podium-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.podium-rank { font-family: var(--font-mono); color: var(--ink-mute); font-size: 11px; letter-spacing: 0.08em; }
.podium-name { font-weight: 700; margin: 6px 0 4px; }
.podium-num { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.podium-card.first { background: var(--accent-soft); }
[data-theme="dark"] .podium-card.first { background: #3a2e10; }

/* ====== admin ====== */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 880px) {
  .admin-grid { grid-template-columns: 280px 1fr; }
}
.admin-side {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 8px;
  height: fit-content;
}
.admin-side-btn {
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.admin-side-btn:hover { background: var(--bg-soft); color: var(--ink); }
.admin-side-btn.is-active { background: var(--ink); color: var(--bg); }
[data-theme="dark"] .admin-side-btn.is-active { background: var(--primary); color: var(--primary-ink); }

.admin-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.admin-list { display: flex; flex-direction: column; gap: 8px; }
.admin-list-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.admin-list-row .photo { width: 44px; height: 44px; border-radius: 12px; }
.admin-list-row .photo .photo-label { display: none; }
.admin-creds { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mute); }

/* ====== empty/login banner ====== */
.banner-cta {
  background: var(--primary-soft);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
[data-theme="dark"] .banner-cta { background: var(--primary-soft); }
.banner-cta .banner-icon {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-ink);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.banner-cta-text { flex: 1; }
.banner-cta-title { font-weight: 700; color: var(--primary); font-size: 14px; }
[data-theme="dark"] .banner-cta-title { color: var(--primary); }
.banner-cta-sub { font-size: 13px; color: var(--ink-soft); }

/* ====== toast ====== */
.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 96px;
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-3);
  animation: toast-in .2s ease;
}
@media (min-width: 780px) { .toast { bottom: 30px; } }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* news header */
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.news-card .photo { border-radius: 0; aspect-ratio: 16/9; }
@media (min-width: 640px) {
  .news-card.has-photo .photo { aspect-ratio: auto; height: 100%; border-radius: 0; }
}
.news-card-body { padding: 18px 20px 20px; }

.stack-2 > * + * { margin-top: 8px; }
.stack-3 > * + * { margin-top: 14px; }
.stack-4 > * + * { margin-top: 20px; }
.row-tight { display: flex; gap: 8px; align-items: center; }
.spacer { flex: 1; }

.muted { color: var(--ink-mute); }
.mono { font-family: var(--font-mono); }
.center { text-align: center; }

/* ====== brand logo image ====== */
.brand-img {
  height: 40px;
  width: auto;
  display: block;
  border-radius: 8px;
  background: var(--bg-elev);
  padding: 2px 6px;
  border: 1px solid var(--line);
}
[data-theme="dark"] .brand-img {
  filter: brightness(1.5) contrast(0.9);
}

/* ====== team ====== */
.team-section { margin-bottom: 36px; }
.team-section-head {
  margin-bottom: 14px;
}
.team-section-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.team-grid-lg {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.team-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}
.team-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}
.team-photo {
  aspect-ratio: 1/1;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--bg-soft);
}
.team-photo-stripes {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    var(--tph-a, #d6cfbf) 0 18px,
    var(--tph-b, #c9c1ad) 18px 36px
  );
  opacity: .55;
}
.team-photo[data-group="leads"]      { --tph-a: #c9d9ee; --tph-b: #a7c1e0; }
.team-photo[data-group="organizers"] { --tph-a: #fbe2a8; --tph-b: #f0c971; }
.team-photo[data-group="counselors"] { --tph-a: #c7e0d2; --tph-b: #a3c8b6; }
[data-theme="dark"] .team-photo[data-group="leads"]      { --tph-a: #1f2c44; --tph-b: #16213a; }
[data-theme="dark"] .team-photo[data-group="organizers"] { --tph-a: #4a3a1a; --tph-b: #322712; }
[data-theme="dark"] .team-photo[data-group="counselors"] { --tph-a: #243a31; --tph-b: #182921; }
.team-photo-mono {
  position: relative;
  z-index: 2;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.team-grid-lg .team-photo-mono {
  width: 78px; height: 78px; font-size: 26px;
}
.team-card-body {
  padding: 14px 16px 18px;
}
.team-role {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.team-name {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.team-grid-lg .team-name { font-size: 19px; }
.team-bio {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.45;
}

/* Squad color cycling by nth-child position */
.squad-grid .squad-card:nth-child(5n+1) { --sc: 1; }
.squad-grid .squad-card:nth-child(5n+2) { --sc: 2; }
.squad-grid .squad-card:nth-child(5n+3) { --sc: 3; }
.squad-grid .squad-card:nth-child(5n+4) { --sc: 4; }
.squad-grid .squad-card:nth-child(5n+5) { --sc: 5; }

/* Squad photo striped placeholders (color variant per nth-child) */
.squad-card:nth-child(5n+1) .squad-photo-placeholder { --ph-a: #b8d8c4; --ph-b: #95c0a6; }
.squad-card:nth-child(5n+2) .squad-photo-placeholder { --ph-a: #f3c79a; --ph-b: #e5a967; }
.squad-card:nth-child(5n+3) .squad-photo-placeholder { --ph-a: #b5cce2; --ph-b: #88aacb; }
.squad-card:nth-child(5n+4) .squad-photo-placeholder { --ph-a: #e7b6b6; --ph-b: #d18d8d; }
.squad-card:nth-child(5n+5) .squad-photo-placeholder { --ph-a: #d3c2dd; --ph-b: #b29ac4; }

.squad-photo-placeholder {
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
  background: var(--bg-soft);
}
.squad-photo-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    var(--ph-a, #d6cfbf) 0 18px,
    var(--ph-b, #c9c1ad) 18px 36px
  );
  opacity: .55;
}

/* Action row layout for interactions */
.action-row {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
}
@media (max-width: 640px) {
  .action-row { grid-template-columns: 48px 1fr; }
  .action-row .action-buttons { grid-column: 1 / -1; }
}
.action-name { font-weight: 700; font-size: 15px; }
.action-motto { font-size: 12px; color: var(--ink-mute); font-style: italic; }
.action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

/* Comment composer (inline textarea card) */
.composer {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  overflow: hidden;
  margin-top: 8px;
}
.composer textarea {
  width: 100%;
  border: none;
  background: transparent;
  resize: none;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  min-height: 60px;
}
.composer-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px 10px;
  border-top: 1px dashed var(--line);
  background: var(--bg);
}
.composer-count {
  font-size: 11px;
  color: var(--ink-mute);
  font-family: var(--font-mono);
}

/* Toast host — stacked at bottom center */
.toast-host {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 96px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
@media (min-width: 780px) { .toast-host { bottom: 30px; } }
.toast-host .toast {
  position: static;
  transform: none;
  left: auto;
  bottom: auto;
}

/* ====== notifications ====== */
.notif-bell { position: relative; }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--danger, #e53e3e);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

.notif-badge--sm {
  top: -2px;
  right: -2px;
}

.notif-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 200;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

.notif-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.notif-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  font-size: 13px;
  transition: background .15s;
}

.notif-item:last-child { border-bottom: none; }

.notif-item--unread {
  background: var(--primary-tint, rgba(99,102,241,.06));
  font-weight: 500;
}

.notif-item--read {
  opacity: 0.55;
}

.notif-item-body {
  flex: 1;
  color: var(--ink, #1a202c);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.notif-item-text {
  font-size: 13px;
  line-height: 1.3;
}

.notif-item-time {
  font-size: 11px;
  color: var(--muted, #718096);
  font-variant-numeric: tabular-nums;
}

.notif-read-btn {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted, #718096);
  padding: 0;
}

.notif-read-btn:hover {
  background: var(--primary, #6366f1);
  border-color: var(--primary, #6366f1);
  color: #fff;
}

.notif-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--muted, #718096);
  font-size: 13px;
  margin: 0;
}
