:root {
  --accent: #65883e;
  --accent-dark: #4a6a2c;
  --accent-soft: rgba(101, 136, 62, 0.14);
  --bg-grad-1: #14181f;
  --bg-grad-2: #232a35;
  --card-bg: #ffffff;
  --text: #171c24;
  --text-muted: #5d6673;
  --border: #e3e6ea;
  --input-bg: #f7f8f6;
  --shadow: 0 20px 60px -15px rgba(6, 10, 16, 0.6);
  --radius: 16px;
  --radius-sm: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 18px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 15% -10%, #2e3a2a 0%, transparent 55%),
              radial-gradient(1000px 700px at 110% 10%, #1d3324 0%, transparent 45%),
              linear-gradient(160deg, var(--bg-grad-1), var(--bg-grad-2));
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
.layout { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; }

.card { width: 100%; max-width: 780px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 26px 24px; border: 1px solid rgba(255,255,255,0.6); }
.card__header { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.card__heading { flex: 1; min-width: 0; }
.logo { width: 48px; height: 48px; flex: 0 0 auto; display: grid; place-items: center; color: #f2efe4; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); border-radius: 14px; box-shadow: 0 8px 20px -6px var(--accent-dark); }
.logo svg { width: 26px; height: 26px; }
.card__header h1 { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.subtitle { color: var(--text-muted); font-size: 0.88rem; margin-top: 3px; }

.card__body { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; }
.inputs, .results { min-width: 0; }

/* Inputs */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 7px; }
.input-wrap { display: flex; align-items: center; background: var(--input-bg); border: 2px solid var(--border); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: #fff; }
.input-wrap input { flex: 1; width: 100%; min-width: 0; border: none; outline: none; background: transparent; padding: 12px 14px; font-size: 1.15rem; font-weight: 700; color: var(--text); font-family: inherit; font-variant-numeric: tabular-nums; }
.hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 7px; line-height: 1.5; }

.seg { display: flex; background: var(--input-bg); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 3px; }
.seg button {
  flex: 1; padding: 10px 4px; border: none; border-radius: 9px; background: transparent; cursor: pointer;
  font-size: 0.85rem; font-weight: 700; color: var(--text-muted); font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}
.seg button.active { background: #fff; color: var(--accent-dark); box-shadow: 0 1px 4px rgba(6,10,16,.14); }

/* Results */
.results { background: linear-gradient(160deg, #171d16, #26301f); border-radius: var(--radius); color: #fff; padding: 22px 20px; }
.result-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 14px; border-bottom: 1px solid rgba(190,200,180,.22); margin-bottom: 14px; }
.result-label { font-size: 0.85rem; color: #cdd6c4; font-weight: 600; }
.result-value { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; }
.result-range { font-size: 0.82rem; color: #a7b39a; margin-top: 2px; font-variant-numeric: tabular-nums; }

.pct { border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.88rem; line-height: 1.55; margin-bottom: 14px; background: rgba(101,136,62,.16); border: 1px solid rgba(101,136,62,.4); color: #d9e4c8; }
.pct b { color: #fff; font-variant-numeric: tabular-nums; }

.rrow { display: flex; justify-content: space-between; align-items: baseline; padding: 7px 0; font-size: 0.9rem; color: #cdd6c4; gap: 12px; }
.rrow span { min-width: 0; }
.rrow b { color: #fff; font-weight: 700; font-size: 0.98rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rrow--head { border-top: 1px solid rgba(190,200,180,.22); margin-top: 4px; padding-top: 12px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #a7b39a; }
.data-note { font-size: 0.74rem; color: #97a28c; margin-top: 12px; line-height: 1.5; }
.data-note a { color: #c4d3ab; }

/* Fundamentals board */
.board { width: 100%; max-width: 780px; background: linear-gradient(160deg, #171d16, #26301f); border-radius: var(--radius); color: #fff; padding: 20px 20px 16px; overflow: hidden; box-shadow: var(--shadow); }
.board h2 { font-size: 1.02rem; font-weight: 700; margin-bottom: 12px; color: #f0f4e8; }
.table-wrap { overflow-x: auto; }
.board table { width: 100%; border-collapse: collapse; min-width: 430px; }
.board th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: #a7b39a; padding: 6px 10px 8px; border-bottom: 1px solid rgba(190,200,180,.25); }
.board td { padding: 9px 10px; font-size: 0.9rem; border-bottom: 1px solid rgba(190,200,180,.13); color: #e6ebdc; font-variant-numeric: tabular-nums; }
.board tr:last-child td { border-bottom: none; }
.board td:first-child { font-weight: 700; color: #fff; }
.board__note { font-size: 0.8rem; color: #a7b39a; margin-top: 12px; line-height: 1.6; }
.board__note a { color: #c4d3ab; }

/* Ads */
.adslot { width: 100%; max-width: 780px; min-height: 90px; display: grid; place-items: center; color: rgba(255,255,255,0.35); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; border: 1px dashed rgba(255,255,255,0.16); border-radius: var(--radius-sm); }
.adrail { display: none; }
@media (min-width: 1440px) {
  .adrail {
    display: grid; place-items: center; position: fixed; top: 50%; transform: translateY(-50%);
    left: max(16px, calc(50vw - 390px - 332px)); width: 300px; height: 600px;
    color: rgba(255,255,255,0.35); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
    border: 1px dashed rgba(255,255,255,0.16); border-radius: var(--radius-sm);
  }
}

/* Footer */
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 18px; padding: 4px 12px 12px; font-size: 0.8rem; color: rgba(255,255,255,0.55); }
.site-footer a { color: rgba(255,255,255,0.75); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.copy { white-space: nowrap; }

/* Content pages */
.doc { width: 100%; max-width: 780px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px 30px; line-height: 1.7; }
.doc__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; text-decoration: none; color: var(--text); }
.doc__brand .logo { width: 38px; height: 38px; border-radius: 11px; }
.doc__brand .logo svg { width: 20px; height: 20px; }
.doc__brand span { font-weight: 700; font-size: 1.02rem; }
.doc h1 { font-size: 1.65rem; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 14px; }
.doc h2 { font-size: 1.22rem; letter-spacing: -0.01em; margin: 26px 0 10px; }
.doc h3 { font-size: 1.02rem; margin: 20px 0 8px; }
.doc p { margin-bottom: 12px; color: #333a44; }
.doc ul, .doc ol { margin: 0 0 14px 22px; color: #333a44; }
.doc li { margin-bottom: 6px; }
.doc a { color: var(--accent-dark); }
.doc .lead { font-size: 1.05rem; color: var(--text); }
.doc table { width: 100%; border-collapse: collapse; margin: 14px 0 18px; font-size: 0.92rem; }
.doc th { text-align: left; background: var(--input-bg); border-bottom: 2px solid var(--border); padding: 9px 12px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.doc td { padding: 9px 12px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.doc tr:last-child td { border-bottom: none; }
.callout { background: var(--accent-soft); border: 1px solid rgba(101,136,62,.35); border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0 18px; font-size: 0.92rem; line-height: 1.6; color: #2f3d20; }
.crumbs { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 16px; }
.crumbs a { color: var(--accent-dark); text-decoration: none; }
.faq h3 { font-size: 1.02rem; margin: 20px 0 6px; }

@media (max-width: 720px) {
  body { padding: 24px 12px; }
  .card { padding: 22px 18px 18px; }
  .card__body { grid-template-columns: minmax(0, 1fr); }
  .doc { padding: 26px 20px; }
  .result-value { font-size: 2rem; }
}
