/* AxCrypt Community — follows axcrypt.net: Open Sans, heavy tight headings, brand green #48772C,
   pale-green pill labels, 14px rounded cards with thin borders, solid green footer. Light and dark themes. */
:root {
  --brand: #48772C;
  --brand-600: #3E6826;
  --brand-700: #335620;
  --brand-800: #1F3514;
  --brand-300: #91B776;
  --brand-200: #C9E0B6;
  --brand-100: #DDEDD2;
  --brand-50: #EEF7EA;
  --link: #48772C;
  --link-hover: #335620;
  --tint-text: #335620;          /* text on --brand-50 */
  --ink: #111827;
  --text: #374151;
  --muted: #6B7280;
  --line: #E5E7EB;
  --line-strong: #D1D5DB;
  --bg: #F6F7F4;
  --card: #FFFFFF;
  --subtle: #F9FAF8;
  --hover: #F8FAF6;
  --warn: #8A5A00;
  --warn-bg: #FFF6DC;
  --warn-line: #F0DFAE;
  --danger: #B3261E;
  --danger-bg: #FDECEA;
  --danger-line: #F1C9C5;
  --code-bg: #F1F4EE;
  --pre-bg: #17211A;
  --pre-text: #E6EDDF;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(17, 24, 39, .04);
  --shadow-md: 0 6px 20px rgba(17, 24, 39, .07), 0 1px 3px rgba(17, 24, 39, .05);
  --shadow-lg: 0 18px 40px rgba(17, 24, 39, .14);
  --ring: 0 0 0 3px rgba(72, 119, 44, .22);
  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header-h: 68px;
  color-scheme: light;
}
/* Dark theme: follows the device unless the visitor picked a theme (data-theme on <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-200: #3D5C2C;
    --brand-100: #2A4020;
    --brand-50: #1B2817;
    --link: #92C66F;
    --link-hover: #B4DC97;
    --tint-text: #A9D48B;
    --ink: #F2F5F0;
    --text: #D3DAD0;
    --muted: #98A396;
    --line: #273027;
    --line-strong: #364235;
    --bg: #0E1310;
    --card: #151C17;
    --subtle: #19211B;
    --hover: #1A231C;
    --warn: #F2C56B;
    --warn-bg: #2B2414;
    --warn-line: #4A3D1E;
    --danger: #F28B82;
    --danger-bg: #2D1715;
    --danger-line: #57302B;
    --code-bg: #1F2921;
    --pre-bg: #0A0F0B;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, .35);
    --shadow-lg: 0 18px 40px rgba(0, 0, 0, .5);
    --ring: 0 0 0 3px rgba(146, 198, 111, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand-200: #3D5C2C;
  --brand-100: #2A4020;
  --brand-50: #1B2817;
  --link: #92C66F;
  --link-hover: #B4DC97;
  --tint-text: #A9D48B;
  --ink: #F2F5F0;
  --text: #D3DAD0;
  --muted: #98A396;
  --line: #273027;
  --line-strong: #364235;
  --bg: #0E1310;
  --card: #151C17;
  --subtle: #19211B;
  --hover: #1A231C;
  --warn: #F2C56B;
  --warn-bg: #2B2414;
  --warn-line: #4A3D1E;
  --danger: #F28B82;
  --danger-bg: #2D1715;
  --danger-line: #57302B;
  --code-bg: #1F2921;
  --pre-bg: #0A0F0B;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, .5);
  --ring: 0 0 0 3px rgba(146, 198, 111, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 20px); }
body { margin: 0; font: 16px/1.6 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { color: var(--ink); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.02em; text-wrap: balance; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1360px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; max-width: 100%; min-width: 0; }
.icon { flex: none; vertical-align: -4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--card); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 3px solid rgba(72, 119, 44, .5); outline-offset: 2px; }
kbd { font-family: var(--mono); font-size: .78rem; }

/* ---------- Header ---------- */
.site-header { background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 28px; width: auto; display: block; }
.brand-sub { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--tint-text); background: var(--brand-50); padding: 4px 10px; border-radius: 999px; }
.header-search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.header-search > .icon { position: absolute; left: 13px; color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.header-search input { width: 100%; height: 40px; border: 1px solid var(--line); background: var(--subtle); border-radius: 10px; padding: 0 36px 0 38px; font: inherit; font-size: .92rem; color: var(--text); transition: border-color .15s, box-shadow .15s, background .15s; }
.header-search input::placeholder { color: var(--muted); }
.header-search input:focus { background: var(--card); border-color: var(--brand); outline: none; box-shadow: var(--ring); }
.search-key { position: absolute; right: 10px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 5px; padding: 0 6px; line-height: 18px; background: var(--card); pointer-events: none; }
.header-search input:focus ~ .search-key { display: none; }
.header-nav { display: flex; align-items: center; gap: 14px; flex: none; }
.nav-link { color: var(--text); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; display: inline-flex; align-items: center; gap: 6px; }
.nav-link .icon { width: 16px; height: 16px; color: var(--link); }
.nav-link:hover { color: var(--link); text-decoration: none; }

/* mobile menu */
.nav-menu { display: none; }
.nav-menu summary { list-style: none; cursor: pointer; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 10px; color: var(--link); }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary:hover, .nav-menu[open] summary { background: var(--brand-50); }
.nav-menu summary .icon { width: 26px; height: 26px; stroke-width: 2.2; }
.nav-menu .when-open, .nav-menu[open] .when-closed { display: none; }
.nav-menu[open] .when-open { display: grid; }
.nav-menu-pop { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 8px 16px 16px; z-index: 30; max-height: calc(100vh - 80px); overflow-y: auto; }
.nav-menu-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }

/* account menu */
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; display: flex; border-radius: 50%; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary .avatar, .menu summary:hover .avatar { box-shadow: 0 0 0 3px var(--brand-100); }
.menu-pop { position: absolute; right: 0; top: 48px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 230px; padding: 6px; z-index: 30; }
.menu-pop a, .menu-pop button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; font: inherit; font-size: .94rem; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--brand-50); color: var(--tint-text); text-decoration: none; }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head strong { color: var(--ink); }
.menu-head span { color: var(--muted); font-size: .85rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 20px; border-radius: 10px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 18px; height: 18px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: .85rem; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-outline { background: transparent; color: var(--link); border-color: var(--brand); text-transform: uppercase; letter-spacing: .06em; font-size: .74rem; }
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-ghost { background: var(--card); color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--brand-50); color: var(--tint-text); border-color: var(--brand-200); }
.btn-light { background: #fff; color: var(--brand-700); border-color: #fff; }
.btn-light:hover { background: var(--brand-50); color: var(--brand-800); border-color: var(--brand-50); }
.btn-danger { background: var(--card); color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.link-btn .icon { width: 16px; height: 16px; }
.link-btn:hover { color: var(--link); }
.link-btn.danger:hover { color: var(--danger); }
.link-btn.ok { color: var(--link); }

/* ---------- Layout ---------- */
main { padding: 28px 0 72px; min-height: 60vh; min-width: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.sidebar { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 22px 24px; }
.narrow { max-width: 760px; margin: 0 auto; }
.narrow.wide { max-width: 880px; }
.narrow > .card { margin-bottom: 20px; }
.section-title { margin: 28px 0 12px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin-bottom: 4px; }
.page-head .lead { color: var(--muted); margin: 0; font-size: 1.02rem; max-width: 680px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: .85rem; color: var(--muted); margin-bottom: 16px; min-width: 0; }
.crumbs a { color: var(--muted); font-weight: 600; flex: none; }
.crumbs > [aria-current] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs a:hover { color: var(--link); }
.empty { padding: 48px 32px; text-align: center; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: var(--brand-300); margin-bottom: 8px; }
.empty p { margin: 0; }

/* ---------- Pills, tags, badges ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tint-text); background: var(--brand-50); padding: 6px 13px; border-radius: 999px; margin-bottom: 18px; }
.tag, .badge { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--subtle); border: 1px solid var(--line); color: var(--muted); vertical-align: 2px; white-space: nowrap; line-height: 1.6; }
.tag .icon, .badge .icon { width: 13px; height: 13px; vertical-align: 0; }
.tag-green, .badge-team { background: var(--brand); border-color: var(--brand); color: #fff; }
.tag-team { background: var(--brand-50); border-color: var(--brand-100); color: var(--tint-text); }
.badge-op { background: var(--brand-50); color: var(--tint-text); border-color: var(--brand-100); }
.badge-muted { background: var(--subtle); color: var(--muted); }
.tag-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.forum-chip { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; color: var(--tint-text); background: var(--brand-50); border-radius: 6px; padding: 1px 8px; white-space: nowrap; }
.forum-chip:hover { background: var(--brand-100); color: var(--tint-text); text-decoration: none; }

/* ---------- Avatars ---------- */
.avatar { --size: 40px; position: relative; display: inline-grid; place-items: center; flex: none; width: var(--size); height: var(--size); border-radius: 50%; background: var(--av, var(--brand)); color: #fff; font-weight: 700; font-size: calc(var(--size) * .38); overflow: hidden; transition: box-shadow .15s; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- Hero (deep brand-green banner) ---------- */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 40px 44px 34px; margin-bottom: 18px; color: #fff;
  background: radial-gradient(90% 120% at 100% 0%, rgba(145, 183, 118, .35) 0%, transparent 55%), radial-gradient(60% 90% at 0% 100%, rgba(0, 0, 0, .25) 0%, transparent 60%), linear-gradient(135deg, #2B4A1B 0%, #48772C 100%); }
.hero::after { content: ''; position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 18px 18px; mask-image: linear-gradient(90deg, transparent 30%, #000 100%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.eyebrow-dark { background: rgba(255, 255, 255, .14); color: #fff; }
.hero h1 { color: #fff; font-size: 2.5rem; line-height: 1.12; letter-spacing: -.03em; margin-bottom: 12px; max-width: 720px; }
.hero h1 .accent { color: #C9E7AE; }
.hero .hero-lead { color: rgba(255, 255, 255, .85); max-width: 600px; font-size: 1.05rem; margin-bottom: 0; }
.hero .hero-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 20px 0 0; font-size: .84rem; color: rgba(255, 255, 255, .75); }
.hero-links a { background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: 3px 12px; color: #fff; font-weight: 600; }
.hero-links a:hover { background: rgba(255, 255, 255, .22); color: #fff; text-decoration: none; }

/* ---------- Categories ---------- */
.topic-list, .activity, .results, .queue, .tips, .sub-list { list-style: none; margin: 0; padding: 0; }
.category { position: relative; padding: 20px 22px 16px; display: flex; flex-direction: column; transition: border-color .15s, box-shadow .15s, transform .15s; }
.category:hover { border-color: var(--brand-200); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.category h3 { font-size: 1.12rem; margin: 0 0 4px; }
.category h3 a { color: var(--ink); }
.category h3 a:hover { color: var(--link); text-decoration: none; }
.category p { margin: 0 0 14px; color: var(--muted); font-size: .92rem; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stretched::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.forum-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-50); color: var(--link); flex: none; transition: background .15s, color .15s; }
.category:hover .forum-icon { background: var(--brand); color: #fff; }
.forum-icon .icon { width: 24px; height: 24px; }
.forum-icon-lg { width: 60px; height: 60px; border-radius: 16px; }
.forum-icon-lg .icon { width: 30px; height: 30px; }

/* ---------- Sidebar cards ---------- */
.ask-card { text-align: left; }
.ask-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--link); margin-bottom: 12px; }
.ask-card h2, .tips-card h2, .support-card h2 { font-size: 1.02rem; margin-bottom: 6px; }
.ask-card p { color: var(--muted); font-size: .92rem; margin-bottom: 16px; }
.tips-card h2 { margin-bottom: 10px; }
.tips li { padding: 6px 0; display: flex; gap: 10px; font-size: .9rem; line-height: 1.5; }
.tips .icon { width: 18px; height: 18px; color: var(--link); margin-top: 2px; }
.support-card { background: linear-gradient(150deg, #48772C 0%, #335620 100%); border: 0; color: #fff; }
.support-card h2 { color: #fff; }
.support-card p { color: rgba(255, 255, 255, .88); font-size: .9rem; }
.support-link { display: flex; align-items: center; gap: 6px; margin-top: 14px; color: #fff; font-weight: 600; font-size: .88rem; }
.support-link .icon { width: 16px; height: 16px; }
.support-link:hover { color: #fff; }
.activity li { padding: 12px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.activity li > div { min-width: 0; display: flex; flex-direction: column; }
.activity li:last-child { border-bottom: 0; }
.activity a { color: var(--ink); font-weight: 600; font-size: .93rem; line-height: 1.4; }
.activity a:hover { color: var(--link); }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; font-size: .88rem; padding: 2px 4px; }
.back-link .icon { width: 16px; height: 16px; }
.back-link:hover { color: var(--link); text-decoration: none; }

/* ---------- Forum header + toolbar ---------- */
.forum-head { display: flex; align-items: center; gap: 20px; padding: 24px 26px; }
.forum-head-text { flex: 1; min-width: 0; }
.forum-head h1 { margin: 0 0 4px; font-size: 1.75rem; }
.forum-head .lead { color: var(--muted); margin: 0 0 8px; max-width: 680px; }
.forum-head-stats { display: flex; gap: 18px; margin: 0; font-size: .84rem; color: var(--muted); }
.forum-head-stats strong { color: var(--ink); }
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; flex-wrap: wrap; }
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--card); border: 1px solid var(--line); border-radius: 11px; }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px; color: var(--muted); font-weight: 700; font-size: .86rem; }
.seg a .icon { width: 16px; height: 16px; }
.seg a:hover { color: var(--ink); text-decoration: none; background: var(--subtle); }
.seg a.active { background: var(--brand-50); color: var(--tint-text); }

/* ---------- Topic list ---------- */
.topic-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto 104px; gap: 16px; align-items: center; padding: 16px 22px; border-bottom: 1px solid var(--line); transition: background .12s; }
.topic-row:hover { background: var(--hover); }
.topic-row:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }
.topic-row:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.topic-row.is-sticky { background: color-mix(in srgb, var(--brand-50) 60%, var(--card)); }
.topic-row.is-pending, .topic-row.is-spam { background: var(--warn-bg); }
.topic-main { min-width: 0; }
.topic-title { font-size: 1rem; font-weight: 700; margin: 0 0 4px; line-height: 1.4; letter-spacing: -.005em; }
.topic-title a { color: var(--ink); }
.topic-title a:hover { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.topic-title a:visited { color: color-mix(in srgb, var(--ink) 72%, var(--bg)); }
.topic-title .tag { margin-right: 4px; }
.topic-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .82rem; color: var(--muted); }
.topic-meta-line .dot { opacity: .6; }
.topic-meta-line .tag { vertical-align: 0; }
.topic-pages { display: inline-flex; gap: 4px; align-items: center; }
.topic-pages a { font-weight: 600; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; font-size: .75rem; color: var(--muted); }
.topic-pages a:hover { color: var(--link); border-color: var(--brand-200); text-decoration: none; }
.list-foot { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.latest .card { overflow: hidden; }

/* ---------- Topic page ---------- */
.topic-head { margin-bottom: 26px; max-width: 920px; }
.topic-head .forum-chip { margin-bottom: 12px; font-size: .76rem; padding: 3px 10px; }
.topic-head h1 { font-size: 2.1rem; line-height: 1.18; letter-spacing: -.03em; margin-bottom: 12px; overflow-wrap: anywhere; }
.topic-head h1 .tag { vertical-align: 8px; }
.topic-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; color: var(--muted); font-size: .9rem; margin: 0; }
.topic-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.topic-meta .icon { width: 17px; height: 17px; }
.topic-layout { grid-template-columns: minmax(0, 1fr) 290px; }
.topic-col, .layout > section { min-width: 0; }
.topic-side { position: sticky; top: calc(var(--header-h) + 24px); }
.topic-box { display: grid; gap: 10px; }
.topic-box form { margin: 0; }
.topic-box .facts { margin: 8px 0 0; padding-top: 14px; border-top: 1px solid var(--line); grid-template-columns: 1fr 1fr; gap: 14px; }

.posts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0 0 16px; }
.post { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; scroll-margin-top: calc(var(--header-h) + 20px); }
.post-avatar { position: sticky; top: calc(var(--header-h) + 20px); align-self: start; padding-top: 4px; }
.post-avatar-sm { display: none; }
.post-card { padding: 20px 26px 16px; min-width: 0; position: relative; }
.post-card::before { content: ''; position: absolute; left: -9px; top: 18px; width: 16px; height: 16px; background: inherit; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.post:target .post-card { box-shadow: 0 0 0 3px rgba(72, 119, 44, .35); }
.post.is-first .post-card { border-top: 3px solid var(--brand); }
.post.is-team .post-card { border-color: var(--brand-200); background: linear-gradient(180deg, var(--brand-50) 0, var(--card) 140px); }
.post.is-team .post-card::before { border-color: var(--brand-200); background: var(--brand-50); }
.post.is-pending .post-card, .post.is-spam .post-card { background: var(--warn-bg); border-color: var(--warn-line); }
.post.is-pending .post-card::before, .post.is-spam .post-card::before { background: var(--warn-bg); border-color: var(--warn-line); }
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-who { min-width: 0; display: flex; flex-direction: column; line-height: 1.4; flex: 1; }
.post-who-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.author-name { font-weight: 700; color: var(--ink); word-break: break-word; }
a.author-name:hover { color: var(--link); }
/* Quote and Report spam: top right of each post, next to the #number */
.post-tools { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.post-tools form { display: inline-flex; margin: 0; }
.post-tools .report, .post-tools .report-btn { margin-left: 0; }
.post-tools:empty { display: none; }
/* Phones: icons only, so the author name keeps its room (labels stay for screen readers) */
@media (max-width: 680px) {
  .post-tools { gap: 6px; }
  .post-tools .link-btn, .post-tools .report-btn { padding: 6px; }
  .post-tools .icon { width: 18px; height: 18px; }
  .post-tools .tool-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.permalink { color: var(--muted); padding: 2px 8px; border-radius: 6px; font-family: var(--mono); font-size: .8rem; font-weight: 600; }
.permalink:hover { color: var(--link); background: var(--brand-50); text-decoration: none; }
.replies-divider { display: flex; align-items: center; gap: 14px; margin: 10px 0 2px 60px; color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.replies-divider::before, .replies-divider::after { content: ''; height: 1px; background: var(--line-strong); flex: 1; }
.replies-divider::before { flex: 0 0 0; }
.post-body { overflow-wrap: anywhere; font-size: 1.02rem; line-height: 1.75; color: var(--text); max-width: 78ch; }
.post-body > :last-child { margin-bottom: 0; }
.post-body p { margin: 0 0 1em; }
.post-body h1, .post-body h2, .post-body h3 { margin: 1.3em 0 .5em; }
.post-body a { text-decoration: underline; text-decoration-color: var(--brand-200); text-underline-offset: 2px; }
.post-body a:hover { text-decoration-color: currentColor; }
.post-body blockquote { margin: 0 0 1em; padding: 10px 18px; border-left: 3px solid var(--brand-300); background: var(--subtle); border-radius: 0 10px 10px 0; color: var(--muted); font-size: .97rem; }
.post-body blockquote > :last-child { margin-bottom: 0; }
.post-body pre { background: var(--pre-bg); color: var(--pre-text); padding: 14px 18px; border-radius: 10px; overflow-x: auto; font-size: .86rem; line-height: 1.6; }
.post-body code { font-family: var(--mono); font-size: .87em; background: var(--code-bg); padding: 2px 6px; border-radius: 5px; }
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body img { border-radius: 10px; border: 1px solid var(--line); }
.post-body table { border-collapse: collapse; margin-bottom: 1em; display: block; overflow-x: auto; font-size: .95rem; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 6px 10px; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li { margin-bottom: .3em; }
.edited { margin: 10px 0 0; font-style: italic; }
.post-actions { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .86rem; }
.post-actions a { color: var(--muted); font-weight: 600; }
.post-actions a:hover { color: var(--link); }
.post-actions form { display: inline; }
.reply-box { margin-top: 24px; margin-left: 60px; }
.reply-box h2 { font-size: 1.1rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.reply-box h2 .icon { color: var(--link); }
.mod-bar { padding: 12px 20px; margin-bottom: 16px; }
.mod-bar summary { cursor: pointer; font-weight: 700; color: var(--link); font-size: .88rem; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
select { height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 8px; font: inherit; font-size: .9rem; background: var(--card); color: var(--text); }
.topic-col > .pagination { margin-bottom: 16px; }

/* ---------- Spam tools ---------- */
.post-actions .report, .report-btn { margin-left: auto; }
.report-btn { color: var(--muted); font-weight: 600; font-size: .84rem; display: inline-flex; align-items: center; gap: 5px; }
.report-btn .icon, .link-btn .icon { width: 15px; height: 15px; }
.report-btn:hover, .link-btn.report-btn:hover { color: var(--danger); text-decoration: none; }
.score { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: .75rem; font-weight: 800; }
.score-low { background: var(--brand-50); color: var(--tint-text); }
.score-mid { background: var(--warn-bg); color: var(--warn); }
.score-high { background: var(--danger-bg); color: var(--danger); }
.post-actions .score { margin-left: auto; font-weight: 700; }
.row-spam { margin-top: 2px; }
.row-spam .report-btn { margin-left: 0; font-size: .78rem; }
.queue-help { margin: 16px 0 20px; max-width: 900px; line-height: 1.55; }
.queue-main { min-width: 0; flex: 1; }
.queue-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.reasons { font-size: .85rem; margin: 0 0 6px; }
.reasons summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.reasons ul, .test-result ul { margin: 6px 0 0; padding-left: 18px; color: var(--text); }
.queue .reasons li, .test-result li { display: list-item; padding: 1px 0; border: 0; gap: 0; }
.reasons li.neg, .test-result li.neg { color: var(--tint-text); }
.stat-grid dd.dd-sm { font-size: 1rem; line-height: 1.4; }
.stat-grid dd.dd-sm small { font-size: .78rem; font-weight: 500; }
.stat-spam dd { color: var(--danger); }
.stat-grid dd a { color: inherit; }
.test-result { display: flex; gap: 14px; align-items: flex-start; margin-top: 18px; padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--subtle); font-size: .92rem; }
.test-result .score { min-width: 48px; height: 40px; font-size: 1.15rem; }
.verdict-spam { border-color: var(--danger-line); background: var(--danger-bg); }
.verdict-review { border-color: var(--warn-line); background: var(--warn-bg); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pagination .page { min-width: 38px; height: 38px; padding: 0 10px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 700; font-size: .88rem; }
.pagination a.page:hover { border-color: var(--brand); color: var(--link); text-decoration: none; }
.pagination .current { background: var(--brand); border-color: var(--brand); color: #fff; }
.pagination .gap { color: var(--muted); padding: 0 4px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; font-size: .92rem; }
.field > span { font-weight: 700; color: var(--ink); display: flex; justify-content: space-between; }
.field em { font-weight: 400; color: var(--muted); font-style: normal; }
.field small { color: var(--muted); }
.field-link { font-weight: 600; }
.field input, .field textarea, .field select, .editor textarea, .admin-search input { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; padding: 11px 13px; font: inherit; font-size: 1rem; color: var(--text); background: var(--card); height: auto; transition: border-color .15s, box-shadow .15s; }
.field input:focus, .field textarea:focus, .editor textarea:focus, .admin-search input:focus { border-color: var(--brand); outline: none; box-shadow: var(--ring); }
.field input:disabled { background: var(--subtle); color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: 2fr 2fr 1fr 1fr; gap: 0 16px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.form-actions .check { margin-right: auto; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: .92rem; cursor: pointer; }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha { margin: 12px 0; min-height: 65px; }
.editor { border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; margin-bottom: 12px; background: var(--card); transition: border-color .15s, box-shadow .15s; }
.editor:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.editor textarea { border: 0; border-radius: 0; resize: vertical; min-height: 150px; display: block; line-height: 1.65; }
.editor textarea:focus { box-shadow: none; }
.editor-bar { display: flex; align-items: center; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--subtle); flex-wrap: wrap; }
.editor-bar button { height: 32px; min-width: 34px; padding: 0 9px; border: 0; border-radius: 7px; background: none; color: var(--text); cursor: pointer; font: inherit; font-size: .9rem; }
.editor-bar button:hover { background: var(--brand-50); color: var(--link); }
.editor-bar .icon { width: 16px; height: 16px; vertical-align: -3px; }
.editor-bar .spacer { flex: 1; }
.editor-bar .tab.active { background: var(--card); color: var(--link); font-weight: 700; box-shadow: inset 0 0 0 1px var(--line); }
.editor-live { border-top: 1px solid var(--line); background: var(--subtle); }
.editor-live-head { display: flex; align-items: center; gap: 8px; padding: 7px 14px 0; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.editor-live-status { text-transform: none; letter-spacing: 0; font-weight: 600; }
.editor-preview { padding: 8px 14px 14px; max-height: 420px; overflow-y: auto; font-size: .97rem; }
.editor-hint { font-size: .8rem; color: var(--muted); padding: 7px 13px; border-top: 1px solid var(--line); background: var(--subtle); }
.login-prompt { background: var(--brand-50); border: 1px solid var(--brand-100); border-radius: 12px; padding: 16px 20px; }
.login-prompt p { margin: 0; }
.alert { padding: 13px 18px; border-radius: 12px; margin-bottom: 20px; border: 1px solid; font-size: .95rem; font-weight: 600; }
.alert-success, .alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--tint-text); }
.alert-error { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }

/* ---------- Auth ---------- */
.auth { max-width: 440px; margin: 40px auto; }
.auth h1 { font-size: 1.7rem; text-align: center; }
.auth > p { text-align: center; }
.auth .card { padding: 32px; box-shadow: var(--shadow-md); }
.auth-alt { text-align: center; margin: 18px 0 0; font-size: .95rem; }

/* ---------- Search / profile ---------- */
.results { display: grid; gap: 12px; margin-bottom: 20px; }
.result { transition: border-color .15s, box-shadow .15s; }
.result:hover { border-color: var(--brand-200); box-shadow: var(--shadow-md); }
.result-title { font-weight: 700; font-size: 1.06rem; display: block; margin-bottom: 4px; color: var(--ink); }
.result-title:hover { color: var(--link); }
.result p { margin: 0 0 8px; font-size: .95rem; color: var(--text); line-height: 1.6; }
.profile { display: flex; gap: 24px; align-items: center; }
.profile h1 { margin: 0; }
.profile p { margin: 4px 0 0; }
.facts { margin: 0 0 12px; display: grid; gap: 14px; }
.facts dt { font-size: .74rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 0; font-weight: 700; color: var(--ink); }
.sub-list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.sub-list { margin-bottom: 16px; }

/* ---------- Admin ---------- */
.admin-nav, .tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.admin-nav a, .tabs a { padding: 10px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.admin-nav a.active, .tabs a.active { color: var(--link); border-color: var(--brand); text-decoration: none; }
.tabs { border: 0; margin-bottom: 12px; }
.tabs a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--card); }
.tabs a.active { background: var(--brand); color: #fff; }
.count { display: inline-block; background: rgba(127, 127, 127, .16); border-radius: 999px; padding: 0 7px; font-size: .78rem; margin-left: 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 0 0 24px; }
.stat-grid dt { font-size: .8rem; color: var(--muted); font-weight: 600; }
.stat-grid dd { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--ink); }
.bulk-bar { display: flex; gap: 8px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.bulk-bar .check { margin-right: auto; }
.queue li { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.queue li:last-child { border-bottom: 0; }
.queue p { margin: 6px 0; font-size: .92rem; }
.queue input { accent-color: var(--brand); margin-top: 5px; }
.admin-search { display: flex; gap: 8px; margin-bottom: 16px; max-width: 480px; }
.admin-search .btn { height: auto; padding: 0 20px; border-radius: 10px; font-size: .95rem; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 16px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.is-banned td { background: var(--danger-bg); }
.admin-forum { margin-bottom: 16px; }
.error-page { text-align: center; padding: 64px 0; max-width: 560px; margin: 0 auto; }

/* ---------- Footer (solid brand green, like axcrypt.net) ---------- */
.site-footer { background: #48772C; color: rgba(255, 255, 255, .86); padding: 56px 0 24px; font-size: .92rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-logo img { height: 27px; width: auto; display: block; margin-bottom: 14px; }
.footer-about p { max-width: 340px; margin: 0 0 16px; line-height: 1.6; }
.footer-cta { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: #335620; font-weight: 700; font-size: .86rem; padding: 8px 16px; border-radius: 10px; }
.footer-cta .icon { width: 16px; height: 16px; }
.footer-cta:hover { background: #EEF7EA; color: #1F3514; text-decoration: none; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer h2 { color: #fff; font-size: .74rem; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 6px; }
.site-footer nav a { color: rgba(255, 255, 255, .86); }
.site-footer nav a:hover { color: #fff; }
.footer-copy { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .22); margin-top: 40px; padding-top: 18px; font-size: .82rem; color: rgba(255, 255, 255, .75); }
.footer-copy span { display: flex; gap: 20px; }
.footer-copy a { color: rgba(255, 255, 255, .75); }
.footer-copy a:hover { color: #fff; }

/* ---------- App shell: sidebar + content ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 32px; align-items: start; }
.rail { position: sticky; top: var(--header-h); max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 24px 0 24px; scrollbar-width: thin; }
.rail-inner { display: grid; gap: 22px; }
.rail-nav, .rail-section nav { display: grid; gap: 2px; }
.rail nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--text); font-weight: 600; font-size: .9rem; }
.rail nav a .icon { width: 18px; height: 18px; color: var(--muted); }
.rail nav a:hover { background: var(--card); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.rail nav a.active { background: var(--brand-50); color: var(--tint-text); }
.rail nav a.active .icon { color: var(--link); }
.rail-section h2 { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 6px 10px; font-weight: 700; }
.rail-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--brand-50); flex: none; }
.rail-ico .icon { width: 15px !important; height: 15px !important; color: var(--link) !important; }
.rail-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-count { font-size: .72rem; color: var(--muted); font-weight: 700; background: var(--subtle); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }

/* header icon button + light/dark toggle */
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); border: 1px solid var(--line); background: var(--card); }
.icon-btn:hover { color: var(--link); border-color: var(--brand-200); background: var(--brand-50); }
.icon-btn .icon { width: 19px; height: 19px; }
.theme-toggle .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .i-sun { display: grid; }
  :root:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
}
:root[data-theme="dark"] .theme-toggle .i-sun { display: grid; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.theme-toggle span { display: grid; }

/* ---------- Home ---------- */
.home-section { margin-bottom: 28px; }
.category-strip { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.category-strip .category { flex-direction: row; align-items: center; gap: 12px; padding: 14px 16px; }
.category-strip .category > .icon { width: 18px; height: 18px; color: var(--muted); transition: transform .15s, color .15s; }
.category-strip .category:hover > .icon { transform: translateX(3px); color: var(--link); }
.category-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.category-text .small, .category-strip h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-strip h3 { font-size: .98rem; margin: 0; }
.feed { min-width: 0; }
.feed-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.feed-head h2 { margin: 0; font-size: 1.3rem; }
.feed-more { margin: 14px 4px 0; color: var(--muted); font-size: .88rem; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.feed-more a { font-weight: 600; }
.feed-more .rss { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.feed-more .rss .icon { width: 15px; height: 15px; }
.stats-card dl { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.stats-card dl div { padding: 16px 12px; text-align: center; }
.stats-card dl div + div { border-left: 1px solid var(--line); }
.stats-card dt { font-size: .7rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.stats-card dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }

/* ---------- Mobile bottom bar ---------- */
.bottom-bar { display: none; }

/* ---------- Responsive ---------- */
/* Content + right sidebar side by side only when there is room for both */
@media (max-width: 1279px) {
  .layout, .topic-layout { grid-template-columns: minmax(0, 1fr); }
  .topic-side { position: static; }
  .sidebar { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .category-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
/* Below laptop width the left sidebar moves into the menu drawer */
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .nav-menu { display: block; }
  .nav-menu[open] .nav-menu-pop { box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .45); }
  .nav-menu-pop { right: auto; width: min(340px, 88vw); height: calc(100vh - 100%); max-height: none; border-right: 1px solid var(--line); border-bottom: 0; padding: 16px; }
  .nav-menu-pop .rail-nav, .nav-menu-pop .rail-section { margin-bottom: 20px; display: grid; gap: 2px; }
  .nav-menu-pop .rail-section nav { display: grid; gap: 2px; }
  .nav-menu-pop a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--text); font-weight: 600; }
  .nav-menu-pop a .icon { width: 18px; height: 18px; color: var(--muted); }
  .nav-menu-pop a:hover { background: var(--subtle); text-decoration: none; }
  .nav-menu-pop a.active { background: var(--brand-50); color: var(--tint-text); }
  .nav-menu-pop .rail-section h2 { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 0 0 6px 10px; }
  .nav-menu-pop   .nav-menu-auth .btn { justify-content: center; }
  .nav-menu-auth a.btn { color: #fff; }
  .nav-menu-auth a.btn-ghost { color: var(--text); }
  .footer-grid { grid-template-columns: 1fr 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .header-inner { gap: 10px 12px; height: auto; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
  .header-nav { margin-left: auto; gap: 10px; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
  .search-key { display: none; }
  html { scroll-padding-top: 130px; }
  .post-avatar { top: 130px; }
  .topic-row { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .hero { padding: 32px 28px 28px; }
  .hero h1 { font-size: 2rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  main { padding: 18px 0 32px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .hide-sm { display: none !important; }
  .brand-logo { height: 24px; }
  .header-nav .guest-link { display: none; }
  .header-nav { gap: 8px; }
  .hero { padding: 24px 20px 22px; border-radius: 16px; }
  .hero h1 { font-size: 1.6rem; }
  .hero .hero-lead { font-size: .96rem; margin-bottom: 16px; }
      .category-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .category-strip .category { padding: 12px; gap: 10px; }
  .category-strip .category > .icon, .category-strip .forum-icon { display: none; }
  .feed-head h2 { font-size: 1.15rem; }
  .forum-head { flex-wrap: wrap; padding: 20px; gap: 14px; }
  .forum-head .btn { display: none; }
  .forum-icon-lg { width: 48px; height: 48px; }
  .forum-head h1 { font-size: 1.45rem; }
  .topic-row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px; gap: 12px; }
  .topic-row > .avatar { display: none; }
  .page-head { flex-direction: column; align-items: stretch; }
  .topic-head h1 { font-size: 1.5rem; }
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-avatar { display: none; }
  .post-avatar-sm { display: inline-flex; }
  .post-card { padding: 16px; }
  .post-card::before { display: none; }
  .post-body { font-size: 1rem; }
  .replies-divider, .reply-box { margin-left: 0; }
  .post-actions { gap: 14px; }
  .card-pad { padding: 18px; }
  .activity li { padding: 12px 16px; }
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .profile { flex-direction: column; align-items: flex-start; }
  .editor-bar { flex-wrap: nowrap; gap: 0; padding: 5px; }
  .editor-bar button { min-width: 30px; padding: 0 6px; }
  .editor-bar .tab { font-size: .85rem; padding: 0 8px; }
  .topic-side a.btn-block[href="#new-post"] { display: none; }
  .auth .card { padding: 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .site-footer { padding-top: 40px; }
  .nav-menu-pop { padding-bottom: 96px; }
  .bottom-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: color-mix(in srgb, var(--card) 96%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-bar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; font-size: .66rem; font-weight: 700; color: var(--muted); border-radius: 10px; }
  .bottom-bar a .icon { width: 22px; height: 22px; }
  .bottom-bar a:hover { text-decoration: none; color: var(--ink); }
  .bottom-bar a.active { color: var(--link); }
  .bottom-bar .bottom-cta { color: #fff; background: var(--brand); margin: -16px 4px 0; padding: 10px 2px 6px; box-shadow: 0 8px 18px rgba(31, 53, 20, .35); border-radius: 14px; }
  .bottom-bar .bottom-cta:hover { color: #fff; background: var(--brand-600); }
}
@media (max-width: 440px) {
  .brand-sub { display: none; }
  .header-inner { gap: 8px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Admin: email settings ---------- */
.email-layout { grid-template-columns: minmax(0, 1fr) 320px; }
.email-form { display: grid; gap: 16px; min-width: 0; }
.email-form h2, .email-layout .sidebar h2 { font-size: 1.02rem; margin-bottom: 12px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 12px 40px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; position: relative; background: var(--card); }
.choice input { position: absolute; left: 14px; top: 15px; accent-color: var(--brand); width: 16px; height: 16px; }
.choice strong { color: var(--ink); font-size: .95rem; }
.choice small { color: var(--muted); line-height: 1.45; }
.choice:has(input:checked), .choice.is-on { border-color: var(--brand); background: var(--brand-50); box-shadow: var(--ring); }
.grid-smtp { grid-template-columns: 2fr 1fr 2fr; }
.secret-line, .status-line { display: flex; align-items: center; gap: 8px; font-size: .88rem; margin: 4px 0 0; color: var(--text); }
.dot-status { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--muted); }
.dot-status.ok { background: #3FA34D; box-shadow: 0 0 0 3px rgba(63, 163, 77, .18); }
.dot-status.warn { background: #D99A1E; box-shadow: 0 0 0 3px rgba(217, 154, 30, .2); }
.switch-row { display: flex; padding: 6px 0; }
.email-status .facts { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.email-status dd { font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
@media (max-width: 1279px) { .email-layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 680px) { .choice-grid, .grid-smtp { grid-template-columns: 1fr; } }

/* =====================================================================
   Layout refresh: flatter surfaces, Discourse-style topic rows, Q&A replies, bolder brand
   ===================================================================== */
:root { --shadow: none; }
.card { border-color: var(--line); }

/* Brand strip above the header (links back to axcrypt.net) */
.brand-strip { background: #1F3514; color: rgba(255, 255, 255, .7); font-size: .76rem; }
.brand-strip-inner { display: flex; align-items: center; justify-content: space-between; height: 34px; gap: 16px; }
.brand-strip nav { display: flex; gap: 18px; }
.brand-strip a { color: rgba(255, 255, 255, .85); font-weight: 600; }
.brand-strip a:hover { color: #fff; }
.site-header { border-bottom-color: var(--line); }
.brand-logo { height: 30px; }

/* Bigger, bolder headings */
.topic-head h1 { font-size: 2.35rem; }
.forum-head h1 { font-size: 2rem; }
.feed-head h2 { font-size: 1.4rem; }

/* Hero illustration */
.hero { padding-right: 400px; min-height: 270px; }
.hero-art { position: absolute; right: 24px; top: 50%; transform: translateY(-50%); width: 360px; height: auto; z-index: 1; }

/* Topic list: column heads + Discourse-style rows */
.topic-card { overflow: hidden; }
.list-head, .topic-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) 150px 64px 76px; gap: 16px; align-items: center; }
.list-head { padding: 10px 22px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--subtle); }
.list-head span:nth-child(1) { grid-column: 1 / 3; }
.list-head span:nth-child(3), .list-head span:nth-child(4) { text-align: center; }
.topic-row { padding: 16px 22px; align-items: start; }
.topic-row:first-child { border-radius: 0; }
.topic-state { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--subtle); color: var(--muted); margin-top: 1px; }
.topic-state .icon { width: 17px; height: 17px; }
.topic-row.is-solved .topic-state { background: #E3F3DA; color: #2E6B1A; }
.topic-title { font-size: 1.04rem; margin-bottom: 3px; }
.topic-excerpt { margin: 0 0 6px; color: var(--muted); font-size: .88rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.topic-meta-line strong { color: var(--text); font-weight: 600; }
.topic-meta-line .row-spam { margin: 0 0 0 auto; }
.topic-people { display: flex; padding-top: 2px; }
.topic-people > span { margin-left: -6px; border-radius: 50%; box-shadow: 0 0 0 2px var(--card); display: inline-flex; }
.topic-people > span:first-child { margin-left: 0; }
.topic-row:hover .topic-people > span { box-shadow: 0 0 0 2px var(--hover); }
.topic-num { display: flex; flex-direction: column; align-items: center; line-height: 1.2; padding-top: 2px; }
.topic-num strong { font-size: 1rem; color: var(--ink); font-weight: 800; }
.topic-num span { font-size: .7rem; color: var(--muted); }
.topic-num.is-zero strong { color: var(--muted); }
a.topic-activity strong { color: var(--link); font-size: .86rem; white-space: nowrap; }
a.topic-activity:hover { text-decoration: none; }
a.topic-activity:hover strong { text-decoration: underline; }
.tag-solved, .badge-solved { background: #2E6B1A; border-color: #2E6B1A; color: #fff; }

/* Q&A topic page: the question is a card, replies are a clean list; team posts and the solution stand out */
.post-card::before { display: none; }
.post.is-first .post-card { border-top-width: 4px; padding: 24px 28px 18px; }
.post.is-first .post-body { font-size: 1.06rem; }
.post:not(.is-first):not(.is-team):not(.is-solution):not(.is-pending):not(.is-spam) .post-card { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 18px 4px 14px; }
.posts { gap: 6px; }
.post.is-team .post-card, .post.is-solution .post-card { margin: 8px 0; }
.post.is-solution .post-card { border: 2px solid #3E8A2A; background: linear-gradient(180deg, #EEF8E8 0, var(--card) 160px); }
.solution-box { margin: 4px 0 10px 60px; padding: 14px 18px; border-radius: 14px; border: 1px solid #BFE0AE; background: #EEF8E8; }
.solution-head { display: flex; align-items: center; gap: 8px; font-weight: 800; color: #2E6B1A; font-size: .9rem; margin-bottom: 4px; }
.solution-head .icon { width: 18px; height: 18px; }
.solution-head .muted { font-weight: 600; }
.solution-box p { margin: 0 0 6px; font-size: .94rem; color: var(--text); }
.solution-box a { font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.solution-box a .icon { width: 15px; height: 15px; }
.solve-btn.is-on, .solve-btn:hover { color: #2E6B1A; }
.post-actions form { display: inline-flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .solution-box { background: #18261A; border-color: #2D4A28; }
  :root:not([data-theme="light"]) .solution-head, :root:not([data-theme="light"]) .solve-btn.is-on { color: #9BD486; }
  :root:not([data-theme="light"]) .post.is-solution .post-card { background: linear-gradient(180deg, #18261A 0, var(--card) 160px); border-color: #3E8A2A; }
  :root:not([data-theme="light"]) .topic-row.is-solved .topic-state { background: #1F3519; color: #9BD486; }
}
:root[data-theme="dark"] .solution-box { background: #18261A; border-color: #2D4A28; }
:root[data-theme="dark"] .solution-head, :root[data-theme="dark"] .solve-btn.is-on { color: #9BD486; }
:root[data-theme="dark"] .post.is-solution .post-card { background: linear-gradient(180deg, #18261A 0, var(--card) 160px); border-color: #3E8A2A; }
:root[data-theme="dark"] .topic-row.is-solved .topic-state { background: #1F3519; color: #9BD486; }

@media (max-width: 1279px) {
  .hero { padding-right: 44px; }
  .hero-art { display: none; }
}
@media (max-width: 1023px) {
  .list-head, .topic-row { grid-template-columns: 32px minmax(0, 1fr) 64px 76px; }
  .topic-people, .list-head span:nth-child(2) { display: none !important; }
}
@media (max-width: 860px) {
  .brand-strip span { display: none; }
  .brand-strip-inner { justify-content: center; }
}
@media (max-width: 680px) {
  .brand-strip { display: none; }
  .list-head { display: none; }
  .topic-row { grid-template-columns: minmax(0, 1fr) 52px; gap: 10px; padding: 14px 16px; }
  .topic-state, .topic-activity { display: none !important; }
  .topic-excerpt { -webkit-line-clamp: 1; }
  .topic-head h1 { font-size: 1.55rem; }
  .forum-head h1 { font-size: 1.45rem; }
  .solution-box { margin-left: 0; }
  .post:not(.is-first):not(.is-team):not(.is-solution) .post-card { padding: 16px 0 12px; }
}
/* Home feed next to the right column: drop the People column so titles get the room */
@media (min-width: 1280px) {
  .feed .list-head, .feed .topic-row { grid-template-columns: 32px minmax(0, 1fr) 64px 76px; }
  .feed .topic-people, .feed .list-head span:nth-child(2) { display: none; }
}

/* Topic page: posts use the full content width; Reply and email notifications sit under the topic title.
   Slightly smaller reading text. */
.topic-layout { grid-template-columns: minmax(0, 1fr); }
.topic-head { max-width: none; }
.topic-head h1 { font-size: 2rem; }
.post-body { font-size: .95rem; line-height: 1.7; max-width: none; }
.post.is-first .post-body { font-size: .98rem; }
.post-body pre { font-size: .82rem; }
.rail .topic-box { padding: 14px; gap: 8px; }
.rail .topic-box .btn { font-size: .86rem; padding-top: 8px; padding-bottom: 8px; }
.rail .topic-box .facts { margin-top: 4px; padding-top: 12px; gap: 10px; }
.rail .topic-box .facts dt { font-size: .66rem; }
.rail .topic-box .facts dd { font-size: .84rem; overflow-wrap: anywhere; }
/* Topic actions (Reply, email notifications): a button row under the topic title on every screen size */
.topic-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.topic-actions form { margin: 0; }
.topic-actions .btn { height: 34px; padding: 0 12px; font-size: .8rem; border-radius: 8px; gap: 6px; }
.topic-actions .btn .icon { width: 15px; height: 15px; }
.topic-actions-title { display: none; } /* only shown in the right-hand box on wide screens */
/* Wide screens: Reply and email notifications sit in a box on the right of the whole topic header,
   one button per row (narrower screens keep them as a row under the facts line) */
@media (min-width: 1200px) {
  .topic-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; }
  .topic-head > * { grid-column: 1; }
  .topic-head > .forum-chip { justify-self: start; }
  .topic-head > .topic-meta { margin-bottom: 0; }
  .topic-head > .topic-actions { grid-column: 2; grid-row: 1 / span 4; align-self: center; flex-direction: column; flex-wrap: nowrap; gap: 8px; margin-top: 0; padding: 14px; min-width: 220px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
  .topic-actions form, .topic-actions .btn { width: 100%; }
  .topic-actions-title { display: block; margin: 0 0 2px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
}
/* Desktop: the topic header (title, facts, Reply) stays under the site header while the posts scroll beneath it.
   --topic-head-h is set by app.js so links to a post (#post-…, #new-post) land below the sticky header. */
@media (min-width: 1024px) {
  .topic-head { position: sticky; top: var(--header-h); z-index: 10; background: var(--bg); padding: 16px 0 18px; margin: -16px 0 20px; border-bottom: 1px solid var(--line); }
  .crumbs { margin-top: 4px; } /* line the breadcrumb up with "Home" in the left menu */
  html:has(.topic-head) { scroll-padding-top: calc(var(--header-h) + var(--topic-head-h, 220px) + 16px); }
  .topic-layout .post { scroll-margin-top: 0; }
  .topic-layout .post-avatar { position: static; }
}
@media (min-width: 1024px) { .topic-side { display: none; } }
@media (max-width: 1023px) { .topic-side { position: static; } }
@media (max-width: 680px) { .topic-head h1 { font-size: 1.45rem; } .post-body, .post.is-first .post-body { font-size: .94rem; } }

/* New topic and edit post: the composer uses the full content width, like the topic page */
.compose { max-width: none; }

/* Brand lockup: the official logo (with a dark-header variant that keeps the green mark) + a divider + "Community" */
.brand { gap: 14px; }
.brand-logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-logo-light:has(+ .brand-logo-dark) { display: none; }
  :root:not([data-theme="light"]) .brand-logo-dark { display: block; }
}
:root[data-theme="dark"] .brand-logo-light:has(+ .brand-logo-dark) { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }
.brand-sub { background: none; border-radius: 0; padding: 2px 0 2px 14px; border-left: 2px solid var(--line); color: var(--link); font-size: 1.05rem; font-weight: 700; text-transform: none; letter-spacing: -.01em; line-height: 1.2; }
.brand:hover .brand-sub { color: var(--ink); }
@media (max-width: 680px) { .brand { gap: 10px; } .brand-sub { font-size: .95rem; padding-left: 10px; } }

/* Show/hide password button inside password fields */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; display: grid; place-items: center; border: 0; background: none; color: var(--muted); border-radius: 8px; cursor: pointer; }
.pw-toggle:hover { color: var(--ink); background: var(--subtle); }
.pw-toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.pw-toggle .icon { width: 20px; height: 20px; }

/* Logo: logo-text-retina.png from axcrypt.net (290x66, shown at half size) */
.brand-logo { height: 33px; }
.footer-logo img { height: 33px; }
@media (max-width: 680px) { .brand-logo { height: 27px; } }

/* ===================== Support desk ===================== */
.desk-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.desk-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.desk-tabs { margin-bottom: 0; flex: 1 1 auto; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.desk-tabs a { white-space: nowrap; flex: none; }
.desk-filter select { min-width: 180px; }
.count-hot { background: var(--danger); color: #fff; }
.desk-alert { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--danger); font-size: .9rem; }
.desk-alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--tint-text); }
.desk-alert .icon { width: 18px; height: 18px; flex: none; }
.desk-card { overflow: hidden; }
.desk-list { list-style: none; margin: 0; padding: 0; }
.desk-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.desk-row:last-child { border-bottom: 0; }
.desk-row:hover { background: var(--hover); }
.desk-state { width: 10px; height: 10px; border-radius: 50%; margin-top: 7px; background: var(--muted); }
.desk-row.is-new .desk-state { background: #D9822B; }
.desk-row.is-open .desk-state { background: var(--brand); }
.desk-row.is-overdue .desk-state { background: var(--danger); }
.desk-row.is-waiting .desk-state { background: #6B8FB8; }
.desk-title { font-weight: 700; color: var(--ink); font-size: 1rem; }
.desk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; color: var(--muted); font-size: .82rem; }
.desk-meta strong { color: var(--text); font-weight: 600; }
.desk-draft { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 10px; border-radius: 8px; font-size: .8rem; background: var(--subtle); color: var(--text); }
.desk-draft .icon { width: 14px; height: 14px; }
.desk-draft.is-review { background: var(--brand-50); color: var(--tint-text); }
.desk-draft.is-returned { background: var(--warn-bg); color: var(--warn); }
.desk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.desk-assign select { font: inherit; font-size: .84rem; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--text); max-width: 190px; }
.due, .status-pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--subtle); color: var(--muted); }
.due .icon { width: 13px; height: 13px; }
.due.is-soon { background: var(--warn-bg); color: var(--warn); }
.due.is-overdue { background: var(--danger-bg); color: var(--danger); }
.status-pill.is-new { background: #FCEBD9; color: #8A4B0F; }
.status-pill.is-open { background: var(--brand-50); color: var(--tint-text); }
.status-pill.is-waiting { background: #E3ECF6; color: #2F557F; }
.status-pill.is-closed, .status-pill.is-none { background: var(--subtle); color: var(--muted); }

/* Topic page: desk bar and the team draft panel */
.desk-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; border-left: 4px solid var(--brand); }
.desk-bar form { margin: 0; }
.desk-bar-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); font-size: .9rem; }
.desk-bar-label .icon { width: 17px; height: 17px; color: var(--link); }
.desk-bar-link { margin-left: auto; font-weight: 600; font-size: .88rem; }
.desk-panel { padding: 20px 22px; margin-bottom: 16px; border: 2px dashed var(--brand-200); background: linear-gradient(180deg, var(--brand-50) 0, var(--card) 120px); scroll-margin-top: calc(var(--header-h) + 20px); }
.desk-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.desk-panel-head h2 { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; margin: 0; }
.desk-panel-head .icon { width: 18px; height: 18px; color: var(--link); }
.draft-state { font-size: .88rem; margin: 0 0 10px; color: var(--muted); }
.draft-state strong { color: var(--ink); }
.draft-state.is-returned strong { color: var(--warn); }
.return-note { margin: 0 0 12px; padding: 8px 14px; border-left: 3px solid var(--warn-line); background: var(--warn-bg); border-radius: 0 8px 8px 0; font-size: .9rem; }
.draft-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.draft-actions .btn:last-child { margin-left: auto; }
.draft-review { display: inline-flex; gap: 6px; align-items: center; }
.draft-review select { font: inherit; font-size: .9rem; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--text); }
.draft-return { display: flex; align-items: flex-end; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.draft-return .field { flex: 1; margin: 0; }
.draft-discard { margin-top: 10px; text-align: right; }
.desk-notes { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.desk-notes h3 { font-size: .95rem; margin: 0 0 10px; }
.note-form { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.note-form textarea { flex: 1; font: inherit; font-size: .9rem; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card); color: var(--text); resize: vertical; }
.activity { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .86rem; }
.activity-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); align-items: baseline; }
.activity-item:last-child { border-bottom: 0; }
.activity-who { font-weight: 700; color: var(--ink); }
.activity-item time { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.activity-note { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Desk settings */
.desk-settings { display: grid; gap: 16px; max-width: 860px; }
.desk-settings h2 { font-size: 1.05rem; margin-bottom: 6px; }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }
.field-inline input, .field-inline select { width: auto; max-width: 120px; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 16px; }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .status-pill.is-new { background: #3A2A16; color: #F0B878; }
  :root:not([data-theme="light"]) .status-pill.is-waiting { background: #1C2A3A; color: #9DC0E6; }
  :root:not([data-theme="light"]) .desk-panel { background: linear-gradient(180deg, #17231A 0, var(--card) 120px); }
}
:root[data-theme="dark"] .status-pill.is-new { background: #3A2A16; color: #F0B878; }
:root[data-theme="dark"] .status-pill.is-waiting { background: #1C2A3A; color: #9DC0E6; }
:root[data-theme="dark"] .desk-panel { background: linear-gradient(180deg, #17231A 0, var(--card) 120px); }

@media (max-width: 680px) {
  .desk-row { grid-template-columns: 10px minmax(0, 1fr); padding: 14px 16px; }
  .desk-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .desk-bar-link { margin-left: 0; }
  .draft-actions .btn:last-child { margin-left: 0; }
  .draft-review { flex-wrap: wrap; }
  .draft-return, .note-form { flex-direction: column; align-items: stretch; }
}

.draft-theirs { margin: 0 0 12px; border: 1px solid var(--warn-line); background: var(--warn-bg); border-radius: 10px; padding: 8px 12px; }
.draft-theirs summary { cursor: pointer; font-weight: 600; color: var(--warn); font-size: .88rem; }
.draft-theirs-body { margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; max-height: 260px; overflow: auto; }
.desk-settings .choice-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; }
@media (max-width: 860px) { .desk-settings .choice-grid { grid-template-columns: 1fr; } }
.alert-warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn); }
