:root {
  color-scheme: light dark;
  --bg: light-dark(#f2f4f0, #0d1110);
  --surface: light-dark(#ffffff, #161b19);
  --surface-2: light-dark(#e9ede8, #202722);
  --text: light-dark(#142018, #eff4f0);
  --muted: light-dark(#667269, #a9b5ad);
  --line: light-dark(#d9e0da, #303a34);
  --green: light-dark(#116a42, #6bd69e);
  --green-soft: light-dark(#e1f3e8, #173b29);
  --red: light-dark(#a33a35, #ff8f89);
  --red-soft: light-dark(#fae8e5, #40211f);
  --amber: light-dark(#845b11, #efbd61);
  --amber-soft: light-dark(#fff2d5, #3a2d17);
  --blue: light-dark(#245f9c, #78b9f7);
  --shadow: 0 18px 55px color-mix(in srgb, var(--text) 7%, transparent);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, a { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 22px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--text); color: var(--surface); font-weight: 700; }
.brand small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .13em; }
.brand strong { display: block; margin-top: 2px; font-size: 16px; font-weight: 650; }
.top-actions, .language-switch { display: flex; align-items: center; gap: 9px; }
.privacy-chip { padding: 7px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 600; }
.language-switch { padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.language-switch button { border: 0; border-radius: 7px; padding: 6px 8px; background: transparent; color: var(--muted); font-size: 12px; }
.language-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px color-mix(in srgb, var(--text) 10%, transparent); }
.signout-button { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: var(--surface); color: var(--muted); font-size: 12px; }
.layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); }
.sidebar { position: sticky; top: 69px; align-self: start; min-height: calc(100vh - 69px); padding: 22px 12px; border-right: 1px solid var(--line); background: var(--surface); }
.nav-link { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); text-align: left; }
.nav-link span:first-child { display: grid; place-items: center; width: 22px; color: var(--muted); }
.nav-link.is-active { background: var(--surface-2); color: var(--text); font-weight: 620; }
main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 30px 32px 60px; }
.view { display: none; }
.view.is-active { display: block; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 7px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: clamp(26px, 3.5vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 17px; }
.page-heading > div > p:last-child { margin-bottom: 0; color: var(--muted); }
.sync-pill, .tag { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 11px; white-space: nowrap; }
.sync-pill span { width: 7px; height: 7px; border-radius: 99px; background: var(--amber); }
.sync-pill b { color: var(--text); font-weight: 600; }
.safety-banner { display: flex; align-items: center; gap: 13px; margin-bottom: 15px; padding: 15px 17px; border: 1px solid color-mix(in srgb, var(--green) 24%, var(--line)); border-radius: 15px; background: var(--green-soft); color: var(--green); }
.safety-banner .shield { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; background: var(--green); color: var(--green-soft); font-weight: 800; }
.safety-banner strong { display: block; margin-bottom: 3px; }
.safety-banner p { margin: 0; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric, .panel, .safety-list article { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.metric { min-height: 126px; padding: 16px; }
.metric p { margin-bottom: 13px; color: var(--muted); font-size: 12px; }
.metric > strong { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; font-size: 19px; }
.metric small { display: block; color: var(--muted); font-size: 11px; line-height: 1.35; }
.status span { width: 8px; height: 8px; border-radius: 99px; background: currentColor; }
.status.offline { color: var(--red); }
.status.online { color: var(--green); }
.status b { font: inherit; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 14px; }
.panel { padding: 18px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.tag { color: var(--green); background: var(--green-soft); font-weight: 650; }
.tag.amber { color: var(--amber); background: var(--amber-soft); }
.market-visual { position: relative; min-height: 260px; overflow: hidden; border-radius: 12px; background: var(--surface-2); color: var(--blue); }
.market-visual svg { position: absolute; inset: 24px 0 0; width: 100%; height: 230px; }
.grid-line { fill: none; stroke: var(--line); stroke-width: 1; }
.area { fill: url(#area); }
.trend { fill: none; stroke: currentColor; stroke-width: 3; }
.chart-lock { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 24px; text-align: center; background: color-mix(in srgb, var(--surface-2) 66%, transparent); backdrop-filter: blur(2px); color: var(--text); }
.chart-lock > span { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 10px; border-radius: 14px; background: var(--surface); color: var(--blue); font-size: 24px; }
.chart-lock small { margin-top: 5px; color: var(--muted); }
.reason-list { display: grid; gap: 13px; }
.reason-list > div { display: flex; align-items: flex-start; gap: 10px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.reason-list > div:last-child { padding-bottom: 0; border-bottom: 0; }
.reason-list > div > span { display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--muted); font-size: 11px; font-weight: 700; }
.reason-list p { margin: 0; }
.reason-list strong, .reason-list small { display: block; }
.reason-list strong { margin: 1px 0 4px; font-size: 13px; }
.reason-list small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.progress-panel { margin-top: 14px; }
.progress-panel p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.progress { height: 10px; overflow: hidden; border-radius: 99px; background: var(--surface-2); }
.progress span { display: block; height: 100%; width: 0; background: var(--blue); transition: width .35s ease; }
.explainer { display: flex; gap: 13px; align-items: flex-start; }
.explainer-icon { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; background: var(--amber-soft); color: var(--amber); font-weight: 800; }
.explainer p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.safety-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.safety-list article { display: flex; align-items: center; gap: 12px; padding: 17px; }
.safety-check { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--green-soft); color: var(--green); font-weight: 800; }
.safety-list strong, .safety-list small { display: block; }
.safety-list strong { font-size: 13px; }
.safety-list small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.false-value { margin-left: auto; color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
@media (max-width: 880px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: sticky; top: 69px; z-index: 9; display: flex; min-height: auto; padding: 8px 12px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .nav-link { width: auto; min-width: max-content; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .two-column { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar { align-items: flex-start; padding: 12px 14px; }
  .privacy-chip { display: none; }
  main { padding: 24px 14px 48px; }
  .page-heading { flex-direction: column; }
  .metric-grid, .metric-grid.three, .safety-list { grid-template-columns: 1fr; }
  .metric { min-height: auto; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

.auth-page { min-height: 100vh; background: #eef0eb; color: #18231f; }
.auth-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: clamp(28px, 7vw, 90px); align-items: center; min-height: 100vh; max-width: 1080px; padding: 48px 28px; }
.auth-context { max-width: 520px; }
.auth-context h1 { max-width: 480px; font-size: clamp(38px, 6vw, 68px); color: #142018; }
.auth-context > p:not(.eyebrow) { color: #657269; font-size: 18px; }
.auth-boundary { display: grid; gap: 5px; margin-top: 30px; padding: 17px 19px; border: 1px solid #bdd8c8; border-radius: 14px; background: #e1f3e8; color: #165f3e; }
.auth-boundary span { font-size: 13px; line-height: 1.45; }
.auth-card { position: relative; padding: 34px; border: 1px solid #d8ded8; border-radius: 18px; background: #fff; box-shadow: 0 24px 70px rgba(20,32,24,.11); }
.auth-card[hidden] { display: none; }
.auth-card h2 { margin-bottom: 8px; color: #142018; font-size: 27px; }
.auth-intro, .auth-help, .password-note { color: #667269; font-size: 13px; line-height: 1.5; }
.auth-language { position: absolute; top: 22px; right: 22px; display: flex; gap: 3px; padding: 3px; border-radius: 9px; background: #edf0ec; }
.auth-language button { border: 0; border-radius: 6px; padding: 5px 7px; background: transparent; color: #69736d; font-size: 11px; }
.auth-language button[aria-pressed="true"] { background: #fff; color: #142018; box-shadow: 0 1px 4px rgba(20,32,24,.12); }
.auth-card form { display: grid; gap: 15px; margin-top: 24px; }
.auth-card label { display: grid; gap: 7px; color: #33423a; font-size: 12px; font-weight: 650; }
.auth-card input { width: 100%; border: 1px solid #ccd4ce; border-radius: 10px; padding: 12px 13px; background: #fff; color: #142018; font: inherit; outline: none; }
.auth-card input:focus { border-color: #287254; box-shadow: 0 0 0 3px rgba(40,114,84,.12); }
.primary-button { border: 0; border-radius: 10px; padding: 13px 16px; background: #1d5a43; color: #fff; font-weight: 700; }
.form-message { min-height: 20px; margin: -4px 0 0; color: #35634e; font-size: 12px; }
.form-message.is-error { color: #9c342f; }
.auth-help { margin: 20px 0 0; padding-top: 17px; border-top: 1px solid #e3e7e3; }
@media (max-width: 760px) {
  .auth-shell { grid-template-columns: 1fr; align-content: center; padding: 32px 18px; }
  .auth-context h1 { font-size: 38px; }
  .auth-context > p:not(.eyebrow) { font-size: 15px; }
  .auth-card { padding: 28px 22px; }
}
