/* StockCalci — design tokens */
@font-face { font-family: "Archivo"; src: url(/fonts/archivo-sub.woff2) format("woff2-variations"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(/fonts/archivo-rupee.woff2) format("woff2-variations"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; unicode-range: U+20B9; }
@font-face { font-family: "DSEG7"; src: url(/fonts/dseg7-bold.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --paper: #eef1ec;
  --sheet: #fbfcfa;
  --ink: #1d2520;
  --muted: #56625b;
  --line: #d3dad4;
  --key: #ffffff;
  --key-edge: #bfc8c1;
  --bezel: #2b332e;
  --bezel-2: #39433d;
  --lcd: #c4ceb3;
  --lcd-ink: #1c2614;
  --eq: #1f4fd8;
  --eq-edge: #1638a3;
  --pos: #0b7a55;
  --neg: #b5332e;
  --radius-key: 10px;
  --radius-panel: 18px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --lcd-font: "DSEG7", "Archivo", monospace;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--font); font-variant-numeric: tabular-nums; }
img, svg { max-width: 100%; }
a { color: var(--eq); text-underline-offset: 2px; }
a:hover { color: var(--eq-edge); }
:focus-visible { outline: 3px solid var(--eq); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: var(--sheet); padding: 8px 12px; z-index: 9; }

/* ---------- header / footer ---------- */
.top { border-bottom: 1px solid var(--line); background: var(--sheet); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { font-weight: 800; font-stretch: 112%; font-size: 1.28rem; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 18px; font-size: 0.95rem; }
.top nav a { color: var(--ink); text-decoration: none; padding: 6px 2px; }
.top nav a:hover, .top nav a[aria-current] { color: var(--eq); box-shadow: inset 0 -2px 0 var(--eq); }

.foot { margin-top: 72px; background: var(--bezel); color: #cfd8d1; font-size: 0.92rem; }
.foot .wrap { padding-top: 40px; padding-bottom: 32px; display: grid; gap: 28px; grid-template-columns: 1.4fr repeat(3, 1fr); }
.foot h2 { font-size: 0.95rem; color: #fff; margin: 0 0 10px; font-weight: 700; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.foot a { color: #e9efe9; text-decoration: none; }
.foot a:hover { text-decoration: underline; color: #fff; }
.foot .legal { grid-column: 1 / -1; border-top: 1px solid var(--bezel-2); padding-top: 18px; color: #a9b4ac; font-size: 0.85rem; }
@media (max-width: 760px) { .foot .wrap { grid-template-columns: 1fr 1fr; } .top nav a.hide-sm { display: none; } }

/* ---------- type ---------- */
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.015em; }
h1 { font-weight: 800; font-stretch: 112%; font-size: clamp(2rem, 4.6vw, 3.1rem); margin: 0 0 12px; }
h2 { font-weight: 750; font-stretch: 106%; font-size: 1.62rem; margin: 2.2em 0 0.5em; }
h3 { font-weight: 700; font-size: 1.2rem; margin: 1.6em 0 0.4em; }
.lede { font-size: 1.18rem; color: var(--muted); max-width: 60ch; margin: 0 0 8px; }
.small { font-size: 0.86rem; color: var(--muted); }
.crumbs { font-size: 0.88rem; color: var(--muted); margin: 22px 0 14px; }
.crumbs a { color: var(--muted); }

/* ---------- the calculator body (signature element) ---------- */
.calc { background: var(--bezel); border-radius: var(--radius-panel); padding: 14px; box-shadow: 0 1px 0 #fff inset, 0 14px 30px -18px rgba(20, 30, 24, 0.55); color: #e8eee9; }
.lcd { background: var(--lcd); color: var(--lcd-ink); border-radius: 10px; padding: 14px 16px 12px; box-shadow: inset 0 2px 0 rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(0, 0, 0, 0.12); min-height: 108px; }
.lcd-line + .lcd-line { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(28, 38, 20, 0.25); }
.lcd-label { display: block; font-size: 0.85rem; font-weight: 600; opacity: 0.8; }
.lcd-value { display: block; font-family: var(--lcd-font); font-weight: 700; font-size: clamp(1.7rem, 4.4vw, 2.5rem); line-height: 1.25; text-align: right; overflow-wrap: anywhere; letter-spacing: 0.02em; }
.calc .rows { margin: 12px 4px 0; display: grid; gap: 0; }
.calc .r { display: flex; justify-content: space-between; gap: 14px; padding: 9px 4px; border-bottom: 1px solid var(--bezel-2); font-size: 0.96rem; }
.calc .r:last-child { border-bottom: 0; }
.calc dt { color: #b8c3bb; }
.calc dd { margin: 0; text-align: right; font-weight: 600; color: #fff; }
.calc .r.strong dd { color: #fff; font-weight: 800; }
.calc .r.pos dd { color: #7fdcb5; }
.calc .r.neg dd { color: #ff9c95; }
.share { display: flex; gap: 10px; margin: 14px 4px 2px; flex-wrap: wrap; }

/* ---------- keys ---------- */
.key, button.key { -webkit-appearance: none; appearance: none; font: inherit; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer;
  background: var(--key); color: var(--ink); border: 1px solid var(--key-edge); border-bottom-width: 4px; border-radius: var(--radius-key); padding: 10px 16px; font-weight: 650; line-height: 1.2; transition: transform 0.06s ease, border-bottom-width 0.06s ease; }
.key:active { transform: translateY(2px); border-bottom-width: 2px; }
.key.eq { background: var(--eq); color: #fff; border-color: var(--eq-edge); }
.key.dark { background: var(--bezel-2); color: #fff; border-color: #1c221f; }
.key.sm { padding: 7px 12px; font-size: 0.92rem; }

/* ---------- home ---------- */
.hero > * { min-width: 0; }
.tool > * { min-width: 0; }
.hero { padding: 36px 0 8px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4rem); font-stretch: 118%; line-height: 1.02; }
.hero p { font-size: 1.15rem; color: var(--muted); max-width: 44ch; }
.hero .calc .lcd { min-height: 132px; display: flex; flex-direction: column; justify-content: space-between; }
.typed { font-family: var(--font); font-weight: 600; font-size: 0.98rem; opacity: 0.8; min-height: 2.8em; overflow-wrap: anywhere; }
.ghost { position: relative; text-align: right; font-family: var(--lcd-font); font-weight: 700; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.2; }
.ghost::before { content: "88,88,888.88"; position: absolute; right: 0; color: rgba(28, 38, 20, 0.07); }
.ghost span { position: relative; }
.keypad { margin-top: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.keypad .key { min-height: 62px; font-size: 0.98rem; text-align: center; padding: 8px; }
.keypad .key.wide { grid-column: span 2; }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; gap: 20px; } }
@media (max-width: 520px) { .keypad { grid-template-columns: repeat(2, 1fr); } .keypad .key.wide { grid-column: span 2; } }

.groups { columns: 3 280px; column-gap: 32px; margin-top: 18px; }
.group { break-inside: avoid; margin-bottom: 26px; }
.group h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--muted); font-weight: 650; }
.group ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.group li { border-bottom: 1px solid var(--line); }
.group a { display: block; padding: 12px 0; text-decoration: none; color: var(--ink); }
.group a b { display: block; font-weight: 700; }
.group a span { display: block; font-size: 0.9rem; color: var(--muted); }
.group a:hover b { color: var(--eq); }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 12px; }
.facts p { margin: 6px 0 0; color: var(--muted); }
.facts strong { font-size: 1.08rem; }
@media (max-width: 760px) { .facts { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- tool page ---------- */
.tool { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-top: 18px; }
.tool .calc { position: sticky; top: 16px; }
@media (max-width: 900px) { .tool { grid-template-columns: 1fr; } .tool .calc { position: static; } }
.inputs { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-panel); padding: 20px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.field { grid-column: span 2; min-width: 0; }
.field.half { grid-column: span 1; }
@media (max-width: 340px) { .field.half { grid-column: span 2; } }
.field > label, .field > .lab { display: block; font-weight: 650; font-size: 0.95rem; margin-bottom: 6px; }
.field .help { font-size: 0.84rem; color: var(--muted); margin-top: 5px; }
.inp { display: flex; align-items: stretch; border: 1px solid var(--key-edge); border-radius: var(--radius-key); background: #fff; overflow: hidden; }
.inp:focus-within { border-color: var(--eq); box-shadow: 0 0 0 3px rgba(31, 79, 216, 0.18); }
.inp span { display: flex; align-items: center; padding: 0 10px; color: var(--muted); background: #f3f6f3; font-weight: 600; }
.inp input, .inp select { flex: 1; min-width: 0; border: 0; padding: 11px 12px; font: inherit; font-size: 1.05rem; background: transparent; color: var(--ink); font-variant-numeric: tabular-nums; }
.inp input:focus, .inp select:focus { outline: none; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; padding: 0; margin: 0; }
.seg legend { font-weight: 650; font-size: 0.95rem; margin-bottom: 6px; padding: 0; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg label span { display: inline-block; padding: 8px 13px; border: 1px solid var(--key-edge); border-bottom-width: 3px; border-radius: var(--radius-key); background: #fff; cursor: pointer; font-weight: 600; font-size: 0.95rem; }
.seg input:checked + span { background: var(--bezel); color: #fff; border-color: #141a16; }
.seg input:focus-visible + span { outline: 3px solid var(--eq); outline-offset: 2px; }
.rows-box .row { display: grid; grid-template-columns: 62px 1fr 1fr 40px; gap: 8px; align-items: center; margin-bottom: 8px; }
.rows-box .row-n { font-size: 0.86rem; color: var(--muted); font-weight: 600; }
.rows-box .row .inp input { padding: 9px 10px; }
.rows-head { display: grid; grid-template-columns: 62px 1fr 1fr 40px; gap: 8px; font-size: 0.86rem; font-weight: 650; color: var(--muted); margin-bottom: 4px; }
.del { background: none; border: 1px solid var(--line); border-radius: 8px; height: 40px; cursor: pointer; color: var(--muted); font-size: 1.1rem; }
[data-add-row] { margin: 4px 0 18px; }
.del:hover { color: var(--neg); border-color: var(--neg); }

.extra .note { background: rgba(196, 206, 179, 0.14); border-left: 3px solid var(--lcd); padding: 10px 12px; margin: 14px 4px 0; border-radius: 0 8px 8px 0; color: #e8eee9; font-size: 0.95rem; }
.extra .tbl { margin: 16px 4px 0; }
.extra h3 { font-size: 1rem; color: #fff; margin: 0 0 6px; }
.extra table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.extra th { text-align: left; color: #b8c3bb; font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--bezel-2); }
.extra td { padding: 7px 4px; border-bottom: 1px solid var(--bezel-2); color: #fff; }
.extra th:not(:first-child), .extra td:not(:first-child) { text-align: right; }
.extra .small { color: #a9b4ac; margin: 6px 0 0; }
.extra .pos { color: #7fdcb5; } .extra .neg { color: #ff9c95; }
.tag { display: inline-block; font-size: 0.72rem; font-weight: 700; background: var(--lcd); color: var(--lcd-ink); padding: 1px 6px; border-radius: 5px; margin-left: 4px; vertical-align: 1px; }
.aff { color: #9ec0ff; }
.chart { width: 100%; height: auto; margin: 14px 0 0; background: #222a25; border-radius: 10px; }
.chart .axis { stroke: #5d6a62; stroke-width: 1; }
.chart .line { fill: none; stroke-width: 3.5; }
.chart .line.pos { stroke: #7fdcb5; } .chart .line.neg { stroke: #ff9c95; }
.chart .mark { stroke: var(--lcd); stroke-dasharray: 4 4; }
.chart .lbl { fill: #b8c3bb; font-size: 17px; font-family: var(--font); }
.chart .dot { fill: var(--lcd); }

/* ---------- article ---------- */
.article { max-width: 70ch; }
.article p, .article li { color: #27302b; }
.table-scroll { overflow-x: auto; margin: 1em 0; -webkit-overflow-scrolling: touch; }
.article table { border-collapse: collapse; width: 100%; font-size: 0.95rem; background: var(--sheet); }
@media (max-width: 600px) { .article table { font-size: 0.86rem; } .article th, .article td { padding: 6px 7px; } }
.article th, .article td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.article th { background: #e6ebe6; font-weight: 650; }
.article blockquote { margin: 1.2em 0; padding: 10px 16px; border-left: 4px solid var(--lcd); background: var(--sheet); }
.article code { background: #e6ebe6; padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.article .formula { font-family: var(--font); background: var(--sheet); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
.article img { border-radius: 10px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style-position: outside; }
.faq details p { margin: 8px 0 0; }
.byline { font-size: 0.9rem; color: var(--muted); margin: 28px 0 22px; }
.article h1 + .byline { margin-top: 6px; }
.related { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.cta-tool { margin: 26px 0; padding: 16px 18px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius-panel); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.cta-tool p { margin: 0; font-weight: 650; }
.post-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); max-width: 760px; }
.post-list li { border-bottom: 1px solid var(--line); padding: 16px 0; }
.post-list a { font-weight: 750; font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.post-list a:hover { color: var(--eq); }
.post-list p { margin: 4px 0 0; color: var(--muted); }
.disclaimer-strip { font-size: 0.84rem; color: var(--muted); margin-top: 18px; max-width: 75ch; }
.ad { margin: 24px 0; min-height: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print { .top, .foot, .share, .ad { display: none; } body { background: #fff; } }
