:root {
  --bg: #0F1419;
  --side: #0B1015;
  --panel: #161C23;
  --inset: #11171D;
  --line: #252D37;
  --line-soft: #1E262F;
  --field: #2E3843;
  --text: #E6EAF0;
  --text-2: #C9D1DB;
  --muted: #9AA4B2;
  --accent: #4C8DFF;
  --accent-text: #7AAEFF;
  --up: #3FB68B;
  --down: #F26D78;
  --warn: #F5A524;
  --warn-text: #F5B85C;
  --violet: #B9A2FF;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, system-ui, sans-serif; }
a { color: var(--accent-text); }
a:hover { color: #A9CBFF; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; }

.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side {
  flex: 1 1 200px; padding: 24px 16px; background: var(--side);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 12px 20px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 17px; }
.nav-link {
  display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
}
.nav-link[aria-current="page"] { background: #1C2430; color: var(--text); font-weight: 600; }
.main {
  flex: 999 1 560px; min-width: 0; max-width: 1240px; padding: 32px 40px 48px;
  display: flex; flex-direction: column; gap: 20px; outline: none;
}

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 12px; }
.up { color: var(--up); }
.down { color: var(--down); }

.head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head-title { display: flex; flex-direction: column; gap: 6px; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 16px; font-weight: 600; }

.chip { font-size: 12px; font-weight: 600; border: 1px solid var(--field); color: var(--text-2); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.chip.green { color: var(--up); border-color: #23493B; }
.chip.blue { color: var(--accent-text); border-color: #2B3A55; }
.chip.amber { color: var(--warn-text); border-color: #5C4527; }
.chip.violet { color: var(--violet); border-color: #3E3463; }
.chip.gray { color: var(--text-2); border-color: #3A4552; }
.tag { align-self: flex-start; font-size: 12px; font-weight: 600; color: var(--text-2); background: var(--line-soft); border-radius: 6px; padding: 3px 8px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > .panel { flex: 1 1 400px; }
.row.top { align-items: flex-start; }

.market { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; border-radius: 12px; padding: 16px 20px; font-size: 14px; color: var(--text-2); border: 1px solid; }
.market strong.status { font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 10px; }
.market .dot { width: 12px; height: 12px; border-radius: 50%; }
.market.good { background: #11201B; border-color: #23493B; }
.market.good .dot { background: var(--up); }
.market.caution { background: #221B10; border-color: #5C4527; }
.market.caution .dot { background: var(--warn); }
.market.bad { background: #241316; border-color: #5A2A31; }
.market.bad .dot { background: var(--down); }

.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tab {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer;
}
.tab[aria-selected="true"] { background: #1B2A44; border-color: var(--accent); color: var(--text); }
.tab .count { font-family: var(--mono); opacity: 0.8; margin-left: 4px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 12px; font-weight: 600; color: var(--muted); }
.input, select.input {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--field); border-radius: 8px;
  background: var(--bg); color: var(--text); font-size: 14px;
}
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; color: var(--text-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.cards { display: flex; flex-wrap: wrap; gap: 16px; }
.card {
  flex: 1 1 320px; min-width: 0; max-width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 14px;
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sym { font-size: 20px; font-weight: 700; }
.name { font-size: 13px; color: var(--muted); }
.card-mid { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.price { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; background: var(--inset); border-radius: 10px; padding: 12px; }
.level { display: flex; flex-direction: column; gap: 2px; }
.level span:first-child { font-size: 12px; color: var(--muted); }
.level span:last-child { font-family: var(--mono); font-size: 15px; font-weight: 600; }
.stats { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.stats strong { color: var(--text); }
.card-link { display: flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: none; }
.empty { padding: 32px; text-align: center; color: var(--muted); border: 1px dashed var(--field); border-radius: 12px; }

.back { align-self: flex-start; display: flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; text-decoration: none; }
.big-price { font-family: var(--mono); font-size: 28px; font-weight: 600; }
.chart { width: 100%; height: 420px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 16px; height: 3px; margin-right: 6px; vertical-align: middle; }

.plan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.plan > div { background: var(--inset); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.plan .v { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.sizer { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 16px; }
.sizer .row > .field { flex: 1 1 140px; }
.sizer-out { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.sizer-out strong { font-family: var(--mono); color: var(--text); }

.checks { display: flex; flex-direction: column; }
.check-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.letter { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; background: var(--line-soft); font-family: var(--mono); font-weight: 700; }
.check-row .t { font-size: 14px; font-weight: 600; }
.check-row .d { font-size: 13px; color: var(--muted); }
.mark { font-size: 12px; font-weight: 700; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px 0; border-bottom: 1px solid var(--line); }
.table td { text-align: right; font-family: var(--mono); padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.table th:first-child, .table td:first-child { text-align: left; }

.footnote { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Market overview */
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; border: 1px solid; border-radius: 14px; padding: 22px 24px; }
.hero.good { background: #11201B; border-color: #23493B; }
.hero.caution { background: #221B10; border-color: #5C4527; }
.hero.bad { background: #241316; border-color: #5A2A31; }
.hero-main { display: flex; align-items: center; gap: 16px; }
.hero .dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.hero.good .dot, .tl-dot.good { background: var(--up); }
.hero.caution .dot, .tl-dot.caution { background: var(--warn); }
.hero.bad .dot, .tl-dot.bad { background: var(--down); }
.hero-status { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.hero-advice { font-size: 14px; color: var(--text-2); margin-top: 4px; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.timeline li { display: flex; align-items: center; gap: 8px; }
.timeline .mono { width: 52px; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; }

.seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { min-height: 38px; min-width: 56px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button[aria-selected="true"] { background: #252D37; color: var(--text); }
.stat-strip { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.stat-strip > div { display: flex; flex-direction: column; gap: 2px; }
.stat-strip .mono { font-size: 16px; font-weight: 600; }
.mini-chart { width: 100%; height: 180px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--inset); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile-v { font-family: var(--mono); font-size: 22px; font-weight: 600; }

.groups { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.group { display: grid; grid-template-columns: 24px minmax(0, 1fr) 110px auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.g-rank { color: var(--muted); font-size: 13px; }
.g-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; font-weight: 600; }
.g-name .small { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-rs { display: flex; align-items: center; gap: 8px; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.more summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-text); min-height: 44px; display: flex; align-items: center; }

@media (max-width: 720px) {
  .group { grid-template-columns: 20px minmax(0, 1fr) auto; }
  .group .g-rs { display: none; }
  .hero-status { font-size: 19px; }
}

@media (max-width: 720px) {
  .main { padding: 20px 16px 40px; }
  .side { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 4px 12px 4px 0; }
  .chart { height: 320px; }
}
