:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  --bg: #10171e; --panel: #151f29; --surface: #1a2733; --line: #31414f;
  --text: #eef2f5; --muted: #aab9c9; --gold: #f2bc68; --green: #7cd7a6; --red: #ffaaa1;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; background: radial-gradient(ellipse at 15% 0, #1e2a34 0, var(--bg) 58vw); color: var(--text); min-height: 100vh }
.shell { width: min(1200px, calc(100% - 40px)); margin-inline: auto }
.top { background: #10171ef2; border-bottom: 1px solid var(--line) }
.top-inner, .section-head, .inline { display: flex; gap: 12px; align-items: center }
.top-inner, .section-head { justify-content: space-between; flex-wrap: wrap }
.top-inner { min-height: 70px; padding-block: 12px }
.top nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap }
a { color: var(--gold); text-underline-offset: 3px }
.top a { color: var(--text); text-decoration: none }
.top a:hover { color: var(--gold) }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .09em }
.brand strong { display: grid; place-items: center; width: 34px; height: 34px; color: #18140f; background: var(--gold); border-radius: 9px; font-size: 22px }
main { padding-block: clamp(26px, 4vw, 56px) 64px }
.heading { margin-bottom: 22px }
h1, h2, h3, p { margin: 0 }
h1 { font-size: clamp(27px, 5vw, 45px); line-height: 1.12; letter-spacing: -.035em }
h2 { font-size: 20px; line-height: 1.25 }
h3 { font-size: 15px; margin-bottom: 10px }
p, small { color: var(--muted); line-height: 1.5 }
.heading p, .panel p { margin-top: 8px }
.panel, .metric { padding: clamp(15px, 2vw, 23px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; min-width: 0 }
.panel { margin-bottom: 15px }
.auth { width: min(100%, 440px); margin: 0 auto }
.registration .heading { width: min(100%, 440px); margin-inline: auto }
.auth form, form:not(.inline) { margin-top: 14px }
form:not(.inline) { display: grid; gap: 12px; align-items: end }
#settings, #payout { grid-template-columns: repeat(2, minmax(0, 1fr)) }
.wide, #payout button, #settings button { grid-column: 1 / -1 }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); min-width: 0 }
input, select, textarea, button, .link-button { font: inherit; min-height: 40px; border: 1px solid var(--line); border-radius: 7px; padding: 8px 12px; color: var(--text) }
input, textarea, select { background: var(--bg); width: 100%; min-width: 0 }
textarea { resize: vertical }
button, .link-button { background: var(--surface); cursor: pointer; font-weight: 650; white-space: nowrap }
button:hover:not(:disabled) { border-color: var(--gold) }
button:disabled { opacity: .55; cursor: default }
.primary { color: #1b1a18; background: var(--gold); border-color: var(--gold) }
.link-button { display: inline-block; text-decoration: none }
.plain { background: transparent }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px }
.notice { margin-bottom: 15px; padding: 11px 14px; color: var(--text); border: 1px solid var(--line); border-radius: 8px; background: var(--surface) }
.notice[data-tone="error"], #operation-error { color: var(--red) }
.notice[data-tone="ok"] { color: var(--green) }
.balance-grid, .stats, .split { display: grid; gap: 12px }
.balance-grid { grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); margin-bottom: 15px }
.metric { display: grid; align-content: start; gap: 5px }
.metric span, .stats span { font-size: 13px; color: var(--muted) }
.metric strong { font-size: clamp(19px, 2.6vw, 30px); font-variant-numeric: tabular-nums; overflow-wrap: anywhere }
.metric:first-child { border-color: #755c3d }
.metric:first-child strong { color: var(--gold) }
.invite { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: center; gap: 16px }
.split { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px }
.stats { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); padding-block: 14px }
.stats div { display: grid; gap: 4px; padding: 10px; background: var(--surface); border-radius: 7px }
.charts { padding-top: 10px }
.chart { display: flex; gap: 4px; height: 86px; align-items: end; border-bottom: 1px solid var(--line); padding-bottom: 3px }
.chart i { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: var(--gold); height: 2px }
.chart i[data-negative] { background: var(--red) }
.chart-dates { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; padding-top: 5px }
.scroll { overflow: auto; margin-top: 12px }
table { width: 100%; border-collapse: collapse; font-size: 14px; text-align: left }
th, td { padding: 11px 9px; border-bottom: 1px solid var(--line); vertical-align: middle }
th { color: var(--muted); font-weight: 600 }
td { overflow-wrap: anywhere; min-width: 76px }
td:first-child { color: var(--text) }
td button { font-size: 13px; min-height: 34px; padding: 5px 9px; margin: 2px }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 10px; color: var(--muted) }
.chain { color: var(--gold); overflow-wrap: anywhere }
dialog { width: min(520px, calc(100% - 32px)); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 20px }
dialog::backdrop { background: #070a10cf }
#operation-fields { display: grid; gap: 12px }
#operation-fields p { white-space: pre-wrap; overflow-wrap: anywhere }
@media (max-width: 720px) {
  .shell { width: calc(100% - 28px) }
  .invite, .split { grid-template-columns: minmax(0, 1fr) }
  .top nav { font-size: 14px; width: 100% }
  .section-head .inline { flex-wrap: wrap }
  .section-head .inline input { flex: 1 1 130px }
  .section-head .inline select { width: auto }
}
@media (max-width: 380px) {
  .balance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  #settings, #payout { grid-template-columns: 1fr }
}
