:root {
  --bg: #0b0d12;
  --bg-2: #0e1118;
  --card: #171b26;
  --card-2: #131722;
  --input: #10131b;
  --border: #252a37;
  --border-2: #313748;
  --text: #eef0f5;
  --text-2: #c9cdd8;
  --muted: #8b92a5;
  --lime: #c2ff0a;
  --lime-2: #aee600;
  --lime-glow: rgba(194, 255, 10, .35);
  --danger: #ff6b7a;
  --radius: 22px;
  --radius-sm: 12px;
  --font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", "PT Serif", serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}
main { flex: 1; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right)); }
@media (min-width: 768px) { .container { padding: 0 28px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(17, 20, 29, .86);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.site-header::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 140% at 30% 0%, rgba(194, 255, 10, .10), transparent 70%);
}
.header-inner { display: flex; align-items: center; height: 72px; position: relative; }
.brand { display: inline-flex; align-items: center; gap: 16px; text-decoration: none; color: var(--lime); }
.brand-logo {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  background: var(--bg); box-shadow: 0 0 0 2.5px var(--lime), 0 0 18px var(--lime-glow);
  flex: none;
}
.brand-logo svg { width: 42px; height: 42px; display: block; }
.brand-name { font-weight: 800; font-size: 24px; letter-spacing: -.02em; text-shadow: 0 0 22px rgba(194, 255, 10, .25); }
@media (max-width: 480px) {
  .header-inner { height: 64px; }
  .brand { gap: 14px; }
  .brand-logo { width: 46px; height: 46px; }
  .brand-logo svg { width: 38px; height: 38px; }
  .brand-name { font-size: 21px; }
}

/* ---------- Tool switch ---------- */
.tool-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin: 28px 0 0; padding: 8px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 999px;
}
.tool-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 8px 16px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); font-weight: 500; font-size: 17px;
  transition: background-color .25s, color .25s, box-shadow .25s;
}
.tool-btn:hover { color: var(--text); }
.tool-btn.active { background: var(--lime); color: #0b0d12; font-weight: 700; box-shadow: 0 6px 24px rgba(194, 255, 10, .28); }
.tool-btn svg { flex: none; }
.lbl-short { display: none; }
@media (max-width: 560px) {
  .tool-switch { margin-top: 20px; padding: 6px; gap: 6px; }
  .tool-btn { min-height: 48px; font-size: 15px; gap: 8px; padding: 6px 10px; }
  .tool-btn svg { width: 18px; height: 18px; }
  .lbl-full { display: none; }
  .lbl-short { display: inline; }
}

/* ---------- Page heading ---------- */
.tool { padding-bottom: 48px; animation: fadeIn .35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.page-title {
  margin: 48px 0 18px; text-align: center; color: var(--lime);
  font-weight: 800; font-size: clamp(28px, 5.2vw, 46px); line-height: 1.12; letter-spacing: -.025em;
  text-shadow: 0 0 40px rgba(194, 255, 10, .18);
}
.lead { max-width: 900px; margin: 0 auto 36px; text-align: center; color: var(--muted); font-size: 17px; line-height: 1.6; }
@media (max-width: 560px) { .page-title { margin-top: 32px; } .lead { font-size: 15.5px; margin-bottom: 26px; } }

/* ---------- Quote ---------- */
.quote {
  display: flex; align-items: center; gap: 32px;
  max-width: 870px; margin: 0 auto 48px; padding: 32px 36px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.quote-avatar {
  flex: none; width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #ffffff, #e2e4e9);
  box-shadow: 0 0 0 3px var(--border-2);
  display: grid; place-items: center; overflow: hidden;
}
.quote-avatar img { width: 100%; height: 100%; object-fit: cover; }
.quote-avatar span { font: italic 700 34px/1 var(--serif); color: #23262e; letter-spacing: -.02em; }
.quote blockquote { margin: 0; }
.quote p { margin: 0 0 10px; font: italic 400 20px/1.6 var(--serif); color: var(--muted); }
.quote figcaption { color: var(--lime); font-weight: 700; font-size: 16px; }
@media (max-width: 560px) {
  .quote { gap: 18px; padding: 22px 20px; margin-bottom: 32px; }
  .quote-avatar { width: 68px; height: 68px; }
  .quote-avatar span { font-size: 24px; }
  .quote p { font-size: 17px; }
}

/* ---------- Card / form ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.form { padding: 36px; }
@media (max-width: 560px) { .form { padding: 24px 20px; } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 32px; }
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; gap: 22px; } }
.field { display: flex; flex-direction: column; min-width: 0; }
.field.full { margin-bottom: 26px; }
.field > label, .field-label { font-weight: 600; font-size: 16px; margin-bottom: 12px; color: var(--text); }
.hint { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.4; }
.err { color: var(--danger); font-size: 13.5px; margin-top: 6px; display: none; }
.field.invalid .err { display: block; }
.field.invalid input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(255, 107, 122, .14); }

input[type="text"], select {
  width: 100%; height: 60px; padding: 0 22px;
  background: var(--input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 19px; color: var(--text); outline: none;
  transition: border-color .2s, box-shadow .2s;
  -webkit-appearance: none; appearance: none;
  font-variant-numeric: tabular-nums;
}
input[type="text"]:hover, select:hover { border-color: var(--border-2); }
input[type="text"]:focus, select:focus { border-color: rgba(194, 255, 10, .6); box-shadow: 0 0 0 3px rgba(194, 255, 10, .12); }
.select { position: relative; }
.select select { padding-right: 52px; cursor: pointer; }
.select::after {
  content: ""; position: absolute; right: 24px; top: 50%; width: 9px; height: 9px; margin-top: -7px;
  border-right: 2px solid var(--text-2); border-bottom: 2px solid var(--text-2);
  transform: rotate(45deg); pointer-events: none;
}
select option { background: #151925; color: var(--text); }
@media (max-width: 560px) { input[type="text"], select { height: 56px; font-size: 18px; padding: 0 18px; } }

.term { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 14px; }
.term span { color: var(--muted); font-size: 16px; }

/* switch */
.toggle-field { justify-content: center; }
.switch { display: inline-flex; align-items: center; gap: 16px; cursor: pointer; user-select: none; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track {
  position: relative; width: 56px; height: 30px; border-radius: 999px; flex: none;
  background: #2a3040; transition: background-color .25s, box-shadow .25s;
}
.switch-track::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%;
  background: #cfd3dc; transition: transform .25s cubic-bezier(.3, .7, .4, 1), background-color .25s;
}
.switch input:checked + .switch-track { background: var(--lime); box-shadow: 0 0 14px rgba(194, 255, 10, .3); }
.switch input:checked + .switch-track::after { transform: translateX(26px); background: #11141c; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--lime); outline-offset: 3px; }
.switch-label { font-weight: 600; font-size: 17px; }

.btn-primary {
  display: block; width: 100%; height: 62px; margin-top: 34px; border: 0; border-radius: 999px;
  background: linear-gradient(90deg, #c6ff12, #b4f000);
  color: #0b0d12; font-weight: 800; font-size: 18px; letter-spacing: .14em; text-transform: uppercase;
  box-shadow: 0 8px 28px rgba(194, 255, 10, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .15s, box-shadow .2s, filter .2s;
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 10px 34px rgba(194, 255, 10, .38), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn-primary:active { transform: scale(.985); }
@media (max-width: 560px) { .btn-primary { height: 60px; margin-top: 28px; font-size: 19px; } }

/* ---------- Results ---------- */
.results { margin-top: 36px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 960px) { .stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; gap: 14px; } }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 18px; text-align: center; min-width: 0;
  display: flex; flex-direction: column; justify-content: center;
}
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; line-height: 1.35; }
.stat-value {
  margin-top: 12px; font-weight: 800; font-size: clamp(22px, 2.3vw, 27px); letter-spacing: -.01em;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2;
}
.stat-value.accent { color: var(--lime); }
.stat-sub { margin-top: 6px; color: var(--muted); font-size: 13.5px; }
.stat-sub:empty { display: none; }
.stat.primary { border-color: rgba(194, 255, 10, .45); box-shadow: inset 0 0 0 1px rgba(194, 255, 10, .12), 0 0 30px rgba(194, 255, 10, .07); }
.stat.primary .stat-value { color: var(--lime); }
@media (max-width: 520px) { .stat { padding: 22px 16px; } .stat-value { font-size: 26px; } }

.summary {
  margin-top: 26px; padding: 30px 34px;
  background: var(--card); border: 1px solid var(--border); border-left: 5px solid var(--lime);
  border-radius: var(--radius); color: var(--muted); font-size: 19px; line-height: 1.75;
}
.summary b { color: var(--lime); font-weight: 700; white-space: nowrap; }
.summary.warn { border-left-color: #ffb547; }
.summary.warn b { color: #ffcf7a; }
.summary:empty { display: none; }
@media (max-width: 560px) { .summary { padding: 24px 22px 24px 26px; font-size: 18px; } .summary b { white-space: normal; } }

.details { margin-top: 26px; padding: 6px 0; }
.details > summary {
  list-style: none; cursor: pointer; padding: 18px 30px; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: space-between;
}
.details > summary::-webkit-details-marker { display: none; }
.details > summary::after {
  content: ""; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s; margin-right: 6px;
}
.details[open] > summary::after { transform: rotate(-135deg); }
.kv { margin: 0; padding: 0 30px 18px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.kv dd.pos { color: var(--lime); }
.kv dd.neg { color: var(--danger); }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; padding: 0 20px 14px; } .details > summary { padding: 16px 20px; } }

.view { margin-top: 26px; }
.gran { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.gran button {
  border: 1px solid var(--border); background: var(--card-2); color: var(--muted);
  border-radius: 999px; padding: 7px 16px; font-size: 14px; transition: all .2s;
}
.gran button.active { color: #0b0d12; background: var(--lime); border-color: var(--lime); font-weight: 600; }

.view-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px;
  background: var(--card-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.view-tabs button {
  min-height: 52px; padding: 8px 10px; border: 0; border-radius: 14px; background: transparent;
  color: var(--muted); font-size: 16px; line-height: 1.25; transition: background-color .25s, color .25s, box-shadow .25s;
}
.view-tabs button:hover { color: var(--text); }
.view-tabs button.active { background: var(--lime); color: #0b0d12; font-weight: 700; box-shadow: 0 6px 20px rgba(194, 255, 10, .25); }
@media (max-width: 620px) { .view-tabs { grid-template-columns: 1fr 1fr; } .view-tabs button { font-size: 15.5px; min-height: 56px; } }

.table-wrap, .chart-wrap {
  margin-top: 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 16px; }
th, td { padding: 16px 14px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 22px; color: var(--muted); }
th:last-child, td:last-child { padding-right: 22px; }
thead th { background: #1b2030; color: var(--muted); font-size: 13.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; position: sticky; top: 0; }
tbody tr { border-top: 1px solid #222736; }
tbody tr:hover { background: rgba(255, 255, 255, .02); }
td.pos { color: var(--lime); }
td.neg { color: var(--danger); }
tfoot td { border-top: 1px solid var(--border-2); font-weight: 700; color: var(--text); background: #1a1f2c; }
tfoot td:first-child { color: var(--text); }
@media (max-width: 560px) {
  table { font-size: 13.5px; letter-spacing: -.01em; }
  th, td { padding: 13px 5px; }
  th:first-child, td:first-child { padding-left: 12px; }
  th:last-child, td:last-child { padding-right: 12px; }
  thead th { font-size: 10.5px; letter-spacing: .02em; }
}
@media (max-width: 380px) {
  table { font-size: 12.5px; }
  th, td { padding: 12px 4px; }
  th:first-child, td:first-child { padding-left: 10px; }
  th:last-child, td:last-child { padding-right: 10px; }
  thead th { font-size: 10px; letter-spacing: 0; }
}
.show-all { display: block; width: 100%; padding: 16px; border: 0; border-top: 1px solid var(--border); background: transparent; color: var(--lime); font-weight: 600; }
.show-all:hover { background: rgba(194, 255, 10, .05); }

.chart-wrap { padding: 22px 20px 16px; }
.chart-box { position: relative; height: 380px; }
@media (max-width: 560px) { .chart-wrap { padding: 16px 10px 10px; } .chart-box { height: 340px; } }
.chart-msg { text-align: center; color: var(--muted); margin: 12px 0 0; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
@media (max-width: 620px) { .actions { grid-template-columns: 1fr; gap: 12px; } }
.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: 58px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--card-2);
  color: var(--text-2); font-size: 18px; font-weight: 500; transition: border-color .2s, color .2s, background-color .2s;
}
.btn-ghost:hover { border-color: rgba(194, 255, 10, .5); color: var(--lime); }
.btn-ghost:active { background: #1a1f2c; }

/* ---------- Footer, toast ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; text-align: center; }
.site-footer p { margin: 0; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 100; padding: 12px 22px; border-radius: 999px;
  background: var(--lime); color: #0b0d12; font-weight: 700; box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  animation: toastIn .25s ease both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
input:focus-visible, select:focus-visible { outline: none; }


/* ---------- Переключатель темы (луна / солнце) ---------- */
.header-inner { justify-content: space-between; gap: 12px; }
.theme-toggle {
  position: relative; flex: none; width: 76px; height: 40px; padding: 0;
  border-radius: 999px; border: 1px solid var(--border-2); background: var(--card-2);
  display: inline-flex; align-items: center; justify-content: space-between;
}
.theme-toggle .tt-icon { position: relative; z-index: 1; width: 38px; display: block; transition: color .3s; }
.theme-toggle .tt-sun { color: var(--muted); }
.theme-toggle .tt-moon { color: #0b0d12; }
.tt-knob {
  position: absolute; top: 3px; left: 3px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--lime); box-shadow: 0 0 14px rgba(194, 255, 10, .45);
  transform: translateX(36px); transition: transform .35s cubic-bezier(.3, .7, .4, 1), background-color .3s, box-shadow .3s;
}
.theme-toggle:hover { border-color: rgba(194, 255, 10, .5); }
.theme-toggle:hover .tt-sun { color: var(--text); }
@media (max-width: 400px) { .theme-toggle { width: 68px; height: 36px; } .theme-toggle .tt-icon { width: 34px; } .tt-knob { width: 28px; height: 28px; transform: translateX(32px); } }

/* Плавная смена темы только в момент переключения */
html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease, fill .35s ease !important;
}

/* =====================================================================
   Светлая тема — в стиле Tag Markets: белый фон, off-white карточки,
   тонкие линии, почти чёрный текст, лаймовые кнопки, чёрные активные элементы
   ===================================================================== */
html[data-theme="light"] {
  --bg: #ffffff;
  --card: #f4f4f1;
  --card-2: #f4f4f1;
  --input: #ffffff;
  --border: #e4e4df;
  --border-2: #d8d8d4;
  --text: #050505;
  --text-2: #292a2e;
  --muted: #696969;
  --lime: #cafd5d;
  --accent: #4d7c0f;
  --danger: #d92d3f;
  color-scheme: light;
}
html[data-theme="light"] body { background: #fff; color: #050505; }
html[data-theme="light"] .theme-toggle { background: #f4f4f1; border-color: #e4e4df; }
html[data-theme="light"] .tt-knob { transform: translateX(0); background: #050505; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
html[data-theme="light"] .theme-toggle .tt-sun { color: #cafd5d; }
html[data-theme="light"] .theme-toggle .tt-moon { color: #7d818a; }
html[data-theme="light"] .theme-toggle:hover { border-color: #050505; }
html[data-theme="light"] .theme-toggle:hover .tt-moon { color: #050505; }
@media (max-width: 400px) { html[data-theme="light"] .tt-knob { transform: translateX(0); } }

html[data-theme="light"] .site-header { background: rgba(255, 255, 255, .9); border-bottom-color: #e4e4df; }
html[data-theme="light"] .site-header::before { background: radial-gradient(50% 140% at 25% 0%, rgba(202, 253, 93, .28), transparent 70%); }
html[data-theme="light"] .brand-name { color: #050505; text-shadow: none; }
html[data-theme="light"] .brand-logo { background: #fff; box-shadow: 0 0 0 2px #050505, 0 4px 14px rgba(160, 210, 30, .35); }

html[data-theme="light"] .tool-switch { background: #f4f4f1; border-color: #e4e4df; }
html[data-theme="light"] .tool-btn { color: #696969; }
html[data-theme="light"] .tool-btn:hover { color: #050505; }
html[data-theme="light"] .tool-btn.active { background: #050505; color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .16); }
html[data-theme="light"] .tool-btn.active svg { color: #cafd5d; }

html[data-theme="light"] .page-title { color: #050505; text-shadow: none; }
html[data-theme="light"] .page-title::after {
  content: ""; display: block; width: 72px; height: 6px; margin: 16px auto 0; border-radius: 999px; background: #cafd5d;
}
html[data-theme="light"] .quote { background: #f4f4f1; border-color: #e4e4df; }
html[data-theme="light"] .quote-avatar { box-shadow: 0 0 0 3px #fff, 0 0 0 4px #e4e4df; }
html[data-theme="light"] .quote p { color: #3e3e3a; }
html[data-theme="light"] .quote figcaption { color: #050505; }
html[data-theme="light"] .quote figcaption::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; background: #cafd5d; box-shadow: 0 0 0 2px #050505; vertical-align: 1px; }

html[data-theme="light"] .card { background: #f4f4f1; border-color: #e4e4df; }
html[data-theme="light"] input[type="text"], html[data-theme="light"] select { background: #fff; border-color: #d1d5db; color: #050505; }
html[data-theme="light"] input[type="text"]:hover, html[data-theme="light"] select:hover { border-color: #9ca3af; }
html[data-theme="light"] input[type="text"]:focus, html[data-theme="light"] select:focus { border-color: #a3d900; box-shadow: 0 0 0 3px rgba(202, 253, 93, .45); }
html[data-theme="light"] select option { background: #fff; color: #050505; }
html[data-theme="light"] .select::after { border-color: #374151; }
html[data-theme="light"] .field.invalid input { box-shadow: 0 0 0 3px rgba(217, 45, 63, .12); }

html[data-theme="light"] .switch-track { background: #d1d5db; }
html[data-theme="light"] .switch-track::after { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
html[data-theme="light"] .switch input:checked + .switch-track { background: #cafd5d; box-shadow: inset 0 0 0 1px #a3d900; }
html[data-theme="light"] .switch input:checked + .switch-track::after { background: #050505; }

html[data-theme="light"] .btn-primary {
  background: #cafd5d; color: #101010;
  box-shadow: 0 6px 18px rgba(160, 210, 30, .35), inset 0 -2px 0 rgba(0, 0, 0, .06);
}
html[data-theme="light"] .btn-primary:hover { background: #bff33f; filter: none; box-shadow: 0 8px 24px rgba(160, 210, 30, .45); }

html[data-theme="light"] .stat { background: #f4f4f1; border-color: #e4e4df; }
html[data-theme="light"] .stat-value.accent { color: var(--accent); }
html[data-theme="light"] .stat.primary { background: #cafd5d; border-color: #b6e83f; box-shadow: 0 8px 24px rgba(160, 210, 30, .25); }
html[data-theme="light"] .stat.primary .stat-value, html[data-theme="light"] .stat.primary .stat-label { color: #050505; }
html[data-theme="light"] .stat.primary .stat-sub { color: #3e3e3a; }

html[data-theme="light"] .summary { background: #f4f4f1; border-color: #e4e4df; border-left-color: #cafd5d; color: #3e3e3a; }
html[data-theme="light"] .summary b { color: #050505; background: linear-gradient(transparent 58%, rgba(202, 253, 93, .85) 58%); padding: 0 2px; }
html[data-theme="light"] .summary.warn { border-left-color: #f5a524; }
html[data-theme="light"] .summary.warn b { color: #050505; background: none; }

html[data-theme="light"] .kv dd.pos { color: var(--accent); }
html[data-theme="light"] .gran button { background: #fff; border-color: #e4e4df; color: #696969; }
html[data-theme="light"] .gran button.active { background: #050505; border-color: #050505; color: #fff; }

html[data-theme="light"] .view-tabs { background: #f4f4f1; border-color: #e4e4df; }
html[data-theme="light"] .view-tabs button { color: #696969; }
html[data-theme="light"] .view-tabs button:hover { color: #050505; }
html[data-theme="light"] .view-tabs button.active { background: #050505; color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .14); }

html[data-theme="light"] .table-wrap, html[data-theme="light"] .chart-wrap { background: #fff; border-color: #e4e4df; }
html[data-theme="light"] thead th { background: #f4f4f1; color: #696969; }
html[data-theme="light"] tbody tr { border-top-color: #ececec; }
html[data-theme="light"] tbody tr:hover { background: #fafaf7; }
html[data-theme="light"] td.pos { color: var(--accent); }
html[data-theme="light"] tfoot td { background: #f4f4f1; border-top-color: #d8d8d4; }
html[data-theme="light"] .show-all { color: #050505; }
html[data-theme="light"] .show-all:hover { background: rgba(202, 253, 93, .25); }

html[data-theme="light"] .btn-ghost { background: #fff; border-color: #e4e4df; color: #050505; font-weight: 600; }
html[data-theme="light"] .btn-ghost:hover { border-color: #050505; color: #050505; background: #f4f4f1; }

html[data-theme="light"] .site-footer { background: #f4f4f1; border-top-color: #e4e4df; color: #3e3e3a; }
html[data-theme="light"] .toast { background: #050505; color: #cafd5d; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
html[data-theme="light"] :focus-visible { outline-color: #050505; }

/* ---------- Print / PDF ---------- */
@media print {
  @page { margin: 14mm; }
  :root { --bg: #fff; --card: #fff; --card-2: #fff; --input: #fff; --border: #d5d8de; --border-2: #c3c7cf; --text: #111; --text-2: #222; --muted: #555; --lime: #3a6b00; }
  body { background: #fff; color: #111; font-size: 12px; }
  .site-header, .tool-switch, .quote, .btn-primary, .view-tabs, .gran, .actions, .chart-wrap, .site-footer, .toast, .show-all, .lead, .hint { display: none !important; }
  .tool[hidden] { display: none !important; }
  .page-title { margin: 0 0 12px; text-shadow: none; font-size: 22px; }
  .form { padding: 12px 16px; break-inside: avoid; }
  .grid-2 { grid-template-columns: 1fr 1fr 1fr; gap: 8px 16px; }
  .field > label { margin-bottom: 4px; font-size: 11px; }
  input[type="text"], select { height: auto; padding: 4px 8px; font-size: 13px; border: 1px solid #ccc; }
  .select::after { display: none; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .stat { padding: 10px; break-inside: avoid; }
  .stat-value { font-size: 16px; }
  .summary { font-size: 13px; padding: 12px 16px; break-inside: avoid; }
  .summary b, .stat-value.accent, .stat.primary .stat-value { color: #3a6b00; }
  .details > summary::after { display: none; }
  .table-wrap { display: block !important; overflow: visible; border-radius: 6px; }
  .table-scroll { overflow: visible; }
  table { font-size: 11px; }
  th, td { padding: 5px 8px; }
  thead th { background: #f0f2f5; position: static; }
  tfoot td { background: #f6f7f9; }
  tr { break-inside: avoid; }
  .animate { animation: none; }
  .tool { animation: none; }
}
@media (max-width: 360px) { .brand { gap: 10px; } .brand-name { font-size: 18px; } .brand-logo { width: 40px; height: 40px; } .brand-logo svg { width: 33px; height: 33px; } }
.brand-name, .tool-btn span { white-space: nowrap; }
@media (max-width: 360px) { .brand-name { font-size: 17px; } .tool-btn { gap: 6px; padding: 6px 8px; font-size: 14px; } .tool-btn svg { width: 16px; height: 16px; } }
