:root {
  color-scheme: light;
  --cp-bg: #f7f4ef;
  --cp-bg-elevated: #fcfbf8;
  --cp-surface: #ffffff;
  --cp-surface-soft: #f5f5f5;
  --cp-border: #dedede;
  --cp-border-strong: #919191;
  --cp-text: #242424;
  --cp-text-muted: #5c5c5c;
  --cp-accent: #b11f4b;
  --cp-accent-hover: #9a1a41;
  --cp-accent-soft: rgba(177, 31, 75, 0.08);
  --cp-accent-fg: #ffffff;
  --cp-link: #0078d4;
  --cp-success: #16803c;
  --cp-danger: #b42338;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  --cp-logo-coral: #ff7c9d;
  --cp-logo-white: #ffffff;
  --cp-logo-navy: #0b1220;
  --cp-transparent: transparent;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --cp-bg: #0b1220;
  --cp-bg-elevated: #111e31;
  --cp-surface: #14253b;
  --cp-surface-soft: #1b3049;
  --cp-border: #2e4965;
  --cp-border-strong: #527390;
  --cp-text: #eff7ff;
  --cp-text-muted: #a9bdd2;
  --cp-accent: #ff7c9d;
  --cp-accent-hover: #ff5f88;
  --cp-accent-soft: rgba(255, 124, 157, 0.15);
  --cp-accent-fg: #111827;
  --cp-link: #68d8ff;
  --cp-success: #7ce2b0;
  --cp-danger: #ff879d;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cp-bg); color: var(--cp-text); font: 16px/1.6 "Segoe UI", Aptos, Calibri, -apple-system, BlinkMacSystemFont, sans-serif; }
a { color: var(--cp-link); text-underline-offset: .2em; overflow-wrap: anywhere; }
a:hover { text-decoration-thickness: 2px; }
button, input, select, textarea { font: inherit; }
button, .button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
:focus-visible { outline: 3px solid var(--cp-link); outline-offset: 3px; }
.skip-link { position: absolute; left: 1rem; top: -6rem; z-index: 2; padding: .75rem; background: var(--cp-surface); }
.skip-link:focus { top: 1rem; }
.site-header { background: var(--cp-bg-elevated); border-bottom: 1px solid var(--cp-border); }
.header-inner { max-width: 1240px; margin: auto; padding: 1.2rem 1.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--cp-link); font-size: 1.6rem; font-weight: 900; text-decoration: none; }
.brand small { display: block; font-size: .78rem; color: var(--cp-text-muted); font-weight: 400; }
.brand-mark { width: 44px; height: 44px; flex: 0 0 auto; }
.logo-bg { fill: var(--cp-logo-coral); }
.logo-white { fill: var(--cp-logo-white); }
.logo-check { fill: none; stroke: var(--cp-logo-navy); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.header-actions, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; }
.header-actions { font-size: .9rem; }
.page { max-width: 1240px; padding: 1.5rem; margin: 0 auto; min-width: 0; }
.breadcrumbs { margin-bottom: 1.5rem; color: var(--cp-text-muted); font-size: .88rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { min-width: 0; overflow-wrap: anywhere; }
.breadcrumbs li + li::before { content: "›"; padding-right: .4rem; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.2; margin: 0 0 .8rem; letter-spacing: -.025em; }
h2 { font-size: 1.3rem; line-height: 1.3; margin: 0 0 1rem; }
h3 { font-size: 1.1rem; line-height: 1.4; margin: 0 0 .5rem; }
p { margin: .5rem 0 1rem; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-heading > div { min-width: 0; }
.eyebrow { margin: 0 0 .5rem; text-transform: uppercase; letter-spacing: .1em; color: var(--cp-accent); font-weight: 700; font-size: .78rem; }
.muted, .meta, .hint { color: var(--cp-text-muted); }
.meta, .hint { font-size: .88rem; }
.card { border: 1px solid var(--cp-border); border-radius: 18px; padding: 1.5rem; background: var(--cp-surface); margin-bottom: 1.25rem; min-width: 0; }
.category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.category-card { margin: 0; }
.category-card h3 a { text-decoration: none; }
.category-card h3 a:hover { text-decoration: underline; }
.category-card p { margin: .25rem 0; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .5rem; padding: .65rem 1rem; min-height: 44px; max-width: 100%; border: 1px solid var(--cp-accent); border-radius: 10px; background: var(--cp-accent); color: var(--cp-accent-fg); text-decoration: none; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.button:hover { background: var(--cp-accent-hover); border-color: var(--cp-accent-hover); text-decoration: none; }
.button.secondary, .button.quiet { background: var(--cp-transparent); color: var(--cp-link); border-color: var(--cp-border-strong); }
.button.secondary:hover, .button.quiet:hover { background: var(--cp-surface-soft); }
.button.small { padding: .45rem .8rem; font-size: .85rem; }
.auth-actions > a { min-width: 135px; }
.topic-list { list-style: none; padding: 0; margin: 0; }
.topic-row { display: grid; grid-template-columns: minmax(0, 1fr) 85px 165px; gap: 1rem; align-items: center; padding: 1.1rem 0; border-top: 1px solid var(--cp-border); }
.topic-row:first-child { border-top: 0; }
.topic-row h3 { margin-bottom: .3rem; }
.topic-row p { margin: 0; }
.topic-title { font-weight: 650; text-decoration: none; }
.topic-title:hover { text-decoration: underline; }
.topic-count { text-align: center; }
.topic-count strong { display: block; font-size: 1.2rem; color: var(--cp-text); }
.search-form { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; margin: 1.5rem 0; }
.search-form .field { flex: 1 1 220px; margin: 0; }
.field { display: flex; flex-direction: column; gap: .4rem; margin: 1rem 0; min-width: 0; }
label { font-weight: 650; }
input, select, textarea { width: 100%; min-width: 0; max-width: 100%; padding: .75rem; border: 1px solid var(--cp-border-strong); border-radius: 9px; background: var(--cp-bg-elevated); color: var(--cp-text); }
textarea { min-height: 150px; resize: vertical; }
.report-form textarea { min-height: 85px; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem; margin: 1.25rem 0; }
.post-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; margin-bottom: 1rem; }
.post-header p { margin: 0; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 1.25rem; }
.original-post { border-top: 4px solid var(--cp-accent); }
.reply { scroll-margin-top: 1rem; }
.report-panel { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--cp-border); }
.status { overflow-wrap: anywhere; }
.status:empty { display: none; }
.status.error { color: var(--cp-danger); }
.status.success { color: var(--cp-success); }
.error-card { border-color: var(--cp-danger); }
.auth-box { padding: 1rem; border-radius: 12px; background: var(--cp-accent-soft); }
.auth-box p { margin-top: 0; }
.rules { background: var(--cp-bg-elevated); margin-top: 2rem; }
.rules h2 { font-size: 1rem; }
.rules p { font-size: .88rem; color: var(--cp-text-muted); }
.rules p:last-child { margin-bottom: 0; }
.site-footer { padding: 1.5rem; text-align: center; color: var(--cp-text-muted); font-size: .8rem; }
.copy-fallback { margin: 1rem 0; }
.chat-list { list-style: none; padding: 0; margin: 1rem 0; }
.chat-list .card { padding: 8px 12px; margin-bottom: 6px; border-radius: 10px; }
.chat-message { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 2px; }
.chat-message .post-header { grid-column: 1; grid-row: 1; align-items: baseline; justify-content: flex-start; gap: 4px 10px; margin: 0; font-size: 13px; line-height: 1.4; }
.chat-message .post-header .meta { font-size: 11px; }
.chat-message .post-body { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: 14px; line-height: 1.45; }
.chat-message > .report-control { grid-column: 2; grid-row: 1; }
.chat-message > .report-control > button { min-height: 24px; min-width: 28px; padding: 0 6px; line-height: 1; font-size: 18px; border-color: var(--cp-transparent); }
.chat-message > .report-control:has(.report-panel:not([hidden])) { grid-column: 1 / -1; grid-row: 3; }
.forum-chat .page-heading { margin-bottom: 12px; }
.forum-chat .page-heading h1 { font-size: clamp(1.6rem, 3vw, 2rem); }
.forum-chat > .hint, .forum-chat > .status { margin: 6px 0; font-size: 12px; }
.forum-chat > .card textarea { min-height: 72px; }
@media (pointer: coarse) {
  .chat-message > .report-control > button { min-height: 36px; min-width: 36px; }
}
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .page, .header-inner { padding: 1rem; }
  .header-inner { gap: 1rem; }
  .brand-mark { width: 34px; height: 34px; }
  .header-actions { gap: .5rem 1rem; }
  .category-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 1rem; border-radius: 14px; }
  .topic-row { grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
  .topic-activity { grid-column: 1 / -1; }
  .topic-count { text-align: right; }
  .topic-count strong { display: inline; font-size: 1rem; }
  .page-heading { gap: .75rem; }
  .auth-actions > a { flex: 1; }
  .pagination { gap: .5rem; }
}
