:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --sidebar: #080808;
  --surface: #111111;
  --surface-raised: #1b1b1b;
  --input: #0d0d0d;
  --border: #252525;
  --border-hover: #505050;
  --text: #f5f5f5;
  --muted: #999999;
  --subtle: #828282;
  --accent: #eeeeee;
  --accent-hover: #ffffff;
  --on-accent: #111111;
  --active: #202020;
  --shadow: 0 16px 50px #00000033;
  --mono: 'Cascadia Code', Consolas, monospace;
  --sans: 'Segoe UI', Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #fafafa;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-raised: #f1f1f1;
  --input: #ffffff;
  --border: #e3e3e3;
  --border-hover: #aaaaaa;
  --text: #111111;
  --muted: #606060;
  --subtle: #737373;
  --accent: #161616;
  --accent-hover: #333333;
  --on-accent: #ffffff;
  --active: #eeeeee;
  --shadow: 0 16px 50px #0000000d;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
svg { flex-shrink: 0; vertical-align: middle; }
img { display: block; max-width: 100%; }
button:disabled { opacity: .5; cursor: wait; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.2; }
h1 { font-size: clamp(28px, 3vw, 38px); font-weight: 650; letter-spacing: -1.5px; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -.55px; }
h3 { font-size: 18px; font-weight: 600; letter-spacing: -.3px; }
p { color: var(--muted); }
form { margin: 0; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 11px; font-size: 12px; font-weight: 600; }
time { color: var(--muted); font-size: 12px; }
:where(a, button, input, textarea):focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
::selection { background: var(--text); color: var(--bg); }
.accent, .required { color: var(--text); }
.muted { color: var(--muted); }
.eyebrow { display: block; color: var(--muted); font: 9px/1.6 var(--mono); letter-spacing: 1.7px; }
.small-text { font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 20; padding: 10px 20px; background: var(--accent); color: var(--on-accent); }
.skip-link:focus { top: 16px; }

/* Original tribe artwork, rendered in monochrome without changing the file. */
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; white-space: nowrap; }
.brand strong { font-size: 24px; font-weight: 850; letter-spacing: -.7px; }
.brand-logo { position: relative; width: 34px; height: 48px; overflow: hidden; flex-shrink: 0; }
.brand-logo img { position: absolute; top: 50%; left: 50%; width: 84px; height: 84px; max-width: none; transform: translate(-50%, -50%); filter: grayscale(1) brightness(4.8); mix-blend-mode: screen; }
[data-theme='light'] .brand-logo img { filter: grayscale(1) brightness(4.8) invert(1); mix-blend-mode: multiply; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 43px; padding: 10px 18px; border: 1px solid transparent; border-radius: 6px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; white-space: nowrap; }
.button:hover { background: var(--accent-hover); transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.secondary { border-color: var(--border); background: transparent; color: var(--text); }
.button.secondary:hover { border-color: var(--border-hover); background: var(--surface-raised); }
.button.small { min-height: 33px; padding: 6px 11px; font-size: 11px; }
.button.text-button { min-height: 34px; padding: 7px 10px; background: transparent; color: var(--muted); }
.button.text-button:hover { background: var(--surface-raised); color: var(--text); }
.danger { color: var(--text); }
.full-width { width: 100%; }
.button-row, .inline-actions { display: flex; align-items: center; gap: 8px; }
.inline-actions { justify-content: flex-end; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; padding: 8px; border-radius: 6px; background: transparent; color: var(--muted); }
.icon-button:hover { background: var(--surface-raised); color: var(--text); }
.panel { padding: 28px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; }
.field small, .stack-form > small { color: var(--muted); font-size: 11px; }
input:where(:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden])), textarea { width: 100%; min-height: 45px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 5px; background: var(--input); color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--subtle); }
input:hover, textarea:hover { border-color: var(--border-hover); }
textarea { min-height: 120px; resize: vertical; line-height: 1.75; }
.stack-form { display: flex; flex-direction: column; gap: 23px; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 70px; }
.password-toggle { position: absolute; top: 4px; right: 4px; bottom: 4px; padding: 0 12px; background: transparent; color: var(--muted); font-size: 11px; }
.password-toggle:hover { color: var(--text); }
.key-input { font-family: var(--mono); letter-spacing: 1.2px; text-transform: uppercase; }
.optional { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 400; }
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.flash { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-raised); color: var(--text); font-size: 12px; }
.flash.error { border-color: var(--border-hover); }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 30; max-width: 90vw; padding: 12px 22px; border-radius: 6px; background: var(--text); color: var(--bg); box-shadow: var(--shadow); transform: translateX(-50%); }
.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 30px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: #00000099; backdrop-filter: blur(4px); }
.confirm-dialog h2 { margin: 12px 0; }
.confirm-dialog p { margin-bottom: 26px; }
.confirm-dialog .button-row { justify-content: flex-end; }

/* The navigation stays quiet and stationary as pages change. */
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 5; display: flex; flex-direction: column; width: 238px; padding: 25px 20px 0; border-right: 1px solid var(--border); background: var(--sidebar); view-transition-name: sidebar; }
.sidebar .brand { margin: 0 12px 44px; }
.sidebar-label { margin: 0 13px 15px; color: var(--subtle); font: 8px var(--mono); letter-spacing: 1.7px; }
.main-nav { display: flex; flex-direction: column; gap: 6px; }
.main-nav > a { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 5px; color: var(--muted); font-size: 12px; }
.main-nav > a:hover { background: var(--surface-raised); color: var(--text); }
.main-nav > a.active { background: var(--active); color: var(--text); font-weight: 600; }
.profile { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 22px 0; border-top: 1px solid var(--border); }
.avatar { display: grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-raised); color: var(--text); font-size: 13px; }
.profile-name { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.profile-name strong { overflow: hidden; color: var(--text); font-size: 11px; font-weight: 600; text-overflow: ellipsis; }
.profile-name span { color: var(--muted); font-size: 10px; }
.page-wrap { min-height: 100vh; }
.member-page .page-wrap { display: flex; flex-direction: column; margin-left: 238px; }
.topbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; height: 74px; padding: 0 44px; border-bottom: 1px solid var(--border); color: var(--subtle); font: 9px var(--mono); letter-spacing: 1px; view-transition-name: topbar; }
.topbar strong { margin-left: 6px; color: var(--muted); font-weight: 400; }
.topbar-actions { display: flex; align-items: center; gap: 22px; }
.private-label { color: var(--muted); white-space: nowrap; }
.private-label i { display: inline-block; width: 4px; height: 4px; margin-right: 7px; border-radius: 50%; background: var(--text); vertical-align: middle; }
.theme-toggle { border: 1px solid var(--border); }
.theme-dark-icon { display: none; }
[data-theme='light'] .theme-light-icon { display: none; }
[data-theme='light'] .theme-dark-icon { display: inline; }
.content { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 46px 44px 60px; view-transition-name: page-content; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 40px; }
.page-heading .eyebrow { margin-bottom: 10px; }
.page-heading p { margin-top: 12px; font-size: 12px; }
.page-heading > .button { flex-shrink: 0; }
.footer { margin: 0 44px; padding: 20px 0 24px; border-top: 1px solid var(--border); color: var(--muted); font: 8px var(--mono); letter-spacing: 1.1px; view-transition-name: footer; }
.footer .muted { margin: 0 5px; color: var(--subtle); }
.section-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-title, .section-toolbar h2 { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; letter-spacing: -.2px; }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--muted); font: 10px var(--mono); vertical-align: middle; }

/* The icon and input occupy separate flex columns, so typed text cannot overlap. */
.search-form { display: flex; align-items: center; gap: 10px; width: 255px; max-width: 100%; padding: 0 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--input); }
.search-form:focus-within { border-color: var(--border-hover); }
.search-submit { display: grid; place-items: center; flex: 0 0 22px; width: 22px; height: 30px; padding: 0; background: transparent; color: var(--muted); }
.search-submit:hover { color: var(--text); }
.search-form input[type='search'] { flex: 1; min-width: 0; min-height: 38px; padding: 8px 0; border: 0; border-radius: 0; background: transparent; font-size: 12px; }
.search-form input[type='search']:focus-visible { outline-offset: 2px; }
.search-summary { margin-bottom: 20px; font-size: 12px; }
.search-summary a { margin-left: 12px; color: var(--text); text-decoration: underline; text-underline-offset: 4px; }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 220px; padding: 48px 24px; border: 1px solid var(--border); border-radius: 7px; text-align: center; }
.empty-state h2 { color: var(--muted); font-size: 18px; font-weight: 400; letter-spacing: -.4px; }
.dashboard-empty { min-height: clamp(280px, 48vh, 520px); }
.empty-state.compact { min-height: 200px; }

/* Strategies */
.strat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.strat-card { overflow: hidden; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.strat-card:hover { border-color: var(--border-hover); transform: translateY(-3px); }
.card-cover { position: relative; display: flex; overflow: hidden; height: 170px; border-bottom: 1px solid var(--border); background: var(--surface-raised); }
.card-cover > img { width: 100%; height: 100%; object-fit: cover; }
.strat-card:hover .card-cover > img { transform: scale(1.025); }
.cover-badge { position: absolute; bottom: 13px; left: 15px; padding: 4px 7px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); color: var(--muted); font: 8px var(--mono); letter-spacing: 1px; }
.abstract-cover { align-items: center; justify-content: center; }
.abstract-cover > svg { color: var(--subtle); opacity: .4; }
.cover-label { position: absolute; top: 16px; left: 17px; color: var(--subtle); font: 8px var(--mono); letter-spacing: 1.5px; }
.cover-number { position: absolute; right: 15px; bottom: 7px; color: var(--subtle); font: 48px/1 var(--mono); opacity: .2; }
.card-body { padding: 19px 18px 15px; }
.card-meta { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: 10px; }
.card-meta > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-avatar { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 24px; height: 24px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-raised); color: var(--muted); font-size: 10px; }
.card-meta time { margin-left: auto; font-size: 9px; white-space: nowrap; }
.card-body h3 { margin: 15px 0 9px; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.card-body h3 a:hover { color: var(--muted); }
.card-body > p { display: -webkit-box; min-height: 41px; overflow: hidden; font-size: 12px; line-height: 1.7; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 19px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 10px; }
.card-bottom > span { display: flex; align-items: center; gap: 5px; color: var(--muted); font: 8px var(--mono); }
.card-bottom a { display: flex; align-items: center; gap: 7px; }
.card-bottom a:hover { color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px; color: var(--muted); font-size: 12px; }
.back-link:hover { color: var(--text); }
.editor-layout { width: 100%; max-width: 900px; }
.editor-form { gap: 28px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 206px; padding: 25px 20px; border: 1px dashed var(--border-hover); border-radius: 6px; background: var(--input); text-align: center; cursor: pointer; }
.dropzone:hover, .dropzone.dragging, .dropzone:focus-within { border-color: var(--text); background: var(--surface-raised); }
.dropzone > svg { margin-bottom: 4px; color: var(--muted); }
.dropzone strong { font-size: 13px; font-weight: 500; }
.dropzone > span { color: var(--muted); font-size: 12px; font-weight: 400; }
.dropzone u { color: var(--text); text-underline-offset: 3px; }
.dropzone small { margin-top: 4px; font-size: 10px; font-weight: 400; line-height: 1.9; }
.dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.upload-preview { display: flex; flex-direction: column; gap: 7px; }
.upload-file { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface-raised); }
.upload-file > img { width: 48px; height: 40px; border-radius: 3px; object-fit: cover; }
.upload-file > span { flex: 1; min-width: 0; font-size: 11px; overflow-wrap: anywhere; }
.upload-file small { display: block; }
.upload-file button { padding: 7px; background: transparent; color: var(--muted); font-size: 11px; }
.upload-file button:hover { color: var(--text); }
.upload-summary { color: var(--muted); font-size: 11px; }
.form-actions { display: flex; justify-content: space-between; gap: 10px; padding-top: 23px; border-top: 1px solid var(--border); }
.strat-detail { max-width: 950px; }
.detail-label { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 12px 0 20px; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font: 9px var(--mono); letter-spacing: 1px; white-space: nowrap; }
.strat-detail h1 { max-width: 850px; font-size: clamp(28px, 4vw, 46px); overflow-wrap: anywhere; }
.detail-meta { display: flex; align-items: center; gap: 11px; margin-bottom: 29px; padding: 25px 0; border-bottom: 1px solid var(--border); }
.detail-meta strong { font-size: 12px; font-weight: 500; }
.detail-meta time { display: block; font-size: 10px; }
.push-right { margin-left: auto; }
.prose { color: var(--text); font-size: 14px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.media-section { margin-top: 35px; }
.media-section h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 17px; font-size: 17px; }
.image-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.image-gallery img { width: 100%; height: 240px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); object-fit: contain; }
.image-gallery a:only-child { grid-column: 1 / -1; }
.image-gallery a:only-child img { height: auto; max-height: 550px; }
.video-gallery { display: flex; flex-direction: column; gap: 22px; }
.video-gallery video { display: block; width: 100%; max-height: 560px; border-radius: 6px; background: #000000; }
.small-link { display: inline-block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.small-link:hover { color: var(--text); }
.detail-footer { display: flex; align-items: center; gap: 9px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11px; }

/* Anonymous feedback. Only administrators render the inbox column. */
.talk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 30px; }
.talk-layout.member-feedback { grid-template-columns: minmax(0, 620px); }
.filter-tabs { display: flex; gap: 22px; overflow: auto; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.filter-tabs a { display: block; padding-bottom: 13px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.filter-tabs a.active { border-bottom: 1px solid var(--text); color: var(--text); }
.filter-tabs a:hover { color: var(--text); }
.talk-posts { display: flex; flex-direction: column; gap: 16px; }
.talk-card { padding: 19px 23px 24px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.talk-top { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.category-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-size: 10px; }
.talk-card .prose { margin-top: 15px; font-size: 13px; }
.talk-compose { position: sticky; top: 28px; padding: 27px; }
.talk-compose h2 { margin: 0 0 10px; font-size: 20px; }
.talk-compose > p { margin-bottom: 27px; font-size: 12px; }
.talk-compose .stack-form { gap: 21px; }
.category-options { display: flex; gap: 7px; }
.category-options label { position: relative; flex: 1; min-width: 0; }
.category-options input { position: absolute; width: 100%; height: 100%; margin: 0; opacity: 0; }
.category-options span { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 9px 5px; border: 1px solid var(--border); border-radius: 5px; color: var(--muted); font-size: 10px; cursor: pointer; }
.category-options input:checked + span { border-color: var(--border-hover); background: var(--active); color: var(--text); }
.category-options input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }
.talk-compose textarea { font-size: 12px; }

/* Administration */
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-panel { position: relative; padding: 23px 24px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
.stat-panel > span { display: block; color: var(--muted); font: 9px var(--mono); letter-spacing: 1px; }
.stat-panel strong { display: block; margin-top: 8px; font-size: 37px; font-weight: 400; line-height: 1.4; }
.stat-panel > svg { position: absolute; right: 23px; bottom: 25px; color: var(--subtle); }
.invite-generator { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-bottom: 30px; }
.invite-generator h2 { margin-bottom: 8px; font-size: 20px; }
.invite-generator p { font-size: 11px; }
.generate-form { display: flex; align-items: end; flex-shrink: 0; gap: 12px; }
.generate-form .field { gap: 5px; width: 90px; }
.generate-form label { font-size: 10px; }
.generate-form input { padding: 10px; }
.new-keys { margin-bottom: 30px; padding: 20px 24px; border: 1px solid var(--border-hover); border-radius: 7px; background: var(--surface); }
.new-keys > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.new-keys strong { font-size: 13px; }
.new-keys pre { max-height: 240px; overflow: auto; font-size: 13px; letter-spacing: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.new-keys small { color: var(--muted); font-size: 11px; }
.admin-section { margin-top: 32px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; white-space: nowrap; }
th { padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-raised); color: var(--muted); font: 8px var(--mono); letter-spacing: 1.2px; }
td { padding: 16px 20px; border-bottom: 1px solid var(--border); color: var(--muted); }
tr:last-child td { border-bottom: 0; }
td code { color: var(--text); font: 11px var(--mono); letter-spacing: 1px; }
.align-right { text-align: right; }
.status-badge { display: inline-flex; align-items: center; padding: 3px 7px; border: 1px solid var(--border); border-radius: 4px; color: var(--muted); font-size: 9px; }
.status-badge.available, .status-badge.admin { background: var(--surface-raised); color: var(--text); }
.table-member { display: flex; align-items: center; gap: 9px; }
.table-member strong { color: var(--text); font-size: 12px; font-weight: 500; }
.table-empty { padding: 38px 20px; color: var(--muted); text-align: center; }

/* Public pages */
.auth-header { position: absolute; inset: 25px 35px auto; display: flex; align-items: center; justify-content: space-between; z-index: 2; }
.auth-shell { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 115px 25px 65px; }
.auth-form-panel { width: 100%; max-width: 360px; }
.auth-form-inner h2 { margin: 12px 0 10px; font-size: 32px; font-weight: 600; letter-spacing: -1.3px; }
.form-intro { margin-bottom: 32px; font-size: 13px; }
.auth-form-inner .button.full-width { justify-content: space-between; margin-top: 5px; padding: 13px 17px; }
.auth-switch { margin-top: 24px; font-size: 12px; text-align: center; }
.auth-switch a { display: inline-flex; align-items: center; gap: 5px; margin-left: 4px; color: var(--text); font-weight: 500; }
.auth-switch a:hover { text-decoration: underline; text-underline-offset: 4px; }
.auth-security { margin-top: 32px; padding-top: 23px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10px; text-align: center; }
.auth-page .flash-stack { position: fixed; top: 85px; left: 50%; z-index: 10; width: min(520px, calc(100% - 32px)); margin: 0; transform: translateX(-50%); }
.error-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 60vh; padding: 40px 20px; text-align: center; }
.auth-page .error-state { min-height: calc(100vh - 120px); padding-top: 100px; }
.error-code { margin-bottom: 20px; color: var(--subtle); font: 100px/1 var(--mono); font-weight: 600; letter-spacing: -8px; }
.error-state h1 { margin: 17px 0; font-size: 30px; letter-spacing: -1px; }
.error-state p { max-width: 500px; margin-bottom: 28px; }

/* Native cross-document transitions progressively enhance ordinary links. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
  body, .sidebar, .topbar, .panel, .footer, .talk-card, .stat-panel, .empty-state, .table-wrap, .flash, .brand-logo img { transition: background-color .24s var(--ease), color .24s var(--ease), border-color .24s var(--ease), filter .24s var(--ease); }
  a, button, input, textarea, .category-options span, .strat-card, .card-cover > img, .dropzone { transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .24s var(--ease), box-shadow .2s var(--ease); }
  .content, .auth-form-panel { animation: content-enter .24s var(--ease) both; }
  .confirm-dialog[open] { animation: content-enter .18s var(--ease) both; }
  ::view-transition-old(root), ::view-transition-new(root), ::view-transition-old(sidebar), ::view-transition-new(sidebar), ::view-transition-old(topbar), ::view-transition-new(topbar), ::view-transition-old(footer), ::view-transition-new(footer) { animation: none; }
  ::view-transition-old(page-content) { animation: content-exit .12s ease both; }
  ::view-transition-new(page-content) { animation: content-enter .22s var(--ease) both; }
}
@keyframes content-enter { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes content-exit { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (max-width: 1200px) {
  .sidebar { width: 216px; padding-inline: 16px; }
  .member-page .page-wrap { margin-left: 216px; }
  .content { padding: 36px 32px 50px; }
  .topbar { padding-inline: 32px; }
  .footer { margin-inline: 32px; }
  .strat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .talk-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; }
  .talk-compose { padding: 22px; }
  .invite-generator { flex-direction: column; align-items: start; gap: 20px; }
}
@media (max-width: 950px) {
  .sidebar { width: 195px; padding-inline: 12px; }
  .member-page .page-wrap { margin-left: 195px; }
  .main-nav > a { gap: 10px; padding-inline: 10px; font-size: 11px; }
  .content { padding: 32px 24px 44px; }
  .topbar { padding-inline: 24px; font-size: 8px; }
  .topbar-actions { gap: 12px; }
  .footer { margin-inline: 24px; }
  .talk-layout { grid-template-columns: 1fr; }
  .talk-compose { position: static; grid-row: 1; }
  .category-options { max-width: 380px; }
  .stats-grid { gap: 10px; }
  .stat-panel { padding: 18px 14px; }
  .stat-panel > span { font-size: 8px; letter-spacing: .5px; }
  .stat-panel > svg { right: 12px; width: 22px; }
}
@media (max-width: 700px) {
  .sidebar { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 17px; width: 100%; padding: 16px 20px 0; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar .brand { margin: 0; }
  .brand strong { font-size: 22px; }
  .brand-logo { height: 40px; }
  .brand-logo img { width: 72px; height: 72px; }
  .sidebar-label { display: none; }
  .main-nav { grid-column: 1 / -1; grid-row: 2; flex-direction: row; gap: 7px; margin-bottom: 12px; }
  .main-nav > a { flex: 1; justify-content: center; gap: 8px; padding: 10px 8px; font-size: 11px; white-space: nowrap; }
  .main-nav > a svg { width: 16px; height: 16px; }
  .profile { grid-column: 2; grid-row: 1; gap: 8px; margin: 0; padding: 0; border: 0; }
  .profile > .avatar { width: 28px; height: 28px; font-size: 11px; }
  .profile-name { max-width: 85px; }
  .profile-name strong { font-size: 10px; }
  .profile-name span { display: none; }
  .member-page .page-wrap { min-height: calc(100vh - 126px); margin: 0; }
  .topbar { height: 55px; padding-inline: 20px; }
  .topbar > span { max-width: 48%; font-size: 7px; letter-spacing: .6px; }
  .topbar-actions { gap: 10px; }
  .private-label { font-size: 7px; letter-spacing: .5px; }
  .theme-toggle { min-width: 31px; min-height: 31px; padding: 6px; }
  .content { padding: 29px 20px 40px; }
  .page-heading { gap: 16px; margin-bottom: 30px; }
  h1 { font-size: 29px; letter-spacing: -1.1px; }
  .page-heading > .button { gap: 7px; padding: 9px 11px; font-size: 10px; }
  .page-heading .eyebrow { font-size: 8px; }
  .page-heading p { font-size: 12px; }
  .section-toolbar { gap: 15px; }
  .search-form { width: 190px; }
  .strat-grid { gap: 15px; }
  .card-cover { height: 148px; }
  .card-body { padding: 16px 14px; }
  .card-meta { gap: 5px; }
  .card-meta time { display: none; }
  .footer { margin-inline: 20px; font-size: 7px; }
  .dashboard-empty { min-height: 340px; }
  .panel { padding: 22px; }
  .strat-detail h1 { font-size: 31px; }
  .detail-meta { flex-wrap: wrap; gap: 9px; }
  .detail-meta .text-button { font-size: 11px; }
  .detail-label .eyebrow { font-size: 8px; letter-spacing: 1px; }
  .image-gallery { grid-template-columns: 1fr; }
  .image-gallery img { height: auto; max-height: 400px; }
  .stats-grid { gap: 8px; }
  .stat-panel { padding: 15px 10px; }
  .stat-panel > span { font-size: 7px; letter-spacing: 0; }
  .stat-panel strong { font-size: 30px; }
  .stat-panel > svg, .admin-pill { display: none; }
  .generate-form { width: 100%; }
  .generate-form > .button { flex: 1; padding: 11px 12px; font-size: 12px; }
  .section-toolbar .small-text { display: none; }
  th, td { padding: 14px 16px; }
  .auth-header { inset: 18px 23px auto; }
  .auth-shell { align-items: start; padding-top: 130px; }
  .auth-form-panel { max-width: 400px; }
  .error-code { font-size: 90px; }
  .error-state h1 { font-size: 26px; }
}
@media (max-width: 420px) {
  .main-nav { gap: 3px; }
  .main-nav > a { gap: 6px; padding: 10px 6px; font-size: 10px; }
  .profile-name { display: none; }
  .strat-grid { grid-template-columns: 1fr; }
  .card-cover { height: 185px; }
  .card-meta time { display: block; }
  .section-toolbar { flex-wrap: wrap; }
  .search-form { width: 100%; }
  .page-heading > .button { font-size: 0; gap: 0; padding: 11px; }
  .form-actions .button { padding: 10px 14px; }
  .filter-tabs { gap: 18px; }
  .new-keys { padding: 18px; }
  .new-keys > div { flex-direction: column; align-items: start; }
}
