@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage-grotesque/files/bricolage-grotesque-latin-wght-normal.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Hanken'; src: url('/fonts/hanken-grotesk/files/hanken-grotesk-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'JetBrains'; src: url('/fonts/jetbrains-mono/files/jetbrains-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --font-display: 'Bricolage', 'Segoe UI', sans-serif;
  --font-body: 'Hanken', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains', Consolas, monospace;
  --radius: 18px;
  --radius-sm: 11px;
  --signal: #c6f135;
  --signal-ink: #141a06;
  color-scheme: dark;
  --bg: #0d100f;
  --surface: #151917;
  --surface-2: #1e2320;
  --surface-3: #282e2a;
  --line: rgba(236, 245, 230, .09);
  --line-strong: rgba(236, 245, 230, .18);
  --text: #eef2ea;
  --muted: #9aa59d;
  --accent: #c6f135;
  --event: #c6f135;
  --meeting: #74c7ff;
  --deadline: #ff8a66;
  --submission: #bda4ff;
  --danger: #ff7d6e;
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    color-scheme: light;
    --bg: #f3f2ea;
    --surface: #fdfcf7;
    --surface-2: #efeee4;
    --surface-3: #e4e3d7;
    --line: rgba(24, 28, 20, .1);
    --line-strong: rgba(24, 28, 20, .2);
    --text: #161a15;
    --muted: #5f675d;
    --accent: #4c6a00;
    --event: #5f8500;
    --meeting: #0f6fb4;
    --deadline: #c8481f;
    --submission: #6a44c9;
    --danger: #bf3322;
    --shadow: 0 24px 60px rgba(40, 44, 30, .18);
  }
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f3f2ea;
  --surface: #fdfcf7;
  --surface-2: #efeee4;
  --surface-3: #e4e3d7;
  --line: rgba(24, 28, 20, .1);
  --line-strong: rgba(24, 28, 20, .2);
  --text: #161a15;
  --muted: #5f675d;
  --accent: #4c6a00;
  --event: #5f8500;
  --meeting: #0f6fb4;
  --deadline: #c8481f;
  --submission: #6a44c9;
  --danger: #bf3322;
  --shadow: 0 24px 60px rgba(40, 44, 30, .18);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.12; letter-spacing: -.02em; font-weight: 650; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
small { font-size: 12.5px; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { flex: none; display: block; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.kicker { font: 500 11.5px/1.4 var(--font-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 12px; white-space: nowrap;
  font-weight: 600; font-size: 14px; background: var(--surface-2); border: 1px solid var(--line);
  transition: background .15s, transform .15s, border-color .15s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--signal); color: var(--signal-ink); border-color: transparent; }
.btn-primary:hover { background: #d6ff4d; border-color: transparent; }
.btn-ink { background: var(--signal-ink); color: var(--signal); border-color: transparent; }
.btn-ink:hover { background: #000; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { background: var(--danger); color: #1b0a06; border-color: transparent; }
.btn-danger:hover { background: var(--danger); filter: brightness(1.1); }
.btn-danger-text { color: var(--danger); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.icon-btn {
  width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px;
  color: var(--muted); transition: background .15s, color .15s; position: relative; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.link-btn { font-size: 13px; font-weight: 600; color: var(--accent); }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--danger); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 99px;
  font: 500 11px/1 var(--font-mono); letter-spacing: .02em; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); vertical-align: middle;
}
.badge-live { background: color-mix(in srgb, var(--event) 16%, transparent); color: var(--accent); }
.badge-warn { background: color-mix(in srgb, var(--deadline) 16%, transparent); color: var(--deadline); }
.badge-lock { background: color-mix(in srgb, var(--submission) 16%, transparent); color: var(--submission); }
.badge.kind-event { color: var(--event); } .badge.kind-meeting { color: var(--meeting); } .badge.kind-deadline { color: var(--deadline); }
.role-head { background: var(--signal); color: var(--signal-ink); }
.role-deputy { background: color-mix(in srgb, var(--meeting) 18%, transparent); color: var(--meeting); }
.count { font: 500 12px/1 var(--font-mono); padding: 5px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }

.avatar {
  width: 36px; height: 36px; flex: none; display: inline-grid; place-items: center; border-radius: 50%;
  font: 600 12.5px/1 var(--font-mono); color: #10130e;
}
.avatar-lg { width: 48px; height: 48px; font-size: 15px; }
.avatar-0 { background: #c6f135; } .avatar-1 { background: #8ed2ff; } .avatar-2 { background: #ffa387; } .avatar-3 { background: #cdb9ff; }

/* ---------- Sign in ---------- */
.auth { min-height: 100dvh; display: grid; grid-template-columns: 1.25fr 1fr; background: var(--bg); }
.auth-art {
  position: relative; overflow: hidden; background: #0a0d0c; color: #eef2ea;
  padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between; min-height: 300px;
}
#network { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-art::after { content: ''; position: absolute; inset: 45% 0 0; background: linear-gradient(transparent, #0a0d0c 72%); pointer-events: none; }
.auth-copy { z-index: 1; }
.auth-brand { position: relative; display: flex; align-items: center; gap: 12px; font-weight: 600; color: #eef2ea; }
.auth-brand .logo-mark { color: var(--signal); }
.auth-copy { position: relative; }
.auth-copy .kicker { color: var(--signal); margin-bottom: 14px; }
.auth-copy h1 { font-size: clamp(38px, 5.4vw, 76px); line-height: 1; letter-spacing: -.035em; font-weight: 700; }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(380px, 100%); }
.auth-card h2 { font-size: 30px; margin-bottom: 6px; }
.auth-card .kicker { margin-bottom: 10px; color: var(--accent); }
.auth-card .form-grid { margin-top: 26px; }
.auth-card > .btn { margin-top: 24px; }
.auth-note { margin-top: 20px; font-size: 13px; color: var(--muted); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field label, .field legend { font-size: 13px; font-weight: 600; padding: 0; }
.field small, .field-check small { color: var(--muted); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); transition: border-color .15s, background .15s;
}
.field textarea { resize: vertical; line-height: 1.5; }
.field input[type=file] { padding: 9px; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: var(--line-strong); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field-check { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; font-size: 14px; font-weight: 500; }
.field-check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.field-check small { display: block; font-weight: 400; }
.form-error { color: var(--danger); font-size: 13.5px; font-weight: 500; }

.stars-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stars-field legend { float: left; }
.stars { display: inline-flex; flex-direction: row-reverse; margin-left: auto; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { color: var(--surface-3); cursor: pointer; padding: 2px; transition: color .1s, transform .1s; }
.stars label .icon { fill: currentColor; stroke: currentColor; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: var(--signal); }
.stars label:hover { transform: scale(1.12); }
.stars label.skip, .stars label.skip:hover { color: var(--muted) !important; font-size: 12px; font-weight: 600; align-self: center; padding: 4px 10px 4px 0; transform: none; }
.stars input:checked + label.skip { color: var(--text) !important; }
.form-heading { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.form-heading h3 { font-size: 17px; }
.form-heading p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.stars input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 6px; }
:root[data-theme='light'] .stars label:hover, :root[data-theme='light'] .stars label:hover ~ label, :root[data-theme='light'] .stars input:checked ~ label { color: var(--event); }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 244px; z-index: 30; padding: 22px 14px 14px;
  display: flex; flex-direction: column; gap: 22px; background: var(--bg); border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 2px 8px; }
.brand .logo-mark { color: var(--accent); flex: none; }
.brand strong { display: block; font: 650 16px/1.15 var(--font-display); letter-spacing: -.01em; }
.brand small { display: block; font-size: 11.5px; color: var(--muted); }
.sidebar nav { display: grid; gap: 2px; flex: 1; align-content: start; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 12px;
  color: var(--muted); font-weight: 500; transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.nav-item.active .icon { color: var(--accent); }
.me { display: flex; align-items: center; gap: 11px; padding: 9px; border-radius: 14px; border: 1px solid var(--line); min-width: 0; }
.me:hover { background: var(--surface); }
.me span:last-child { min-width: 0; }
.me strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { display: block; color: var(--muted); }

.main { margin-left: 244px; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px;
  padding: 12px 32px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px);
}
.brand-mobile { display: none; padding: 0; }
.view { max-width: 1160px; margin: 0 auto; padding: 4px 32px 64px; outline: none; }
.view:not(.no-anim) > * { animation: rise .38s cubic-bezier(.2, .7, .2, 1) both; }
.view:not(.no-anim) > *:nth-child(2) { animation-delay: .04s; }
.view:not(.no-anim) > *:nth-child(3) { animation-delay: .08s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.bell-count {
  position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--signal); color: var(--signal-ink); font: 700 10px/17px var(--font-mono); text-align: center;
}
.tabs, .scrim { display: none; }

.inbox {
  position: fixed; top: 62px; right: 24px; z-index: 40; width: min(390px, calc(100vw - 32px));
  max-height: min(600px, calc(100dvh - 90px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.inbox-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 12px; }
.inbox-head h2 { font-size: 17px; }
.inbox-list { overflow-y: auto; padding: 0 6px 6px; }
.inbox-item { display: flex; gap: 11px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 12px; position: relative; }
.inbox-item:hover { background: var(--surface-2); }
.inbox-icon { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.inbox-item.unread .inbox-icon { background: var(--signal); color: var(--signal-ink); }
.inbox-text { min-width: 0; font-size: 13px; color: var(--muted); }
.inbox-text strong { display: block; font-size: 14px; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.inbox-text span { display: block; overflow-wrap: anywhere; }
.inbox-text time { font-size: 12px; }
.inbox-empty { padding: 26px 18px 34px; text-align: center; color: var(--muted); }

#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100vw - 32px); pointer-events: none; }
.toast {
  padding: 11px 17px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow); animation: rise .25s both; transition: opacity .3s, transform .3s;
}
.toast.error { background: var(--danger); color: #1b0a06; }
.toast.leaving { opacity: 0; transform: translateY(6px); }

/* ---------- Page furniture ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: clamp(32px, 4vw, 44px); font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; }
.page-head p { color: var(--muted); margin-top: 6px; }
.section-title { font-size: 18px; margin: 34px 0 14px; }
.back { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.back:hover { color: var(--text); }
.stack { display: grid; gap: 16px; margin-top: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2, .card > h2 { font-size: 19px; }
.card-actions { margin-top: 16px; }

.empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 44px 20px; color: var(--muted); }
.empty h3 { font-size: 19px; color: var(--text); }
.empty .btn { margin-top: 10px; }
.empty-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 15px; background: var(--surface-2); margin-bottom: 6px; color: var(--accent); }

.trust-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); padding: 12px 14px; margin-bottom: 18px; border-radius: 13px; border: 1px dashed var(--line-strong); }
.trust-note .icon { margin-top: 2px; color: var(--accent); }
.state-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 13px; background: var(--surface-2); font-size: 14px; color: var(--muted); }
.state-note .icon { margin-top: 2px; }
.state-note.done { color: var(--text); }
.state-note.done .icon { color: var(--accent); }

/* ---------- Home ---------- */
.home-head { margin-bottom: 22px; }
.home-head h1 { font-size: clamp(36px, 5.2vw, 60px); font-weight: 700; letter-spacing: -.035em; margin-top: 6px; }
.home-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.home-grid > :nth-child(1) { grid-column: span 7; }
.home-grid > :nth-child(2) { grid-column: span 5; }
.home-grid > :nth-child(3) { grid-column: span 12; }
.home-grid > :nth-child(4) { grid-column: span 12; }
.hero {
  position: relative; overflow: hidden; min-height: 300px; padding: 26px 28px; border-radius: var(--radius);
  background: var(--signal); color: var(--signal-ink); display: flex; flex-direction: column; align-items: flex-start;
}
.hero .kicker { color: inherit; opacity: .72; }
.hero h2 { position: relative; font-size: clamp(30px, 4vw, 46px); line-height: 1.02; font-weight: 700; letter-spacing: -.03em; margin: 12px 0 auto; max-width: 15ch; overflow-wrap: anywhere; }
.hero-count { position: relative; font: 700 19px/1.2 var(--font-display); margin-top: 24px; }
.hero-meta { position: relative; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; font-weight: 500; margin-top: 8px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-graph { position: absolute; right: -14px; top: -6px; width: 300px; opacity: .17; pointer-events: none; }
.hero-empty .btn { position: relative; margin-top: 14px; }
.hero-empty h2 { margin-bottom: 8px; }

.todo { display: grid; gap: 2px; margin: 0 -10px; }
.todo a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; transition: background .15s; }
.todo a:hover { background: var(--surface-2); }
.todo-icon { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 11px; }
.todo-submission { background: color-mix(in srgb, var(--submission) 17%, transparent); color: var(--submission); }
.todo-poll { background: color-mix(in srgb, var(--meeting) 17%, transparent); color: var(--meeting); }
.todo-rating { background: color-mix(in srgb, var(--event) 17%, transparent); color: var(--event); }
.todo-text { min-width: 0; flex: 1; }
.todo-text strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-text small { color: var(--muted); }
.todo-go { font-size: 12.5px; font-weight: 600; color: var(--accent); }
.all-clear { display: grid; justify-items: center; gap: 8px; padding: 42px 0; color: var(--muted); }
.all-clear .icon { color: var(--accent); }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { min-height: 128px; padding: 10px; border-radius: 13px; background: var(--surface-2); min-width: 0; }
.week-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.week-name { display: block; font: 500 10.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.week-num { display: block; font: 650 23px/1.2 var(--font-display); margin: 3px 0 8px; }
.week-items { display: grid; gap: 4px; }
.week-item { display: block; font-size: 11.5px; line-height: 1.3; padding-left: 7px; border-left: 2px solid var(--kind); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-item b { display: block; font-weight: 500; color: var(--muted); font-size: 10.5px; }
.week-more { font-size: 11px; color: var(--muted); }

.kind-event { --kind: var(--event); } .kind-meeting { --kind: var(--meeting); } .kind-deadline { --kind: var(--deadline); } .kind-submission { --kind: var(--submission); }

.mini-posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mini-post { padding: 14px; border-radius: 13px; background: var(--surface-2); min-width: 0; transition: background .15s; }
.mini-post:hover { background: var(--surface-3); }
.mini-post strong { display: block; font-weight: 650; }
.mini-post p { color: var(--muted); font-size: 13.5px; margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-post small { color: var(--muted); }

/* ---------- Planner ---------- */
.planner { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.calendar { padding: 18px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding: 2px 4px; gap: 8px; }
.cal-head h2 { font-size: 22px; }
.cal-nav { display: flex; align-items: center; gap: 2px; }
.cal-nav .btn { margin-right: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-weekdays { margin-bottom: 6px; }
.cal-weekdays span { font: 500 10.5px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 4px 8px; }
.cal-day {
  display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 92px; padding: 6px; text-align: left;
  border-radius: 11px; background: var(--surface-2); min-width: 0; transition: background .12s, box-shadow .12s;
}
.cal-day:hover { background: var(--surface-3); }
.cal-day.outside { background: transparent; }
.cal-day.outside .cal-num { opacity: .4; }
.cal-day.selected { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-num { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; font-size: 13px; font-weight: 600; }
.cal-day.today .cal-num { background: var(--signal); color: var(--signal-ink); }
.cal-chips { display: grid; gap: 2px; min-width: 0; }
.chip {
  display: block; font-size: 11px; line-height: 1.5; font-weight: 500; padding: 0 5px; border-radius: 5px;
  background: color-mix(in srgb, var(--kind) 18%, transparent); color: var(--kind);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip-more { font-size: 11px; color: var(--muted); padding-left: 5px; }
.cal-dots { display: none; gap: 3px; justify-content: center; }
.cal-dots i, .legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--kind); display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 14px 4px 2px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.agenda-card { position: sticky; top: 72px; }
.agenda-card h2 { font-size: 17px; }
.agenda { display: grid; gap: 6px; margin-bottom: 14px; }
.agenda-empty { padding: 8px 0 20px; }
.agenda-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 10px 12px; text-align: left; border-radius: 12px; background: var(--surface-2);
  box-shadow: inset 3px 0 0 var(--kind); transition: background .12s;
}
.agenda-item:hover { background: var(--surface-3); }
.agenda-time { font: 500 12px/1 var(--font-mono); color: var(--muted); width: 62px; flex: none; }
.agenda-text { min-width: 0; flex: 1; }
.agenda-text strong { display: block; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.agenda-text small { color: var(--muted); }
.detail { display: grid; gap: 10px; }
.detail-row { display: flex; align-items: center; gap: 9px; color: var(--muted); }

/* ---------- Board ---------- */
.posts { display: grid; gap: 14px; max-width: 760px; }
.post-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; flex-wrap: wrap; }
.post-head strong { display: block; font-size: 14px; }
.post-head small { color: var(--muted); }
.post h2 { font-size: 22px; margin-bottom: 8px; overflow-wrap: anywhere; }
.post-restricted { border-color: color-mix(in srgb, var(--submission) 40%, transparent); }
.post-actions { display: flex; gap: 16px; margin-top: 14px; }

/* ---------- Polls and ratings ---------- */
.poll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 16px; align-items: start; }
.poll { display: grid; gap: 12px; }
.rating { display: grid; gap: 12px; justify-items: stretch; }
.rating > .btn { justify-self: start; }
.poll h2, .rating h2 { font-size: 21px; overflow-wrap: anywhere; }
.poll-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.poll-foot { display: flex; align-items: center; gap: 14px; color: var(--muted); padding-top: 2px; }
.vote-form { display: grid; gap: 12px; justify-items: start; }
.choices { display: grid; gap: 6px; width: 100%; }
.choice { display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); border: 1px solid transparent; transition: border-color .12s, background .12s; overflow-wrap: anywhere; }
.choice span::before { content: ''; width: 16px; height: 16px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); transition: border .12s; }
.choice:hover span { background: var(--surface-3); }
.choice input:checked + span { border-color: var(--accent); }
.choice input:checked + span::before { border: 5px solid var(--accent); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.bars { display: grid; gap: 11px; flex: 1; min-width: 0; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; margin-bottom: 5px; }
.bar-label b { font: 500 13px/1.5 var(--font-mono); }
.bar-track { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-track span { display: block; height: 100%; border-radius: inherit; background: var(--muted); }
.rating .bar-track span, .bar.winner .bar-track span { background: var(--event); }
.bar.winner .bar-label span { font-weight: 650; }
.rating-results { display: flex; gap: 22px; align-items: center; }
.score { text-align: center; flex: none; }
.score b { display: block; font: 700 46px/1 var(--font-display); letter-spacing: -.03em; }
.score small { color: var(--muted); }
.peer-scores { display: grid; gap: 11px; padding-top: 14px; border-top: 1px solid var(--line); }
.peer-scores h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quotes { display: grid; gap: 7px; }
.quotes li { padding: 10px 13px; border-radius: 12px; background: var(--surface-2); font-size: 14px; overflow-wrap: anywhere; }

/* ---------- Rows, submissions, team ---------- */
.rows { display: grid; gap: 8px; }
.row-link { display: flex; align-items: center; gap: 13px; padding: 13px 16px; flex-wrap: wrap; transition: border-color .15s; }
a.row-link:hover { border-color: var(--line-strong); }
.row-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); color: var(--accent); }
.row-text { flex: 1 1 180px; min-width: 0; }
.row-text strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.row-text small { color: var(--muted); }
.is-done { opacity: .62; }
.handin { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.attachments:empty { display: none; }
.attachment { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; font-weight: 500; overflow-wrap: anywhere; }
.attachment:hover { background: var(--surface-3); }
.attachment small { color: var(--muted); font-weight: 400; }
.feedback { margin: 14px 0 0; padding: 11px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 12px 12px 0; white-space: pre-wrap; }
.feedback strong { display: block; font-size: 12.5px; color: var(--muted); }
.review-list { display: grid; }
.review-row { display: flex; gap: 12px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.review-row:first-child { border-top: 0; padding-top: 2px; }
.review-main { flex: 1; min-width: 0; }
.review-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.missing { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.missing b { color: var(--text); font-weight: 600; margin-right: 6px; }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.member { display: flex; align-items: center; gap: 13px; padding: 16px; flex-wrap: wrap; }
.member-text { flex: 1 1 110px; min-width: 0; }
.member-text strong { display: block; font-weight: 650; overflow-wrap: anywhere; }
.member-text small { color: var(--muted); }
.copy-link { display: flex; gap: 8px; margin-bottom: 10px; }
.copy-link input { flex: 1; min-width: 0; padding: 0 12px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); font: 12.5px var(--font-mono); }
.account-id { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.account-id strong { display: block; font-size: 17px; }
.account-id small { color: var(--muted); overflow-wrap: anywhere; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 16px; align-items: start; }
.account-grid .btn { justify-self: start; }

/* ---------- Modal ---------- */
.modal {
  width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line-strong);
  border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.modal[open] { animation: rise .22s cubic-bezier(.2, .7, .2, 1); }
.modal::backdrop { background: rgba(5, 7, 6, .62); backdrop-filter: blur(3px); }
.modal-body { padding: 22px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.modal-head h2 { font-size: 23px; overflow-wrap: anywhere; }
.modal-head p { color: var(--muted); font-size: 14px; margin-top: 5px; overflow-wrap: anywhere; }
.modal-head .icon-btn { margin: -8px -8px 0 0; }
.modal-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.modal .form-error { margin-top: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .planner { grid-template-columns: 1fr; }
  .agenda-card { position: static; }
  .mini-posts { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: minmax(250px, 34dvh) 1fr; }
  .auth-art { padding: 22px 20px; }
  .auth-panel { place-items: start center; padding: 28px 16px; }

  .sidebar { transform: translateX(-100%); transition: transform .24s cubic-bezier(.2, .7, .2, 1); width: 270px; visibility: hidden; }
  .nav-open .sidebar { transform: none; visibility: visible; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: rgba(5, 7, 6, .6); }
  .main { margin-left: 0; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .topbar { padding: 8px 16px; }
  .brand-mobile { display: flex; }
  .brand-mobile strong { font-size: 16px; }
  .view { padding: 4px 16px 32px; }
  .inbox { top: 58px; right: 16px; }
  #toasts { bottom: calc(86px + env(safe-area-inset-bottom)); }

  .tabs {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0; z-index: 20;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  }
  .tabs a, .tabs button { display: grid; justify-items: center; gap: 3px; padding: 6px 0; border-radius: 10px; font-size: 11px; font-weight: 500; color: var(--muted); }
  .tabs a.active { color: var(--text); }
  .tabs a.active .icon { color: var(--accent); }

  .home-grid > * { grid-column: 1 / -1 !important; }
  .hero { min-height: 250px; padding: 22px; }
  .hero-graph { width: 230px; }
  .week-grid { display: flex; overflow-x: auto; margin: 0 -22px; padding: 0 22px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .week-day { flex: 0 0 132px; scroll-snap-align: start; }

  .calendar { padding: 12px; }
  .cal-grid { gap: 2px; }
  .cal-weekdays span { padding: 4px 0; text-align: center; font-size: 9.5px; letter-spacing: .03em; }
  .cal-day { min-height: 52px; align-items: center; padding: 4px 1px; }
  .cal-chips { display: none; }
  .cal-dots { display: flex; }
  .card { padding: 18px; }
  .week { overflow: hidden; }
  .rating-results { align-items: stretch; flex-direction: column; gap: 14px; }
  .score { display: flex; align-items: baseline; gap: 8px; text-align: left; }
  .review-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Finish ---------- */
::selection { background: var(--signal); color: var(--signal-ink); }
html { scrollbar-color: var(--surface-3) transparent; }
body { font-variant-numeric: tabular-nums; }

/* Faint node grid behind the top of every page */
.main { position: relative; }
.main::before {
  content: ''; position: fixed; inset: 0 0 auto 244px; height: 380px; pointer-events: none;
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1.4px); background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(#000, transparent); mask-image: linear-gradient(#000, transparent);
}
.view { position: relative; }

.page-head h1.dot::after { content: '.'; color: var(--accent); }

/* Sidebar */
.nav-item { position: relative; }
.nav-item .icon { transition: transform .18s; }
.nav-item:hover .icon { transform: translateX(2px); }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 11px; bottom: 11px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}

/* Surfaces */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, var(--text)), var(--surface) 130px);
  transition: border-color .18s, transform .18s;
}
a.card:hover, .member:hover, .mini-post:hover { transform: translateY(-2px); }
.mini-post { transition: background .15s, transform .18s; }
.member:hover, .poll:hover, .rating:hover { border-color: var(--line-strong); }
.post-restricted { box-shadow: inset 3px 0 0 var(--submission); }

/* Controls */
.btn-primary { box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset; }
.btn-primary:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 8px 26px color-mix(in srgb, var(--signal) 32%, transparent); transform: translateY(-1px); }
.field input:focus, .field textarea:focus, .field select:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.avatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line-strong); }

/* Home */
.home-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 10px; color: var(--muted); }
.home-summary b { color: var(--text); font-weight: 600; }
.home-summary i { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.hero { background: radial-gradient(130% 150% at 100% 0%, #e2ff7a 0%, var(--signal) 58%); }
.hero-graph { opacity: .3; }
.hero-graph circle { transform-box: fill-box; transform-origin: center; animation: node-pulse 3.6s ease-in-out infinite; }
.hero-graph circle:nth-child(2n) { animation-delay: -1.2s; }
.hero-graph circle:nth-child(3n) { animation-delay: -2.4s; }
@keyframes node-pulse { 50% { transform: scale(1.35); } }
.hero-count { font-size: clamp(26px, 3vw, 34px); letter-spacing: -.02em; }
.week-day { transition: background .15s; }
.week-day:hover { background: var(--surface-3); }
.week-day.is-today { background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }

/* Planner */
.chip { border-left: 2px solid var(--kind); border-radius: 3px 5px 5px 3px; }
.cal-day.today { background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }

/* Board uses the full width */
.posts { max-width: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); align-items: start; }

/* Polls and ratings */
.poll-meta .badge-live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: live 2s ease-in-out infinite;
}
@keyframes live { 50% { opacity: .3; } }
.bar-track span { transform-origin: left; }
.view:not(.no-anim) .bar-track span { animation: grow .7s cubic-bezier(.2, .7, .2, 1) both .12s; }
@keyframes grow { from { transform: scaleX(0); } }
.quotes li { position: relative; padding-left: 26px; }
.quotes li::before { content: '\201C'; position: absolute; left: 10px; top: 5px; font: 700 20px/1.2 var(--font-display); color: var(--accent); }

.empty { border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.card .empty { border: 0; }

/* Sign in */
.auth-card h2 { font-size: 34px; font-weight: 700; letter-spacing: -.03em; }

@media (max-width: 860px) {
  .main::before { left: 0; height: 260px; }
  .nav-item.active::before { display: none; }
}

/* ---------- Chat room ---------- */
.view:has(.chat) { padding-bottom: 14px; }
.chat { display: flex; flex-direction: column; height: calc(100dvh - 84px); min-height: 380px; }
.chat .page-head { margin-bottom: 16px; }
.chat-log {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
.chat-log > :first-child { margin-top: auto; }
.chat-log .empty { border: 0; margin: auto; }
.chat-day { align-self: center; margin: 8px 0 4px; font-size: 12px; color: var(--muted); }
.chat-day span { padding: 3px 12px; border-radius: 99px; background: var(--surface-2); }
.chat-msg {
  align-self: flex-start; max-width: min(620px, 82%); padding: 9px 14px 7px;
  background: var(--surface-2); border-radius: 4px 16px 16px 16px;
}
.chat-msg p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.chat-msg footer { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.chat-msg .link-btn { font-size: 11.5px; opacity: 0; color: var(--danger); }
.chat-msg:hover .link-btn, .chat-msg .link-btn:focus-visible { opacity: 1; }
.chat-msg.mine {
  align-self: flex-end; border-radius: 16px 4px 16px 16px;
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
}
.chat-compose { display: flex; align-items: flex-end; gap: 10px; margin-top: 12px; }
.chat-compose textarea {
  flex: 1; min-width: 0; min-height: 46px; max-height: 150px; padding: 11px 14px; resize: none; field-sizing: content;
  font: inherit; line-height: 1.45; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 14px;
}
.chat-compose textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.chat-compose .btn { width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 14px; flex: none; }
.chat-hint { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }

.chat-unread .nav-item[data-nav='chat']::after {
  content: ''; width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--accent);
}
.chat-unread .tabs [data-act='openNav'] { position: relative; }
.chat-unread .tabs [data-act='openNav']::after {
  content: ''; position: absolute; top: 6px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}

@media (hover: none) { .chat-msg .link-btn { opacity: 1; } }
@media (max-width: 860px) {
  .chat { height: calc(100dvh - 150px); }
  .chat-log { padding: 12px; }
  .chat-msg { max-width: 90%; }
  .chat-hint { display: none; }
}

/* ---------- Create ---------- */
.nav-create { margin-bottom: 10px; }
.head-actions { display: flex; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; }
.create-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.create-tab {
  display: flex; align-items: center; gap: 11px; min-width: 0; padding: 13px 14px; border-radius: 15px; color: var(--muted);
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, transform .18s, color .15s;
}
.create-tab:hover { border-color: var(--line-strong); color: var(--text); transform: translateY(-1px); }
.create-tab.active { color: var(--text); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.create-tab.active .icon { color: var(--accent); }
.create-tab .icon { flex: none; }
.create-tab span { min-width: 0; }
.create-tab strong { display: block; font-size: 14px; color: var(--text); }
.create-tab small { display: block; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.create-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.create-form { padding: 22px; display: grid; gap: 16px; }
.create-side { position: sticky; top: 74px; display: grid; gap: 10px; min-width: 0; }
.preview-card { pointer-events: none; display: grid; gap: 10px; }
.preview-card h2 { overflow-wrap: anywhere; }
.preview-card .prose { overflow-wrap: anywhere; }
.ghost { color: var(--muted); opacity: .65; font-weight: 400; }
.seg { display: inline-flex; width: fit-content; max-width: 100%; flex-wrap: wrap; gap: 3px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 13px; border-radius: 9px; font-size: 13.5px; font-weight: 500; color: var(--muted); transition: background .15s, color .15s; }
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .18), inset 0 0 0 1px var(--line-strong); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset {
  padding: 5px 11px; border-radius: 99px; font: inherit; font-size: 12.5px; color: var(--muted); text-align: left; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); transition: color .15s, border-color .15s;
}
.preset:hover { color: var(--text); border-color: var(--accent); }
.preset-link { display: inline-flex; align-items: center; gap: 6px; justify-self: start; }
.option-rows { display: grid; gap: 7px; margin-top: 4px; }
.option-row { display: flex; align-items: center; gap: 6px; }
.option-row input { flex: 1; min-width: 0; }
.option-add { justify-self: start; }

/* ---------- Meeting approvals and breakdowns ---------- */
.requests { margin-bottom: 22px; display: grid; gap: 8px; }
.requests .section-title { margin: 0 0 4px; }
.request { display: flex; align-items: center; gap: 13px; padding: 13px 16px; flex-wrap: wrap; border-left: 3px solid var(--meeting); }
.request.is-declined { border-left-color: var(--danger); }
.request .row-text { flex: 1; min-width: 180px; display: grid; gap: 2px; }
.request small { color: var(--muted); }
.request-note { color: var(--danger) !important; }
.request-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip.is-pending, .agenda-item.is-pending { opacity: .72; outline: 1px dashed var(--line-strong); outline-offset: -1px; }
.agenda-item.is-done strong { text-decoration: line-through; color: var(--muted); }
.steps { display: grid; gap: 4px; margin-top: 6px; }
.steps h3 { font-size: 15px; margin-bottom: 4px; }
.steps h3 small { font: 400 12.5px var(--font-body); color: var(--muted); margin-left: 6px; }
.step { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); cursor: pointer; }
.step input { margin-top: 3px; accent-color: var(--accent); }
.step strong { display: block; font-size: 14px; font-weight: 500; }
.step small { color: var(--muted); }
.step.is-done strong { text-decoration: line-through; color: var(--muted); }

/* ---------- Assistant ---------- */
.view:has(.assistant) { padding-bottom: 14px; }
.assistant { display: flex; flex-direction: column; height: calc(100dvh - 84px); min-height: 380px; }
.assistant .page-head { margin-bottom: 14px; }
.ai-tools { display: flex; align-items: center; gap: 2px; }
.ai-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; padding: 4px 2px 14px; }
.ai-log > :first-child { margin-top: auto; }
.ai-intro { display: grid; gap: 16px; justify-items: center; margin-bottom: auto; }
.ai-intro .empty { border: 0; padding-bottom: 0; }
.ai-suggestions { display: grid; gap: 7px; width: min(620px, 100%); }
.ai-suggestions .preset { border-radius: 12px; padding: 10px 14px; font-size: 13.5px; }
.ai-msg p { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.ai-user { align-self: flex-end; max-width: min(620px, 85%); padding: 9px 14px; border-radius: 16px 4px 16px 16px; background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); }
.ai-bot { display: flex; gap: 11px; max-width: min(760px, 100%); }
.ai-avatar { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--signal); color: var(--signal-ink); }
.ai-body { display: grid; gap: 10px; min-width: 0; flex: 1; padding-top: 4px; justify-items: start; }
.ai-cards { display: grid; gap: 10px; width: 100%; }
.ai-card { display: grid; gap: 7px; padding: 14px 16px; border-radius: 15px; background: var(--surface); border: 1px solid var(--line-strong); }
.ai-card.is-settled { border-color: var(--line); }
.ai-card h3 { font-size: 16.5px; overflow-wrap: anywhere; }
.ai-card-type { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent); }
.ai-options { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.ai-options li { padding: 4px 11px; border-radius: 99px; font-size: 13px; background: var(--surface-2); }
.ai-steps { display: grid; gap: 4px; margin: 2px 0 0; padding: 0; list-style: none; counter-reset: step; }
.ai-steps li { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 10px; border-radius: 10px; background: var(--surface-2); counter-increment: step; }
.ai-steps li::before { content: counter(step); font: 600 12px var(--font-mono); color: var(--accent); }
.ai-steps span { flex: 1; min-width: 0; }
.ai-steps strong { display: block; font-size: 13.5px; font-weight: 500; }
.ai-steps small { color: var(--muted); }
.ai-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 13px; color: var(--muted); }
.ai-card-foot.is-done { color: var(--accent); font-weight: 600; }
.ai-thinking { display: flex; gap: 5px; padding: 12px 4px; }
.ai-thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: ai-dot 1.1s ease-in-out infinite; }
.ai-thinking i:nth-child(2) { animation-delay: .15s; }
.ai-thinking i:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot { 50% { opacity: .25; transform: translateY(-3px); } }
.ai-setup { max-width: 520px; padding: 26px; display: grid; gap: 12px; justify-items: start; }
.ai-setup form { width: 100%; }
.prose-list { display: grid; gap: 10px; color: var(--muted); }
.prose-list ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

@media (max-width: 1080px) {
  .create-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .create-tabs { display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding-inline: 16px; }
  .create-tab { flex: none; padding: 9px 13px; }
  .create-tab small { display: none; }
  .create-layout { grid-template-columns: minmax(0, 1fr); }
  .create-side { position: static; }
  .create-form { padding: 16px; }
  .assistant { height: calc(100dvh - 150px); }
}

/* ---------- Event page and tasks ---------- */
.back-link { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 14px; }
.event-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; }
.event-title { display: grid; gap: 7px; min-width: 0; }
.event-title h1 { font-size: clamp(30px, 4vw, 42px); font-weight: 700; letter-spacing: -.03em; overflow-wrap: anywhere; }
.event-head .head-actions { flex-wrap: wrap; }
.event-notes { margin-bottom: 18px; max-width: 760px; }
.event-foot { margin-top: 12px; }
.view > .state-note { margin-bottom: 18px; }
.checklist { display: grid; gap: 12px; }
.checklist-bar { height: 8px; }
.checklist-bar span { background: var(--accent); }
.checklist-empty { display: grid; gap: 10px; justify-items: start; padding: 6px 0; }
.task-list { display: grid; gap: 6px; }
.task {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(130px, 190px) auto; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 12px; background: var(--surface-2);
}
.task input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.task input[type=checkbox]:disabled { cursor: not-allowed; }
.task-text { min-width: 0; }
.task-text strong { display: block; font-size: 14.5px; font-weight: 550; overflow-wrap: anywhere; }
.task-text small { color: var(--muted); }
.task-text a { color: var(--accent); }
.task.is-done strong { text-decoration: line-through; color: var(--muted); }
.task.is-overdue small { color: var(--deadline); }
.task.is-overdue .task-text a { color: inherit; text-decoration: underline; }
.task-assign {
  width: 100%; min-width: 0; padding: 7px 9px; font: inherit; font-size: 13px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 9px; cursor: pointer;
}
.task-owner { display: flex; align-items: center; gap: 7px; font-size: 13px; min-width: 0; }
.task-tools { display: flex; align-items: center; gap: 2px; }
.avatar-sm { width: 24px; height: 24px; font-size: 10px; flex: none; }
.task-add { display: grid; grid-template-columns: minmax(0, 1fr) 210px 150px auto; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.task-add input, .task-add select {
  min-width: 0; padding: 9px 11px; font: inherit; font-size: 14px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.task-add input:focus, .task-add select:focus { outline: none; border-color: var(--accent); }
.task-group { display: grid; gap: 6px; }
.task-groups { display: grid; gap: 14px; }
.ai-via { font: 11.5px var(--font-mono); color: var(--muted); }
.ai-models { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.ai-setup code, .prose-list code { font: 12.5px var(--font-mono); padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }

@media (max-width: 860px) {
  .task { grid-template-columns: auto minmax(0, 1fr) auto; }
  .task > .task-assign, .task > .task-owner { grid-column: 2 / -1; grid-row: 2; }
  .task-add { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .task-add input[name=title] { grid-column: 1 / -1; }
  .task-add .btn { grid-column: 1 / -1; }
}

.member-about, .member-contact { flex: 1 0 100%; margin: 0; font-size: 13px; }
.member-about { color: var(--muted); overflow-wrap: anywhere; }
.member-contact { display: flex; flex-wrap: wrap; gap: 14px; }

.res-events { display: grid; gap: 14px; }
.res-event { padding: 18px; display: grid; gap: 14px; }
.res-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.res-title { min-width: 0; }
.res-title h2 { font-size: 19px; overflow-wrap: anywhere; }
.res-title a:hover { color: var(--accent); }
.res-stage-wrap_up { color: var(--accent); }
.res-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.res-phase { display: grid; gap: 10px; align-content: start; justify-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; }
.res-phase.is-due { border-color: var(--accent); }
.res-phase h3 { font-size: 14px; }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.res-item { display: flex; align-items: center; gap: 10px; min-width: 0; }
.res-item .row-icon { width: 32px; height: 32px; border-radius: 10px; }
.res-item .row-text a { display: block; overflow-wrap: anywhere; }
.res-item .row-text small { display: block; overflow-wrap: anywhere; }
.ai-warning { font-size: 13px; color: var(--danger); }
