/* ============================================================
   Maple Hollow — Neighborhood Hub prototype
   Theme token system: 3 visual directions × 2 densities
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--canvas, #e9eaee);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--fs);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }

/* ---------- DENSITY (default: comfortable) ---------- */
:root {
  --pad: 20px;
  --pad-tight: 14px;
  --gap: 14px;
  --fs: 15px;
  --fs-sm: 13px;
  --fs-xs: 11.5px;
  --row-pad: 13px;
  --control-h: 38px;
  --sidebar-w: 244px;
}
[data-density="compact"] {
  --pad: 13px;
  --pad-tight: 10px;
  --gap: 8px;
  --fs: 13.5px;
  --fs-sm: 12px;
  --fs-xs: 11px;
  --row-pad: 8px;
  --control-h: 32px;
  --sidebar-w: 216px;
}

/* ---------- THEME A: CIVIC SLATE (default) ---------- */
:root, [data-theme="slate"] {
  --canvas: oklch(0.93 0.006 260);
  --bg: oklch(0.975 0.004 260);
  --surface: oklch(1 0 0);
  --surface-2: oklch(0.985 0.004 260);
  --surface-3: oklch(0.965 0.006 260);
  --text: oklch(0.27 0.025 264);
  --muted: oklch(0.52 0.022 264);
  --faint: oklch(0.66 0.018 264);
  --border: oklch(0.915 0.008 264);
  --border-strong: oklch(0.86 0.012 264);
  --accent: oklch(0.52 0.15 262);
  --accent-hover: oklch(0.46 0.15 262);
  --accent-fg: oklch(0.99 0.01 262);
  --accent-soft: oklch(0.955 0.025 262);
  --accent-border: oklch(0.88 0.05 262);
  --font-ui: "Hanken Grotesk", system-ui, sans-serif;
  --font-head: "Hanken Grotesk", system-ui, sans-serif;
  --head-weight: 700;
  --head-spacing: -0.01em;
  --radius: 9px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 2px oklch(0.4 0.03 264 / 0.06), 0 1px 3px oklch(0.4 0.03 264 / 0.05);
  --shadow-md: 0 4px 14px oklch(0.4 0.03 264 / 0.08), 0 1px 3px oklch(0.4 0.03 264 / 0.06);
  --shadow-pop: 0 12px 40px oklch(0.35 0.04 264 / 0.18);
}

/* ---------- THEME B: WARM CLAY ---------- */
[data-theme="clay"] {
  --canvas: oklch(0.9 0.014 67);
  --bg: oklch(0.975 0.012 70);
  --surface: oklch(0.995 0.006 72);
  --surface-2: oklch(0.978 0.012 70);
  --surface-3: oklch(0.955 0.016 67);
  --text: oklch(0.29 0.025 52);
  --muted: oklch(0.52 0.028 55);
  --faint: oklch(0.66 0.025 58);
  --border: oklch(0.9 0.018 62);
  --border-strong: oklch(0.84 0.026 60);
  --accent: oklch(0.56 0.13 42);
  --accent-hover: oklch(0.5 0.13 42);
  --accent-fg: oklch(0.99 0.012 60);
  --accent-soft: oklch(0.95 0.03 50);
  --accent-border: oklch(0.86 0.06 48);
  --font-ui: "Figtree", system-ui, sans-serif;
  --font-head: "Figtree", system-ui, sans-serif;
  --head-weight: 700;
  --head-spacing: -0.015em;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px oklch(0.4 0.04 50 / 0.07), 0 1px 3px oklch(0.4 0.04 50 / 0.05);
  --shadow-md: 0 6px 18px oklch(0.4 0.04 50 / 0.09), 0 1px 3px oklch(0.4 0.04 50 / 0.06);
  --shadow-pop: 0 14px 44px oklch(0.35 0.05 50 / 0.2);
}

/* ---------- THEME C: SAGE CIVIC ---------- */
[data-theme="sage"] {
  --canvas: oklch(0.9 0.016 150);
  --bg: oklch(0.972 0.012 150);
  --surface: oklch(0.995 0.005 150);
  --surface-2: oklch(0.975 0.012 150);
  --surface-3: oklch(0.952 0.016 150);
  --text: oklch(0.26 0.022 158);
  --muted: oklch(0.48 0.022 156);
  --faint: oklch(0.62 0.02 154);
  --border: oklch(0.895 0.016 152);
  --border-strong: oklch(0.83 0.024 152);
  --accent: oklch(0.46 0.085 158);
  --accent-hover: oklch(0.4 0.085 158);
  --accent-fg: oklch(0.985 0.012 150);
  --accent-soft: oklch(0.945 0.025 154);
  --accent-border: oklch(0.85 0.045 154);
  --font-ui: "Public Sans", system-ui, sans-serif;
  --font-head: "Newsreader", Georgia, serif;
  --head-weight: 560;
  --head-spacing: 0;
  --radius: 5px;
  --radius-sm: 3px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px oklch(0.35 0.03 156 / 0.07), 0 1px 3px oklch(0.35 0.03 156 / 0.05);
  --shadow-md: 0 4px 14px oklch(0.35 0.03 156 / 0.09), 0 1px 3px oklch(0.35 0.03 156 / 0.06);
  --shadow-pop: 0 12px 40px oklch(0.3 0.04 156 / 0.2);
}

/* semantic priority colors (kept consistent, lightly tuned) */
:root {
  --urgent: oklch(0.55 0.2 25);
  --urgent-soft: oklch(0.955 0.035 28);
  --urgent-border: oklch(0.88 0.07 28);
  --important: oklch(0.64 0.13 64);
  --important-soft: oklch(0.955 0.04 75);
  --important-border: oklch(0.87 0.08 70);
  --success: oklch(0.55 0.12 155);
  --success-soft: oklch(0.95 0.04 155);
}

/* ============================================================
   STAGE + DEVICE
   ============================================================ */
.stage {
  min-height: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.stage[data-device="mobile"] {
  align-items: flex-start;
  padding: 28px 16px;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--surface-3), var(--canvas));
}
.app-shell {
  container-type: inline-size;
  width: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* phone frame */
.stage[data-device="mobile"] .phone {
  width: 393px;
  flex: none;
  border-radius: 46px;
  background: oklch(0.18 0.01 264);
  padding: 11px;
  box-shadow: var(--shadow-pop), 0 0 0 2px oklch(0.3 0.01 264);
  position: sticky;
  top: 28px;
}
.stage[data-device="mobile"] .phone-screen {
  border-radius: 36px;
  overflow: hidden;
  height: calc(100vh - 112px);
  min-height: 620px;
  position: relative;
  background: var(--bg);
}
.stage[data-device="mobile"] .app-shell {
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.phone-notch {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 116px; height: 27px; background: oklch(0.18 0.01 264);
  border-radius: 16px; z-index: 60;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-layout { display: flex; flex: 1; min-height: 0; }

.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  gap: 4px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px 16px;
}
.brand-mark {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-fg);
  display: grid; place-items: center;
}
.brand-name { font-family: var(--font-head); font-weight: var(--head-weight);
  font-size: 16px; letter-spacing: var(--head-spacing); line-height: 1.1; white-space: nowrap; }
.brand-sub { font-size: var(--fs-xs); color: var(--faint); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--muted); font-size: var(--fs-sm); font-weight: 500;
  cursor: pointer; border: 0; background: transparent; width: 100%;
  text-align: left; position: relative;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active svg { color: var(--accent); }
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--faint); }
.nav-item .count {
  margin-left: auto; font-size: var(--fs-xs); font-weight: 700;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--urgent); color: white; display: grid; place-items: center;
}
.nav-item.active .count { background: var(--accent); }

.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); position: relative; }

.sidebar-switcher { position: static; }
.sidebar-switcher > summary { list-style: none; }
.sidebar-switcher > summary::-webkit-details-marker { display: none; }
.sidebar-switcher-dropdown {
  position: absolute; bottom: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-pop); z-index: 100;
  overflow: hidden; padding: 4px;
}
.sidebar-switcher-item {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px; width: 100%;
  background: none; border: none; font: inherit; cursor: pointer; color: var(--text);
  border-radius: var(--radius-sm); text-align: left;
}
.sidebar-switcher-item:hover { background: var(--surface-3); }
.sidebar-switcher-email { font-size: var(--fs-sm); font-weight: 600; }
.sidebar-switcher-role { font-size: var(--fs-xs); color: var(--faint); }
.viewing-as {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  border-radius: var(--radius-sm); cursor: pointer; border: 1px solid var(--border);
  background: var(--surface-2); width: 100%; text-align: left;
  text-decoration: none; color: inherit;
}
.viewing-as:hover { border-color: var(--border-strong); }
.viewing-as .va-text { line-height: 1.25; min-width: 0; }
.viewing-as .va-name { font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.viewing-as .va-role { font-size: var(--fs-xs); color: var(--faint); }
.viewing-as .va-chev { margin-left: auto; color: var(--faint); }

/* main column */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.topbar {
  height: 60px; flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 24px; border-bottom: 1px solid var(--border);
  background: color-mix(in oklch, var(--bg) 80%, transparent);
  backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 30;
}
.topbar-title { font-family: var(--font-head); font-weight: var(--head-weight);
  font-size: 18px; letter-spacing: var(--head-spacing); }
.topbar-spacer { flex: 1; }

.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
  color: white; font-weight: 700; font-size: 0.82em; display: grid; place-items: center;
  user-select: none; border: 2px solid transparent; transition: border-color 120ms;
}
.user-menu[open] .user-menu-avatar,
.user-menu > summary:hover .user-menu-avatar { border-color: var(--accent); filter: brightness(1.1); }
.user-menu-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-pop);
  min-width: 160px; z-index: 100; overflow: hidden;
}
.user-menu-item {
  display: block; padding: 9px 14px; font-size: var(--fs-sm); color: var(--text);
  text-decoration: none; white-space: nowrap;
}
.user-menu-item:hover { background: var(--surface-3); }
.search {
  display: flex; align-items: center; gap: 8px; height: 34px;
  padding: 0 12px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid transparent; color: var(--muted); min-width: 180px; max-width: 280px;
}
.search input { border: 0; background: transparent; outline: none; color: var(--text);
  font: inherit; font-size: var(--fs-sm); width: 100%; }
.search svg { width: 15px; height: 15px; flex: none; }

.icon-btn {
  position: relative; width: 36px; height: 36px; flex: none;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
  display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--urgent); border: 2px solid var(--bg);
}
.icon-btn .notif-count {
  position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px;
  padding: 0 4px; border-radius: 8px; background: var(--urgent); color: #fff;
  border: 2px solid var(--bg); font-size: 10px; font-weight: 700;
  line-height: 1; display: grid; place-items: center;
}

.content { flex: 1; overflow-y: auto; min-height: 0; }
.content-inner { max-width: 760px; margin: 0 auto; padding: 26px 24px 80px; }
.content-inner.wide { max-width: 1000px; }

/* device segmented control in topbar */
.device-seg { display: flex; background: var(--surface-3); border-radius: 8px; padding: 3px; gap: 2px; }
.device-seg button { border: 0; background: transparent; padding: 5px 8px; border-radius: 6px;
  color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.device-seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.device-seg svg { width: 16px; height: 16px; display: block; }

/* ============================================================
   PRIMITIVES
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--control-h); padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s, transform .04s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { height: calc(var(--control-h) - 8px); padding: 0 11px; font-size: var(--fs-xs); }
.btn-danger { color: var(--urgent); border-color: var(--urgent-border); background: var(--urgent-soft); }
.btn-danger:hover { background: color-mix(in oklch, var(--urgent-soft) 80%, var(--urgent)); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em;
  background: var(--surface-3); color: var(--muted); border: 1px solid transparent;
  white-space: nowrap;
}
.badge.role-admin { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-border); }
.badge.role-moderator { background: var(--important-soft); color: oklch(0.5 0.13 60); border-color: var(--important-border); }
.badge.role-member { background: var(--surface-3); color: var(--faint); }
.badge .dot-i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.prio {
  display: inline-flex; align-items: center; gap: 6px;
  height: 23px; padding: 0 10px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  border: 1px solid transparent;
}
.prio[data-prio="urgent"] { background: var(--urgent-soft); color: var(--urgent); border-color: var(--urgent-border); }
.prio[data-prio="important"] { background: var(--important-soft); color: oklch(0.48 0.13 60); border-color: var(--important-border); }
.prio[data-prio="normal"] { background: var(--surface-3); color: var(--faint); }
.prio svg { width: 13px; height: 13px; }

.avatar {
  flex: none; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; color: white; font-size: 0.82em; line-height: 1;
  width: 34px; height: 34px; user-select: none; background: var(--accent);
}
.avatar.sm { width: 26px; height: 26px; }
.avatar.lg { width: 44px; height: 44px; }
.avatar.xl { width: 60px; height: 60px; font-size: 1.1em; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

.meta { color: var(--faint); font-size: var(--fs-sm); }
.dotsep::before { content: "·"; margin: 0 7px; color: var(--border-strong); }

/* ============================================================
   ANNOUNCEMENT FEED
   ============================================================ */
.page-head { margin-bottom: 18px; display: flex; align-items: flex-end; gap: 14px; }
.page-head h1 { font-family: var(--font-head); font-weight: var(--head-weight);
  letter-spacing: var(--head-spacing); font-size: 27px; margin: 0; line-height: 1.1; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.page-head .grow { flex: 1; }

.filterbar { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .ct { opacity: .6; font-variant-numeric: tabular-nums; }

.feed { display: flex; flex-direction: column; gap: var(--gap); }
.ann-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: var(--pad); cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .12s, box-shadow .12s, transform .06s;
}
.ann-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.ann-card:active { transform: translateY(1px); }
.ann-card[data-prio="urgent"] { border-left: 3px solid var(--urgent); }
.ann-card.pinned-card { background: linear-gradient(180deg, var(--accent-soft), var(--surface) 56px); }
.ann-top { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.ann-author { line-height: 1.25; min-width: 0; flex-shrink: 0; }
.ann-author .nm { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.ann-author .ti { font-size: var(--fs-xs); color: var(--faint); }
.ann-top .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.ann-title { font-family: var(--font-head); font-weight: var(--head-weight);
  letter-spacing: var(--head-spacing); font-size: 18px; margin: 0 0 5px; line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.ann-excerpt { color: var(--muted); font-size: var(--fs-sm); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ann-foot { display: flex; align-items: center; gap: 16px; margin-top: 14px;
  color: var(--faint); font-size: var(--fs-sm); }
.ann-foot .f { display: inline-flex; align-items: center; gap: 6px; }
.ann-foot svg { width: 15px; height: 15px; }
.pin-flag { display: inline-flex; align-items: center; gap: 5px; color: var(--accent);
  font-size: var(--fs-xs); font-weight: 700; }
.pin-flag svg { width: 13px; height: 13px; }

/* ============================================================
   DETAIL / ARTICLE
   ============================================================ */
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; background: 0; border: 0;
  padding: 6px 0; margin-bottom: 14px; }
.backlink:hover { color: var(--text); }
.backlink svg { width: 16px; height: 16px; }

.article-head { margin-bottom: 18px; }
.article-head h1 { font-family: var(--font-head); font-weight: var(--head-weight);
  letter-spacing: var(--head-spacing); font-size: 30px; line-height: 1.15; margin: 12px 0 14px; }
.byline { display: flex; align-items: center; gap: 11px; }
.byline .b-text { line-height: 1.3; }
.byline .b-name { font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.byline .b-meta { font-size: var(--fs-xs); color: var(--faint); white-space: nowrap; }
.byline .right { margin-left: auto; display: flex; gap: 6px; }

.prose { color: var(--text); font-size: calc(var(--fs) + 1px); line-height: 1.7; }
.prose p { margin: 0 0 16px; }
.prose strong { font-weight: 700; }
.prose ul { margin: 0 0 16px; padding-left: 22px; }
.prose li { margin: 0 0 7px; }
.prose .callout { background: var(--surface-3); border-radius: var(--radius-sm);
  padding: 14px 16px; border-left: 3px solid var(--accent); margin: 0 0 16px; }
.img-placeholder {
  border-radius: var(--radius-sm); border: 1px dashed var(--border-strong);
  background-image: repeating-linear-gradient(45deg, var(--surface-3), var(--surface-3) 10px, var(--surface-2) 10px, var(--surface-2) 20px);
  display: grid; place-items: center; color: var(--faint); margin: 0 0 16px;
  font-family: ui-monospace, monospace; font-size: var(--fs-xs); min-height: 180px; text-align: center;
}

.divider { height: 1px; background: var(--border); margin: 24px 0; border: 0; }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.comments-head h2 { font-family: var(--font-head); font-weight: var(--head-weight);
  font-size: 18px; margin: 0; letter-spacing: var(--head-spacing); }
.locked-note { display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  background: var(--surface-3); border-radius: var(--radius-sm); color: var(--muted);
  font-size: var(--fs-sm); margin-bottom: 16px; }
.locked-note svg { width: 16px; height: 16px; }

.comment { display: flex; gap: 11px; padding: 14px 0; border-top: 1px solid var(--border); }
.comment:first-child { border-top: 0; }
.comment .c-body { min-width: 0; flex: 1; }
.c-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.c-name { font-weight: 600; font-size: var(--fs-sm); }
.c-time { color: var(--faint); font-size: var(--fs-xs); }
.reply-to { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs);
  color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.c-text { font-size: var(--fs-sm); color: var(--text); line-height: 1.55; }
.c-actions { display: flex; gap: 14px; margin-top: 7px; }
.c-act { background: 0; border: 0; padding: 0; color: var(--faint); font-size: var(--fs-xs);
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.c-act:hover { color: var(--text); }
.c-act.danger:hover { color: var(--urgent); }
.c-act svg { width: 13px; height: 13px; }
.c-hidden { font-style: italic; color: var(--faint); font-size: var(--fs-sm);
  display: flex; align-items: center; gap: 8px; }
.mod-tag { font-size: var(--fs-xs); color: var(--important); font-weight: 700; }

/* Moderation: tombstones for hidden content + staff action toolbars */
.tombstone { display: flex; align-items: center; gap: 8px; padding: 14px 16px;
  border: 1px dashed var(--border); border-radius: var(--radius); background: var(--surface);
  color: var(--faint); font-style: italic; font-size: var(--fs-sm); }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mod-actions form { margin: 0; }
.c-actions form { margin: 0; }

.composer { display: flex; gap: 11px; padding-top: 18px; }
.composer-box { flex: 1; }
.replying-banner { display: flex; align-items: center; justify-content: space-between;
  font-size: var(--fs-xs); color: var(--accent); margin-bottom: 6px; }
.replying-banner button { background: 0; border: 0; color: var(--faint); cursor: pointer; font-weight: 700; }
.input, .textarea {
  width: 100%; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm);
  padding: 10px 12px; outline: none; resize: vertical;
}
.input { height: var(--control-h); padding: 0 12px; }
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; align-items: center; }

/* ============================================================
   POLL
   ============================================================ */
.attach-card { border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-sm); padding: var(--pad); margin: 0 0 var(--gap); }
.attach-head { display: flex; align-items: center; gap: 9px; margin-bottom: 4px; }
.attach-kicker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.06em; line-height: 1.4;
  text-transform: uppercase; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.attach-kicker svg { width: 14px; height: 14px; }
.attach-title { font-family: var(--font-head); font-weight: var(--head-weight);
  font-size: 17px; margin: 0 0 14px; letter-spacing: var(--head-spacing); }

.poll-opt {
  position: relative; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 11px 13px; margin-bottom: 9px; cursor: pointer; overflow: hidden;
  display: flex; align-items: center; gap: 11px; background: var(--surface);
  transition: border-color .12s;
}
.poll-opt:hover { border-color: var(--accent); }
.poll-opt .fill { position: absolute; inset: 0; background: var(--accent-soft);
  transform-origin: left; transition: width .5s cubic-bezier(.3,.7,.4,1); z-index: 0; }
.poll-opt.mine, .poll-opt:has(.poll-radio-input:checked) { border-color: var(--accent); }
.poll-opt > * { position: relative; z-index: 1; }
/* native radio drives the selected state; hide it but keep it focusable */
.poll-opt .poll-radio-input { position: absolute; opacity: 0; margin: 0; pointer-events: none; }
.poll-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-strong);
  flex: none; display: grid; place-items: center; }
.poll-opt.mine .poll-radio, .poll-opt:has(.poll-radio-input:checked) .poll-radio { border-color: var(--accent); }
.poll-opt.mine .poll-radio::after, .poll-opt:has(.poll-radio-input:checked) .poll-radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.poll-opt .opt-label { font-size: var(--fs-sm); font-weight: 600; flex: 1; }
.poll-opt .opt-pct { font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.poll-opt.mine .opt-pct, .poll-opt:has(.poll-radio-input:checked) .opt-pct { color: var(--accent); }
/* options are radio labels inside one form */
.poll-form { display: block; }
.poll-voters { display: flex; align-items: center; gap: 6px; margin-top: 12px; color: var(--faint); font-size: var(--fs-xs); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.poll-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 10px; }
.poll-foot .meta { white-space: nowrap; }

/* ============================================================
   ACTION ITEMS
   ============================================================ */
.ai-row { display: flex; align-items: center; gap: 12px; padding: var(--row-pad) 0;
  border-top: 1px solid var(--border); }
.ai-row:first-of-type { border-top: 0; }
.ai-check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--border-strong);
  flex: none; cursor: pointer; background: var(--surface); display: grid; place-items: center; color: transparent; }
.ai-check:hover { border-color: var(--accent); }
.ai-check.done { background: var(--success); border-color: var(--success); color: white; }
.ai-check svg { width: 14px; height: 14px; }
.ai-main { flex: 1; min-width: 0; }
.ai-title { font-size: var(--fs-sm); font-weight: 600; }
.ai-row.is-done .ai-title { text-decoration: line-through; color: var(--faint); }
.ai-sub { font-size: var(--fs-xs); color: var(--faint); display: flex; gap: 10px; align-items: center; margin-top: 2px; }
.ai-sub .due { display: inline-flex; align-items: center; gap: 4px; }
.ai-sub .due svg { flex: none; }
.ai-sub .due.over { color: var(--urgent); font-weight: 700; }
.ai-owner { display: flex; align-items: center; gap: 7px; }
.ai-assign { font-size: var(--fs-xs); color: var(--accent); font-weight: 600; cursor: pointer;
  background: 0; border: 1px dashed var(--accent-border); border-radius: 999px; padding: 4px 10px;
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ai-assign svg { width: 11px; height: 11px; }
.ai-assign:hover { background: var(--accent-soft); }
.ai-context { color: var(--muted); font-weight: 600; max-width: 32ch;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-context:hover { color: var(--accent); }
.ai-owner-name { color: var(--muted); font-weight: 600; }
/* button_to wraps its <button> in a <form>; keep it transparent to the row's flexbox */
.ai-row form.button_to { display: contents; }
.ai-assign-menu .user-menu-dropdown { width: 212px; max-height: 248px; overflow-y: auto; padding: 6px; }
.ai-assign-menu .user-menu-item { display: flex; align-items: center; gap: 9px; border-radius: var(--radius-sm); }
.ai-stats { display: flex; gap: 12px; margin-bottom: 8px; }
.ai-stat { flex: 1; padding: 14px 16px; }
.ai-stat .n { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 26px; line-height: 1; }
.ai-stat .n.done { color: var(--success); }
.ai-stat .l { margin-top: 4px; }

.group-head { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--faint); margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; }
.group-head .line { flex: 1; height: 1px; background: var(--border); }

/* ----- add action item: empty entry, ghost link, and the reveal form ----- */
.add-attach { display: flex; gap: 13px; align-items: center; width: 100%; text-align: left;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); padding: 14px 16px; cursor: pointer; color: var(--text);
  margin-bottom: var(--gap); transition: border-color .12s, background .12s; }
.add-attach:hover { border-color: var(--accent); background: var(--accent-soft); }
.add-attach .ic { width: 38px; height: 38px; flex: none; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--muted); display: grid; place-items: center; }
.add-attach:hover .ic { background: var(--surface); color: var(--accent); }
.add-attach .ic svg { width: 19px; height: 19px; }
.add-attach .t { font-weight: 600; font-size: var(--fs-sm); }
.add-attach .d { font-size: var(--fs-xs); color: var(--faint); margin-top: 1px; }
.add-attach .plus { margin-left: auto; color: var(--accent); display: grid; place-items: center; }

.form-errors { background: var(--urgent-soft); color: var(--urgent);
  border: 1px solid var(--urgent-border); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: var(--fs-sm); margin-bottom: 16px; }
.form-errors div { font-weight: 600; }

.ai-add-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  background: 0; border: 0; padding: 6px 2px; cursor: pointer;
  color: var(--accent); font-weight: 600; font-size: var(--fs-sm); }
.ai-add-link:hover { color: var(--accent-hover); }
.ai-add-link svg { width: 14px; height: 14px; }

.opt-edit, .act-edit { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.opt-edit .dot { width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid var(--border-strong); }
.act-edit .chk { width: 21px; height: 21px; border-radius: 6px; flex: none;
  border: 2px solid var(--border-strong); background: var(--surface); }
.opt-edit .input, .act-edit .input { flex: 1; }
.act-edit .input.due { flex: none; width: 132px; }
.act-edit select.input.who { flex: none; width: 150px; cursor: pointer; }
.row-rm { width: 32px; height: 32px; flex: none; border: 0; background: transparent;
  color: var(--faint); cursor: pointer; border-radius: var(--radius-sm);
  display: grid; place-items: center; }
.row-rm:hover { background: var(--urgent-soft); color: var(--urgent); }
.row-rm[disabled] { opacity: .28; cursor: not-allowed; }
.row-rm svg { width: 15px; height: 15px; }
.editor-note { font-size: var(--fs-xs); color: var(--muted); display: flex; gap: 7px;
  align-items: center; margin-top: 12px; }
.editor-note svg { width: 13px; height: 13px; flex: none; }
.attach-remove { margin-left: auto; background: 0; border: 0; padding: 4px; cursor: pointer;
  color: var(--faint); border-radius: var(--radius-sm); display: grid; place-items: center; }
.attach-remove:hover { background: var(--urgent-soft); color: var(--urgent); }
.attach-remove svg { width: 16px; height: 16px; }

.ai-add { margin-top: 4px; }
.ai-add-foot { display: flex; align-items: center; gap: 9px; margin-top: 11px; }
.ai-claim { margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-xs); font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.ai-claim input { position: absolute; opacity: 0; pointer-events: none; }
.ai-claim .box { width: 18px; height: 18px; border-radius: 5px; flex: none; display: grid;
  place-items: center; border: 2px solid var(--border-strong); background: var(--surface);
  color: transparent; transition: background .12s, border-color .12s; }
.ai-claim input:checked + .box { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.ai-claim .box svg { width: 11px; height: 11px; }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--text); color: var(--bg); border-radius: var(--radius);
  padding: 9px 18px; font-size: var(--fs-sm); font-weight: 500;
  box-shadow: var(--shadow-pop); z-index: 200; pointer-events: none;
  opacity: 0; transition: opacity 180ms ease, transform 180ms ease; white-space: nowrap;
}
.toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   NOTIFICATIONS
   ============================================================ */
.notif-pop {
  position: absolute; top: 52px; right: 16px; width: 380px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop); z-index: 80; overflow: hidden;
}
/* When the popover hangs off the topbar bell trigger it is anchored to the
   36px-wide <details>, not .main — so re-anchor it directly under the bell. */
.notif-bell .notif-pop { top: calc(100% + 6px); right: 0; }
.notif-pop-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); }
.notif-pop-head b { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 15px; }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif { display: flex; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; position: relative; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--accent-soft); }
.notif.unread:hover { background: color-mix(in oklch, var(--accent-soft) 80%, var(--surface)); }
.notif-ic { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted); }
.notif-ic svg { width: 17px; height: 17px; }
.notif-ic.urgent { background: var(--urgent-soft); color: var(--urgent); }
.notif-ic.task { background: var(--accent-soft); color: var(--accent); }
.notif-tx { font-size: var(--fs-sm); line-height: 1.4; min-width: 0; flex: 1;
  color: var(--text); text-decoration: none; }
.notif-tx .n-time { color: var(--faint); font-size: var(--fs-xs); margin-top: 3px; }
.notif-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }
.notif-mark-read { flex: none; align-self: flex-start; background: transparent; border: 0;
  color: var(--accent); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; padding: 2px 4px; }
.notif-mark-read:hover { text-decoration: underline; }

/* preferences */
.pref-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.pref-row { display: grid; grid-template-columns: 1fr auto auto; gap: 24px; align-items: center;
  padding: var(--row-pad) 18px; border-top: 1px solid var(--border); }
.pref-row:first-child { border-top: 0; }
.pref-row.head { background: var(--surface-2); font-size: var(--fs-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); }
.pref-name { font-size: var(--fs-sm); font-weight: 600; }
.pref-desc { font-size: var(--fs-xs); color: var(--faint); margin-top: 2px; }
.pref-col { width: 60px; text-align: center; }
.switch { width: 40px; height: 23px; border-radius: 999px; background: var(--border-strong);
  border: 0; position: relative; cursor: pointer; transition: background .15s; flex: none; }
.switch.on { background: var(--accent); }
.switch i { position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%;
  background: white; transition: transform .15s; box-shadow: var(--shadow-sm); }
.switch.on i { transform: translateX(17px); }
.switch.locked { opacity: .55; cursor: not-allowed; }
/* ============================================================
   TOGGLE FIELD
   ============================================================ */
.toggle-field { display: flex; align-items: flex-start; gap: 12px; }
.toggle-field input[type=checkbox] { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-field .toggle-label { display: flex; flex-direction: column; gap: 3px; padding-top: 2px; }
.toggle-field .toggle-label strong { font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; }
.toggle-field .toggle-label span { font-size: var(--fs-xs); color: var(--faint); line-height: 1.4; }

/* ============================================================
   ADMIN
   ============================================================ */
.seg-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.seg-tab { background: 0; border: 0; padding: 10px 4px; margin-right: 18px; color: var(--muted);
  font-size: var(--fs-sm); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
  position: relative; top: 1px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.seg-tab:hover { color: var(--text); }
.seg-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.seg-tab .ct { background: var(--surface-3); color: var(--muted); border-radius: 999px;
  font-size: var(--fs-xs); padding: 1px 7px; font-weight: 700; }
.seg-tab.on .ct { background: var(--accent-soft); color: var(--accent); }
.seg-tab .t-short { display: none; }

.request-card { display: flex; align-items: flex-start; gap: 14px; padding: var(--pad);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); margin-bottom: var(--gap); }
.request-card .rc-body { flex: 1; min-width: 0; }
.request-card .rc-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.request-card .rc-main { flex: 1; min-width: 0; }
.request-card .rc-name { font-weight: 600; font-size: var(--fs); display: flex;
  align-items: center; gap: 8px; flex-wrap: wrap; }
.request-card .rc-meta { font-size: var(--fs-xs); color: var(--faint); margin-top: 3px; }
.request-card .rc-note { font-size: var(--fs-sm); color: var(--muted); margin-top: 9px;
  background: var(--surface-3); padding: 8px 11px; border-radius: var(--radius-sm); }
.rc-actions { display: flex; gap: 8px; flex: none; }

.mtable { width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mtable th { text-align: left; font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--faint); padding: 11px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); }
.mtable td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); vertical-align: middle; }
.mtable tr:last-child td { border-bottom: 0; }
.mtable tr:hover td { background: var(--surface-2); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .cu-name { font-weight: 600; white-space: nowrap; }
.cell-user .cu-email { font-size: var(--fs-xs); color: var(--faint); }
.role-select { height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); padding: 0 8px; cursor: pointer; }

/* responsive display helpers */
.only-mobile { display: none; }
.only-desktop { display: block; }

/* member cards (mobile alternative to the table) */
.member-cards { display: none; flex-direction: column; gap: var(--gap); }
.member-card { display: flex; gap: 12px; align-items: flex-start; padding: var(--pad-tight) var(--pad);
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.member-card .mc-main { flex: 1; min-width: 0; }
.member-card .mc-name { font-weight: 600; font-size: var(--fs-sm); }
.member-card .mc-email { font-size: var(--fs-xs); color: var(--faint); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.member-card .mc-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 7px;
  display: flex; flex-wrap: wrap; gap: 6px 9px; align-items: center; }
.member-card .mc-sub { white-space: nowrap; }
.member-card .mc-foot { display: flex; align-items: center; gap: 10px; margin-top: 11px; flex-wrap: wrap; }
.member-card .role-select { flex: 1; min-width: 110px; height: 34px; }

.invite-box { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: var(--pad);
  background: var(--surface-2); }
.invite-link { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.invite-link .lk { flex: 1; font-family: ui-monospace, monospace; font-size: var(--fs-sm);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 9px 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   ONBOARDING / AUTH
   ============================================================ */
.auth-stage { min-height: 100vh; display: grid; place-items: center; padding: 32px 20px;
  background: radial-gradient(130% 90% at 50% -10%, var(--accent-soft), var(--bg) 55%); }
.auth-card { width: 100%; max-width: 412px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 32px; }
.auth-brand { display: flex; align-items: center; gap: 11px; justify-content: center; margin-bottom: 26px; }
.auth-brand .brand-name { font-size: 18px; }
.auth-card h1 { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 23px;
  letter-spacing: var(--head-spacing); margin: 0 0 6px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: var(--fs-sm); margin: 0 0 24px; }
.field { margin-bottom: 15px; }
.field label { display: block; font-size: var(--fs-sm); font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: var(--fs-xs); color: var(--faint); margin-top: 5px; }
.auth-steps { display: flex; align-items: center; gap: 6px; justify-content: center; margin-bottom: 24px; }
.auth-steps .s { width: 26px; height: 4px; border-radius: 2px; background: var(--border-strong); }
.auth-steps .s.on { background: var(--accent); }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--faint); font-size: var(--fs-xs); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-section-label { font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 20px 0 12px; }
.magic-sent { text-align: center; padding: 8px 0; }
.magic-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin: 0 auto 18px; }
.magic-icon svg { width: 30px; height: 30px; }
.pw-strength { display: flex; gap: 4px; margin-top: 8px; }
.pw-strength .b { flex: 1; height: 4px; border-radius: 2px; background: var(--border-strong); transition: background .2s; }
.checklist { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-direction: column; gap: 9px; }
.checklist li { display: flex; gap: 9px; align-items: center; font-size: var(--fs-sm); color: var(--muted); }
.checklist .ck { width: 20px; height: 20px; border-radius: 50%; background: var(--success-soft); color: var(--success);
  display: grid; place-items: center; flex: none; }
.checklist .ck svg { width: 12px; height: 12px; }

/* ============================================================
   MOBILE (container query) — collapses sidebar to bottom nav
   ============================================================ */
.bottom-nav { display: none; }
@container (max-width: 720px) {
  .sidebar { display: none; }
  .topbar { padding: 0 16px; height: 54px; }
  .search { display: none; }
  .content-inner { padding: 18px 16px 90px; }
  .bottom-nav {
    display: flex; position: sticky; bottom: 0; z-index: 40;
    background: color-mix(in oklch, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px); border-top: 1px solid var(--border);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  }
  .bn-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: 0; border: 0; padding: 6px 0; color: var(--faint); cursor: pointer; font-size: 10px; font-weight: 600; }
  .bn-item svg { width: 22px; height: 22px; }
  .bn-item.active { color: var(--accent); }
  .page-head h1 { font-size: 22px; }
  .article-head h1 { font-size: 24px; }
  .pref-row { grid-template-columns: 1fr auto auto; gap: 14px; }
  .mtable .hide-sm { display: none; }
  .device-seg { display: none; }
  .notif-pop { right: 8px; left: 8px; width: auto; }

  /* fit all three tabs across the width — no horizontal scroll */
  .seg-tabs { gap: 0; margin-bottom: 18px; }
  .seg-tab { flex: 1; margin-right: 0; justify-content: center; gap: 6px;
    padding: 11px 4px; font-size: 13px; }
  .seg-tab svg { display: none; }
  .seg-tab .t-full { display: none; }
  .seg-tab .t-short { display: inline; }

  /* stack join-request cards vertically */
  .request-card { flex-direction: column; align-items: stretch; gap: 12px; }
  .rc-actions { width: 100%; }
  .rc-actions .btn { flex: 1; }

  /* swap members table for cards */
  .only-desktop { display: none; }
  .only-mobile { display: block; }
  .member-cards.only-mobile { display: flex; }
}
/* hide bottom-nav whenever shell is wide even if not in phone */
@container (min-width: 721px) { .bottom-nav { display: none !important; } }

.ann-comments { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.ann-comments-head { font-family: var(--font-head); font-weight: var(--head-weight);
  font-size: 18px; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.comments-ct { background: var(--surface-3); color: var(--muted); border-radius: 999px;
  padding: 1px 7px; font-size: var(--fs-xs); font-weight: 700; }

/* ============================================================
   FORM GRID (ported from design/src/styles.css)
   ============================================================ */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 15px; }
.field-grid .field { margin-bottom: 0; }
@media (max-width: 560px) { .field-grid { grid-template-columns: 1fr; gap: 15px; } }

/* ============================================================
   MODAL (edit member) — ported from design/src/styles.css
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  padding: 20px; background: color-mix(in oklch, var(--text) 46%, transparent);
  backdrop-filter: blur(2px); animation: modal-in 0.14s ease; }
@keyframes modal-in { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); display: flex; flex-direction: column;
  max-height: min(90vh, 760px); overflow: hidden; animation: modal-pop 0.16s cubic-bezier(.2,.8,.3,1); }
@keyframes modal-pop { from { transform: translateY(8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border); }
.modal-head h3 { font-family: var(--font-head); font-weight: var(--head-weight); font-size: 18px;
  letter-spacing: var(--head-spacing); margin: 0; }
.modal-head p { font-size: var(--fs-sm); color: var(--muted); margin: 4px 0 0; line-height: 1.45; }
.modal-x { flex: none; background: 0; border: 0; padding: 6px; margin: -4px -6px 0 0; cursor: pointer;
  color: var(--faint); border-radius: var(--radius-sm); display: grid; place-items: center; }
.modal-x:hover { background: var(--surface-3); color: var(--text); }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px;
  border-top: 1px solid var(--border); background: var(--surface-2); }
.sanction-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 16px; }
.sanction-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; text-align: left;
  padding: 12px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; color: var(--muted); transition: border-color .12s, background .12s; }
.sanction-opt:hover { border-color: var(--border-strong); }
.sanction-opt .so-label { font-size: var(--fs-sm); font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px; }
.sanction-opt .so-desc { font-size: var(--fs-xs); color: var(--faint); line-height: 1.35; }
/* The prototype toggled an .on class via JS; here the radio drives the highlight. */
.sanction-opt input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sanction-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 3px var(--accent-soft); color: var(--accent); }
.sanction-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) { .sanction-grid { grid-template-columns: 1fr; } }

/* ============================================================
   CLICKABLE MEMBER ROWS
   ============================================================ */
.mtable tr.row-link { cursor: pointer; }
.member-card.row-link { cursor: pointer; }
.row-link-name { color: inherit; text-decoration: none; }
.row-link-name:hover { text-decoration: underline; }

/* ============================================================
   ANNOUNCEMENT COMPOSER (new / edit)
   ============================================================ */
.cmp-intro { display: flex; align-items: center; gap: 8px; }
.cmp-byline { display: flex; align-items: center; gap: 11px; padding-bottom: 16px;
  margin-bottom: 4px; border-bottom: 1px solid var(--border); }
.cmp-byline .b-name { font-weight: 600; font-size: var(--fs-sm); }
.cmp-byline .b-meta { font-size: var(--fs-xs); color: var(--faint); }
.cmp-visibility { margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); color: var(--faint); font-weight: 600; }
.cmp-visibility svg { width: 14px; height: 14px; }

.cmp-field { margin-top: 18px; }
.cmp-label { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm);
  font-weight: 600; margin-bottom: 8px; }
.cmp-label .opt { font-weight: 500; color: var(--faint); font-size: var(--fs-xs);
  margin-left: 2px; }
.cmp-label .count { margin-left: auto; font-size: var(--fs-xs); color: var(--faint);
  font-variant-numeric: tabular-nums; font-weight: 500; }
.input-lg { height: auto; padding: 12px 14px; font-size: 19px; font-weight: 600;
  font-family: var(--font-head); letter-spacing: var(--head-spacing); line-height: 1.3; }

.cmp-attach-head { font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--faint); margin: 26px 0 10px;
  display: flex; align-items: center; gap: 8px; }
.cmp-attach-head .line { flex: 1; height: 1px; background: var(--border); }

/* priority picker */
.prio-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.prio-opt { position: relative; text-align: left; cursor: pointer; display: block;
  border: 1.5px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); padding: 13px 14px 14px; transition: border-color .12s, background .12s, box-shadow .12s; }
.prio-opt:hover { border-color: var(--muted); }
.prio-opt .pp-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--muted); margin-bottom: 10px; }
.prio-opt .pp-ic svg { width: 17px; height: 17px; }
.prio-opt .pp-label { display: block; font-weight: 700; font-size: var(--fs-sm); }
.prio-opt .pp-desc { display: block; font-size: var(--fs-xs); color: var(--faint); margin-top: 3px; line-height: 1.45; }
.prio-opt .pp-tick { position: absolute; top: 11px; right: 11px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: white; opacity: 0; transform: scale(.7); transition: opacity .12s, transform .12s; }
.prio-opt.on .pp-tick { opacity: 1; transform: none; }
.prio-opt[data-prio="normal"].on { border-color: var(--muted); background: var(--surface-2); box-shadow: 0 0 0 3px var(--surface-3); }
.prio-opt[data-prio="normal"].on .pp-ic { background: var(--text); color: var(--bg); }
.prio-opt[data-prio="normal"].on .pp-tick { background: var(--text); }
.prio-opt[data-prio="important"].on { border-color: var(--important-border); background: var(--important-soft); box-shadow: 0 0 0 3px var(--important-soft); }
.prio-opt[data-prio="important"].on .pp-ic { background: var(--important); color: white; }
.prio-opt[data-prio="important"].on .pp-label { color: oklch(0.46 0.13 64); }
.prio-opt[data-prio="important"].on .pp-tick { background: var(--important); }
.prio-opt[data-prio="urgent"].on { border-color: var(--urgent-border); background: var(--urgent-soft); box-shadow: 0 0 0 3px var(--urgent-soft); }
.prio-opt[data-prio="urgent"].on .pp-ic { background: var(--urgent); color: white; }
.prio-opt[data-prio="urgent"].on .pp-label { color: var(--urgent); }
.prio-opt[data-prio="urgent"].on .pp-tick { background: var(--urgent); }

/* publishing option rows */
.pub-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: var(--gap); }
.pub-row { display: flex; align-items: center; gap: 13px; padding: 15px 16px; }
.pub-row + .pub-row { border-top: 1px solid var(--border); }
.pub-ic { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--muted); }
.pub-ic svg { width: 17px; height: 17px; }
.pub-text { flex: 1; min-width: 0; }
.pub-title { font-weight: 600; font-size: var(--fs-sm); }
.pub-desc { font-size: var(--fs-xs); color: var(--faint); margin-top: 2px; line-height: 1.45; }

/* composer footer */
.cmp-foot { display: flex; align-items: center; gap: 12px; margin-top: 24px;
  padding-top: 18px; border-top: 1px solid var(--border); }
.cmp-foot .spacer { flex: 1; }
.cmp-foot-hint { font-size: var(--fs-xs); color: var(--faint); display: inline-flex;
  align-items: center; gap: 6px; }
.cmp-foot-hint svg { width: 14px; height: 14px; }

@media (max-width: 620px) {
  .prio-pick { grid-template-columns: 1fr; }
  .prio-opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 13px; }
  .prio-opt .pp-ic { margin-bottom: 0; }
  .prio-opt .pp-text { flex: 1; }
}
