/* RDAR public site (hub, app page, inbox). Dependency-free. */
:root {
  color-scheme: light dark;
  --bg: #f5f7fb;
  --bg-hero: #eef4fe;
  --surface: #ffffff;
  --surface-2: #f2f5fa;
  --surface-3: #e9eef6;
  --border: #e1e7f0;
  --border-strong: #c9d3e1;
  --text: #14213d;
  --muted: #56617a;
  --accent: #1f7aec;
  --accent-strong: #1769d6;
  --accent-hover: #1257b4;
  --accent-text: #1462c8;
  --accent-soft: #e7f0fe;
  --on-accent: #ffffff;
  --focus: #1f7aec;
  --danger: #c0262d;
  --danger-soft: #fdecec;
  --success: #12795a;
  --success-soft: #e5f6ef;
  --warning: #8a5a00;
  --warning-soft: #fff5de;
  --bubble-team: #f0f3f8;
  --bubble-me: #1769d6;
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, .06);
  --shadow: 0 1px 2px rgba(20, 33, 61, .05), 0 6px 20px rgba(20, 33, 61, .06);
  --shadow-lg: 0 18px 50px rgba(20, 33, 61, .18);
  --radius: 14px;
  --radius-sm: 9px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1221;
    --bg-hero: #0f1a30;
    --surface: #121c30;
    --surface-2: #17233a;
    --surface-3: #1e2b45;
    --border: #25324c;
    --border-strong: #354563;
    --text: #e7edf8;
    --muted: #a5b1c7;
    --accent: #4c9aff;
    --accent-strong: #1f6fd6;
    --accent-hover: #3b86ea;
    --accent-text: #85b8ff;
    --accent-soft: #16294a;
    --focus: #6aaeff;
    --danger: #ff8a8a;
    --danger-soft: #3a1a20;
    --success: #5fd3a6;
    --success-soft: #11352b;
    --warning: #f5c56a;
    --warning-soft: #3a2d10;
    --bubble-team: #1c2840;
    --bubble-me: #1f6fd6;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, .55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text); font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; outline: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.6rem); font-weight: 750; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.08rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); padding: .1em .4em; border-radius: 6px; word-break: break-all; }
svg { flex: none; }
.icon { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--accent-strong); color: #fff;
  padding: 10px 14px; border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; color: #fff; }
.muted { color: var(--muted); }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: var(--accent-text); margin-bottom: .5em; }
.eyebrow a { text-decoration: none; }
.lede { font-size: 1.08rem; color: var(--muted); max-width: 62ch; }
.loading { color: var(--muted); padding: 24px 0; }
.loading::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px;
  border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.noscript { text-align: center; padding: 16px; background: var(--warning-soft); margin: 0; }

/* ---------- header / footer */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-mark { width: 28px; height: 28px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.brand-name { font-weight: 800; letter-spacing: .06em; font-size: 1.1rem; }
.brand-by { color: var(--muted); font-size: .85rem; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { color: var(--text); text-decoration: none; font-weight: 550; font-size: .95rem; padding: 8px 12px; border-radius: 8px; }
.site-nav a:hover { background: var(--surface-2); color: var(--text); }
.site-nav a[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 56px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; font-size: .92rem; color: var(--muted); }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-inner a { color: var(--muted); }
.footer-inner a:hover { color: var(--accent-text); }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px;
  font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent-strong); color: var(--on-accent); box-shadow: 0 1px 2px rgba(23, 105, 214, .25); }
.btn-primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--accent-text); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-text); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn-lg { min-height: 48px; padding: 12px 22px; font-size: 1rem; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn .icon { width: 18px; height: 18px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 20px; height: 20px; }

/* ---------- cards & states */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.section { margin-top: 40px; }
.section-head { margin-bottom: 18px; }
.section-head p { margin: 0; }
.state-card { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 28px; text-align: center; }
.state-card > :last-child { margin-bottom: 0; }
.state-card p { color: var(--muted); max-width: 60ch; margin-left: auto; margin-right: auto; }
.state-warning, .state-error { border-style: solid; text-align: left; margin-top: 28px; }
.state-warning { border-color: #f0d9a8; background: var(--warning-soft); }
.state-error { border-color: #f3c3c5; background: var(--danger-soft); }
.state-warning p, .state-error p { margin-left: 0; color: var(--text); }
@media (prefers-color-scheme: dark) {
  .state-warning { border-color: #5a4515; }
  .state-error { border-color: #5d2a31; }
}
.field-auto { flex: 0 0 auto !important; }
.thread:focus, .panel:focus:not(:focus-visible) { outline: none; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin: 14px 0; font-size: .95rem; border: 1px solid transparent; white-space: pre-line; }
.notice .icon { margin-top: 2px; }
.notice-info { background: var(--accent-soft); color: var(--text); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.notice-success { background: var(--success-soft); color: var(--text); border-color: color-mix(in srgb, var(--success) 30%, transparent); }
.notice-success .icon { color: var(--success); }
.notice-error { background: var(--danger-soft); color: var(--text); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.notice-error .icon { color: var(--danger); }

/* ---------- hub */
.hero {
  background:
    radial-gradient(900px 300px at 85% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(700px 260px at 0% 110%, color-mix(in srgb, #7b5cff 10%, transparent), transparent 70%),
    var(--bg-hero);
  border-bottom: 1px solid var(--border);
}
.hero-inner { padding-top: 64px; padding-bottom: 60px; }
.hero h1 { max-width: 18ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.app-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.app-card { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; transition: box-shadow .2s, transform .2s, border-color .2s; }
.app-card:hover { box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.app-card-head { display: flex; align-items: center; gap: 14px; }
.app-card h3 { margin: 0; font-size: 1.15rem; }
.app-card h3 a { color: var(--text); text-decoration: none; }
.app-card h3 a:hover { color: var(--accent-text); text-decoration: underline; }
.app-card .welcome { color: var(--muted); font-size: .93rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.app-card-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 12px;
  color: #fff; font-weight: 750; font-size: 1.25rem; background: var(--accent-strong); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12);
}
.avatar-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 1.7rem; }
.avatar-sm { width: 26px; height: 26px; border-radius: 7px; font-size: .8rem; }
.avatar-icon svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.split-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.promo { display: flex; gap: 18px; align-items: flex-start; }
.promo h2 { font-size: 1.15rem; }
.promo p { color: var(--muted); }
.promo-icon { width: 40px; height: 40px; padding: 8px; border-radius: 12px; background: var(--accent-soft); stroke: var(--accent-text); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- app page */
.page { padding-top: 28px; }
.app-hero { display: flex; gap: 18px; align-items: center; margin-bottom: 26px; }
.app-hero h1 { margin-bottom: .15em; font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); overflow-wrap: anywhere; }
.app-hero .eyebrow { margin-bottom: .3em; }
.app-hero .lede { margin: .3em 0 0; white-space: pre-line; }
.tabs-wrap { position: relative; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.tablist { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 0; }
.tablist::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: -1px;
  font: inherit; font-weight: 600; font-size: .95rem; color: var(--muted); background: transparent; border: 0;
  border-bottom: 3px solid transparent; border-radius: 8px 8px 0 0; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab[aria-selected="true"] { color: var(--accent-text); border-bottom-color: var(--accent); }
.tab:focus-visible { outline-offset: -3px; }
.tab .icon { width: 18px; height: 18px; }
.tab-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; }
@media (prefers-color-scheme: dark) { .tab-badge { background: #e5484d; } }
.panel { outline: none; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2 { margin-bottom: .2em; }
.panel-head p { margin: 0; color: var(--muted); max-width: 64ch; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.side-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; font-size: .93rem; }
.side-card h3 { font-size: 1rem; }
.side-card ul { margin: 0; padding-left: 1.1em; color: var(--muted); }
.side-card li { margin-bottom: .4em; }

/* ---------- forms */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 6px; min-width: 0; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.label { font-weight: 600; font-size: .95rem; }
.optional { font-weight: 400; color: var(--muted); }
.counter { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.near { color: var(--warning); font-weight: 600; }
.hint { font-size: .86rem; color: var(--muted); margin: 0; }
input[type="text"], input[type="email"], input[type="search"], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.5; }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent) !important; }
.field-error { color: var(--danger); font-size: .87rem; font-weight: 600; margin: 0; }
.field-error:empty { display: none; }
fieldset.group { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 0; display: grid; gap: 16px; background: var(--surface-2); min-width: 0; }
fieldset.group legend { font-weight: 700; padding: 0 6px; }
fieldset.group legend .optional { font-weight: 400; }
fieldset.group input, fieldset.group textarea, fieldset.group select { background-color: var(--surface); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent-strong); cursor: pointer; }
.check-field { display: grid; gap: 4px; }
.check-field .hint, .check-field .field-error { margin-left: 30px; }
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-foot { font-size: .86rem; color: var(--muted); margin: 0; }
.public-note { display: flex; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); font-size: .93rem; }
.public-note .icon { color: var(--warning); margin-top: 2px; }
.public-note p { margin: 0; }

/* image picker */
.file-input { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; }
.file-input:focus-visible + .file-btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.file-input:disabled + .file-btn { opacity: .55; cursor: not-allowed; }
.file-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.thumbs { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 92px; height: 92px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-remove {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(10, 18, 35, .78); color: #fff; display: grid; place-items: center;
}
.thumb-remove:hover { background: rgba(192, 38, 45, .95); }
.thumb-remove .icon { width: 16px; height: 16px; }

/* success */
.success { text-align: center; padding: 40px 24px; }
.success-icon { width: 60px; height: 60px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.success-icon .icon { width: 30px; height: 30px; stroke-width: 2.5; }
.success h2 { outline: none; }
.success p { color: var(--muted); max-width: 56ch; margin-left: auto; margin-right: auto; }
.success .form-actions { justify-content: center; margin-top: 18px; }

/* ---------- pills & badges */
.pill {
  --pill: #3c6fd8; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; line-height: 1.4; white-space: nowrap;
  color: color-mix(in srgb, var(--pill) 82%, #000); background: color-mix(in srgb, var(--pill) 13%, transparent);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pill); }
.pill[data-status="open"], .pill[data-status="new"] { --pill: #2f6fdb; }
.pill[data-status="planned"], .pill[data-status="reviewing"] { --pill: #7546d8; }
.pill[data-status="in_progress"] { --pill: #b86e00; }
.pill[data-status="completed"], .pill[data-status="resolved"] { --pill: #158a5e; }
.pill[data-status="maybe_later"], .pill[data-status="closed"], .pill[data-status="unavailable"] { --pill: #66708a; }
@media (prefers-color-scheme: dark) {
  .pill { color: color-mix(in srgb, var(--pill) 45%, #fff); background: color-mix(in srgb, var(--pill) 24%, transparent); }
}
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: var(--accent-soft); color: var(--accent-text); white-space: nowrap; }
.badge-new { background: var(--danger); color: #fff; }
@media (prefers-color-scheme: dark) { .badge-new { background: #e5484d; } }
.badge-official { background: var(--accent-strong); color: #fff; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; font-size: .86rem; color: var(--muted); }
.meta-item { display: inline-flex; align-items: center; gap: 5px; }
.meta-item .icon { width: 16px; height: 16px; }

/* ---------- feature board */
.board-controls { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; margin-bottom: 16px; }
.board-controls .field { flex: 1 1 200px; }
.board-controls .field.narrow { flex: 0 1 200px; }
.segmented { display: inline-flex; background: var(--surface-3); padding: 4px; border-radius: 11px; gap: 2px; }
.segmented button { font: inherit; font-weight: 600; font-size: .92rem; border: 0; background: transparent; color: var(--muted); padding: 8px 16px; min-height: 36px; border-radius: 8px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.search-wrap { position: relative; }
.search-wrap .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-wrap input { padding-left: 38px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.feature-card {
  display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.feature-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.feature-body { min-width: 0; flex: 1; }
.feature-body h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.feature-title { font: inherit; font-weight: 650; color: var(--text); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.feature-title:hover { color: var(--accent-text); text-decoration: underline; }
.excerpt { color: var(--muted); font-size: .94rem; margin: 0 0 10px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vote-btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; flex: none;
  width: 58px; min-height: 64px; padding: 6px 4px; border-radius: 12px; cursor: pointer; font: inherit;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border-strong);
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.vote-btn .icon { width: 22px; height: 22px; stroke-width: 2.5; color: var(--accent-text); }
.vote-btn .vote-count { font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.vote-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.vote-btn:active { transform: scale(.96); }
.vote-btn[aria-pressed="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.vote-btn[aria-pressed="true"] .icon { color: #fff; }
.vote-btn[aria-busy="true"] { opacity: .8; }
.vote-btn.lg { flex-direction: row; gap: 8px; width: auto; min-height: 46px; padding: 8px 18px; }
.load-more { display: flex; justify-content: center; margin-top: 18px; }

/* ---------- dialogs */
dialog.dialog {
  width: min(680px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 1px solid var(--border);
  border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.dialog::backdrop { background: rgba(8, 14, 28, .5); backdrop-filter: blur(2px); }
dialog.dialog[open] { animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dialog-inner { padding: 22px 24px 26px; }
.dialog-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.dialog-head h2 { margin: 6px 0 0; outline: none; overflow-wrap: anywhere; }
.dialog-head .icon-btn { margin: -4px -8px 0 0; }
.detail-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 16px 0; }
.detail-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.comments { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 12px; }
.comment { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.comment-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .86rem; margin-bottom: 4px; }
.comment-head strong { font-size: .93rem; }
.comment-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment.team { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); border-left: 4px solid var(--accent); }
.divider { border: 0; border-top: 1px solid var(--border); margin: 22px 0; }

/* ---------- conversations */
.conv-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.conv-list-wrap { display: grid; gap: 16px; }
.conv-group h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.conv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.conv-item {
  display: grid; gap: 6px; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, background-color .15s;
}
.conv-item:hover { border-color: var(--border-strong); }
.conv-item[aria-current="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.conv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.conv-title { font-weight: 650; overflow-wrap: anywhere; }
.conv-preview { font-size: .88rem; color: var(--muted); margin: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.conv-item .meta { font-size: .8rem; gap: 6px 10px; }
.thread { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; min-width: 0; }
.thread-empty { color: var(--muted); text-align: center; padding: 48px 16px; }
.thread-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.thread-head h3 { font-size: 1.25rem; margin: 0 0 6px; outline: none; overflow-wrap: anywhere; }
.back-btn { display: none; margin: -6px 0 10px -10px; }
.chat { list-style: none; margin: 20px 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: min(80%, 560px); display: grid; gap: 4px; }
.bubble.team { align-self: flex-start; }
.bubble.reporter { align-self: flex-end; justify-items: end; }
.bubble-head { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.bubble-head strong { color: var(--text); font-size: .86rem; }
.bubble-body { margin: 0; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.team .bubble-body { background: var(--bubble-team); border-bottom-left-radius: 5px; border: 1px solid var(--border); }
.bubble.reporter .bubble-body { background: var(--bubble-me); color: #fff; border-bottom-right-radius: 5px; }
.chat-empty { text-align: center; color: var(--muted); font-size: .93rem; padding: 18px; background: var(--surface-2); border-radius: 12px; }
details.collapsible { border: 1px solid var(--border); border-radius: 12px; margin: 12px 0; background: var(--surface-2); }
details.collapsible > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; list-style-position: inside; border-radius: 12px; }
details.collapsible > summary:hover { color: var(--accent-text); }
details.collapsible[open] > summary { border-bottom: 1px solid var(--border); border-radius: 12px 12px 0 0; }
.collapsible-body { padding: 12px 14px 14px; }
.collapsible-body h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 4px; }
.collapsible-body h4:first-child { margin-top: 0; }
.collapsible-body p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 10px; }
.timeline li { position: relative; padding-left: 20px; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.timeline time { display: block; color: var(--muted); font-size: .8rem; }
.composer { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.composer textarea { min-height: 90px; }

/* ---------- responsive */
@media (max-width: 900px) {
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .conv-layout { grid-template-columns: 1fr; }
  .conv-layout.show-thread .conv-list-wrap { display: none; }
  .conv-layout:not(.show-thread) .thread { display: none; }
  .back-btn { display: inline-flex; }
}
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .container { padding: 0 14px; }
  .brand-by { display: none; }
  .site-nav a { padding: 7px 9px; font-size: .9rem; }
  .hero-inner { padding-top: 40px; padding-bottom: 40px; }
  .card { padding: 18px; }
  .grid-2 { grid-template-columns: 1fr; }
  .app-hero { gap: 14px; align-items: flex-start; }
  .avatar-lg { width: 52px; height: 52px; font-size: 1.4rem; border-radius: 14px; }
  .tab { padding: 11px 10px; font-size: .9rem; }
  .feature-card { gap: 12px; padding: 14px; }
  .vote-btn { width: 50px; min-height: 58px; }
  .board-controls .field, .board-controls .field.narrow { flex: 1 1 100%; }
  .dialog-inner { padding: 18px 16px 22px; }
  .thread { padding: 16px; }
  .bubble { max-width: 92%; }
  .promo { flex-direction: column; }
  .form-actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media (forced-colors: active) {
  .vote-btn[aria-pressed="true"], .tab[aria-selected="true"] { border: 2px solid Highlight; }
  .pill::before { forced-color-adjust: none; }
}
