:root {
  color-scheme: dark;
  --brand-navy: #020621;
  --brand-gold: #BC9343;
  --night: var(--brand-navy);
  --base: #0b102d;
  --panel: #141a38;
  --line: #343a55;
  --gold: var(--brand-gold);
  --bright: #ebc778;
  --text: #f6f1e8;
  --muted: #aab4cd;
  font: 15px/1.55 "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--base); color: var(--text); min-height: 100vh; }
body { overflow-wrap: anywhere; }
.mobile-tabs, .compact-brand { display: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button .i { width: 18px; height: 18px; margin-right: 6px; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, .button { cursor: pointer; display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--line); padding: .62rem 1rem; border-radius: 7px; color: var(--text); background: var(--base); font-weight: 600; }
button:hover, .button:hover { border-color: var(--gold); }
:focus-visible { outline: 2px solid var(--bright); outline-offset: 4px; }
.primary { background: var(--bright); color: var(--night); border-color: var(--bright); }
.sidebar { width: 230px; position: fixed; inset: 0 auto 0 0; background: var(--night); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 24px 16px 16px; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 4px 26px; color: var(--bright); font-family: Georgia, serif; font-size: 19px; letter-spacing: .05em; line-height: 1.2; }
.brand img { width: 48px; height: 48px; border: 1px solid #514329; border-radius: 50%; }
.brand small { display: block; font: 9px/1.7 "Segoe UI", sans-serif; letter-spacing: .17em; color: var(--muted); }
nav, .side-bottom { display: grid; gap: 5px; }
nav a, .side-bottom a { border: 1px solid transparent; display: flex; align-items: center; gap: 12px; padding: 10px 12px; color: var(--muted); border-radius: 7px; }
nav a .i, .side-bottom a .i { width: 20px; height: 20px; }
nav a:hover, .side-bottom a:hover, a[aria-current="page"] { border-color: #514329; color: var(--bright); background: #1a192a; }
.side-bottom { margin-top: auto; }
.account { border-top: 1px solid var(--line) !important; }
#account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 36px; height: 36px; flex: none; display: grid; place-items: center; background: #30263a; color: var(--bright); border-radius: 50%; font-size: 12px; font-weight: 700; object-fit: cover; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; }
.avatar.xl { width: 120px; height: 120px; font-size: 36px; border: 2px solid #514329; background: #30263a; }
video.avatar { transform: scaleX(-1); }
.photo-editor { display: grid; justify-items: start; gap: 4px; }
.photo-editor .actions button { min-height: 44px; }
main { margin-left: 230px; }
[hidden] { display: none !important; }
.signed-out .sidebar, .signed-out .topbar { display: none; }
.signed-out main { margin-left: 0; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.admin-grid-single { grid-template-columns: minmax(0, 640px); }
.admin-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; margin: 0 0 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--night); }
.admin-nav a { min-height: 44px; padding: 8px 13px; font-weight: 600; }
.admin-nav + .notice { margin: 0 0 16px; }
.admin-page .card { border-radius: 12px; }
.admin-page .card h2 { margin-bottom: 2px; }
.admin-page fieldset { min-width: 0; margin: 0; padding: 6px 10px 10px; border: 1px solid var(--line); border-radius: 8px; }
.admin-page legend { padding-inline: 6px; color: var(--muted); }
.admin-page .choice { min-height: 38px; }
.topbar { gap: 12px; height: 65px; border-bottom: 1px solid var(--line); padding: 0 clamp(20px, 4vw, 52px); display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .88rem; }
.topbar a { color: var(--bright); }
#inbox-link { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 8px; }
#inbox-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bright); color: var(--night); font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.menu-profile { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.menu-profile > span:not(.avatar), .menu-row > span:nth-child(2) { flex: 1; min-width: 0; }
.menu-profile strong, .menu-row strong { display: block; }
.menu-profile small, .menu-row small { color: var(--muted); }
.menu-profile > .i, .menu-row > .i { color: var(--muted); width: 18px; height: 18px; }
.card.menu-list { padding: 4px 0; }
.menu-row { display: flex; align-items: center; gap: 13px; padding: 12px 18px; min-height: 64px; }
.menu-row + .menu-row { border-top: 1px solid var(--line); }
.menu-row:hover { background: #1a1f40; }
.signout { width: 100%; margin-top: 14px; min-height: 50px; color: #f0a8a0; }
.ai-fab { display: none; }
body:not(.signed-out):not(.admin-page):not([data-route="assistant"]) .ai-fab {
  position: fixed; z-index: 4; right: max(20px, env(safe-area-inset-right)); bottom: 24px;
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bright); color: var(--night); box-shadow: 0 8px 24px rgba(0, 0, 0, .45), 0 0 0 4px rgba(235, 199, 120, .16);
  transition: transform .15s ease;
}
.ai-fab:hover { transform: scale(1.06); }
.ai-fab .i { width: 23px; height: 23px; stroke-width: 1.9; }
#content { max-width: 1200px; margin: auto; padding: 30px clamp(20px, 4vw, 52px) 48px; }
h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: Georgia, serif; font-weight: 400; line-height: 1.1; }
h1 { font-size: clamp(2.35rem, 5vw, 4.4rem); letter-spacing: -.045em; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.05rem; }
p { color: var(--muted); }
.hero { min-height: 305px; position: relative; overflow: hidden; display: grid; grid-template-columns: 1.35fr 1fr; align-items: center; background: var(--night); border: 1px solid #4f422c; border-radius: 12px; }
.hero-copy { position: relative; z-index: 1; padding: clamp(24px, 4vw, 52px); }
.hero p { margin: 12px 0 23px; max-width: 43ch; }
.hero-art { width: 100%; max-height: 342px; height: 100%; object-fit: contain; transform: scale(1.04); }
.eyebrow { color: var(--bright); font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; display: block; margin-bottom: 12px; }
.stats, .shortcuts, .grid { display: grid; gap: 16px; }
.stats, .shortcuts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 18px; }
.grid { grid-template-columns: 1.48fr 1fr; margin-top: 24px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 20px; min-width: 0; }
a.card:hover { border-color: var(--gold); }
.stat { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 13px; }
.stat strong { display: block; font-family: Georgia, serif; font-size: 1.65rem; line-height: 1.1; }
.stat small { color: var(--muted); }
.icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid #514329; background: #292236; color: var(--bright); border-radius: 8px; font-size: 1.15rem; }
.section-head { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; margin-bottom: 17px; }
.section-head a, .text-link { color: var(--bright); font-size: .88rem; }
.news { padding: 14px 0; border-top: 1px solid var(--line); }
.news:last-child { padding-bottom: 0; }
.news p { margin-top: 4px; }
.label { color: var(--bright); font-size: .73rem; font-weight: 700; margin-bottom: 4px; }
.ranking { list-style: none; margin: 0; padding: 0; }
.ranking li { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.ranking li > span:first-child { color: var(--bright); }
.shortcuts .card { display: flex; gap: 13px; align-items: center; }
.shortcuts small { display: block; color: var(--muted); }
.page-heading { margin-bottom: 23px; }
.page-heading p { margin-top: 9px; }
.stack { display: grid; gap: 15px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.selected { border-color: var(--gold); color: var(--bright); }
form { display: grid; gap: 12px; }
label { display: grid; gap: 5px; }
input, textarea, select { background: var(--base); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 9px 11px; min-width: 0; width: 100%; }
input[type="radio"], input[type="checkbox"] { width: auto; accent-color: var(--gold); }
.choice { display: flex; align-items: center; gap: 8px; padding: 8px; }
form button { justify-self: start; }
.result, .notice { padding: 12px; border: 1px solid #514329; border-radius: 7px; color: var(--bright); margin-top: 12px; }
.content-line { margin: 6px 0 12px; white-space: pre-line; }
@media (max-width: 900px) {
  .sidebar { width: 185px; padding-inline: 10px; }
  main { margin-left: 185px; }
  .grid { grid-template-columns: 1fr; }
  .stat { display: block; }
  .stat .icon { margin-bottom: 10px; }
  .shortcuts { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.8rem; }
}
@media (max-width: 640px) {
  .admin-grid { grid-template-columns: 1fr; }
  #content { padding-top: 18px; }
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding-bottom: 0; }
  .hero { min-height: 0; }
  .hero-copy { padding: 22px 20px 0; }
  .hero h1 { font-size: 2.1rem; }
  .hero p { margin: 8px 0 16px; font-size: .92rem; }
  .hero-art { height: 120px; margin: 8px 0 16px; transform: none; }
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.35rem; }
  .page-heading { margin-bottom: 16px; }
  .card { padding: 16px; }
  .stats, .shortcuts { gap: 10px; margin-top: 12px; }
  .grid { gap: 12px; margin-top: 12px; }
  .upcoming { margin-top: 12px; }
  .stat { display: block; padding: 12px; }
  .stat .icon { width: 32px; height: 32px; margin-bottom: 8px; }
  .stat .icon .i { width: 18px; height: 18px; }
  .stat strong { font-size: 1.35rem; }
  .stat small { font-size: .74rem; }
  .shortcuts { grid-template-columns: 1fr; }
  .shortcuts .card { padding: 12px 16px; }
  .section-head { margin-bottom: 10px; }
}
@media (max-width: 767px) {
  :root { --mobile-dock-height: 66px; }
  html { scroll-padding-bottom: calc(var(--mobile-dock-height) + env(safe-area-inset-bottom, 0px)); }
  .sidebar { display: none; }
  main { margin-left: 0; }
  .topbar {
    height: auto;
    min-height: 56px;
    gap: 8px;
    padding: calc(6px + env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  }
  .topbar button, .topbar > a { min-height: 44px; }
  .topbar > a { display: inline-flex; align-items: center; }
  .topbar button { padding-inline: .65rem; }
  .compact-brand { display: inline-flex; flex: none; }
  .compact-brand img { border-radius: 50%; }
  #crumb { flex: 1; min-width: 0; font-size: .8rem; }
  #content { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); }
  body:not(.signed-out):not(.admin-page) #content {
    padding-bottom: calc(var(--mobile-dock-height) + 16px + env(safe-area-inset-bottom, 0px));
  }
  body:not(.signed-out):not(.admin-page) .mobile-tabs {
    position: fixed;
    z-index: 3;
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(2px, calc(env(safe-area-inset-bottom, 0px) - 16px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 4px;
    border: 1px solid #2c3354;
    border-radius: 20px;
    background: rgba(20, 26, 56, .94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  }
  .mobile-tabs a { min-height: 50px; min-width: 0; justify-content: center; flex-direction: column; gap: 3px; padding: 3px 2px; border: 0; border-radius: 16px; text-align: center; font-size: .65rem; font-weight: 600; line-height: 1.15; }
  .mobile-tabs a:hover { background: transparent; border-color: transparent; }
  .mobile-tabs a[aria-current="page"] { color: var(--bright); background: rgba(235, 199, 120, .2); }
  .mobile-tabs a[aria-current="page"] .i { stroke-width: 2.1; }
  body:not(.signed-out):not(.admin-page):not([data-route="assistant"]) .ai-fab { bottom: calc(var(--mobile-dock-height) + 12px + env(safe-area-inset-bottom, 0px)); right: max(18px, env(safe-area-inset-right)); width: 44px; height: 44px; }
  .ai-fab .i { width: 21px; height: 21px; }
  body.keyboard-open .ai-fab { display: none !important; }
  #logout, .crumb-root, .inbox-text { display: none; }
  #crumb { color: var(--text); font-weight: 600; font-size: .95rem; }
  .mobile-tabs a:focus-visible { outline-offset: -2px; }
  body.keyboard-open:not(.signed-out):not(.admin-page) .mobile-tabs { display: none; }
  body.keyboard-open:not(.signed-out):not(.admin-page) #content { padding-bottom: 24px; }
}
.upcoming { margin-top: 18px; }
body:not(.signed-out) #content { padding-bottom: 104px; }
#crumb { margin-right: auto; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chat { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - 160px); }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.chat-head h1 { font-size: 1.9rem; }
.chat-head p { font-size: .8rem; margin-top: 4px; }
.chat-empty { text-align: center; padding: 36px 8px 12px; display: grid; justify-items: center; gap: 10px; }
.chat-empty p { max-width: 46ch; }
.chat-avatar { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--bright); color: var(--night); }
.chat-avatar .i { width: 28px; height: 28px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.chips button { border-radius: 999px; font-weight: 500; font-size: .86rem; padding: .5rem .9rem; background: var(--panel); }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 18px 0; }
.msg { max-width: 88%; padding: 12px 15px; border-radius: 16px; line-height: 1.6; }
.msg p { color: inherit; margin: 0 0 8px; }
.msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: 4px 0 10px; padding-inline-start: 22px; }
.msg li { margin: 3px 0; }
.msg.user { align-self: flex-end; background: var(--bright); color: var(--night); border-bottom-right-radius: 4px; white-space: pre-line; }
.msg.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--text); }
.msg .source { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: .86rem; }
.msg .source p { color: var(--muted); }
.msg .copy { margin-top: 8px; padding: .25rem .7rem; font-size: .78rem; font-weight: 500; }
.typing span { animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; } }
.chat-form { position: sticky; bottom: 12px; display: flex; align-items: flex-end; gap: 6px; padding: 5px 5px 5px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.chat-form textarea { border: 0; background: transparent; resize: none; min-height: 40px; max-height: 140px; field-sizing: content; padding: 9px 0; line-height: 1.4; }
.chat-form textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.chat-form textarea:focus { outline: none; }
.chat-form:focus-within { border-color: var(--gold); }
.chat-form .send { width: 40px; height: 40px; padding: 0; border-radius: 12px; flex: none; justify-self: auto; }
.chat-form .send .i { margin: 0; width: 20px; height: 20px; }
@media (max-width: 767px) {
  .chat { min-height: calc(100vh - 56px - var(--mobile-dock-height) - 40px); }
  .chat-head h1 { font-size: 1.5rem; }
  .chat-form { bottom: calc(var(--mobile-dock-height) + 10px + env(safe-area-inset-bottom, 0px)); border-radius: 16px; }
  body.keyboard-open .chat-form { bottom: 8px; }
  .msg { max-width: 94%; }
}
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: rgba(2, 6, 33, .72); backdrop-filter: blur(4px); }
.sheet { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: grid; gap: 12px; justify-items: center; text-align: center; padding: 26px 22px 20px; background: var(--panel); border: 1px solid #4f422c; border-radius: 22px; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.sheet img { border-radius: 50%; }
.sheet h2 { font-size: 1.6rem; }
.sheet .step { width: 100%; display: flex; gap: 12px; text-align: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--base); }
.sheet .step > div { display: grid; gap: 4px; min-width: 0; flex: 1; }
.sheet .step small { color: var(--muted); }
.sheet .step button { justify-self: start; margin-top: 6px; min-height: 44px; }
.sheet .hint { font-size: .86rem; margin-top: 4px; }
.sheet .hint .i { width: 16px; height: 16px; vertical-align: -3px; }
.step-done { color: #8fd19e; display: flex; align-items: center; gap: 6px; font-weight: 600; margin-top: 4px; }
.step-done .i { width: 18px; height: 18px; }
.sheet-close { width: 100%; min-height: 46px; }
.menu-install { width: 100%; margin-top: 14px; min-height: 50px; }
@media (max-width: 767px) {
  .sheet-backdrop { place-items: end center; padding: 0; }
  .sheet { width: 100%; border-radius: 22px 22px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}
form[data-action="quiz"] .choice, form[data-action="vote"] .choice { min-height: 50px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--base); cursor: pointer; transition: border-color .15s, background .15s; }
form[data-action="quiz"] .choice:hover, form[data-action="vote"] .choice:hover { border-color: #5a5f7d; }
form[data-action="quiz"] .choice:has(input:checked), form[data-action="vote"] .choice:has(input:checked) { border-color: var(--gold); background: rgba(235, 199, 120, .1); }
form[data-action="quiz"] .choice input, form[data-action="vote"] .choice input { width: 18px; height: 18px; }
form[data-action="quiz"] button, form[data-action="vote"] button { min-height: 46px; }
@media (max-width: 767px) { .mobile-tabs .i { width: 21px; height: 21px; } }
.login-page { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 8px 0; }
.signed-out { background: radial-gradient(ellipse 80% 55% at 50% 0%, rgba(188, 147, 67, .16), transparent 70%), var(--base); }
.login-card { width: min(440px, 100%); display: grid; justify-items: center; gap: 6px; text-align: center; padding: 34px 28px 26px; background: rgba(2, 6, 33, .86); border: 1px solid #4f422c; border-radius: 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
.login-logo { width: 120px; height: 120px; object-fit: cover; border-radius: 50%; border: 2px solid #514329; margin-bottom: 10px; filter: drop-shadow(0 6px 18px rgba(188, 147, 67, .25)); }
.login-card .eyebrow { margin-bottom: 2px; }
.login-card h1 { font-size: 2.5rem; }
.login-lead { margin: 6px 0 18px; font-size: .95rem; max-width: 36ch; }
.google-button { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 12px; border-radius: 12px; background: #fff; color: #1f1f1f; font-weight: 600; font-size: 1rem; border: 1px solid #dadce0; transition: box-shadow .15s, transform .15s; }
.google-button:hover { box-shadow: 0 4px 16px rgba(235, 199, 120, .35); }
.google-button:active { transform: scale(.99); }
.g-logo { width: 22px; height: 22px; flex: none; }
.login-status { width: 100%; display: grid; gap: 4px; text-align: start; padding: 12px 14px; margin-bottom: 12px; border: 1px solid #514329; border-radius: 12px; background: rgba(235, 199, 120, .08); color: var(--text); font-size: .9rem; }
.login-status strong { color: var(--bright); }
.login-status span { color: var(--muted); }
.login-perks { list-style: none; width: 100%; margin: 20px 0 6px; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; text-align: start; }
.login-perks li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; }
.login-perks .i { width: 20px; height: 20px; color: var(--bright); }
.login-foot { margin-top: 10px; font-size: .78rem; }
@media (max-width: 480px) {
  .login-page { min-height: calc(100vh - 36px); }
  .login-card { padding: 28px 20px 22px; border-radius: 20px; }
  .login-logo { width: 104px; height: 104px; }
  .login-card h1 { font-size: 2.2rem; }
}
/* No zoom: stop double-tap zoom, and keep inputs at 16px so iOS does not zoom on focus. */
html, body { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; }
@media (max-width: 767px) { input, textarea, select { font-size: 16px; } }
/* Pull to refresh */
body { overscroll-behavior-y: contain; }
.ptr { position: fixed; z-index: 15; top: -48px; left: 50%; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--muted); box-shadow: 0 6px 18px rgba(0, 0, 0, .4); transform: translate(-50%, 0); transition: transform .25s ease, color .15s; pointer-events: none; }
.ptr.dragging { transition: color .15s; }
.ptr.ready, .ptr.spinning { color: var(--bright); border-color: #514329; }
.ptr .i { width: 20px; height: 20px; }
.ptr.spinning .i { animation: ptr-spin .8s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ptr.spinning .i { animation-duration: 2s; } }
/* Page headings: calmer size on wide screens */
.page-heading h1 { font-size: clamp(2rem, 3.2vw, 2.8rem); }
/* Feed */
.filter-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 0 16px; padding-bottom: 2px; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-row button { flex: none; border-radius: 999px; padding: .45rem .95rem; font-size: .86rem; font-weight: 600; background: var(--panel); }
.filter-row button.selected { background: var(--bright); color: var(--night); border-color: var(--bright); }
.post { display: grid; gap: 8px; }
.post.pinned { border-color: #514329; }
.post-head { display: flex; align-items: center; gap: 8px; font-size: .76rem; color: var(--muted); }
.post-type { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 999px; background: rgba(235, 199, 120, .12); color: var(--bright); font-weight: 700; }
.post-type .i { width: 14px; height: 14px; }
.post-pin { padding: 3px 8px; border-radius: 999px; border: 1px solid #514329; color: var(--bright); font-weight: 600; }
.post-head time { margin-left: auto; }
.post h3 { font-size: 1.12rem; line-height: 1.35; }
.post .content-line { margin: 0; color: #c9d0e2; }
.post form { margin-top: 6px; gap: 8px; }
.poll-results { display: grid; gap: 8px; margin-top: 6px; }
.poll-bar { position: relative; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--base); }
.poll-bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(170, 180, 205, .12); transition: width .5s ease; }
.poll-bar.mine { border-color: var(--gold); }
.poll-bar.mine .fill { background: rgba(235, 199, 120, .2); }
.poll-label, .poll-pct { position: relative; }
.poll-label { flex: 1; min-width: 0; }
.poll-pct { font-weight: 700; color: var(--bright); }
.poll-total { font-size: .8rem; margin-top: 2px; }
.card.empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 32px 20px; color: var(--muted); }
.card.empty .i { width: 30px; height: 30px; }
/* Board workspace */
.back-link { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--bright); font-size: .88rem; margin-bottom: 4px; }
.back-link .i { width: 16px; height: 16px; transform: rotate(180deg); }
.admin-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { flex: none; white-space: nowrap; }
.section-head .count { font-size: .8rem; color: var(--muted); padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; }
.member-list { display: grid; }
.member-row { border-top: 1px solid var(--line); }
.member-row summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 2px; cursor: pointer; min-height: 60px; }
.member-row summary::-webkit-details-marker { display: none; }
.member-row summary > .i { width: 16px; height: 16px; color: var(--muted); transition: transform .2s; }
.member-row[open] summary > .i { transform: rotate(90deg); }
.member-row .member-form { padding: 4px 0 16px; }
.list-main { flex: 1; min-width: 0; display: grid; }
.list-main strong, .list-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main small { color: var(--muted); font-size: .8rem; }
.badge { flex: none; font-size: .72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(235, 199, 120, .12); color: var(--bright); }
.badge.off { background: rgba(240, 168, 160, .12); color: #f0a8a0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.row-actions { display: flex; gap: 6px; flex: none; }
.row-actions button, .list-row > button { padding: .4rem .7rem; font-size: .8rem; }
button.danger { color: #f0a8a0; }
button.danger:hover { border-color: #f0a8a0; }
.sub-head { margin-top: 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
@media (max-width: 480px) {
  .form-grid { grid-template-columns: 1fr; }
  .list-row:has(.row-actions) { flex-wrap: wrap; }
  .row-actions { width: 100%; }
  .row-actions button { flex: 1; }
}
/* Members directory */
.admin-grid:has(.directory) { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.directory-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 8px; }
.member-row[hidden] { display: none; }
.member-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--base); border: 1px solid var(--line); }
.member-details dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.member-details dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.on { background: #8fd19e; }
.dot.wait { background: #5a6080; }
.dot.off { background: #f0a8a0; }
.badge.board { background: rgba(143, 209, 158, .14); color: #8fd19e; }
.remove-member { margin: 10px 0 16px; width: 100%; }
.hint { font-size: .84rem; }
@media (max-width: 900px) { .admin-grid:has(.directory) { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .directory-tools, .member-details { grid-template-columns: 1fr; } }
/* Poll choices show live percentages before voting */
.poll-choice { position: relative; overflow: hidden; }
.poll-choice .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(170, 180, 205, .12); transition: width .5s ease; pointer-events: none; }
.poll-choice:has(input:checked) .fill { background: rgba(235, 199, 120, .2); }
.poll-choice input, .poll-choice .poll-label, .poll-choice .poll-pct { position: relative; }
.poll-choice .poll-label { flex: 1; min-width: 0; }
form[data-action="vote"] .poll-total { margin: 2px 0 4px; }
/* Role access chips, inbox details, points history */
.access { display: grid; gap: 6px; margin: 4px 0 6px; }
.access-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.access-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: .76rem; padding: 3px 9px; border-radius: 999px; border: 1px solid #514329; color: var(--bright); background: rgba(235, 199, 120, .08); }
.chip.off { border-color: var(--line); color: var(--muted); background: transparent; }
.note-body { margin: 4px 0 6px; font-size: .9rem; white-space: pre-line; }
.history-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
#points-history .ranking li { grid-template-columns: 48px 1fr; }
#points-history .plus { color: #8fd19e; font-weight: 700; }
#points-history .minus { color: #f0a8a0; font-weight: 700; }
