/* The operator's dark workspace is deliberately separate from personal accounts. */
:root {
  color-scheme: dark;
  --ink: #e0e6e3;
  --muted: #a1aea7;
  --line: #34423a;
  --canvas: #151c19;
  --surface: #1c2520;
  --soft: #28352d;
  --success: #a8c9b5;
  --danger: #e1a2a2;
  --sidebar-width: 220px;
  --accent: #a8c9b5;
}

body { font-size: 14px; }
h1, h2, h3 { color: var(--ink); }
h1 { font-family: Bahnschrift, "Segoe UI", sans-serif; font-size: clamp(28px, 3vw, 36px); font-weight: 500; letter-spacing: -.8px; }
h2 { font-size: 18px; font-weight: 600; }
h3 { font-size: 14px; }
:focus-visible { outline-color: var(--accent); }
button, .button { border-color: #496451; background: #3f5b48; color: #edf2ee; }
button:hover, .button:hover { border-color: #72947d; background: #4e6e58; }
button.secondary, .button.secondary { border-color: #405047; background: transparent; color: var(--ink); }
button.secondary:hover, .button.secondary:hover { border-color: #677e6e; background: var(--soft); }
button.danger { border-color: #614444; background: transparent; color: var(--danger); }
button.danger:hover { border-color: #916262; background: #382929; }
button:disabled { opacity: .55; }
button.small { min-height: 34px; padding: 6px 11px; font-size: 12px; }
button svg { width: 16px; height: 16px; }
input, textarea, select { border-color: #45544b; background: #151e19; color: var(--ink); }
input::placeholder, textarea::placeholder { color: #99a79f; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
input, select { min-height: 44px; }
label { color: #c1ccc5; }

.sidebar { padding: 30px 16px 22px; border-color: #2a372f; background: #111813; }
.brand { gap: 10px; margin: 0 4px 44px; font-size: 14px; letter-spacing: -.2px; }
.brand-mark { width: 38px; height: 41px; border: 1px solid #415849; border-radius: 10px 10px 10px 3px; background: #23362a; color: #c4ddcd; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 3px; }
.side-nav { gap: 8px; }
.nav-link { position: relative; min-height: 46px; padding: 12px 14px; border-radius: 6px; color: #a7b4ac; font-size: 13px; }
.nav-link svg { color: #a7b4ac; }
.nav-link:hover { background: #1c2920; color: var(--ink); }
.nav-link.active { color: #e0ede4; background: #283e2f; font-weight: 600; }
.nav-link.active::before { position: absolute; content: ""; width: 3px; height: 18px; left: 0; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav-link.active svg { color: var(--accent); }
.nav-count { background: #385140; color: #e0ede4; font-size: 11px; padding: 1px 6px; }
.sidebar-bottom { padding-top: 36px; }
.sidebar-note { margin: 0; padding: 20px 4px 0; border-top: 1px solid #2a372f; gap: 10px; color: #a3b2a8; font-size: 12px; }
.sidebar-note svg { width: 19px; height: 19px; color: #a3b2a8; }
.sidebar-note small { color: #91a096; font-size: 10px; }

.topbar { min-height: 70px; padding: 14px 40px; background: var(--canvas); border-color: #2c3931; }
.breadcrumb { font-size: 12px; }
.breadcrumb strong { color: #d3dfd7; }
.breadcrumb-divider { color: #6f8175; }
.account-bar { gap: 10px; }
.account-bar strong { color: #c0cdc4; }
.avatar { background: #24372b; border-color: #3d5444; color: #c0d8c9; }
.icon-button { border-color: transparent; background: transparent; color: var(--muted); }
.icon-button:hover { border-color: transparent; background: var(--soft); color: var(--ink); }
.main-content { max-width: 1440px; padding: 40px 40px 24px; }
.page-heading { margin-bottom: 30px; }
.page-heading p { margin-top: 10px; color: var(--muted); font-size: 14px; }
.panel { border-color: var(--line); border-radius: 10px; box-shadow: none; margin-bottom: 26px; }
.panel-heading { padding: 25px 28px 22px; }
.panel-heading p { color: var(--muted); font-size: 13px; margin-top: 6px; }
.panel-content { padding: 0 28px 24px; }
.panel-heading > .muted { font-size: 12px; }

.admin-stats { margin-bottom: 30px; border-radius: 10px; background: transparent; }
.admin-stats .stat { position: relative; gap: 0; padding: 24px; background: #1b251e; }
.admin-stats .stat + .stat { border-color: var(--line); }
.admin-stats .stat:hover { background: #26352b; }
.admin-stats .stat-icon { position: absolute; right: 22px; top: 26px; width: 20px; height: 20px; border: 0; color: #a0b9a8; }
.admin-stats .stat-icon svg { width: 19px; height: 19px; }
.admin-stats .stat-label { color: #b6c5bc; font-size: 12px; padding-right: 24px; min-height: 38px; }
.admin-stats .stat strong { color: #e1e9e4; margin-top: 4px; font-size: 36px; font-weight: 500; letter-spacing: -1px; line-height: 1.2; }
.stat-hint { margin-top: 12px; color: #9eafa3; font-size: 11px; }

.reach-panel .panel-heading { align-items: flex-start; padding-block: 27px; }
.reach-panel .panel-heading button { flex-shrink: 0; }
.reach-columns, .reach-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px 130px; gap: 20px; align-items: center; padding-inline: 28px; }
.reach-columns { padding-block: 11px; border-block: 1px solid var(--line); color: var(--muted); background: #19221c; font-size: 11px; }
.reach-columns span:not(:first-child) { text-align: right; }
.reach-row { min-height: 116px; padding-block: 24px; }
.reach-row + .reach-row { border-top: 1px solid var(--line); }
.reach-page { display: flex; gap: 16px; align-items: center; min-width: 0; }
.reach-page h3 { font-size: 15px; font-weight: 600; }
.reach-path { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.feature-icon { width: 42px; height: 42px; background: #27382c; border-color: #3c5343; color: #bad1c2; border-radius: 9px; }
.reach-total, .reach-today { text-align: right; font-variant-numeric: tabular-nums; }
.reach-total strong { color: #d7e7dc; font-size: 33px; font-weight: 500; letter-spacing: -.7px; }
.reach-today { color: #b3c3b9; font-size: 16px; }
.mobile-metric-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.reach-footer { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding: 18px 28px; color: var(--muted); font-size: 12px; }
.reach-footer p { max-width: 82ch; line-height: 1.7; }
.reach-footer [role="status"]:empty { display: none; }

.toolbar { padding: 0 28px 22px; gap: 16px; }
.search-field { max-width: 440px; }
.search-field > svg { color: #a5b6aa; top: 14px; }
.search-field input, select { font-size: 13px; }
.toolbar select { max-width: 45%; }
table { font-size: 13px; }
th { padding-block: 13px; border-color: var(--line); background: #18211b; color: #b3c2b8; font-size: 12px; }
td { color: #b3c2b8; padding-block: 20px; border-color: #2c3931; }
th:first-child, td:first-child { padding-left: 28px; }
th:last-child, td:last-child { padding-right: 28px; }
tbody tr:hover { background: #222e26; }
.map-name::before { border-color: #8fab98; }
td button.small:not(.danger) { border-color: #45574b; background: #243329; color: #d5e3da; }
td button.small:not(.danger):hover { border-color: #769580; background: #344a3b; }
td .revision button:not(.secondary):not(.danger) { border-color: #52735d; background: #3c5c47; color: #e9f1ec; }
td > a { border-color: #45574b; color: #c4d6cb; }
td > a:hover { background: var(--soft); border-color: #769580; }
.badge { font-size: 11px; }
.badge.public, .badge.selected, .badge.state-promoted { background: #294333; color: #bcdbc7; }
.badge.private, .badge.cat, .badge[class*="state-"] { background: #303e34; color: #c4d0c8; }
.badge.state-promoted { background: #294333; color: #bcdbc7; }
.badge.state-labor { background: #423c29; color: #dfc996; }
.badge.state-quarantined, .badge.state-withdrawn { background: #422d2f; color: #e4b4b8; }
.revision { gap: 8px; padding-block: 9px; }
.revision .muted { font-size: 11px; }
.revisions { min-width: 260px; }

.feed > .message { padding: 25px 28px; }
.message.unread { border-left-color: #a8c9b5; padding-left: 25px; background: #202e25; }
.message-head { gap: 10px; }
.message-subject { font-size: 15px; }
.message-head .muted { font-size: 12px; }
.message-body { color: #c4d0c8; max-width: 75ch; font-size: 14px; line-height: 1.75; }
.message > .row { margin-top: 20px; gap: 9px; }
.message select { border-color: #45574b; min-height: 34px; }
.board-posts { border-color: #49614f; }
.board-posts .message-body { font-size: 13px; }
.board-reply textarea { background: #151e19; }
.moderation-help { color: var(--muted); font-size: 12px; }
.moderation-help summary { cursor: pointer; width: fit-content; padding-block: 3px; }
.moderation-help p { margin-top: 10px; max-width: 76ch; line-height: 1.75; }
.inline-info { background: #243329; color: #bacbc0; }
.inline-info a { color: var(--accent); }
.empty-icon { background: #25352a; border-color: #425a49; color: var(--accent); }
.empty-state { padding-block: 45px; }
.empty-state p { font-size: 13px; }
.err { color: var(--danger); font-size: 13px; }
.notice:not(:empty) { background: #243a2c; color: #bfdfc9; border-color: #42614d; }
.page-notice:not(:empty) { background: #3a3424; color: #e4d0a5; border-color: #655b3c; }
.access-error:has(.err:not(:empty)) { background: #302324; border-color: #6a484b; }
.auth-intro { background: #19251e; padding: 36px; }
.auth-intro p { color: #b3c2b8; }
.auth-form { padding: 36px; }
.auth-actions button { min-height: 44px; }
.access-state p { color: #b3c2b8; }
.loading-dot { background: var(--accent); }
.skip-link { background: #bfd7c7; color: #18231c; }
.page-footer { margin-top: 30px; border-color: #2c3931; color: #9aaba0; font-size: 11px; }
.page-footer span:first-child { color: #a9b9ae; }

@media (max-width: 1100px) {
  :root { --sidebar-width: 200px; }
  .sidebar { padding-inline: 12px; }
  .brand { font-size: 13px; gap: 8px; }
  .brand small { font-size: 10px; }
  .topbar { padding-inline: 28px; }
  .main-content { padding-inline: 28px; }
  .admin-stats .stat { padding: 20px 18px; }
  .admin-stats .stat-icon { right: 17px; top: 22px; }
  .admin-stats .stat-label { font-size: 11px; min-height: 36px; }
  .reach-columns, .reach-row { grid-template-columns: minmax(0, 1fr) 115px 100px; }
}

@media (max-width: 760px) {
  :root { --sidebar-width: 245px; }
  .sidebar { padding: 28px 18px 22px; }
  .brand { font-size: 14px; }
  .brand small { font-size: 11px; }
  .topbar { min-height: 64px; padding: 12px 20px; }
  .main-content { padding: 28px 20px 20px; }
  .page-heading { margin-bottom: 24px; }
  .page-heading p { font-size: 13px; }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 24px; }
  .admin-stats .stat { padding: 20px; align-items: flex-start; flex-direction: column; }
  .admin-stats .stat:nth-child(3) { border-left: 0; }
  .admin-stats .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .admin-stats .stat-icon { display: none; }
  .admin-stats .stat-label { padding-right: 0; font-size: 12px; min-height: 36px; }
  .admin-stats .stat strong { font-size: 32px; }
  .stat-hint { font-size: 11px; }
  .panel-heading { padding: 22px 20px; gap: 16px; }
  .panel-content { padding-inline: 20px; }
  .reach-panel .panel-heading { flex-wrap: wrap; padding-block: 23px; }
  .reach-columns { display: none; }
  .reach-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 22px 20px; border-top: 1px solid var(--line); }
  .reach-page { grid-row: 1 / 3; gap: 10px; }
  .reach-page .feature-icon { display: none; }
  .reach-page h3 { font-size: 14px; }
  .reach-path { font-size: 11px; }
  .reach-total strong { font-size: 29px; }
  .reach-today { grid-column: 2; font-size: 11px; }
  .mobile-metric-label { position: static; width: auto; height: auto; clip-path: none; }
  .reach-footer { padding: 17px 20px; }
  .toolbar { padding: 0 20px 20px; flex-wrap: wrap; gap: 12px; }
  .search-field { max-width: none; }
  .toolbar select { max-width: 100%; }
  th:first-child, td:first-child { padding-left: 20px; }
  .feed > .message { padding-inline: 20px; }
  .message.unread { padding-left: 17px; }
  .auth-intro, .auth-form { padding: 25px; }
  .sidebar-backdrop:not([hidden]) { background: #050b08b3; }
  body.menu-open .sidebar { box-shadow: 12px 0 50px #0005; }
}

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