:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #f5f2fd;
  background: #100e18;
  --muted: #bdb3ce;
  --subtle: #a597bd;
  --accent: #d4bbff;
  --line: #3d3452;
  --panel: #211b31;
  --gap: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  line-height: 1.5;
  background: radial-gradient(ellipse at 66% 0, #251a3b 0, transparent 54%), #100e18;
}
p, h1, h2 { margin: 0; }
button, a { color: inherit; }
a { text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid #cfb1ff; outline-offset: 3px; }
#title:focus { outline: none; }
.symbols { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 19px; height: 19px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.shell {
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100svh; width: min(100%, 1580px); margin: 0 auto;
}
.rail {
  position: sticky; top: 0; min-height: 600px; height: 100svh;
  display: flex; flex-direction: column; gap: 12px;
  padding: 26px 15px 18px;
  border-right: 1px solid #30283f;
  background: linear-gradient(160deg, #191423, #12101b 70%);
}
.brand { display: flex; align-items: center; gap: 12px; align-self: start; padding: 0 9px 19px; }
.brand strong { display: block; font-size: 1.3rem; line-height: 1.12; letter-spacing: -.025em; }
.brand small { color: var(--subtle); font-size: .66rem; font-weight: 650; letter-spacing: .17em; }
.brand-mark, .icon-tile, .avatar {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px;
  border: 1px solid #6a4d99; border-radius: 11px; color: #e6d4ff;
  background: linear-gradient(145deg, #62439b, #302043);
}
.brand-mark { width: 42px; height: 42px; box-shadow: 0 0 24px #9e66ff44; }
.brand-mark .icon { width: 23px; height: 23px; }
.launch-card {
  width: min(calc(100% - 28px), 390px); margin: 12vh auto 0;
  padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
}
.launch-card .brand-mark { margin-bottom: 13px; }
.launch-card p { margin-top: 8px; }
#retry-launch { margin-top: 12px; }
.rail-label {
  padding: 0 11px; color: var(--subtle); font-size: .67rem;
  letter-spacing: .11em; text-transform: uppercase; font-weight: 650;
}
nav { display: grid; gap: 6px; }
nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 11px;
  min-height: 44px; border: 1px solid transparent; border-radius: 10px;
  color: var(--muted); font-size: .9rem; font-weight: 600;
}
nav a .icon { color: #baa9d6; }
nav a:hover { color: #fff; background: #282035; }
nav a[aria-current="page"] {
  color: #fff; border-color: #9963e5;
  background: linear-gradient(115deg, #7144c6, #50317f);
  box-shadow: 0 5px 20px #7c40ea33, inset 0 1px #ddc7ff35;
}
nav a[aria-current="page"] .icon { color: #f6ecff; }
.rail-footer {
  margin-top: auto; padding: 11px 7px 0; border-top: 1px solid #332b44;
  display: flex; align-items: center; gap: 9px; font-size: .8rem;
}
.rail-footer small { display: block; color: var(--subtle); }
.avatar { width: 32px; height: 32px; border-radius: 50%; font-weight: 700; }
.workspace { min-width: 0; }
.topbar {
  min-height: 65px; padding: 12px clamp(20px, 3.2vw, 46px);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid #392d48; background: #1b1526b3;
}
.breadcrumb { display: flex; gap: 8px; color: var(--subtle); font-size: .84rem; }
.breadcrumb strong { color: #eee7fb; font-weight: 600; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; width: max-content;
  min-height: 25px; padding: 3px 9px; border: 1px solid #554467; border-radius: 8px;
  background: #332745; color: #e2d0f7; font-size: .74rem; font-weight: 600; white-space: nowrap;
}
.chip[data-tone="good"] { color: #b7f4dc; background: #253c3a; border-color: #3b6257; }
.chip[data-tone="warn"] { color: #f7d9a2; background: #46352c; border-color: #735741; }
.chip[data-tone="error"] { color: #ffb9c3; background: #4c2935; border-color: #865065; }
.chip[data-tone="neutral"] { color: #dfd7e9; background: #393140; border-color: #61566d; }
.status-badge { max-width: 100%; white-space: normal; }
.status-badge::before {
  content: ""; width: .48rem; height: .48rem; flex: none;
  border-radius: 50%; background: currentColor; box-shadow: 0 0 .55rem currentColor;
}
.content { padding: 25px clamp(20px, 3.2vw, 46px) 18px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.eyebrow {
  color: #ccabff; font-size: .72rem; font-weight: 730; letter-spacing: .16em; text-transform: uppercase;
}
h1 { margin: 3px 0 5px; font-size: clamp(1.72rem, 3vw, 2.35rem); letter-spacing: -.037em; line-height: 1.16; }
.muted { color: var(--muted); font-size: .92rem; }
.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 42px; padding: 8px 13px;
  border: 1px solid #544269; border-radius: 9px;
  color: #f6edff; background: #30243e; font-size: .85rem; font-weight: 650;
}
.button-primary {
  background: linear-gradient(130deg, #7845d3, #563395); border-color: #9865de;
  box-shadow: 0 5px 18px #783bd24a, inset 0 1px #c6a5fa55;
}
.button:hover { border-color: #c69cfb; filter: brightness(1.12); }
.button:disabled { opacity: .65; cursor: default; filter: none; }
.card {
  min-width: 0; border: 1px solid var(--line); border-radius: 15px;
  background: linear-gradient(145deg, #282036 0, #211b30 48%, #1b1727 100%);
  box-shadow: inset 0 1px #a789d21b, 0 10px 25px #06040c2b;
}
#account-content, .period-grid { display: grid; gap: var(--gap); }
.period-grid, #account-content[data-page="home"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-card {
  display: grid; align-content: start; justify-items: start; gap: 9px;
  padding: clamp(14px, 2.3vw, 21px);
  background: radial-gradient(ellipse at 0 0, #35244a, transparent 70%), #211b30;
}
.account-card h2 { color: #efe4fa; font-size: 1rem; font-weight: 670; }
.account-card time { color: var(--muted); font-size: .78rem; }
.balance-card { background: radial-gradient(ellipse at 8% 0, #513475, transparent 82%), #211b30; }
.balance-card > .metric-value { font-size: clamp(1.45rem, 3vw, 2.1rem); }
.balance-cost {
  display: grid; gap: 4px; width: 100%; padding-top: 12px; margin-top: 4px;
  border-top: 1px solid var(--line);
}
.balance-cost h3 { margin: 0; font-weight: 550; }
.balance-cost .metric-value { color: #d7c7e7; font-size: 1.05rem; }
.metric-value {
  font-size: clamp(1.2rem, 2.4vw, 1.72rem); line-height: 1.2; letter-spacing: -.025em;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.account-message:not(:empty) { margin-bottom: 14px; }
.text-link {
  display: inline-flex; align-items: center; min-height: 38px;
  color: var(--accent); font-size: .85rem; font-weight: 660;
}
.text-link:hover { text-decoration: underline; }
.chart-period, .decimal-field {
  display: grid; gap: 5px; color: var(--muted); font-size: .84rem;
}
.chart-period select, .decimal-field input {
  width: 100%; min-height: 42px; padding: 7px 10px;
  border: 1px solid #66527f; border-radius: 8px;
  background: #241b31; color: inherit; font: inherit;
}
.account-form { display: grid; justify-items: start; gap: 12px; width: min(100%, 340px); }
.decimal-field { width: 100%; }
.currency-chart { display: grid; gap: 12px; width: 100%; }
.currency-layout {
  display: grid; grid-template-columns: minmax(95px, 156px) minmax(0, 255px);
  align-items: center; gap: clamp(10px, 3vw, 22px);
}
.currency-ring { position: relative; animation: chart-enter .36s ease-out both; }
.currency-ring svg { display: block; width: 100%; }
.currency-center {
  position: absolute; inset: 0; display: grid; align-content: center; justify-items: center;
  pointer-events: none; line-height: 1.15;
}
.currency-percent { font-size: clamp(1rem, 5vw, 1.5rem); font-variant-numeric: tabular-nums; }
.currency-center .muted { font-size: .69rem; }
.currency-legend { display: grid; gap: 7px; min-width: 0; }
[data-currency="stars"] { --currency-color: #f9c65a; }
[data-currency="gram"] { --currency-color: #b38aff; }
[data-currency="unknown"] { --currency-color: #8fa2b8; }
.currency-arc {
  fill: none; stroke: var(--currency-color); stroke-width: 15; opacity: .65;
  cursor: pointer; transition: opacity .2s, stroke-width .2s;
}
.currency-arc.selected { opacity: 1; stroke-width: 19; }
.currency-row { justify-content: start; text-align: start; overflow-wrap: anywhere; }
.currency-row::before {
  content: ""; flex: 0 0 9px; height: 9px; border-radius: 50%; background: var(--currency-color);
}
.currency-row[aria-pressed="true"] { background: #493360; border-color: #a477d8; }
.bot-menu { display: grid; gap: 12px; margin: 0 0 4px; }
.bot-menu-entry dt { font-weight: 650; }
.bot-menu-entry dd { margin: 2px 0 0; }
.settings-values {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px;
  width: min(100%, 480px); margin: 0; font-size: .87rem;
}
.settings-values dt { color: var(--muted); }
.settings-values dd { margin: 0; text-align: end; font-weight: 600; }
#account-content > *, nav a { animation: panel-enter .2s ease-out both; }
@keyframes panel-enter {
  from { opacity: .72; transform: translateY(3px); }
}
@keyframes chart-enter {
  from { opacity: .35; transform: scale(.94); }
}
@media (prefers-reduced-motion: reduce) {
  #account-content > *, nav a, .currency-ring { animation: none; }
  .currency-arc { transition: none; }
}
.chart-readout { color: #e2c9ff; font-size: .86rem; font-weight: 650; overflow-wrap: anywhere; }
footer { padding-top: 18px; color: var(--subtle); font-size: .75rem; }

@media (max-width: 1080px) {
  .shell { grid-template-columns: 194px minmax(0, 1fr); }
  :root { --gap: 12px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto; min-height: auto; padding: 14px 20px;
    border: 0; border-bottom: 1px solid var(--line);
  }
  .brand { padding: 0; }
  .rail-label, .rail-footer { display: none; }
  nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  nav a { background: #231b2f; border-color: #392c4b; }
}
@media (max-width: 610px) {
  .rail { padding: 12px 13px; gap: 9px; }
  .brand-mark { width: 36px; height: 36px; }
  nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  nav a { min-height: 40px; padding: 7px 8px; font-size: .81rem; }
  nav a .icon { width: 16px; height: 16px; }
  .topbar { padding: 8px 13px; min-height: 45px; }
  .breadcrumb { font-size: .72rem; gap: 4px; }
  .content { padding: 15px 13px; }
  .page-heading { align-items: start; flex-direction: column; gap: 10px; margin-bottom: 15px; }
  .page-heading .button { min-height: 39px; }
  .period-grid, #account-content[data-page="home"] { grid-template-columns: minmax(0, 1fr); }
}
