:root {
  --bg: oklch(98% 0.004 240);
  --surface: oklch(100% 0 0);
  --fg: oklch(20% 0.02 240);
  --muted: oklch(50% 0.018 240);
  --border: oklch(90% 0.006 240);
  --accent: oklch(56% 0.12 170);
  --font-display: 'Söhne', 'Avenir Next', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  --ink-soft: oklch(31% 0.02 240);
  --accent-deep: oklch(41% 0.11 170);
  --accent-pale: oklch(94% 0.035 170);
  --warning: oklch(61% 0.16 68);
  --warning-pale: oklch(96% 0.035 68);
  --danger: oklch(53% 0.19 28);
  --danger-pale: oklch(96% 0.025 28);
  --shadow: 0 12px 28px oklch(22% 0.02 240 / .08);
  --shadow-sm: 0 4px 12px oklch(22% 0.02 240 / .06);
  --radius: 16px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 16px/1.55 var(--font-body); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid color-mix(in oklch, var(--accent) 60%, white); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; border-radius: 8px; background: var(--fg); color: var(--surface); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.app-shell { min-height: 100dvh; padding-bottom: 88px; }
.topbar { position: relative; z-index: 20; border-bottom: 1px solid color-mix(in oklch, var(--border) 85%, transparent); background: color-mix(in oklch, var(--bg) 88%, transparent); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1180px; min-height: 72px; margin: auto; padding: 0 20px; gap: 14px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; font-family: var(--font-display); font-weight: 760; letter-spacing: -.03em; }
.brand-mark { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 10px; background: var(--accent); color: white; box-shadow: 0 5px 12px oklch(56% 0.12 170 / .25); }
.brand-mark svg { width: 19px; height: 19px; }
.desktop-nav { display: none; align-items: center; gap: 2px; }
.desktop-nav a { padding: 10px 12px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 650; }
.desktop-nav a:hover, .desktop-nav a[aria-current='page'] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-button { display: inline-grid; width: 44px; height: 44px; place-items: center; border: 0; border-radius: 12px; background: transparent; color: var(--ink-soft); transition: background 180ms ease, transform 180ms ease; }
.icon-button:hover { background: var(--surface); box-shadow: var(--shadow-sm); }
.icon-button:active { transform: scale(.96); }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.container { width: min(1180px, calc(100% - 32px)); margin: auto; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 32px 0 22px; }
.eyebrow { margin: 0 0 8px; color: var(--accent-deep); font-size: 13px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.035em; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 48px); }
h2 { margin-bottom: 8px; font-size: clamp(22px, 2.6vw, 30px); }
h3 { margin-bottom: 5px; font-size: 18px; }
.lede { max-width: 65ch; margin: 0; color: var(--muted); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 16px; gap: 9px; border: 1px solid transparent; border-radius: 12px; color: var(--fg); font-weight: 740; transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(.98); }
.button-primary { background: var(--accent); color: white; box-shadow: 0 8px 16px oklch(56% 0.12 170 / .25); }
.button-primary:hover { background: var(--accent-deep); box-shadow: 0 10px 20px oklch(56% 0.12 170 / .32); }
.button-secondary { border-color: var(--border); background: var(--surface); }
.button-secondary:hover { border-color: color-mix(in oklch, var(--accent) 38%, var(--border)); }
.button-danger { color: var(--danger); background: var(--danger-pale); }
.button .icon { width: 18px; height: 18px; }
.search-wrap { display: flex; align-items: center; min-height: 52px; gap: 10px; padding: 0 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-sm); }
.search-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px oklch(56% 0.12 170 / .13); }
.search-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--fg); background: transparent; font-size: 16px; }
.search-wrap input::placeholder { color: var(--muted); }
.hero { position: relative; overflow: hidden; padding: clamp(28px, 6vw, 70px) 0 clamp(32px, 7vw, 80px); }
.hero::after { position: absolute; z-index: 0; top: -85px; right: -90px; width: 280px; height: 280px; border: 46px solid color-mix(in oklch, var(--accent) 14%, transparent); border-radius: 999px; content: ''; }
.hero > .container { position: relative; z-index: 1; }
.hero-grid { display: grid; gap: 24px; }
.hero h1 { max-width: 710px; font-size: clamp(38px, 6vw, 66px); }
.hero-copy { max-width: 620px; margin-bottom: 24px; font-size: 18px; color: var(--ink-soft); }
.hero-search { max-width: 680px; }
.search-submit { display: inline-grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 10px; background: var(--accent); color: white; }
.search-submit .icon { width: 18px; height: 18px; }
.trust-note { display: flex; align-items: flex-start; gap: 10px; max-width: 710px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.trust-note .icon { flex: 0 0 auto; width: 17px; margin-top: 2px; color: var(--accent-deep); }
.section { padding: 24px 0 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-link { color: var(--accent-deep); font-size: 14px; font-weight: 760; }
.specialty-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.specialty { min-height: 104px; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.specialty:hover { border-color: color-mix(in oklch, var(--accent) 45%, var(--border)); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.specialty strong { display: block; margin-bottom: 4px; font-family: var(--font-display); font-size: 17px; letter-spacing: -.02em; }
.specialty span { color: var(--muted); font-size: 13px; }
.content-grid { display: grid; gap: 18px; }
.feed { display: grid; gap: 12px; }
.post-card { display: block; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 oklch(20% .02 240 / .02); transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease; }
.post-card:hover { border-color: color-mix(in oklch, var(--accent) 38%, var(--border)); box-shadow: var(--shadow); transform: translateY(-2px); }
.post-meta, .post-footer, .meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.post-meta { margin-bottom: 10px; }
.post-card h3 { margin-bottom: 7px; }
.post-card p { margin-bottom: 12px; color: var(--ink-soft); }
.post-footer { justify-content: space-between; border-top: 1px solid var(--border); padding-top: 12px; }
.tag { display: inline-flex; align-items: center; min-height: 25px; padding: 2px 8px; border-radius: 999px; background: var(--accent-pale); color: var(--accent-deep); font-size: 12px; font-weight: 760; }
.tag-neutral { background: color-mix(in oklch, var(--border) 55%, var(--surface)); color: var(--muted); }
.tag-warn { background: var(--warning-pale); color: oklch(42% .12 68); }
.answer-status { color: var(--accent-deep); font-weight: 740; }
.panel { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.panel h3 { margin-bottom: 12px; }
.list-clean { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.list-clean a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; color: var(--ink-soft); font-weight: 650; }
.list-clean a:hover { color: var(--accent-deep); }
.count { color: var(--muted); font: 12px var(--font-mono); }
.notice { display: flex; gap: 11px; padding: 14px; border: 1px solid color-mix(in oklch, var(--warning) 30%, var(--border)); border-radius: 12px; background: var(--warning-pale); color: oklch(33% .07 68); font-size: 14px; }
.notice .icon { flex: 0 0 auto; color: oklch(48% .13 68); }
.chip-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip { min-height: 38px; flex: 0 0 auto; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.chip[aria-pressed='true'], .chip:hover { border-color: color-mix(in oklch, var(--accent) 55%, var(--border)); background: var(--accent-pale); color: var(--accent-deep); }
.filters { display: grid; gap: 12px; padding: 14px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.filter-row { display: flex; gap: 10px; align-items: center; }
.filter-row label { color: var(--muted); font-size: 13px; font-weight: 750; }
.filter-row select { min-height: 44px; min-width: 0; flex: 1; padding: 0 10px; border: 1px solid var(--border); border-radius: 10px; color: var(--fg); background: var(--surface); }
.detail-layout { display: grid; gap: 16px; }
.article { padding: clamp(20px, 4vw, 34px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.article h1 { font-size: clamp(29px, 4.5vw, 46px); }
.article-body { max-width: 72ch; color: var(--ink-soft); }
.article-body p { margin-bottom: 16px; }
.article-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.reply { padding: 16px 0; border-top: 1px solid var(--border); }
.reply:first-of-type { border-top: 0; }
.reply-author { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-weight: 760; }
.avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: color-mix(in oklch, var(--accent) 22%, var(--surface)); color: var(--accent-deep); font-family: var(--font-display); font-size: 13px; font-weight: 800; }
.avatar-large { width: 72px; height: 72px; font-size: 23px; }
.reply p { margin: 0 0 8px 46px; color: var(--ink-soft); }
.form-layout { display: grid; gap: 16px; }
.form-card { padding: clamp(20px, 4vw, 34px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label, fieldset legend { font-weight: 760; }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 11px; color: var(--fg); background: var(--surface); }
.field textarea { min-height: 156px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--accent); outline: 3px solid oklch(56% .12 170 / .13); }
.field-help { color: var(--muted); font-size: 13px; }
.field-error { min-height: 20px; margin: 0; color: var(--danger); font-size: 13px; font-weight: 650; }
fieldset { padding: 0; border: 0; }
.radio-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.radio-option { position: relative; display: flex; min-height: 52px; align-items: center; padding: 10px 11px 10px 40px; border: 1px solid var(--border); border-radius: 11px; color: var(--ink-soft); font-size: 14px; font-weight: 650; }
.radio-option input { position: absolute; left: 13px; width: 18px; height: 18px; accent-color: var(--accent); }
.radio-option:has(input:checked) { border-color: var(--accent); background: var(--accent-pale); color: var(--accent-deep); }
.library-grid { display: grid; gap: 12px; }
.resource { display: flex; gap: 14px; padding: 17px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: transform 180ms ease, box-shadow 180ms ease; }
.resource:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.resource[role='link'] { cursor: pointer; }
.is-hidden { display: none !important; }
.resource-icon { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: var(--accent-pale); color: var(--accent-deep); }
.resource-icon .icon { width: 20px; }
.resource h3 { margin-bottom: 4px; }
.resource p { margin-bottom: 9px; color: var(--muted); font-size: 14px; }
.profile-header { display: flex; align-items: center; gap: 16px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.profile-header h1 { margin-bottom: 4px; font-size: 28px; }
.profile-header p { margin: 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stat { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.stat strong { display: block; font: 700 22px/1 var(--font-mono); }
.stat span { color: var(--muted); font-size: 12px; }
.bottom-nav { position: fixed; z-index: 30; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 7px max(10px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); border-top: 1px solid var(--border); background: color-mix(in oklch, var(--surface) 92%, transparent); backdrop-filter: blur(16px); }
.bottom-nav a { display: grid; min-height: 54px; place-items: center; align-content: center; gap: 3px; border-radius: 10px; color: var(--muted); font-size: 11px; font-weight: 730; }
.bottom-nav a .icon { width: 19px; height: 19px; }
.bottom-nav a[aria-current='page'] { color: var(--accent-deep); background: var(--accent-pale); }
.bottom-nav .nav-compose { color: white; background: var(--accent); box-shadow: 0 5px 12px oklch(56% .12 170 / .28); }
.sheet-backdrop { position: fixed; z-index: 50; inset: 0; display: grid; align-items: end; background: oklch(20% .02 240 / .48); opacity: 0; pointer-events: none; transition: opacity 200ms ease; }
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet { width: min(660px, 100%); max-height: 88dvh; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--surface); transform: translateY(100%); transition: transform 240ms ease-out; }
.sheet-backdrop.is-open .sheet { transform: translateY(0); }
.sheet-handle { width: 40px; height: 4px; margin: 0 auto 16px; border-radius: 99px; background: var(--border); }
.sheet-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.report-options { display: grid; gap: 8px; margin: 16px 0; }
.report-option { min-height: 48px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); text-align: left; color: var(--ink-soft); }
.report-option:hover { border-color: var(--danger); background: var(--danger-pale); }
.toast { position: fixed; z-index: 60; right: 16px; bottom: 92px; max-width: min(360px, calc(100% - 32px)); padding: 12px 14px; border-radius: 12px; background: var(--fg); color: var(--surface); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(16px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-showing { opacity: 1; transform: translateY(0); }

@media (min-width: 700px) {
  .container { width: min(1180px, calc(100% - 48px)); }
  .specialty-grid { grid-template-columns: repeat(4, 1fr); }
  .content-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .detail-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .form-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bottom-nav { display: none; }
  .app-shell { padding-bottom: 0; }
  .desktop-nav { display: flex; }
  .top-actions .button { display: inline-flex; }
}
@media (max-width: 699px) { .top-actions .button { display: none; } .page-head .button { display: none; } }
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: 1.1fr .7fr; align-items: center; }
  .hero-rail { display: grid; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
  .hero-rail .rail-item { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .hero-rail .rail-item:last-child { padding: 0; border: 0; }
  .filters { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }
