:root {
  --black: #000;
  --white: #fff;
  --ink: #111;
  --canvas: #f3f3f3;
  --muted: #5e5e5e;
  --line: #d8d8d8;
  --focus: #276ef1;
  --danger: #b42318;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-size: 16px; line-height: 1.55; }
a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--black); }
button, input, textarea { font: inherit; }
button, .button, .login-button { transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease; -webkit-tap-highlight-color: transparent; }
button:active, .button:active, .login-button:active { transform: scale(0.97); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 16px; color: var(--black); background: var(--white); border: 2px solid var(--black); border-radius: var(--radius-md); box-shadow: var(--shadow-md); }
.skip-link:focus { top: 12px; }

.global-nav { height: 72px; color: var(--white); background: var(--black); box-shadow: var(--shadow-md); }
.nav-inner, .page-shell, .footer-inner { width: min(100% - 48px, 1120px); margin-inline: auto; }
.nav-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 12px; color: var(--white); font-size: 19px; font-weight: 700; letter-spacing: -.04em; }
.brand img { width: 34px; height: 34px; border-radius: var(--radius-sm); }
.global-nav nav { height: 100%; display: flex; align-items: center; gap: 14px; }
.login-button, .nav-button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--white); border-radius: var(--radius-lg); padding: 10px 20px; color: var(--black); background: var(--white); font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.login-button:hover, .nav-button:hover { background: var(--canvas); border-color: var(--canvas); }
.login-button:active, .nav-button:active { transform: scale(0.97); }
.nav-button { color: var(--white); background: var(--black); border-color: var(--white); }
.nav-button:hover { background: var(--ink); }
.nav-user { min-height: 48px; display: inline-flex; align-items: center; gap: 9px; color: var(--white); font-weight: 700; padding: 8px 16px; border-radius: var(--radius-lg); transition: background-color 0.15s ease; }
.nav-user:hover { background: rgba(255, 255, 255, 0.1); }
.nav-user img { width: 34px; height: 34px; border-radius: var(--radius-sm); }
.inline-form { margin: 0; }
.content { max-width: min(100%, 720px); margin-inline: auto; }

.flash { width: min(100% - 48px, 1120px); margin: 18px auto 0; border: 2px solid var(--ink); border-radius: var(--radius-md); padding: 13px 16px; color: var(--ink); background: var(--white); font-weight: 600; box-shadow: var(--shadow-sm); }
.flash-error { border-color: var(--danger); color: #7a271a; background: #fff1f0; }
.flash-success { border-color: #16794b; color: #0d5735; background: #edfff5; }

.page-shell { padding-block: 48px 80px; }
.forum-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: start; gap: 28px; }
.composer { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; background: var(--white); box-shadow: var(--shadow-md); }
.composer-label, .section-label, .eyebrow { margin: 0 0 12px; font-size: 13px; line-height: 1; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.composer h1, .feed-header h1, .form-card h1 { margin: 0; font-size: 36px; line-height: 1.08; letter-spacing: -.045em; }
.composer-copy { margin: 12px 0 22px; color: var(--muted); }
.field { margin-top: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.field input, .field textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; color: var(--ink); background: var(--white); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.field input:focus, .field textarea:focus { border-color: var(--black); outline: none; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08); }
.field textarea { min-height: 180px; resize: vertical; line-height: 1.55; }
.field-hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--black); border-radius: var(--radius-lg); padding: 11px 20px; font-weight: 600; cursor: pointer; transition: all 0.15s ease; }
.button:hover { background: var(--canvas); border-color: var(--ink); }
.button:active { transform: scale(0.97); }
.button-primary { color: var(--white); background: var(--black); border-color: var(--black); }
.button-primary:hover { background: var(--ink); border-color: var(--ink); }
.button-secondary { color: var(--black); background: var(--white); border-color: var(--black); }
.button-secondary:hover { background: var(--canvas); border-color: var(--ink); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.composer .button-primary { width: 100%; }

.feed { min-width: 0; }
.feed-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; border-bottom: 2px solid var(--line); padding-bottom: 18px; }
.feed-header h1 { font-size: 44px; }
.feed-count { margin: 0 0 4px; color: var(--muted); font-size: 14px; font-weight: 600; }
.post-list { display: grid; gap: 12px; margin-top: 16px; }
.post-card { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; background: var(--white); box-shadow: var(--shadow-sm); transition: box-shadow 0.15s ease, transform 0.15s ease; }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.post-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.post-meta img { width: 44px; height: 44px; border-radius: var(--radius-md); }
.post-author { display: block; color: var(--ink); font-size: 15px; font-weight: 600; }
.post-card h2 { margin: 18px 0 8px; font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
.post-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty-state { border: 2px solid var(--line); border-radius: var(--radius-lg); padding: 48px 24px; text-align: center; background: var(--white); }
.empty-state h2 { margin: 0; font-size: 28px; }

.locked-page { position: relative; min-height: calc(100vh - 64px); display: grid; place-items: center; overflow: hidden; padding: 40px 24px; color: var(--white); background: radial-gradient(ellipse 60% 45% at 50% 0%, rgba(255, 255, 255, .09), transparent 70%), var(--black); }
.locked-page::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px); background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 55% 50% at 50% 35%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 55% 50% at 50% 35%, #000 20%, transparent 75%); pointer-events: none; }
.locked-content { position: relative; width: min(100%, 680px); text-align: center; padding: 40px; }
.lock-icon { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 18px 30px rgba(255, 255, 255, .08)); animation: lock-float 6s ease-in-out infinite; transform-origin: 50% 60%; }
@keyframes lock-float { 0%, 100% { transform: translateY(0) rotateY(-14deg); } 50% { transform: translateY(-8px) rotateY(14deg); } }
@media (prefers-reduced-motion: reduce) { .lock-icon { animation: none; } }
.bind-prompt-fallback { width: min(100% - 48px, 520px); margin: 18px auto 0; border: 2px solid var(--ink); border-radius: 20px; padding: 22px; background: #fff; }
.bind-prompt-fallback h2 { margin: 0 0 8px; }
.bind-prompt-fallback p { margin: 0; }
.recovery-panel { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 22px; }
.recovery-panel h2 { margin: 0; font-size: 28px; letter-spacing: -.04em; }
.recovery-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.recovery-add, .recovery-change { border: 0; background: transparent; cursor: pointer; }
.recovery-add { width: 36px; height: 36px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; color: #333; }
.recovery-add[hidden] { display: none; }
.recovery-add svg { width: 19px; height: 19px; display: block; }
.recovery-add:hover { background: #f3f3f3; }
.recovery-change { margin-top: 8px; padding: 0; color: #111; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.recovery-waiting { margin: 16px 0 0; font-weight: 700; }
.recovery-notice { margin-top: 16px; border: 2px solid #16794b; border-radius: 16px; padding: 16px; background: #edfff5; }
.recovery-notice p { margin: 0 0 14px; color: #0d5735; font-weight: 600; }
.recovery-state { margin-top: 12px; font-weight: 600; }
.locked-content h1 { margin: 0; font-size: clamp(36px, 7vw, 64px); line-height: 1.05; letter-spacing: -.04em; background: linear-gradient(180deg, #fff 30%, #a1a1a1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.locked-content p { max-width: 560px; margin: 18px auto 30px; color: #a1a1a1; font-size: clamp(16px, 2.4vw, 19px); line-height: 1.6; }
.locked-content .button { min-height: 46px; border: 1px solid var(--white); border-radius: 12px; padding: 10px 22px; color: var(--black); background: var(--white); box-shadow: 0 0 0 4px rgba(255, 255, 255, .06); }
.locked-content .button:hover { border-color: #e5e5e5; background: #e5e5e5; }
.locked-content .login-privacy-note { max-width: 560px; margin: 20px auto 0; color: #6f6f6f; font-size: 14px; line-height: 1.5; }
.google-login-button { gap: 10px; }
.google-login-button svg { flex: none; }
.locked-content .signup-note { margin: 12px auto 0; color: #a1a1a1; font-size: 13px; }
.locked-content .signup-note a { color: #ededed; }
.signup-note a, .privacy-note a { text-decoration: underline; text-underline-offset: 3px; }
.field select { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 12px; color: var(--ink); background: var(--white); }
.password-input-wrap { position: relative; }
.password-input-wrap input { padding-right: 56px; }
.password-visibility-button { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 9px; color: #555; background: transparent; cursor: pointer; }
.password-visibility-button:hover { color: #111; background: #f1f1f1; }
.password-visibility-button:active { transform: translateY(-50%) scale(.95); }
.password-visibility-button svg { width: 21px; height: 21px; }
.password-visibility-button .eye-closed, .password-visibility-button[aria-pressed="true"] .eye-open { display: none; }
.password-visibility-button[aria-pressed="true"] .eye-closed { display: block; }
.password-requirements { display: grid; gap: 7px; margin: 11px 0 0; padding: 0; list-style: none; font-size: 13px; }
.password-requirements li { display: flex; align-items: center; gap: 8px; color: #a3231a; font-weight: 600; }
.password-requirements li.is-valid { color: #146c43; }
.password-rule-icon { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 50%; color: #fff; background: #b42318; font-size: 14px; font-weight: 800; line-height: 1; }
.password-requirements li.is-valid .password-rule-icon { background: #17804c; }

.form-page { min-height: calc(100vh - 72px); padding: 48px 24px 80px; }
.form-card { width: min(100%, 720px); margin-inline: auto; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 32px; background: var(--white); box-shadow: var(--shadow-lg); }
.form-intro { margin: 12px 0 26px; color: var(--muted); }
.error-list { border: 2px solid var(--danger); border-radius: var(--radius-md); padding: 14px 16px 14px 38px; color: #7a271a; background: #fff1f0; }
.avatar-panel { display: flex; align-items: center; gap: 20px; margin: 24px 0; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; background: var(--canvas); }
.avatar-panel img { width: 96px; height: 96px; border-radius: var(--radius-lg); }
.avatar-panel p { margin: 0 0 10px; }
.privacy-note { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: 13px; }

/* Threads-style layout */
.threads-layout { max-width: 600px; margin: 0 auto; }
.threads-header { padding: 16px 0; border-bottom: 1px solid var(--line); background: var(--canvas); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 12px; padding: 0 24px; }
.user-avatar { flex-shrink: 0; }
.user-avatar img { width: 48px; height: 48px; border-radius: 50%; }
.composer-trigger { flex: 1; min-height: 56px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 12px 20px; color: var(--muted); background: var(--canvas); font-size: 16px; cursor: pointer; transition: all 0.15s ease; text-align: left; }
.composer-trigger:hover { border-color: var(--black); color: var(--black); background: var(--canvas); }
.composer-trigger:active { transform: scale(0.98); }
.composer-placeholder { color: var(--muted); }

/* Modal styles */
.composer-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px); }
.modal-content { position: relative; width: min(90vw, 600px); max-height: 90vh; overflow: hidden; border-radius: var(--radius-xl); background: var(--white); box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 20px; font-weight: 700; }
.close-button { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: none; background: none; font-size: 24px; color: var(--muted); cursor: pointer; border-radius: var(--radius-sm); transition: all 0.15s ease; }
.close-button:hover { background: var(--canvas); color: var(--black); }
.modal-body { padding: 20px; overflow-y: auto; max-height: calc(90vh - 160px); }
.modal-body .user-info { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.modal-body .user-info img { width: 40px; height: 40px; border-radius: 50%; }
.modal-body .user-info .username { font-weight: 600; color: var(--black); }
.modal-body textarea { width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 14px; font-size: 16px; line-height: 1.5; resize: none; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.modal-body textarea:focus { border-color: var(--black); outline: none; box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08); }
.modal-body .field-hint { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 16px 24px; border-top: 1px solid var(--line); background: var(--canvas); }
.composer-footer { align-items: center; }
.composer-more { position: relative; }
.composer-more-button { width: 48px; min-height: 48px; border: 0; border-radius: 50%; color: #333; background: transparent; font-size: 18px; font-weight: 700; letter-spacing: 2px; cursor: pointer; }
.composer-more-button:hover, .composer-more-button[aria-expanded="true"] { background: #dfdfdf; }
.composer-menu { position: absolute; z-index: 40; right: 0; bottom: 56px; width: 190px; border: 1px solid var(--line); border-radius: 14px; padding: 6px; background: #fff; box-shadow: var(--shadow-lg); }
.composer-menu button { width: 100%; display: flex; align-items: center; gap: 12px; border: 0; border-radius: 9px; padding: 12px; color: #222; background: transparent; text-align: left; cursor: pointer; }
.composer-menu button:hover { background: #f1f1f1; }
.composer-menu button > span:first-child { width: 22px; color: #555; text-align: center; font-size: 19px; }
.composer-addon { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--canvas); }
.addon-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.addon-remove { width: 32px; height: 32px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 20px; cursor: pointer; }
.addon-remove:hover { color: #000; background: #ddd; }
.composer-addon input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); background: #fff; }
.poll-builder { display: grid; gap: 8px; }
.add-poll-option { margin-top: 8px; border: 0; border-radius: 9px; padding: 8px 10px; color: #333; background: transparent; font-weight: 650; cursor: pointer; }
.add-poll-option:hover { background: #ddd; }

/* Post card styles - Threads style */
.post-list { margin-top: 0; }
.post-card { border: none; border-radius: 0; padding: 16px 0; background: transparent; box-shadow: none; position: relative; }
.post-card:not(:last-child) { border-bottom: 1px solid var(--line); }
.post-card:hover { background: transparent; }

.post-header { display: flex; align-items: center; gap: 12px; }
.post-author-info { display: flex; align-items: center; gap: 12px; flex: 1; }
.post-author-info img { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.author-details { display: flex; flex-direction: column; }
.post-author { color: var(--black); font-size: 15px; font-weight: 600; line-height: 1.3; }
.post-byline { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }
.post-handle { overflow-wrap: anywhere; }
.post-header time { color: inherit; font-size: inherit; }

.post-content { margin-top: 12px; }
.post-content h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.post-body { margin: 0; font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.post-location { margin: 10px 0 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.post-poll { margin: 14px 0 0 56px; }
.poll-options { display: grid; gap: 8px; }
.poll-option { position: relative; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; overflow: hidden; border: 1px solid #bdbdbd; border-radius: 12px; padding: 10px 13px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.poll-option:not(:disabled):hover { border-color: #222; background: rgba(0, 0, 0, .035); }
.poll-option:disabled { opacity: 1; color: var(--ink); cursor: default; }
.poll-fill { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; appearance: none; border: 0; background: transparent; }
.poll-fill::-webkit-progress-bar { background: transparent; }
.poll-fill::-webkit-progress-value { background: #dedede; }
.poll-fill::-moz-progress-bar { background: #dedede; }
.poll-option.selected { border-color: #222; font-weight: 700; }
.poll-option.selected .poll-fill::-webkit-progress-value { background: #c8c8c8; }
.poll-option.selected .poll-fill::-moz-progress-bar { background: #c8c8c8; }
.poll-option-text, .poll-percent { position: relative; z-index: 1; }
.poll-percent { flex: 0 0 auto; font-weight: 700; }
.poll-meta { margin: 8px 2px 0; color: var(--muted); font-size: 12px; }

/* Post actions */
.post-actions { display: flex; align-items: center; gap: 24px; margin-top: 12px; padding: 8px 0; }
.action-button { display: inline-flex; align-items: center; gap: 8px; border: none; background: none; color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; padding: 8px 12px; border-radius: var(--radius-md); transition: all 0.15s ease; }
.action-button:hover { background: rgba(0, 0, 0, 0.05); color: var(--black); }
.action-button:active { transform: scale(0.95); }
.action-button.liked { color: #b42318; }
.action-button.liked:hover { background: rgba(180, 35, 24, 0.1); }

.action-icon { width: 20px; height: 20px; }
.action-count { font-size: 14px; font-weight: 600; }
.heart-icon { fill: none; }
.action-button.liked .heart-icon { fill: currentColor; }
.comment-icon { fill: none; }

/* Comments section */
.comments-section { margin-top: 12px; padding: 0; }
.comments-list { display: none; margin-top: 8px; }
.comments-list.display { display: block; }
.comment { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: none; }
.comment-header { display: flex; align-items: center; gap: 10px; }
.comment-header img { width: 32px; height: 32px; border-radius: 50%; }
.comment-author { display: flex; flex-direction: column; }
.comment-username { font-size: 14px; font-weight: 600; color: var(--black); }
.comment-byline { display: flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; }
.comment-header time { color: inherit; font-size: inherit; }
.comment-body { margin: 0; font-size: 15px; line-height: 1.4; color: var(--ink); }

.comment-input-container { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.comment-input-container img { width: 32px; height: 32px; border-radius: 50%; }
.comment-input { flex: 1; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-xl); padding: 10px 16px; font-size: 15px; color: var(--ink); background: var(--white); transition: border-color 0.15s ease; }
.comment-input:focus { border-color: var(--black); outline: none; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08); }
.comment-input::placeholder { color: var(--muted); }

/* Feed header adjustments */
.feed { min-width: 0; padding: 0; }
.feed-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; border-bottom: none; padding-bottom: 0; margin-bottom: 24px; }
.feed-header h1 { font-size: 32px; }
.feed-count { margin: 0; color: var(--muted); font-size: 14px; font-weight: 600; }

/* Remove old composer and forum layout styles */
.forum-layout { display: block; }
.composer { display: none; }

/* Update page shell for threads layout */
.page-shell { padding-block: 0; }

/* Empty state update */
.empty-state { border: none; border-radius: 0; padding: 48px 0; text-align: center; background: transparent; }
.empty-state h2 { margin: 0; font-size: 24px; }
.empty-state p { color: var(--muted); }


.footer { padding: 34px 0; color: #cfcfcf; background: var(--black); font-size: 13px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; }
.footer p { max-width: 760px; margin: 0; }
.fine-print { color: #999; }

@media (max-width: 900px) {
  .forum-layout { grid-template-columns: 280px minmax(0, 1fr); gap: 20px; }
  .composer, .post-card { padding: 20px; }
}

@media (max-width: 760px) {
  .nav-inner, .page-shell, .footer-inner, .flash { width: min(100% - 28px, 1120px); }
  .global-nav { height: 64px; }
  .brand span { font-size: 16px; }
  .nav-user span, .nav-button { display: none; }
  .page-shell { padding-block: 24px 56px; }
  .forum-layout { display: block; }
  .composer { position: static; margin-bottom: 30px; }
  .feed-header h1 { font-size: 36px; }
  .footer-inner { display: block; }
  .footer .fine-print { margin-top: 12px; }
}

/* Account menu, profiles, compliance, and moderation */
.account-menu { position: relative; }
.account-menu > summary { list-style: none; cursor: pointer; }
.account-menu > summary::-webkit-details-marker { display: none; }
.menu-chevron { color: #aaa; font-size: 15px; }
.account-popover { position: absolute; z-index: 100; top: calc(100% + 8px); right: 0; width: 210px; overflow: hidden; border: 1px solid #333; border-radius: 14px; padding: 6px; color: var(--ink); background: #fff; box-shadow: var(--shadow-lg); }
.account-popover a, .account-popover button { width: 100%; display: block; border: 0; border-radius: 9px; padding: 11px 12px; color: #222; background: transparent; font: inherit; text-align: left; cursor: pointer; }
.account-popover a:hover, .account-popover button:hover { background: #f1f1f1; }
.account-popover form { margin: 0; border-top: 1px solid var(--line); padding-top: 5px; }
.verified-badge { width: 16px; height: 16px; display: inline-grid; place-items: center; margin-left: 5px; border-radius: 50%; color: #fff; background: #1687f8; font-size: 11px; font-weight: 900; line-height: 1; vertical-align: 1px; }
.author-avatar-link { display: inline-flex; flex: 0 0 auto; border-radius: 50%; }
.author-avatar-link:focus-visible { outline-offset: 3px; }
.field textarea, .admin-form input, .admin-form select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; color: var(--ink); background: #fff; font: inherit; }

.profile-shell { padding-top: 0; }
.public-profile { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 28px 0 18px; }
.profile-copy h1 { display: flex; align-items: center; margin: 0 0 3px; font-size: 28px; }
.profile-handle, .profile-followers { margin: 0 0 18px; color: var(--muted); }
.profile-bio { max-width: 470px; min-height: 48px; margin: 24px 0 16px; white-space: normal; overflow-wrap: anywhere; }
.profile-avatar { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 50%; }
.profile-follow-button { width: 100%; color: #fff; background: #000; }
.profile-follow-button.following { border: 1px solid var(--line); color: #222; background: #fff; }
.profile-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-top: 20px; border-bottom: 1px solid var(--line); }
.profile-tabs a { border-bottom: 2px solid transparent; padding: 14px; color: var(--muted); text-align: center; }
.profile-tabs a.active { border-bottom-color: #111; color: #111; font-weight: 700; }
.profile-reply { display: grid; gap: 8px; border-bottom: 1px solid var(--line); padding: 18px 2px; color: var(--ink); }
.profile-reply:hover { background: rgba(0,0,0,.025); }
.profile-reply-context, .profile-reply time { color: var(--muted); font-size: 13px; }
.profile-reply-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.site-notice-fallback { width: min(100% - 48px, 1120px); margin: 18px auto 0; border: 2px solid var(--ink); border-radius: var(--radius-md); padding: 13px 16px; background: #fff; font-weight: 600; }
.site-notice-fallback a { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.site-notice { width: min(92vw, 520px); max-height: calc(100dvh - 32px); margin: auto; overflow: auto; border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: #fff; box-shadow: var(--shadow-lg); }
.site-notice::backdrop { background: rgba(0, 0, 0, 0.66); }
.site-notice-body { margin: 0; padding: 28px; }
.site-notice h2 { margin: 0 0 12px; font-size: 24px; }
.site-notice p { margin: 0; line-height: 1.65; }
.site-notice a { font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.site-notice .button { width: 100%; margin-top: 20px; }
.bind-prompt-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; }
.bind-prompt .bind-prompt-actions .button, .bind-prompt-fallback .bind-prompt-actions .button { width: auto; min-height: 40px; margin: 0; padding: 8px 15px; border-width: 1px; border-radius: 11px; font-size: 14px; white-space: nowrap; }
.bind-prompt-actions .button-primary { gap: 7px; }
.bind-prompt-actions svg { width: 15px; height: 15px; flex: none; }
.sanction-dialog { position: fixed; z-index: 5000; inset: 0; width: min(92vw, 520px); border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: #fff; box-shadow: var(--shadow-lg); }
.sanction-dialog::backdrop { background: rgba(0,0,0,.66); backdrop-filter: blur(4px); }
.sanction-dialog form { margin: 0; padding: 28px; }
.sanction-dialog h2 { margin: 12px 0 8px; }
.sanction-dialog p { line-height: 1.65; }
.sanction-dialog .button { width: 100%; margin-top: 12px; }
.sanction-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--danger); font-size: 25px; font-weight: 800; }
.sanction-type { color: var(--danger); font-weight: 800; }
.compliance-page { max-width: 760px; }
.compliance-list, .audit-list { display: grid; gap: 12px; }
.compliance-card, .audit-card, .admin-panel, .managed-profile { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fff; }
.compliance-card header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.compliance-card h2 { margin: 0; font-size: 19px; }
.compliance-card time, .audit-card time { color: var(--muted); font-size: 13px; }
.compliance-card.revoked { opacity: .7; }
.status-pill { display: inline-block; margin-top: 8px; border-radius: 999px; padding: 4px 9px; color: #555; background: #e7e7e7; font-size: 12px; font-weight: 700; }

.admin-intro { color: var(--muted); }
.admin-menu { position: relative; margin-top: 4px; }
.admin-menu > summary { list-style: none; cursor: pointer; }
.admin-menu > summary::-webkit-details-marker { display: none; }
.admin-menu nav { position: absolute; z-index: 50; top: 52px; right: 0; width: 210px; border: 1px solid var(--line); border-radius: 13px; padding: 6px; background: #fff; box-shadow: var(--shadow-lg); }
.admin-menu nav a { display: block; border-radius: 8px; padding: 10px 12px; }
.admin-menu nav a:hover { background: #f1f1f1; }
.admin-form { display: grid; grid-template-columns: minmax(140px, 1fr) auto; align-items: end; gap: 10px; }
.admin-form label { grid-column: 1 / -1; font-weight: 700; }
.admin-table-wrap { margin-top: 20px; overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 12px; text-align: left; }
.filter-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.filter-bar select, .duration-fields input, .duration-fields select { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; }
.audit-card p { margin: 0 0 9px; }
.audit-card form { margin-top: 12px; }
.managed-profile { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin: 20px 0; }
.managed-profile h2 { margin-top: 0; }
.managed-profile img { border-radius: 50%; }
.direct-moderation { margin: 20px 0; }
.duration-fields { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.duration-fields input[type="number"] { width: 92px; }
.duration-fields .field-hint { flex-basis: 100%; }
.moderation-fieldset { display: grid; gap: 12px; margin: 0 0 16px; border: 0; padding: 0; }
.moderation-fieldset legend { margin-bottom: 10px; font-weight: 700; }
.history-heading { margin-top: 34px; }

/* Keep composer controls inside narrow mobile viewports. */
.composer-dialog, .report-dialog { max-height: calc(100dvh - 24px); overflow: visible; }
.composer-dialog form, .report-dialog form { max-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
.composer-dialog .modal-body, .report-dialog .modal-body { min-height: 0; overflow-y: auto; }

@media (max-width: 760px) {
  .nav-user { padding: 6px; }
  .nav-user .menu-chevron { display: none; }
  .account-popover { position: fixed; top: 58px; right: 12px; width: min(260px, calc(100vw - 24px)); }
  .composer-dialog, .report-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: 8px auto; }
  .composer-dialog form, .report-dialog form { max-height: calc(100dvh - 16px); }
  .composer-footer { display: grid; grid-template-columns: 1fr auto auto; padding: 12px 14px max(12px, env(safe-area-inset-bottom)); }
  .composer-menu { right: auto; left: 0; width: min(190px, calc(100vw - 44px)); }
  .public-profile { padding-top: 22px; }
  .profile-avatar { width: 72px; height: 72px; }
  .admin-page { width: min(100% - 28px, 980px); padding-top: 28px; }
  .admin-header { display: grid; }
  .admin-menu { justify-self: start; }
  .admin-menu nav { right: auto; left: 0; }
  .admin-form { grid-template-columns: 1fr; }
  .admin-form label { grid-column: auto; }
  .compliance-card header { display: grid; }
}

@media (max-width: 420px) {
  .brand { gap: 8px; }
  .brand img { width: 30px; height: 30px; }
  .brand span { max-width: 185px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .login-button { min-height: 44px; padding-inline: 14px; }
  .composer h1, .form-card h1 { font-size: 31px; }
  .form-card { padding: 22px; }
  .avatar-panel { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Current forum UI */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.policy-links { position: fixed; z-index: 20; left: 18px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 5px 12px; max-width: 360px; padding: 8px 10px; color: #666; background: rgba(243, 243, 243, .93); border-radius: 10px; font-size: 12px; backdrop-filter: blur(8px); }
.policy-links a:hover { color: #000; text-decoration: underline; }
.footer { display: none; }
.page-shell { padding: 0 20px 90px; }
.threads-layout { max-width: 640px; }
.threads-header { top: 0; padding: 14px 0; }
.header-inner { padding: 0; }
.user-avatar { width: 44px; height: 44px; border-radius: 50%; }
.composer-trigger { min-height: 48px; border-radius: 999px; color: #444; }
.feed-header { margin: 22px 0 8px; }
.feed-header h1 { font-size: 30px; }
.post-card { padding: 18px 2px; }
.post-card:hover { transform: none; }
.post-open-link { display: block; border-radius: 8px; }
.post-open-link:hover { color: inherit; }
.post-open-link:focus-visible { outline-offset: 5px; }
.post-header { align-items: flex-start; }
.post-content { margin: 10px 0 0 56px; }
.post-actions { margin: 6px 0 0 44px; gap: 6px; }
.action-button { min-height: 40px; padding: 8px 10px; }
.action-button:disabled, .send-button:disabled, .button:disabled { opacity: .45; cursor: wait; }
.top-comment-preview { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; margin-top: 2px; padding: 10px 0 4px; color: var(--ink); border-radius: 10px; }
.top-comment-preview:hover { color: inherit; background: rgba(0, 0, 0, .025); }
.top-comment-preview:focus-visible { outline-offset: 3px; }
.top-comment-preview > img { position: relative; z-index: 1; justify-self: center; border-radius: 50%; background: var(--canvas); box-shadow: 0 0 0 3px var(--canvas); }
.preview-thread-line { position: absolute; top: -10px; bottom: calc(100% - 27px); left: 21px; width: 2px; background: #d6d6d6; }
.preview-content { min-width: 0; display: grid; gap: 4px; }
.preview-byline { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; color: var(--muted); font-size: 12px; }
.preview-byline strong { color: var(--ink); font-size: 14px; }
.preview-body { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.preview-stats { display: flex; gap: 14px; color: var(--muted); font-size: 12px; }
.content-menu { position: relative; margin-left: auto; }
.content-menu summary { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); cursor: pointer; list-style: none; letter-spacing: 1px; }
.content-menu summary::-webkit-details-marker { display: none; }
.content-menu summary:hover { color: #000; background: #e7e7e7; }
.menu-popover { position: absolute; z-index: 30; top: 42px; right: 0; width: 190px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; box-shadow: var(--shadow-lg); }
.menu-item { width: 100%; border: 0; border-radius: 8px; padding: 11px 12px; color: #222; background: transparent; text-align: left; cursor: pointer; }
.menu-item:hover { background: #f2f2f2; }
.report-content { color: var(--danger); }
.remove-post { color: var(--danger); font-weight: 700; }
.composer-dialog, .report-dialog { width: min(92vw, 600px); max-height: 88vh; border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: #fff; box-shadow: var(--shadow-lg); }
.composer-dialog::backdrop, .report-dialog::backdrop { background: rgba(0, 0, 0, .52); backdrop-filter: blur(3px); }
.composer-dialog form, .report-dialog form { margin: 0; }
.block-dialog, .confirm-dialog { width: min(92vw, 440px); border: 0; border-radius: 20px; padding: 0; color: var(--ink); background: #fff; box-shadow: var(--shadow-lg); }
.block-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(0, 0, 0, .52); backdrop-filter: blur(3px); }
.block-dialog form, .confirm-dialog form { margin: 0; }
.block-dialog .modal-body p:first-child, .confirm-dialog .modal-body p:first-child { margin: 0; line-height: 1.6; }
.block-dialog .modal-footer, .confirm-dialog .modal-footer { flex-wrap: wrap; }
.block-dialog .button-primary, .confirm-dialog.is-danger .button-primary { background: var(--danger); border-color: var(--danger); }
.block-dialog .button-primary:hover, .confirm-dialog.is-danger .button-primary:hover { background: #8f1d16; border-color: #8f1d16; }
.modal-body .user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.modal-body .user-info img { border-radius: 50%; }
.modal-body textarea, .report-dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; resize: vertical; }
.form-status { min-height: 1.4em; margin: 8px 0 0; color: var(--danger); font-size: 13px; }
.reason-list { display: grid; gap: 3px; margin: 18px 0; border: 0; padding: 0; }
.reason-list legend { margin-bottom: 8px; font-weight: 700; }
.reason-list label { display: flex; gap: 8px; border-radius: 9px; padding: 8px; cursor: pointer; }
.reason-list label:hover { background: #f3f3f3; }
.field-label { display: block; margin: 12px 0 6px; font-weight: 600; }
.feed-sentinel { min-height: 90px; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.toast { position: fixed; z-index: 2000; right: 26px; bottom: 26px; transform: translateX(calc(100% + 52px)); max-width: min(90vw, 460px); border-radius: 999px; padding: 11px 18px; color: #fff; background: #111; opacity: 0; transition: transform .24s ease, opacity .24s ease; }
.toast.show { transform: translateX(0); opacity: 1; }
.toast.error { background: #8f1d16; }
.page-loading { position: fixed; z-index: 3000; inset: 0; display: grid; place-content: center; justify-items: center; gap: 16px; color: #fff; background: rgba(0, 0, 0, .68); backdrop-filter: blur(5px); }
.page-loading[hidden] { display: none; }
.page-loading p { margin: 0; font-weight: 700; }
.logo-loader { position: relative; width: 132px; height: 132px; flex: none; }
.logo-loader img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; user-select: none; -webkit-user-drag: none; }
.logo-loader-fill { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); will-change: clip-path; }
.logo-loader.is-finishing .logo-loader-fill { transition: clip-path .3s ease-out; }
@media (prefers-reduced-motion: reduce) { .logo-loader.is-finishing .logo-loader-fill { transition: none; } }
.logo-loader-screen { display: none; position: fixed; z-index: 3000; inset: 0; place-content: center; justify-items: center; gap: 18px; color: #fff; background: #000; }
.feed-loading .logo-loader-screen { display: grid; }
.logo-loader-screen p { margin: 0; font-weight: 700; }

/* Thread detail and recursive replies */
.detail-shell { padding-top: 0; }
.detail-nav { position: sticky; z-index: 12; top: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); padding: 14px 0; background: rgba(243, 243, 243, .96); backdrop-filter: blur(8px); }
.detail-nav h1 { grid-column: 2; margin: 0; font-size: 18px; }
.back-link { grid-column: 1; grid-row: 1; justify-self: start; font-weight: 650; }
.post-detail { border-bottom: 1px solid var(--line); padding-top: 22px; }
.post-detail.thread-parent::after { content: ""; position: absolute; z-index: 0; top: 66px; bottom: -17px; left: 23px; width: 2px; background: #d5d5d5; }
.post-detail.thread-parent .post-header, .post-detail.thread-parent .post-content, .post-detail.thread-parent .post-poll, .post-detail.thread-parent .post-actions { position: relative; z-index: 1; }
.post-detail.thread-parent .author-avatar-link img { background: var(--canvas); box-shadow: 0 0 0 4px var(--canvas); }
.replies > h2 { margin: 22px 0 12px; font-size: 20px; }
.replies > h2 span { color: var(--muted); font-size: 14px; }
.replies.focused-view { margin-top: 0; }
.reply-form { position: relative; display: grid; grid-template-columns: 32px 1fr 42px; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.reply-form[hidden] { display: none; }
.reply-form img { border-radius: 50%; }
.reply-form textarea { min-height: 42px; max-height: 150px; border: 1px solid var(--line); border-radius: 18px; padding: 9px 13px; resize: vertical; line-height: 1.4; }
.send-button { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; color: #fff; background: #000; cursor: pointer; }
.send-button .action-icon { width: 18px; }
.reply-form .form-status { grid-column: 2 / 4; margin: 0; }
.reply-form .reply-turnstile { grid-column: 1 / -1; }
.reply-form .reply-turnstile:empty { display: none; }
.reply-counter { grid-column: 2 / 4; justify-self: end; color: var(--muted); font-size: 12px; }
.comment-tree { padding-bottom: 70px; }
.comment { position: relative; display: block; border: 0; border-bottom: 1px solid var(--line); padding: 16px 0 12px; scroll-margin-top: 72px; }
.comment-header { align-items: flex-start; }
.comment-header .author-avatar-link { width: 44px; justify-content: center; }
.comment-header .content-menu { margin-left: auto; }
.comment-focus-link { display: block; margin: 8px 38px 4px 56px; border-radius: 6px; color: var(--ink); }
.comment-focus-link:hover { color: inherit; background: rgba(0, 0, 0, .025); }
.comment-focus-link:focus-visible { outline-offset: 3px; }
.comment-body { display: block; margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-actions { display: flex; gap: 2px; margin-left: 44px; }
.nested-reply-form { margin-left: 56px; border-bottom: 0; padding-bottom: 4px; }
.focused-comment-chain .comment { border-bottom: 0; }
.focused-comment-chain .comment.has-thread-continuation::after { content: ""; position: absolute; z-index: 0; top: 49px; bottom: -17px; left: 21px; width: 2px; background: #d5d5d5; }
.focused-comment-chain .comment-header, .focused-comment-chain .comment-focus-link, .focused-comment-chain .comment-actions, .focused-comment-chain .reply-form { position: relative; z-index: 1; }
.focused-comment-chain .author-avatar-link img { background: var(--canvas); box-shadow: 0 0 0 4px var(--canvas); }
.comment.is-focused { margin: 0 -10px; border-radius: 12px; padding-right: 10px; padding-left: 10px; background: rgba(0, 0, 0, .03); }
.comment.is-focused.has-thread-continuation::after { left: 31px; }
.focused-replies { margin-top: 12px; border-top: 1px solid var(--line); }
.focused-replies > h3 { margin: 0; padding: 18px 0 2px; color: var(--muted); font-size: 14px; }
.empty-replies { padding: 28px 0; color: var(--muted); text-align: center; }

/* Owner dashboard */
.admin-entry { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 24px; }
.admin-entry h2 { margin: 0; }
.invite-list { margin-top: 16px; }
.admin-page { width: min(100% - 40px, 980px); margin: 0 auto; padding: 46px 0 100px; }
.admin-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.admin-header h1 { margin: 0; font-size: 38px; }
.admin-header p:not(.eyebrow) { color: var(--muted); }
.report-admin-list { display: grid; gap: 16px; }
.report-card { border: 1px solid var(--line); border-radius: 16px; padding: 20px; background: #fff; box-shadow: var(--shadow-sm); }
.report-card.resolved { opacity: .65; }
.report-card > header { display: flex; justify-content: space-between; gap: 14px; }
.report-card > header a { color: #1657b8; }
.report-count { display: inline-block; border-radius: 999px; padding: 4px 9px; color: #fff; background: var(--danger); font-size: 13px; font-weight: 700; }
.report-pending { margin-left: 8px; color: var(--muted); font-size: 13px; }
.report-meta, .report-reasons { color: var(--muted); font-size: 14px; }
.report-card blockquote { margin: 14px 0; border-left: 3px solid #bbb; padding: 8px 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.moderation-controls { display: flex; align-items: flex-start; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.handle-panel { flex: 1; }
.handle-panel > summary { width: max-content; list-style: none; }
.handle-panel > summary::-webkit-details-marker { display: none; }
.handle-panel form { margin-top: 12px; border-radius: 12px; padding: 16px; background: #f4f4f4; }
.handle-panel fieldset { display: grid; gap: 12px; margin: 0 0 16px; border: 0; padding: 0; }
.handle-panel legend { margin-bottom: 10px; font-weight: 700; }
.inline-option { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-left: 24px; color: var(--muted); }
.inline-option input[type="number"] { width: 84px; padding: 6px; }
.inline-option select { padding: 6px; }
.delete-content-choice { display: flex !important; flex-direction: row; flex-wrap: wrap; gap: 10px 22px !important; margin-top: 16px !important; border-top: 1px solid var(--line) !important; padding-top: 16px !important; }
.delete-content-choice legend { flex-basis: 100%; }
.delete-content-choice label { font-weight: 650; }
.deleted-content-note { color: var(--muted); font-size: 13px; }

/* Simple policy pages */
.policy-page { width: min(100% - 40px, 760px); margin: 0 auto; padding: 48px 0 110px; }
.policy-page h1 { font-size: 38px; }
.policy-page h2 { margin-top: 30px; }
.policy-page p, .policy-page li { color: #333; }

@media (max-width: 760px) {
  .page-shell { width: 100%; padding: 0 16px 90px; }
  .threads-header { margin: 0; }
  .post-card { padding: 16px 0; }
  .post-content { margin-left: 0; }
  .post-poll { margin-left: 0; }
  .post-actions { margin-left: -8px; }
  .policy-links { right: 12px; left: 12px; justify-content: center; }
  .comment-focus-link { margin-right: 8px; }
  .admin-header { display: block; }
  .admin-header .button { margin-top: 10px; }
  .report-card > header { display: block; }
  .toast { right: 12px; bottom: 18px; max-width: calc(100vw - 24px); }
  .report-card > header a { display: inline-block; margin-top: 10px; }
  .moderation-controls { flex-wrap: wrap; }
  .handle-panel { min-width: 100%; }
}

/* Owner dashboard controls */
.admin-page { min-width: 0; max-width: calc(100vw - 32px); }
.admin-page > *, .admin-header > div, .report-card, .audit-card, .managed-profile-main, .handle-panel, .handle-panel form { min-width: 0; }
.admin-page .audit-card, .admin-page .report-card, .managed-profile { overflow-wrap: anywhere; }
.admin-list-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 16px; color: var(--muted); font-size: 14px; }
.period-filter { position: relative; flex: none; color: var(--ink); }
.period-filter > summary { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; list-style: none; }
.period-filter > summary::-webkit-details-marker, .custom-select > summary::-webkit-details-marker { display: none; }
.period-filter[open] > summary { border-color: #111; background: #f4f4f4; }
.period-menu { position: absolute; z-index: 80; top: calc(100% + 8px); right: 0; width: 164px; max-width: calc(100vw - 32px); border: 1px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; box-shadow: var(--shadow-lg); }
.period-menu a { display: block; border-radius: 8px; padding: 9px 12px; color: var(--ink); font-size: 14px; font-weight: 600; }
.period-menu a:hover, .period-menu a[aria-current="true"] { background: #f0f0f0; }
.modal-header-actions { display: flex; align-items: center; gap: 8px; }
#login-ips-dialog .modal-header { overflow: visible; }
#login-ips-dialog .modal-body { min-width: 0; }
#login-ips-dialog .ip-list-meta { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
#login-ips-dialog .audit-list { max-height: min(58vh, 520px); overflow-y: auto; overflow-x: hidden; }
#login-ips-dialog .audit-list p { margin: 0; border-bottom: 1px solid var(--line); padding: 9px 0; overflow-wrap: anywhere; }
#login-ips-dialog .ip-pagination { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }
#login-ips-dialog .ip-pagination .button { min-width: 100px; text-align: center; }
.managed-profile { display: grid; grid-template-columns: minmax(0, 1fr) 80px; gap: 10px 18px; }
.managed-profile h2 { overflow-wrap: anywhere; }
.managed-profile > img { width: 80px; height: 80px; }
.managed-profile-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.managed-profile-actions .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.button-danger-outline { color: var(--danger); background: #fff; border-color: var(--danger); }
.button-danger-outline:hover { background: #fff1f0; }
.button-danger { color: #fff; background: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: #8f1d16; border-color: #8f1d16; }
.owner-confirm-dialog { width: min(92vw, 480px); max-height: calc(100dvh - 24px); border: 0; border-radius: 18px; padding: 0; color: var(--ink); background: #fff; box-shadow: var(--shadow-lg); }
.owner-confirm-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.owner-confirm-body { padding: 20px 24px 24px; }
.owner-confirm-body p { margin: 0 0 18px; line-height: 1.6; overflow-wrap: anywhere; }
.owner-confirm-body label { display: block; margin-bottom: 7px; font-weight: 700; }
.owner-confirm-body input { display: block; width: 100%; max-width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.owner-confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.direct-moderation { min-width: 0; margin: 22px 0; }
.direct-moderation > summary { width: 100%; display: flex; align-items: center; gap: 14px; padding: 7px 0; color: #111; background: none; font-weight: 800; cursor: pointer; white-space: nowrap; }
.direct-moderation > summary::before, .direct-moderation > summary::after { content: ""; height: 2px; flex: 1; background: #111; }
.direct-moderation form { margin-top: 16px; border: 1px solid var(--line); padding: 20px; background: #fff; }
.handle-panel [hidden] { display: none !important; }
.moderation-field { display: block; width: 100%; min-width: 0; margin: 0 0 16px; }
.moderation-field .field-label { display: block; margin: 0 0 7px; font-size: 14px; font-weight: 700; }
.moderation-field input[type="number"], .reason-field textarea { display: block; width: 100%; max-width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; color: var(--ink); background: #fff; font: inherit; }
.reason-field textarea { min-height: 116px; line-height: 1.6; resize: vertical; }
.field-error { margin: 7px 0 0; color: var(--danger); font-size: 13px; }
.custom-select { position: relative; width: 100%; min-width: 0; }
.custom-select > summary { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: #fff; cursor: pointer; list-style: none; }
.custom-select[open] > summary { border-color: #111; }
.select-chevron { width: 9px; height: 9px; flex: none; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.custom-select[open] .select-chevron { transform: rotate(225deg) translateY(-2px); }
.custom-select-menu { position: absolute; z-index: 90; top: calc(100% + 5px); right: 0; left: 0; display: grid; gap: 2px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 5px; background: #fff; box-shadow: var(--shadow-lg); }
.custom-select-menu button { width: 100%; border: 0; border-radius: 7px; padding: 10px 12px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.custom-select-menu button:hover, .custom-select-menu button[aria-pressed="true"] { background: #f0f0f0; }
.duration-fields { display: block; }
.duration-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, 140px); gap: 10px; }
.duration-inputs > *, .duration-unit { min-width: 0; }
.permanent-choice { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.duration-fields .field-hint { margin: 7px 0 0; }
.composer-dialog, .report-dialog { max-height: calc(100dvh - 24px); overflow: visible; }
.composer-dialog form, .report-dialog form { max-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
.composer-dialog .modal-body, .report-dialog .modal-body { min-height: 0; overflow-y: auto; }
@media (max-width: 760px) {
  body { min-width: 0; }
  .composer-dialog, .report-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); margin: 8px auto; }
  .composer-dialog form, .report-dialog form { max-height: calc(100dvh - 16px); }
  .composer-footer { display: grid; grid-template-columns: 1fr auto auto; padding: 12px 14px max(12px, env(safe-area-inset-bottom)); }
  .composer-menu { right: auto; left: 0; width: min(190px, calc(100vw - 44px)); }
  .admin-page { width: calc(100% - 28px); padding-top: 24px; }
  .admin-header h1 { font-size: clamp(27px, 8vw, 34px); }
  .managed-profile { grid-template-columns: minmax(0, 1fr) 64px; padding: 16px; }
  .managed-profile > img { width: 64px; height: 64px; }
  .managed-profile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .managed-profile-actions .button { min-width: 0; padding-inline: 8px; font-size: 13px; line-height: 1.3; text-align: center; }
  .direct-moderation form { padding: 16px; }
  .handle-panel { min-width: 0; }
  #login-ips-dialog .modal-header { padding: 14px 16px; }
  #login-ips-dialog .modal-body { padding: 16px; }
  .owner-confirm-body { padding: 16px; }
}

/* ==========================================================================
   SaaS app shell (dashboard + moderation) — Resend-inspired dark UI.
   Everything is scoped to .app-shell so forum pages stay untouched.
   ========================================================================== */
.app-shell {
  --app-bg: #000;
  --app-surface: #0a0a0a;
  --app-elevated: #111;
  --app-hover: rgba(255, 255, 255, .06);
  --app-border: rgba(255, 255, 255, .09);
  --app-border-strong: rgba(255, 255, 255, .16);
  --app-text: #ededed;
  --app-muted: #a1a1a1;
  --app-subtle: #6f6f6f;
  --app-success: #3dd68c;
  --app-danger: #ff6369;
  --app-radius: 12px;
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  color: var(--app-text);
  background: linear-gradient(90deg, transparent 239px, var(--app-border) 239px, var(--app-border) 240px, transparent 240px) var(--app-bg);
  font-size: 14px;
  color-scheme: dark;
}
body:has(.app-shell) { background: #000; }
body:has(.app-shell) .global-nav { box-shadow: none; border-bottom: 1px solid rgba(255, 255, 255, .09); }
body:has(.app-shell) .flash { border-width: 1px; border-color: rgba(255, 255, 255, .16); border-radius: 10px; color: #ededed; background: #111; font-size: 14px; box-shadow: none; }
body:has(.app-shell) .flash-error { border-color: rgba(255, 99, 105, .4); color: #ffb3b6; background: #1a0a0b; }
body:has(.app-shell) .flash-success { border-color: rgba(61, 214, 140, .35); color: #9ff0c6; background: #07170f; }
body:has(.app-shell) .policy-links { right: 18px; left: auto; color: #6f6f6f; background: rgba(10, 10, 10, .85); border: 1px solid rgba(255, 255, 255, .09); }
body:has(.app-shell) .policy-links a:hover { color: #ededed; }
.app-shell a:hover { color: inherit; }
.app-shell :focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Sidebar */
.app-sidebar { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding: 20px 12px; }
.app-sidebar-title { margin: 0 10px 18px; color: var(--app-text); font-size: 13px; font-weight: 600; letter-spacing: .01em; }
.app-nav { display: grid; gap: 2px; }
.app-nav-label { margin: 16px 10px 6px; color: var(--app-subtle); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.app-nav-label:first-child { margin-top: 0; }
.app-nav a { display: flex; align-items: center; gap: 10px; min-height: 34px; border-radius: 8px; padding: 7px 10px; color: var(--app-muted); font-size: 14px; font-weight: 500; transition: background-color .15s ease, color .15s ease; }
.app-nav a:hover { color: var(--app-text); background: var(--app-hover); }
.app-nav a[aria-current="page"] { color: var(--app-text); background: rgba(255, 255, 255, .09); }
.app-icon { flex: none; }

/* Main column */
.app-main, .app-shell .admin-page { min-width: 0; width: 100%; max-width: 1040px; margin: 0; padding: 40px 48px 110px; }
.app-page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 0 0 28px; border-bottom: 1px solid var(--app-border); padding-bottom: 24px; }
.app-page-header .eyebrow { margin: 0 0 10px; color: var(--app-subtle); font-size: 12px; letter-spacing: .06em; }
.app-page-header h1 { margin: 0; color: var(--app-text); font-size: 30px; font-weight: 600; line-height: 1.15; letter-spacing: -.03em; }
.app-page-header p:not(.eyebrow) { margin: 8px 0 0; color: var(--app-muted); font-size: 14px; }

/* Cards */
.app-card { margin: 0 0 20px; border: 1px solid var(--app-border); border-radius: var(--app-radius); padding: 24px; background: var(--app-surface); }
.app-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.app-card-header h2 { margin: 0; color: var(--app-text); font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.app-card-header p { max-width: 620px; margin: 6px 0 0; color: var(--app-muted); font-size: 13px; line-height: 1.6; }
.app-card-header form { flex: none; margin: 0; }
.app-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 24px -24px -24px; border-top: 1px solid var(--app-border); border-radius: 0 0 var(--app-radius) var(--app-radius); padding: 14px 24px; background: rgba(255, 255, 255, .02); }
.app-card-footer p { margin: 0; color: var(--app-subtle); font-size: 13px; }
.app-empty-row { margin: 0; border: 1px dashed var(--app-border-strong); border-radius: 10px; padding: 18px; color: var(--app-subtle); text-align: center; font-size: 13px; }

/* Stats */
.app-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 24px; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); }
.app-stat { display: grid; gap: 6px; padding: 18px 20px; }
.app-stat + .app-stat { border-left: 1px solid var(--app-border); }
.app-stat span { color: var(--app-muted); font-size: 13px; }
.app-stat strong { color: var(--app-text); font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.app-stat .report-status-filter { justify-self: end; }

/* Badges */
.app-badge, .app-shell .status-pill { display: inline-flex; align-items: center; gap: 6px; margin: 0; border: 1px solid var(--app-border-strong); border-radius: 999px; padding: 2px 9px; color: var(--app-muted); background: rgba(255, 255, 255, .04); font-size: 12px; font-weight: 500; line-height: 1.6; }
.app-badge-success { border-color: rgba(61, 214, 140, .3); color: var(--app-success); background: rgba(61, 214, 140, .08); }
.app-badge-success::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Buttons & inputs */
.app-shell .button { min-height: 36px; border: 1px solid var(--app-border-strong); border-radius: 8px; padding: 7px 14px; color: var(--app-text); background: transparent; font-size: 14px; font-weight: 500; line-height: 1.4; }
.app-shell .button:hover { border-color: rgba(255, 255, 255, .28); background: var(--app-hover); }
.app-shell .button-primary { border-color: #fff; color: #000; background: #fff; }
.app-shell .button-primary:hover { border-color: #d4d4d4; background: #d4d4d4; }
.app-shell .button-danger { border-color: var(--danger); color: #fff; background: var(--danger); }
.app-shell .button-danger:hover { border-color: #d0342a; background: #d0342a; }
.app-shell .button-danger-outline { border-color: rgba(255, 99, 105, .4); color: var(--app-danger); background: transparent; }
.app-shell .button-danger-outline:hover { background: rgba(255, 99, 105, .08); }
.app-shell .field { margin-top: 18px; }
.app-shell .field label, .app-shell .field-label, .app-shell .admin-form label, .app-shell .owner-confirm-body label { color: var(--app-text); font-size: 13px; font-weight: 500; }
.app-shell .field input, .app-shell .field textarea, .app-shell .admin-form input, .app-shell .admin-form select,
.app-shell .moderation-field input[type="number"], .app-shell .reason-field textarea, .app-shell .owner-confirm-body input,
.app-shell .custom-select > summary { min-height: 40px; border: 1px solid var(--app-border-strong); border-radius: 8px; padding: 9px 12px; color: var(--app-text); background: var(--app-bg); font-size: 14px; }
.app-shell .field textarea { min-height: 120px; }
.app-shell .field input:focus, .app-shell .field textarea:focus, .app-shell .admin-form input:focus, .app-shell .moderation-field input:focus,
.app-shell .reason-field textarea:focus, .app-shell .owner-confirm-body input:focus { border-color: rgba(255, 255, 255, .5); outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .08); }
.app-shell input::placeholder, .app-shell textarea::placeholder { color: var(--app-subtle); }
.app-shell .field-hint { color: var(--app-subtle); font-size: 12px; }
.app-shell .form-actions { margin-top: 20px; }
.app-shell .error-list { margin: 0 0 20px; border: 1px solid rgba(255, 99, 105, .4); border-radius: 10px; color: #ffb3b6; background: rgba(255, 99, 105, .08); }
.app-shell .field-error, .app-shell .form-status { color: var(--app-danger); }
.app-shell .privacy-note { margin: 28px 0 0; border-top: 0; padding: 0; color: var(--app-subtle); font-size: 12px; line-height: 1.6; }

/* Dashboard specifics */
.app-shell .avatar-panel { display: flex; align-items: center; gap: 16px; margin: 0 0 4px; border: 1px solid var(--app-border); border-radius: 10px; padding: 16px; background: var(--app-bg); }
.app-shell .avatar-panel img { width: 56px; height: 56px; flex: none; border-radius: 12px; }
.app-shell .avatar-panel > div { flex: 1; min-width: 0; }
.app-shell .avatar-panel p { margin: 0; color: var(--app-muted); font-size: 13px; line-height: 1.55; }
.app-shell .avatar-panel strong { color: var(--app-text); font-weight: 500; }
.app-shell .avatar-panel form { flex: none; margin: 0; }
.app-shell .recovery-panel { margin-top: 0; padding-top: 24px; border-top: 1px solid var(--app-border); }
.app-shell .recovery-add { width: 36px; height: 36px; border: 1px solid var(--app-border-strong); border-radius: 8px; color: var(--app-text); }
.app-shell .recovery-add:hover { background: var(--app-hover); }
.app-shell .recovery-change { color: var(--app-text); font-size: 13px; }
.app-shell .recovery-state, .app-shell .recovery-waiting { margin: 0; color: var(--app-muted); font-weight: 500; }
.app-shell .recovery-notice { border: 1px solid rgba(61, 214, 140, .3); border-radius: 10px; background: rgba(61, 214, 140, .06); }
.app-shell .recovery-notice p { color: #9ff0c6; }
.app-shell .admin-entry { margin-top: 0; padding-top: 24px; border-top: 1px solid var(--app-border); }

/* Lists (audit logs, invites, login IPs, history) */
.app-shell .audit-list { display: block; overflow: hidden; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); }
.app-shell .audit-card { position: relative; border: 0; border-radius: 0; padding: 16px 20px; color: var(--app-muted); background: transparent; font-size: 13px; }
.app-shell .audit-card + .audit-card { border-top: 1px solid var(--app-border); }
.app-shell .audit-card:hover { background: rgba(255, 255, 255, .02); }
.app-shell .audit-card p { margin: 0 0 6px; line-height: 1.6; }
.app-shell .audit-card strong { color: var(--app-text); font-weight: 500; }
.app-shell .audit-card a { color: var(--app-text); text-decoration: underline; text-decoration-color: var(--app-border-strong); text-underline-offset: 3px; }
.app-shell .audit-card time { margin-right: 8px; color: var(--app-subtle); font-size: 12px; font-variant-numeric: tabular-nums; }
.app-shell .audit-card form { margin-top: 10px; }
.app-shell .audit-list > .app-empty-row { border: 0; border-radius: 0; }
.app-shell .invite-list .audit-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.app-shell .invite-list .audit-card p, .app-shell .invite-list .audit-card form { margin: 0; }
.app-shell .invite-list strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; }
.app-shell .deleted-content-note { color: var(--app-subtle); }
.app-shell .empty-state { margin: 0 0 20px; border: 1px dashed var(--app-border-strong); border-radius: var(--app-radius); padding: 48px 24px; color: var(--app-muted); }
.app-shell .empty-state h2 { color: var(--app-text); font-size: 16px; font-weight: 600; }
.app-shell .empty-state p { margin: 6px 0 0; color: var(--app-subtle); }
.app-shell .history-heading { margin: 36px 0 14px; color: var(--app-text); font-size: 16px; font-weight: 600; }

/* Moderation: report cards */
.app-shell .report-admin-list { gap: 12px; }
.app-shell .report-card { border: 1px solid var(--app-border); border-radius: var(--app-radius); padding: 20px 22px; color: var(--app-muted); background: var(--app-surface); box-shadow: none; }
.app-shell .report-card.resolved { opacity: .55; }
.app-shell .report-card > header { align-items: center; }
.app-shell .report-card > header a { color: var(--app-text); font-size: 13px; }
.app-shell .report-card > header a:hover { text-decoration: underline; text-underline-offset: 3px; }
.app-shell .report-count { border: 1px solid rgba(255, 99, 105, .35); padding: 2px 9px; color: var(--app-danger); background: rgba(255, 99, 105, .1); font-size: 12px; font-weight: 500; }
.app-shell .report-pending { color: var(--app-subtle); }
.app-shell .report-meta { margin: 12px 0 0; color: var(--app-subtle); font-size: 13px; }
.app-shell .report-card blockquote { margin: 14px 0; border: 1px solid var(--app-border); border-radius: 8px; padding: 12px 14px; color: var(--app-text); background: var(--app-bg); font-size: 14px; line-height: 1.65; }
.app-shell .report-reasons { margin: 6px 0; color: var(--app-muted); font-size: 13px; line-height: 1.6; }
.app-shell .report-reasons strong { color: var(--app-text); font-weight: 500; }
.app-shell .moderation-controls { margin-top: 16px; border-top: 1px solid var(--app-border); padding-top: 16px; }
.app-shell .moderation-controls > form { margin: 0; }
.app-shell .handle-panel form { margin-top: 12px; border: 1px solid var(--app-border); border-radius: 10px; padding: 18px; background: var(--app-bg); }
.app-shell .delete-content-choice { border-top-color: var(--app-border) !important; color: var(--app-text); }
.app-shell .permanent-choice, .app-shell .delete-content-choice label { color: var(--app-text); font-weight: 500; }
.app-shell input[type="radio"], .app-shell input[type="checkbox"] { accent-color: #fff; }
.app-shell .select-chevron { color: var(--app-muted); }
.app-shell .custom-select[open] > summary { border-color: rgba(255, 255, 255, .5); }
.app-shell .custom-select-menu, .app-shell .period-menu { border: 1px solid var(--app-border-strong); border-radius: 10px; background: var(--app-elevated); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); }
.app-shell .custom-select-menu button, .app-shell .period-menu a { color: var(--app-text); font-size: 14px; font-weight: 400; }
.app-shell .custom-select-menu button:hover, .app-shell .custom-select-menu button[aria-pressed="true"],
.app-shell .period-menu a:hover, .app-shell .period-menu a[aria-current="true"] { background: var(--app-hover); }

/* Moderation: toolbar, forms, table */
.app-shell .admin-list-toolbar { color: var(--app-muted); font-size: 13px; }
.app-shell .period-filter { color: var(--app-text); }
.app-shell .period-filter > summary { width: 36px; height: 36px; border-color: var(--app-border-strong); border-radius: 8px; background: transparent; }
.app-shell .period-filter[open] > summary, .app-shell .period-filter > summary:hover { border-color: rgba(255, 255, 255, .3); background: var(--app-hover); }
.app-shell .admin-panel { border: 1px solid var(--app-border); border-radius: var(--app-radius); padding: 24px; color: var(--app-muted); background: var(--app-surface); }
.app-shell .admin-panel > p { margin: 0 0 18px; font-size: 13px; line-height: 1.6; }
.app-shell .admin-form { gap: 8px 10px; }
.app-shell .admin-form label { margin: 0; }
.app-shell .admin-form .button { min-height: 40px; }
.app-shell .user-search { margin-bottom: 24px; }
.app-shell .admin-table-wrap { margin-top: 20px; overflow-x: auto; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); }
.app-shell .admin-table { min-width: 620px; background: transparent; font-size: 13px; }
.app-shell .admin-table th { border-bottom: 1px solid var(--app-border); padding: 11px 16px; color: var(--app-subtle); background: rgba(255, 255, 255, .02); font-size: 12px; font-weight: 500; white-space: nowrap; }
.app-shell .admin-table td { border-bottom: 1px solid var(--app-border); padding: 12px 16px; color: var(--app-muted); vertical-align: middle; }
.app-shell .admin-table tbody tr:last-child td { border-bottom: 0; }
.app-shell .admin-table tbody tr:hover td { background: rgba(255, 255, 255, .02); }
.app-shell .admin-table td:first-child { color: var(--app-text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.app-shell .admin-table form { margin: 0; }
.app-shell .admin-table .button { min-height: 30px; padding: 4px 10px; font-size: 13px; }

/* Moderation: managed user */
.app-shell .managed-profile { margin: 0 0 20px; border: 1px solid var(--app-border); border-radius: var(--app-radius); padding: 24px; color: var(--app-muted); background: var(--app-surface); }
.app-shell .managed-profile h2 { margin: 0 0 4px; color: var(--app-text); font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.app-shell .managed-profile p { margin: 0 0 8px; font-size: 13px; line-height: 1.6; }
.app-shell .managed-profile a { color: var(--app-text); text-decoration: underline; text-underline-offset: 3px; }
.app-shell .managed-profile > img { border: 1px solid var(--app-border); border-radius: 14px; }
.app-shell .managed-profile .profile-handle { color: var(--app-subtle); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.app-shell .managed-profile-actions { margin-top: 12px; border-top: 1px solid var(--app-border); padding-top: 16px; }
.app-shell .direct-moderation { margin: 0 0 20px; border: 1px solid var(--app-border); border-radius: var(--app-radius); background: var(--app-surface); }
.app-shell .direct-moderation > summary { padding: 16px 20px; color: var(--app-text); font-size: 14px; font-weight: 500; }
.app-shell .direct-moderation > summary::before { content: "+"; flex: none; width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--app-border-strong); border-radius: 6px; color: var(--app-muted); background: none; }
.app-shell .direct-moderation > summary::after { display: none; }
.app-shell .direct-moderation[open] > summary::before { content: "−"; }
.app-shell .direct-moderation form { margin: 0; border: 0; border-top: 1px solid var(--app-border); border-radius: 0 0 var(--app-radius) var(--app-radius); padding: 20px; background: transparent; }
.app-shell .flash { width: 100%; margin: 0 0 20px; }

/* Dialogs opened from inside the shell */
.app-shell dialog { border: 1px solid var(--app-border-strong); border-radius: 14px; color: var(--app-text); background: var(--app-elevated); box-shadow: 0 24px 60px rgba(0, 0, 0, .7); }
.app-shell dialog::backdrop { background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); }
.app-shell dialog .modal-header { border-bottom-color: var(--app-border); }
.app-shell dialog .modal-header h2 { font-size: 16px; font-weight: 600; }
.app-shell dialog .close-button { color: var(--app-muted); }
.app-shell dialog .close-button:hover { color: var(--app-text); background: var(--app-hover); }
.app-shell dialog .owner-confirm-body p, .app-shell #login-ips-dialog .ip-list-meta { color: var(--app-muted); font-size: 14px; }
.app-shell dialog strong { color: var(--app-text); }
.app-shell #login-ips-dialog .audit-list { border: 1px solid var(--app-border); border-radius: 10px; background: var(--app-bg); }
.app-shell #login-ips-dialog .audit-list p { border-bottom-color: var(--app-border); padding: 10px 14px; color: var(--app-muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.app-shell #login-ips-dialog .audit-list p:last-child { border-bottom: 0; }

/* Responsive: sidebar becomes a scrollable top tab bar */
@media (max-width: 900px) {
  .app-shell { display: block; background: var(--app-bg); }
  .app-sidebar { position: sticky; z-index: 30; top: 0; height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--app-border); padding: 8px 12px; background: rgba(0, 0, 0, .92); backdrop-filter: blur(10px); }
  .app-sidebar-title, .app-nav-label { display: none; }
  .app-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav a { flex: none; white-space: nowrap; }
  .app-main, .app-shell .admin-page { max-width: none; padding: 28px 20px 110px; }
}
@media (max-width: 600px) {
  .app-main, .app-shell .admin-page { padding: 22px 16px 110px; }
  .app-page-header { display: block; padding-bottom: 18px; }
  .app-page-header h1 { font-size: 24px; }
  .app-card, .app-shell .managed-profile, .app-shell .admin-panel { padding: 18px; }
  .app-card-footer { display: grid; margin: 20px -18px -18px; padding: 12px 18px; }
  .app-card-footer .button { width: 100%; }
  .app-card-header { display: grid; }
  .app-shell .avatar-panel { flex-wrap: wrap; }
  .app-stat { padding: 14px; }
  .app-stat strong { font-size: 20px; }
  .app-shell .invite-list .audit-card { display: block; }
  .app-shell .invite-list .audit-card form { margin-top: 10px; }
  body:has(.app-shell) .policy-links { right: 12px; left: 12px; }
}

/* ==========================================================================
   Site-wide Resend theme (feed, auth, policy, dialogs).
   Overrides the original light theme; keep this block last.
   ========================================================================== */
:root {
  --ink: #ededed;
  --canvas: #000;
  --muted: #a1a1a1;
  --line: rgba(255, 255, 255, .1);
  --focus: #fff;
  --surface: #0a0a0a;
  --elevated: #111;
  --hover: rgba(255, 255, 255, .06);
  --line-strong: rgba(255, 255, 255, .16);
  --subtle: #6f6f6f;
  --danger-text: #ff6369;
  --success-text: #3dd68c;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body { color: var(--ink); background: #000; }
a:hover { color: #fff; }
::selection { color: #000; background: #fff; }
:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.skip-link { border: 1px solid var(--line-strong); color: #000; background: #fff; }

/* Navigation */
.global-nav { position: relative; z-index: 50; height: 64px; border-bottom: 1px solid var(--line); background: #000; box-shadow: none; }
.brand { gap: 10px; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.brand img { width: 28px; height: 28px; border-radius: 7px; }
.login-button { min-height: 36px; border: 1px solid #fff; border-radius: 10px; padding: 6px 14px; font-size: 14px; font-weight: 500; }
.login-button:hover { border-color: #d4d4d4; color: #000; background: #d4d4d4; }
.nav-user { min-height: 40px; gap: 8px; border-radius: 10px; padding: 4px 10px 4px 4px; font-size: 14px; font-weight: 500; }
.nav-user img { width: 30px; height: 30px; border-radius: 8px; }
.nav-user:hover { background: var(--hover); }
.menu-chevron { color: var(--subtle); }
.account-popover { top: calc(100% + 6px); border: 1px solid var(--line-strong); border-radius: 12px; padding: 5px; color: var(--ink); background: var(--elevated); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); }
.account-popover a, .account-popover button { border-radius: 8px; padding: 9px 11px; color: var(--ink); font-size: 14px; }
.account-popover a:hover, .account-popover button:hover { color: #fff; background: var(--hover); }
.account-popover form { border-top-color: var(--line); }

/* Buttons */
.button { min-height: 40px; gap: 8px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 16px; color: var(--ink); background: transparent; font-size: 14px; font-weight: 500; }
.button:hover { border-color: rgba(255, 255, 255, .3); color: #fff; background: var(--hover); }
.button-primary { border-color: #fff; color: #000; background: #fff; }
.button-primary:hover { border-color: #d4d4d4; color: #000; background: #d4d4d4; }
.button-secondary { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.button-secondary:hover { border-color: rgba(255, 255, 255, .3); color: #fff; background: var(--hover); }
.button-danger-outline { border-color: rgba(255, 99, 105, .4); color: var(--danger-text); background: transparent; }
.button-danger-outline:hover { background: rgba(255, 99, 105, .08); }
.button:disabled { opacity: .45; cursor: not-allowed; }

/* Flash & notices */
.flash { width: min(100% - 32px, 1120px); border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: var(--elevated); font-size: 14px; font-weight: 500; box-shadow: none; }
.flash-error { border-color: rgba(255, 99, 105, .4); color: #ffb3b6; background: #1a0a0b; }
.flash-success { border-color: rgba(61, 214, 140, .35); color: #9ff0c6; background: #07170f; }
.site-notice-fallback, .bind-prompt-fallback { border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); background: var(--elevated); }

/* Forms */
.field label { color: var(--ink); font-size: 13px; font-weight: 500; }
.field input, .field textarea, .field select, .composer-addon input, .modal-body textarea, .report-dialog textarea, .reply-form textarea, .comment-input,
.filter-bar select, .duration-fields input, .duration-fields select, .admin-form input, .admin-form select, .owner-confirm-body input, .moderation-field input[type="number"], .reason-field textarea, .custom-select > summary {
  border: 1px solid var(--line-strong); color: var(--ink); background: #0a0a0a; font-size: 15px;
}
.field input, .field select { min-height: 44px; border-radius: 10px; padding: 10px 12px; }
.field textarea { border-radius: 10px; }
.field input:focus, .field textarea:focus, .field select:focus, .composer-addon input:focus, .modal-body textarea:focus, .report-dialog textarea:focus, .reply-form textarea:focus, .comment-input:focus {
  border-color: rgba(255, 255, 255, .5); outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}
input::placeholder, textarea::placeholder { color: var(--subtle); }
.field-hint { color: var(--subtle); font-size: 12px; }
.error-list { border: 1px solid rgba(255, 99, 105, .4); border-radius: 10px; color: #ffb3b6; background: rgba(255, 99, 105, .08); font-size: 14px; }
p.error-list { padding: 12px 14px; }
.form-status { color: var(--danger-text); }
.password-visibility-button { color: var(--muted); }
.password-visibility-button:hover { color: #fff; background: var(--hover); }
.password-requirements li { color: var(--danger-text); font-weight: 500; }
.password-requirements li.is-valid { color: var(--success-text); }
.password-rule-icon { color: #000; background: var(--danger-text); font-size: 12px; }
.password-requirements li.is-valid .password-rule-icon { background: var(--success-text); }
input[type="radio"], input[type="checkbox"] { accent-color: #fff; }

/* Auth & form pages */
.form-page { position: relative; min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); overflow: hidden; padding: 64px 16px 110px; background: radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255, 255, 255, .07), transparent 70%), #000; }
.form-page::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255, 255, 255, .03) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .03) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask-image: radial-gradient(ellipse 50% 40% at 50% 0%, #000 10%, transparent 70%); mask-image: radial-gradient(ellipse 50% 40% at 50% 0%, #000 10%, transparent 70%); pointer-events: none; }
.form-page > .content { position: relative; }
.form-card { width: min(100%, 460px); border: 1px solid var(--line); border-radius: 16px; padding: 32px; background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, 0) 40%), var(--surface); box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 30px 80px rgba(0, 0, 0, .6); }
.form-card .eyebrow { margin-bottom: 14px; color: var(--subtle); font-size: 12px; letter-spacing: .08em; }
.form-card h1 { color: #fff; font-size: 26px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.form-intro { margin: 10px 0 22px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.form-card .form-actions { margin-top: 24px; }
.form-card .form-actions .button { flex: 1 1 auto; min-height: 44px; }
.avatar-panel { gap: 16px; margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: #000; }
.avatar-panel img { width: 64px; height: 64px; border-radius: 12px; }
.avatar-panel p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.avatar-panel strong { color: var(--ink); font-weight: 500; }
.privacy-note { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; color: var(--subtle); font-size: 13px; line-height: 1.6; }
.privacy-note a, .form-intro a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.privacy-note a:hover, .form-intro a:hover { text-decoration-color: #fff; }
.cf-turnstile { margin-top: 18px; min-height: 65px; }
.page-loading { background: rgba(0, 0, 0, .78); }
.toast { border: 1px solid var(--line-strong); border-radius: 12px; color: var(--ink); background: var(--elevated); font-size: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); }
.toast.error { border-color: rgba(255, 99, 105, .4); color: #ffb3b6; background: #1a0a0b; }

/* Hero (logged-out home) */
.locked-page.hero { min-height: calc(100vh - 64px); min-height: calc(100svh - 64px); padding: 48px 24px 96px; }
.hero-inner { position: relative; width: min(100%, 1120px); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 32px; }
.hero-copy { width: auto; padding: 0; text-align: left; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 24px !important; border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 12px 5px 10px; color: var(--ink) !important; background: rgba(255, 255, 255, .04); font-size: 13px !important; line-height: 1.4 !important; }
.hero-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--success-text); box-shadow: 0 0 10px var(--success-text); }
.hero .locked-content h1 { font-size: clamp(44px, 6.4vw, 80px); line-height: 1.02; letter-spacing: -.045em; }
.hero .locked-content p { margin: 20px 0 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero .locked-content .button { min-height: 46px; border-radius: 12px; padding: 10px 20px; box-shadow: none; font-size: 15px; }
.hero .locked-content .button-secondary { border-color: var(--line-strong); color: var(--ink); background: rgba(255, 255, 255, .02); }
.hero .locked-content .button-secondary:hover { border-color: rgba(255, 255, 255, .3); color: #fff; background: var(--hover); }
.hero .locked-content .signup-note { margin: 22px 0 0; }
.hero .locked-content .login-privacy-note { margin: 10px 0 0; }
.lock-scene { position: relative; width: 100%; max-width: 520px; aspect-ratio: 1 / 1; justify-self: center; display: grid; place-items: center; }
.lock-scene::before { content: ""; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .09), transparent 65%); filter: blur(10px); pointer-events: none; }
.lock-scene .lock-icon { width: 42%; height: auto; }
.lock-scene.is-3d .lock-icon { display: none; }
.lock-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.lock-scene.is-dragging .lock-canvas { cursor: grabbing; }
@media (max-width: 900px) {
  .locked-page.hero { place-items: start center; padding: 16px 20px 110px; }
  .hero-inner { grid-template-columns: 1fr; gap: 0; }
  .lock-scene { order: -1; max-width: 300px; }
  .hero-copy { text-align: center; }
  .hero .locked-content h1 { font-size: clamp(38px, 11vw, 56px); }
  .hero .locked-content p { margin: 16px auto 26px; }
  .hero-actions { justify-content: center; }
  .hero-actions .button { flex: 1 1 220px; }
}

/* Feed */
.page-shell { padding: 0 20px 110px; }
.threads-header { border-bottom: 1px solid var(--line); background: rgba(0, 0, 0, .82); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.composer-trigger { border: 1px solid var(--line-strong); color: var(--subtle); background: var(--surface); font-size: 15px; }
.composer-trigger:hover { border-color: rgba(255, 255, 255, .3); color: var(--muted); background: var(--elevated); }
.section-label { color: var(--subtle); font-size: 12px; letter-spacing: .08em; }
.feed-header h1 { font-weight: 600; letter-spacing: -.03em; background: linear-gradient(180deg, #fff 30%, #a1a1a1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.post-card { transition: background-color .15s ease; }
.post-card:not(:last-child) { border-bottom-color: var(--line); }
.post-author, .comment-username, .modal-body .user-info .username { color: var(--ink); }
.post-byline, .comment-byline, .preview-byline, .preview-stats { color: var(--subtle); }
.post-body, .comment-body, .preview-body { color: #d4d4d4; }
.post-location { color: var(--muted); }
.post-author-info img, .comment-header img, .user-avatar, .top-comment-preview > img { background: #000; box-shadow: 0 0 0 1px var(--line); }
.action-button { color: var(--subtle); }
.action-button:hover { color: #fff; background: var(--hover); }
.action-button.liked { color: var(--danger-text); }
.action-button.liked:hover { background: rgba(255, 99, 105, .1); }
.poll-option { border-color: var(--line-strong); color: var(--ink); }
.poll-option:not(:disabled):hover { border-color: rgba(255, 255, 255, .35); background: var(--hover); }
.poll-option:disabled { color: var(--ink); }
.poll-option.selected { border-color: rgba(255, 255, 255, .5); }
.poll-fill::-webkit-progress-value { background: rgba(255, 255, 255, .08); }
.poll-fill::-moz-progress-bar { background: rgba(255, 255, 255, .08); }
.poll-option.selected .poll-fill::-webkit-progress-value { background: rgba(255, 255, 255, .16); }
.poll-option.selected .poll-fill::-moz-progress-bar { background: rgba(255, 255, 255, .16); }
.poll-meta { color: var(--subtle); }
.top-comment-preview:hover, .comment-focus-link:hover, .profile-reply:hover { background: rgba(255, 255, 255, .03); }
.top-comment-preview > img, .post-detail.thread-parent .author-avatar-link img, .focused-comment-chain .author-avatar-link img { box-shadow: 0 0 0 3px #000; }
.preview-thread-line, .post-detail.thread-parent::after, .focused-comment-chain .comment.has-thread-continuation::after { background: rgba(255, 255, 255, .14); }
.content-menu summary { color: var(--subtle); }
.content-menu summary:hover { color: #fff; background: var(--hover); }
.menu-popover, .composer-menu { border: 1px solid var(--line-strong); border-radius: 12px; padding: 5px; background: var(--elevated); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); }
.menu-item, .composer-menu button { color: var(--ink); font-size: 14px; }
.menu-item:hover, .composer-menu button:hover { background: var(--hover); }
.composer-menu button > span:first-child { color: var(--muted); }
.report-content, .remove-post { color: var(--danger-text); }
.feed-sentinel { color: var(--subtle); }
.empty-state h2 { color: var(--ink); font-weight: 600; }
.empty-state p { color: var(--subtle); }

/* Thread detail */
.detail-nav { border-bottom-color: var(--line); background: rgba(0, 0, 0, .82); -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px); }
.detail-nav h1 { font-size: 16px; font-weight: 600; }
.back-link { color: var(--muted); font-size: 14px; font-weight: 500; }
.back-link:hover { color: #fff; }
.post-detail, .comment, .reply-form, .focused-replies { border-color: var(--line); }
.comment.is-focused { background: rgba(255, 255, 255, .04); }
.replies > h2 { font-size: 16px; font-weight: 600; }
.replies > h2 span, .focused-replies > h3, .empty-replies, .reply-counter { color: var(--subtle); }
.send-button { color: #000; background: #fff; }
.send-button:hover { background: #d4d4d4; }

/* Profile */
.profile-copy h1 { font-weight: 600; letter-spacing: -.02em; }
.profile-handle, .profile-followers { color: var(--subtle); }
.profile-bio { color: #d4d4d4; }
.profile-avatar { border-color: var(--line); background: #000; }
.profile-follow-button { border-color: #fff; color: #000; background: #fff; }
.profile-follow-button:hover { border-color: #d4d4d4; color: #000; background: #d4d4d4; }
.profile-follow-button.following { border: 1px solid var(--line-strong); color: var(--ink); background: transparent; }
.profile-tabs { border-bottom-color: var(--line); }
.profile-tabs a { color: var(--subtle); font-size: 14px; }
.profile-tabs a:hover { color: var(--ink); }
.profile-tabs a.active { border-bottom-color: #fff; color: #fff; font-weight: 600; }
.profile-reply { border-bottom-color: var(--line); }
.profile-reply-context, .profile-reply time { color: var(--subtle); }

/* Compliance */
.compliance-card { border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; background: var(--surface); }
.compliance-card h2 { font-size: 15px; font-weight: 600; }
.compliance-card p { color: var(--muted); font-size: 14px; }
.compliance-card time { color: var(--subtle); }
.status-pill { border: 1px solid var(--line-strong); padding: 2px 9px; color: var(--muted); background: rgba(255, 255, 255, .04); font-weight: 500; }

/* Dialogs */
.composer-dialog, .report-dialog, .block-dialog, .site-notice, .sanction-dialog, .owner-confirm-dialog, .confirm-dialog {
  border: 1px solid var(--line-strong); border-radius: 16px; color: var(--ink); background: var(--elevated); box-shadow: 0 30px 80px rgba(0, 0, 0, .75);
}
.composer-dialog::backdrop, .report-dialog::backdrop, .block-dialog::backdrop, .site-notice::backdrop, .sanction-dialog::backdrop, .owner-confirm-dialog::backdrop, .confirm-dialog::backdrop { background: rgba(0, 0, 0, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.modal-header { border-bottom-color: var(--line); padding: 16px 20px; }
.modal-header h2 { font-size: 16px; font-weight: 600; }
.modal-footer { border-top-color: var(--line); background: rgba(255, 255, 255, .02); }
.close-button { width: 36px; height: 36px; color: var(--muted); font-size: 22px; }
.close-button:hover { color: #fff; background: var(--hover); }
.modal-body textarea { border-radius: 12px; }
.composer-more-button { color: var(--muted); }
.composer-more-button:hover, .composer-more-button[aria-expanded="true"] { color: #fff; background: var(--hover); }
.composer-addon { border-color: var(--line); background: #000; }
.addon-remove { color: var(--muted); }
.addon-remove:hover { color: #fff; background: var(--hover); }
.add-poll-option { color: var(--ink); }
.add-poll-option:hover { background: var(--hover); }
.reason-list legend { color: var(--ink); font-size: 14px; font-weight: 600; }
.reason-list label { color: #d4d4d4; font-size: 14px; }
.reason-list label:hover { background: var(--hover); }
.site-notice h2, .sanction-dialog h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.site-notice p, .sanction-dialog p { color: var(--muted); }
.site-notice a, .sanction-dialog a { color: var(--ink); }
.sanction-type { color: var(--danger-text) !important; }
.sanction-icon { color: var(--danger-text); background: rgba(255, 99, 105, .12); box-shadow: inset 0 0 0 1px rgba(255, 99, 105, .35); font-size: 22px; }
.block-dialog .button-primary, .confirm-dialog.is-danger .button-primary { border-color: var(--danger); color: #fff; background: var(--danger); }
.block-dialog .button-primary:hover, .confirm-dialog.is-danger .button-primary:hover { border-color: #d0342a; color: #fff; background: #d0342a; }

/* Policy pages */
.policy-shell { width: min(100% - 32px, 1080px); display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 56px; margin: 0 auto; padding: 56px 0 120px; }
.policy-toc { position: sticky; top: 24px; max-height: calc(100vh - 120px); overflow-y: auto; padding-right: 8px; scrollbar-width: thin; }
.policy-toc p { margin: 0 0 12px; color: var(--subtle); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.policy-toc ol { display: grid; gap: 2px; margin: 0; border-left: 1px solid var(--line); padding: 0; list-style: none; }
.policy-toc a { display: block; margin-left: -1px; border-left: 1px solid transparent; padding: 5px 0 5px 14px; color: var(--subtle); font-size: 13px; line-height: 1.45; }
.policy-toc a:hover { border-left-color: var(--line-strong); color: var(--ink); }
.policy-toc a.is-active { border-left-color: #fff; color: #fff; }
.policy-page { width: auto; max-width: 720px; margin: 0; padding: 0; }
.policy-page .eyebrow { color: var(--subtle); font-size: 12px; letter-spacing: .08em; }
.policy-page h1 { margin: 0 0 32px; font-size: clamp(32px, 5vw, 48px); font-weight: 600; line-height: 1.1; letter-spacing: -.035em; background: linear-gradient(180deg, #fff 30%, #a1a1a1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.policy-page h2 { margin: 48px 0 14px; color: #fff; font-size: 20px; font-weight: 600; letter-spacing: -.01em; scroll-margin-top: 24px; }
.policy-page h3 { margin: 28px 0 10px; color: var(--ink); font-size: 16px; font-weight: 600; }
.policy-page p, .policy-page li { color: var(--muted); font-size: 15px; line-height: 1.8; }
.policy-page li { margin: 4px 0; }
.policy-page strong { color: var(--ink); font-weight: 600; }
.policy-page a:not(.button) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.policy-page a:not(.button):hover { text-decoration-color: #fff; }
.policy-page hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line); }
.policy-page blockquote { margin: 18px 0; border: 1px solid var(--line); border-left: 2px solid #fff; border-radius: 0 10px 10px 0; padding: 4px 18px; background: var(--surface); }
.policy-page table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.policy-page th, .policy-page td { border-bottom: 1px solid var(--line); padding: 10px 12px; color: var(--muted); text-align: left; vertical-align: top; }
.policy-page th { color: var(--ink); font-weight: 600; }
.policy-page > p:last-child { margin-top: 48px; }
@media (max-width: 900px) {
  .policy-shell { display: block; padding: 32px 0 110px; }
  .policy-toc { position: static; max-height: none; margin: 0 0 32px; border: 1px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden; }
  .policy-toc details > summary { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; list-style: none; }
  .policy-toc details > summary::-webkit-details-marker { display: none; }
  .policy-toc details > summary::after { content: "+"; color: var(--subtle); font-size: 18px; }
  .policy-toc details[open] > summary::after { content: "−"; }
  .policy-toc details > p { display: none; }
  .policy-toc ol { max-height: 50vh; overflow-y: auto; margin: 0; border-top: 1px solid var(--line); border-left: 0; padding: 6px 0; }
  .policy-toc a { margin: 0; border: 0; padding: 8px 16px; font-size: 14px; }
  .policy-page h2 { margin-top: 40px; font-size: 18px; }
  .policy-page p, .policy-page li { font-size: 15px; }
}
@media (min-width: 901px) {
  .policy-toc details > summary { display: none; }
}

/* Floating policy links */
.policy-links { right: auto; border: 1px solid var(--line); color: var(--subtle); background: rgba(10, 10, 10, .85); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.policy-links a:hover { color: #fff; text-decoration: none; }

@media (max-width: 760px) {
  .global-nav { height: 56px; }
  .locked-page.hero, .form-page { min-height: calc(100vh - 56px); min-height: calc(100svh - 56px); }
  .form-page { padding: 28px 12px 110px; }
  .form-card { padding: 24px 20px; border-radius: 14px; }
  .form-card h1 { font-size: 23px; }
  .page-shell { padding: 0 16px 100px; }
  .policy-links { right: 12px; left: 12px; }
  .account-popover { top: 52px; }
  .app-sidebar { top: 0; }
}
@media (hover: none) {
  .post-card:hover, .top-comment-preview:hover, .comment-focus-link:hover { background: transparent; }
}

/* Account security: change password & signed-in devices (scoped to .app-shell). */
.app-shell .password-input-wrap input { padding-right: 50px; }
.app-shell .password-visibility-button { right: 4px; width: 34px; height: 34px; border-radius: 6px; }
.app-shell .password-visibility-button svg { width: 18px; height: 18px; }
.app-shell .password-requirements { font-size: 12px; }
.app-shell .password-cooldown { text-align: left; }
.app-shell #password-change-form .form-status:empty { min-height: 0; margin: 0; }
.app-shell .owner-confirm-dialog { width: min(calc(100vw - 32px), 440px); margin: auto; }
.app-shell .owner-confirm-body p { line-height: 1.65; }
.device-list { margin: 0; padding: 0; list-style: none; overflow: hidden; border: 1px solid var(--app-border); border-radius: 10px; background: var(--app-bg); }
.device-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.device-row + .device-row { border-top: 1px solid var(--app-border); }
.device-icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--app-border-strong); border-radius: 10px; color: var(--app-text); background: var(--app-elevated); }
.device-icon .app-icon { width: 20px; height: 20px; }
.device-info { flex: 1; min-width: 0; }
.device-info p { margin: 0; overflow-wrap: anywhere; }
.device-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--app-text); font-size: 14px; font-weight: 500; }
.device-meta { margin-top: 3px !important; color: var(--app-muted); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.device-row form { flex: none; margin: 0; }
.app-shell .device-row .button { min-width: 64px; min-height: 34px; padding: 6px 14px; }
@media (max-width: 600px) {
  .device-row { gap: 12px; padding: 12px; }
  .device-icon { width: 36px; height: 36px; border-radius: 9px; }
  .app-shell .device-row .button { min-width: 56px; padding: 6px 12px; }
  .app-shell .owner-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Notification bell */
.global-nav nav { gap: 6px; }
.nav-icon-button { position: relative; width: 40px; height: 40px; display: inline-grid; place-items: center; flex: none; border-radius: 10px; color: var(--muted); transition: background-color .15s ease, color .15s ease; -webkit-tap-highlight-color: transparent; }
.nav-icon-button:hover, .nav-icon-button:focus-visible { color: #fff; background: var(--hover); }
.nav-icon-button:active { transform: scale(.94); }
.nav-icon-button svg { width: 24px; height: 24px; }
.notif-badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; border: 2px solid #000; border-radius: 999px; padding: 0 4px; color: #fff; background: #ff3040; font-size: 10px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.notif-badge[hidden] { display: none; }

/* Mentions */
.mention { color: #6fb3ff; font-weight: 500; cursor: pointer; }
.mention:hover { text-decoration: underline; text-underline-offset: 2px; }
.mention-popup { position: fixed; z-index: 6000; max-height: min(296px, 45vh); overflow-y: auto; overscroll-behavior: contain; margin: 0; border: 1px solid var(--line-strong); border-radius: 14px; padding: 6px; color: var(--ink); background: var(--elevated); box-shadow: 0 16px 40px rgba(0, 0, 0, .6); -webkit-overflow-scrolling: touch; }
.mention-popup[hidden] { display: none; }
.mention-status { padding: 12px 10px; color: var(--subtle); font-size: 13px; animation: mention-pulse 1s ease-in-out infinite; }
.mention-popup.is-searching .mention-option { opacity: .7; }
@keyframes mention-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .mention-status { animation: none; } }
.mention-option { display: flex; align-items: center; gap: 10px; min-height: 48px; border-radius: 10px; padding: 6px 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.mention-option[aria-selected="true"], .mention-option:hover { background: var(--hover); }
.mention-option img { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #000; box-shadow: 0 0 0 1px var(--line); }
.mention-option-names { min-width: 0; display: grid; line-height: 1.3; }
.mention-option-names strong, .mention-option-names > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mention-option-names strong { display: flex; align-items: center; color: #fff; font-size: 14px; font-weight: 600; }
.mention-option-names > span { color: var(--subtle); font-size: 13px; }

/* Notifications (activity) */
.activity-filters { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.activity-filters::-webkit-scrollbar { display: none; }
.activity-filters a { flex: none; min-height: 36px; display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 10px; padding: 6px 16px; color: var(--ink); font-size: 14px; font-weight: 500; }
.activity-filters a:hover { background: var(--hover); }
.activity-filters a.active { border-color: #fff; color: #000; background: #fff; }
.activity-list { margin: 0; padding: 0; list-style: none; }
.activity-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 0 0; }
.activity-item.is-unread::before { content: ""; position: absolute; top: 33px; left: -11px; width: 6px; height: 6px; border-radius: 50%; background: #0095f6; }
.activity-avatar { position: relative; flex: none; width: 44px; height: 44px; }
.activity-avatar img { width: 44px; height: 44px; border-radius: 50%; background: #000; box-shadow: 0 0 0 1px var(--line); }
.activity-type { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid #000; border-radius: 50%; color: #fff; }
.activity-type-like { background: #ff3040; }
.activity-type-reply { background: #24a0ed; }
.activity-type-mention { background: #20b16a; }
.activity-type-follow { background: #7a5af8; }
.activity-main { flex: 1; min-width: 0; display: grid; gap: 1px; border-bottom: 1px solid var(--line); padding-bottom: 14px; color: var(--ink); }
.activity-item:last-child .activity-main { border-bottom-color: transparent; }
.activity-line { display: flex; align-items: center; min-width: 0; font-size: 15px; }
.activity-line strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-weight: 600; }
.activity-line time { flex: none; margin-left: 8px; color: var(--subtle); font-size: 14px; }
.activity-action { color: var(--subtle); font-size: 15px; }
.activity-snippet { display: -webkit-box; overflow: hidden; margin-top: 3px; color: #d4d4d4; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.activity-item .connection-button { align-self: center; margin-top: -14px; }
.activity-more { display: flex; justify-content: center; padding: 24px 0; }

/* Followers / following */
.profile-followers-link { color: inherit; }
.profile-followers-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.connections-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.connections-tabs a { display: grid; justify-items: center; gap: 2px; margin-bottom: -1px; border-bottom: 2px solid transparent; padding: 12px 8px 10px; color: var(--subtle); font-size: 15px; font-weight: 600; line-height: 1.25; }
.connections-tabs a strong { font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.connections-tabs a:hover { color: var(--ink); }
.connections-tabs a.active { border-bottom-color: #fff; color: #fff; }
.connections-search { position: relative; display: flex; align-items: center; margin: 16px 0 6px; }
.connections-search svg { position: absolute; left: 14px; color: var(--subtle); pointer-events: none; }
.connections-search input { width: 100%; min-height: 46px; border: 1px solid transparent; border-radius: 12px; padding: 10px 14px 10px 44px; color: var(--ink); background: #1e1e1e; font-size: 16px; -webkit-appearance: none; appearance: none; }
.connections-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.connections-search input:focus { border-color: var(--line-strong); outline: none; background: #232323; }
.connections-list { margin: 0; padding: 0; list-style: none; }
.connection-row { position: relative; display: flex; align-items: center; gap: 12px; }
.connection-row::after { content: ""; position: absolute; right: 0; bottom: 0; left: 62px; border-bottom: 1px solid var(--line); pointer-events: none; }
.connection-row:last-child::after { display: none; }
.connection-row[hidden] { display: none; }
.connection-profile { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; color: var(--ink); }
.connection-profile img { flex: none; width: 48px; height: 48px; border-radius: 50%; background: #000; box-shadow: 0 0 0 1px var(--line); }
.connection-names { flex: 1; min-width: 0; display: grid; gap: 1px; padding: 16px 0; line-height: 1.3; }
.connection-names strong { display: flex; align-items: center; min-width: 0; overflow: hidden; color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; }
.connection-names > span { overflow: hidden; color: var(--subtle); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.connection-button { flex: none; min-width: 104px; min-height: 36px; border: 1px solid #fff; border-radius: 10px; padding: 6px 16px; color: #000; background: #fff; font-size: 15px; font-weight: 600; }
.connection-button:hover { border-color: #d4d4d4; color: #000; background: #d4d4d4; }
.connection-button.following { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.connection-button.following:hover { border-color: rgba(255, 255, 255, .3); color: #fff; background: var(--hover); }
.connection-button:disabled { opacity: .6; }
.connections-empty-search, .connections-note { margin: 24px 0; color: var(--subtle); font-size: 14px; text-align: center; }

@media (max-width: 760px) {
  .activity-item.is-unread::before { left: -9px; }
  .connection-button { min-width: 92px; padding-inline: 12px; font-size: 14px; }
  .connection-profile { gap: 12px; }
  .connection-row::after { left: 60px; }
  .mention-option { min-height: 52px; }
}
@media (hover: none) {
  .mention-option:hover:not([aria-selected="true"]) { background: transparent; }
}

/* Share sheet */
.share-dialog { width: min(92vw, 440px); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; color: var(--ink); background: var(--elevated); box-shadow: 0 30px 80px rgba(0, 0, 0, .75); }
.share-dialog::backdrop { background: rgba(0, 0, 0, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.share-dialog .modal-body { max-height: none; padding: 20px; }
.share-targets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.share-target { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 8px 4px; border-radius: 12px; color: var(--ink); font-size: 13px; text-decoration: none; transition: background .15s ease; }
.share-target:hover { background: var(--hover); }
.share-target:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.share-target-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-target-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; }
.share-target-icon svg { width: 28px; height: 28px; }
.share-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.share-line { background: #06c755; }
.share-line svg { width: 34px; height: 34px; }
.share-x { background: #000; box-shadow: inset 0 0 0 1px var(--line-strong); }
.share-x svg { width: 24px; height: 24px; }
.share-email { background: #2a2a2a; }
.share-link-row { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: #000; }
.share-link-input { flex: 1; min-width: 0; border: 0; padding: 0; color: var(--ink); background: transparent; font-size: 14px; text-overflow: ellipsis; }
.share-link-input:focus { outline: none; }
.share-link-row:focus-within { border-color: rgba(255, 255, 255, .3); }
.share-copy { flex: none; min-height: 36px; border-radius: 999px; }
@media (max-width: 380px) {
  .share-target-icon { width: 48px; height: 48px; }
  .share-target { font-size: 12px; }
}
