
:root {
  color-scheme:dark;
  font:15px system-ui,-apple-system,"Segoe UI",sans-serif;
  --background:#111113; --surface:#1b1b1e; --subtle:#252529;
  --text:#eee9e9; --muted:#bbb1b1; --border:#4a4245; --input-border:#796c70;
  --header:#080809; --header-text:#f8eeee;
  --accent:#c33c46; --link:#ff959b; --link-hover:#ffc7cb;
  --button:#a12634; --button-hover:#bb3141; --button-text:#fff;
  --selected:#3b2026; --notice:#302025; --notice-border:#8c414b;
  --success:#85d8a3; --success-accent:#c33c46;
  --danger:#a22e3a; --danger-hover:#bc3a47;
  color:var(--text); background:var(--background);
}
:root[data-theme="light"] {
  color-scheme:light;
  --background:#f4f5f6; --surface:#fff; --subtle:#eaeef2;
  --text:#23282e; --muted:#5a6671; --border:#cbd2da; --input-border:#919eaa;
  --header:#242a32; --header-text:#f5f7fa;
  --accent:#457ca8; --link:#28618f; --link-hover:#143c5b;
  --button:#32688f; --button-hover:#245271; --button-text:#fff;
  --selected:#e8eff5; --notice:#e8f0f6; --notice-border:#afc5d7;
  --success:#23683e; --success-accent:#49876d;
  --danger:#8d3b3b; --danger-hover:#743131;
}
:root[data-theme="dark"] {
  color-scheme:dark;
  --background:#15191e; --surface:#20262d; --subtle:#2b333d;
  --text:#e8edf2; --muted:#b3bfcc; --border:#4a5664; --input-border:#758496;
  --header:#0d1116; --header-text:#f0f5fa;
  --accent:#6b9bc3; --link:#9ac9ee; --link-hover:#cfebff;
  --button:#376e98; --button-hover:#41779f; --button-text:#fff;
  --selected:#293d50; --notice:#243749; --notice-border:#547b9d;
  --success:#85d8a3; --success-accent:#548369;
  --danger:#a44149; --danger-hover:#b95059;
}
* { box-sizing:border-box }
body { margin:0; line-height:1.5; background:var(--background) }
header { background:var(--header); border-bottom:3px solid var(--accent); color:var(--header-text) }
nav { max-width:1160px; margin:auto; display:flex; align-items:center; gap:28px; padding:15px 24px; flex-wrap:wrap }
nav a { color:var(--header-text); text-decoration:none }
nav a:hover { color:var(--header-text); text-decoration:underline }
.brand { font-weight:650; font-size:18px; white-space:nowrap }
.nav-links,.account-nav { display:flex; align-items:center; gap:18px; flex-wrap:wrap }
.account-nav { margin-left:auto }
.account-nav form { margin:0 }
main { max-width:1112px; margin:30px auto 48px; padding:0 24px; min-height:65vh; overflow-wrap:anywhere; overflow-anchor:none }
h1 { font-size:27px; font-weight:600; margin:0 0 20px }
h2 { font-size:21px; font-weight:600; margin:30px 0 13px }
h3 { font-size:17px; margin:0 0 10px }
p { margin:12px 0 }
a { color:var(--link); text-underline-offset:2px }
a:hover { color:var(--link-hover) }
small,.muted { color:var(--muted) }
small { font-size:12px }
.online { color:var(--success) }
table { width:100%; border-collapse:collapse; background:var(--surface); text-align:left; margin:16px 0; border:1px solid var(--border) }
th,td { padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:top }
thead th { background:var(--subtle); font-weight:600; font-size:13px; white-space:nowrap }
tbody th { font-weight:500 }
tbody tr:last-child th,tbody tr:last-child td { border-bottom:0 }
.empty { padding:23px 12px; color:var(--muted) }
.table-scroll { overflow-x:auto }
form { margin:14px 0 }
.form { display:flex; flex-direction:column; gap:14px }
.narrow { max-width:440px }
.inline,.filters { display:flex; align-items:end; gap:12px; flex-wrap:wrap }
.inline a,.inline span { align-self:center }
.inline label { margin:0 }
.filters label { min-width:140px }
.filters { padding:16px; background:var(--subtle); border:1px solid var(--border) }
label { display:flex; flex-direction:column; gap:5px; font-weight:500 }
label small { font-weight:400 }
input,select,textarea,button { font:inherit }
input,select,textarea { border:1px solid var(--input-border); border-radius:3px; background:var(--surface); color:var(--text); padding:8px 10px; max-width:100% }
textarea { resize:vertical; width:100% }
input[type=number] { width:180px }
.form input { width:100% }
button { border:1px solid var(--button); border-radius:3px; padding:8px 14px; background:var(--button); color:var(--button-text); cursor:pointer; white-space:nowrap }
button:hover { background:var(--button-hover) }
.secondary { color:var(--text); background:var(--surface); border-color:var(--input-border) }
.secondary:hover { background:var(--subtle) }
.danger { background:var(--danger); border-color:var(--danger) }
.danger:hover { background:var(--danger-hover) }
.link-button { border:0; background:none; color:var(--header-text); padding:0 }
.link-button:hover { background:none; text-decoration:underline }
.checkbox { flex-direction:row; align-items:center; align-self:center; gap:6px; font-weight:400 }
.checkbox input { width:auto }
.notice { padding:12px 15px; border:1px solid var(--notice-border); background:var(--notice); overflow-wrap:anywhere }
.plain-section,.clan-message { padding:18px 0; border-bottom:1px solid var(--border) }
.message-meta { font-size:13px; color:var(--muted) }
.message-text { white-space:pre-wrap; overflow-wrap:anywhere }
.statistics details { border:1px solid var(--border); background:var(--surface); margin:10px 0; padding:0 16px }
.statistics summary { padding:12px 0; font-weight:600; cursor:pointer }
.statistics table { margin:0 0 14px; border:0 }
.statistics th { width:55% }
.statistics td { text-align:right }
details summary { cursor:pointer }
.pagination { display:flex; gap:20px; margin-top:16px }
input:focus-visible,select:focus-visible,textarea:focus-visible,button:focus-visible,a:focus-visible,summary:focus-visible { outline:2px solid var(--accent); outline-offset:3px }
@media(max-width:760px) { nav { gap:15px; padding:15px 18px } .nav-links { order:3; width:100%; gap:15px } .account-nav { gap:12px } main { padding:0 18px; margin-top:24px } .brand { font-size:16px } .filters label { flex:1; min-width:130px } th,td { padding:8px } .statistics th { width:60% } .inline { gap:10px } .inline input[type=number] { width:150px } }
.panel { background:var(--surface); border:1px solid var(--border); border-top:3px solid var(--accent); border-radius:3px; padding:20px 22px; margin:22px 0 }
.panel.green { border-top-color:var(--success-accent) }
.panel h2 { margin:0 0 16px; font-size:19px }
.panel table { border:0; margin-bottom:4px }
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:22px }
.settings-grid .panel { min-width:0 }
.profile-header { display:flex; gap:22px; align-items:center; padding:24px; background:var(--surface); border:1px solid var(--border); margin-bottom:24px }
.profile-header h1 { margin:0; font-size:29px }
.profile-header p { margin:5px 0 0 }
.avatar { width:78px; height:78px; background:var(--subtle); color:var(--muted); display:grid; place-items:center; font-size:36px; border:1px solid var(--border); border-radius:5px; flex-shrink:0 }
.profile-count { margin-left:auto; text-align:right; display:flex; flex-direction:column; color:var(--muted) }
.profile-count strong { color:var(--text); font-size:25px }
.profile-layout { display:grid; grid-template-columns:175px minmax(0,1fr); gap:24px }
.profile-tabs { display:flex; flex-direction:column; gap:2px; align-self:start; margin:0; padding:0; border:1px solid var(--border); background:var(--surface) }
.profile-tabs a { padding:12px 16px; color:var(--text); text-decoration:none; border-left:3px solid transparent }
.profile-tabs a[aria-current=page] { background:var(--selected); border-left-color:var(--accent); color:var(--link); font-weight:600 }
.profile-tabs a:hover { background:var(--subtle); color:var(--link) }
.profile-content .panel:first-child { margin-top:0 }
.mode-tabs { display:flex; flex-wrap:wrap; gap:7px; padding:0; margin:0 0 18px }
.mode-tabs a { border:1px solid var(--border); border-radius:3px; padding:6px 10px; font-size:13px; color:var(--text); background:var(--surface); text-decoration:none }
.mode-tabs a[aria-current=page] { background:var(--button); color:var(--button-text); border-color:var(--button) }
.stat-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin:0; gap:0 20px }
.stat-grid div { border-bottom:1px solid var(--border); padding:13px 0 }
.stat-grid dt { color:var(--muted); font-size:13px }
.stat-grid dd { margin:3px 0 0; font-size:20px; color:var(--text); font-variant-numeric:tabular-nums }
.platform-row { border-bottom:1px solid var(--border); padding:16px 0; display:flex; gap:30px; align-items:start; flex-wrap:wrap }
.platform-row:first-of-type { padding-top:0 }
.platform-row .form { max-width:390px; margin-left:auto }
.confirmation-code { font:600 25px ui-monospace,monospace; background:var(--subtle); padding:15px 12px; text-align:center }
.secret { font-family:ui-monospace,monospace; overflow-wrap:anywhere; background:var(--subtle); padding:12px }
.news-post { padding:16px 0; border-bottom:1px solid var(--border) }
.news-post:last-child { border-bottom:0 }
.news-post .message-meta { margin:4px 0 12px }
.stat-slot { scroll-margin-top:18px }
.stat-frame { width:100%; border:0; display:block; background:var(--surface) }
.stat-mount { width:100%; overflow:hidden }
.stat-open { font-size:12px; margin:14px 0 0 }
.stat-load-warning { padding:8px; background:var(--notice) }
.stat-frame-body { background:var(--surface); padding:0; margin:0 }
.stat-document { padding:0; margin:0; display:flow-root }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0 }
@media(max-width:760px) { .settings-grid { grid-template-columns:1fr; gap:0 } .profile-layout { grid-template-columns:1fr; gap:16px } .profile-tabs { flex-direction:row; width:100%; } .profile-tabs a { flex:1; text-align:center; padding:10px; border-left:0; border-bottom:3px solid transparent } .profile-tabs a[aria-current=page] { border-bottom-color:var(--accent) } .profile-header { padding:18px; gap:15px } .profile-count { display:none } .avatar { width:58px;height:58px;font-size:28px } .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)) } .panel { padding:18px } }

.connection-footer { max-width:1112px; margin:0 auto; padding:18px 24px 28px; border-top:1px solid var(--border); color:var(--muted); font-size:13px }
.connection-footer strong { color:var(--text); font-variant-numeric:tabular-nums }
.message-label { display:flex; justify-content:space-between; gap:12px; align-items:center }
[data-character-count] { font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums }
[data-character-count].near-limit { color:var(--link); font-weight:600 }
[data-character-count].at-limit { color:var(--link); font-weight:700 }
.stat-standalone-body .stat-document { padding:0 0 10px }
.stat-standalone-body main { max-width:1000px }

.notification-unread { border-left: 3px solid var(--accent); padding-left: 1rem; }
[data-notification-badge] { font-size: .8em; font-weight: 700; }
.stat-subsection + .stat-subsection { margin-top:28px; padding-top:24px; border-top:2px solid var(--accent) }
.stat-subsection h2 { margin:0 0 8px; font-size:19px }

.profile-identity { min-width:0; flex:1 }
.profile-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-left:auto }
.profile-actions form { margin:0; flex-shrink:0 }
.profile-friend-request { display:flex; align-items:center; gap:8px }
.social-button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:42px; padding:8px 12px; font-weight:600 }
.social-icon { width:20px; height:20px; flex-shrink:0; vertical-align:middle }
.friend-button { background:#1769ad; border-color:#1769ad; color:#fff }
.friend-button:hover { background:#10558f; border-color:#10558f }
.block-button { background:#bd2638; border-color:#bd2638; color:#fff }
.block-button:hover { background:#a51e2e; border-color:#a51e2e }
button:disabled { cursor:default; opacity:.6 }
@media(max-width:760px) {
  .profile-header { padding:16px; gap:12px }
  .profile-header h1 { font-size:23px }
  .profile-header .avatar { width:48px; height:48px; font-size:26px }
  .profile-actions { align-items:flex-start; gap:8px }
  .profile-actions .social-button { width:44px; min-height:44px; padding:10px }
  .profile-actions .button-label { display:none }
  .profile-friend-request { flex-direction:column; gap:4px }
  .profile-actions .request-deny { width:44px; min-height:26px; padding:2px 0; font-size:12px; border:0; background:none; color:var(--muted) }
}
@media(max-width:480px) {
  .profile-header .avatar { display:none }
  .profile-header h1 { font-size:22px }
}
