/* Calculators — Groww-style. Leans on ../css/protium-ui.css tokens. */

.page { flex: 1; min-height: 0; padding: 24px 32px; overflow: hidden; }
.layout {
  height: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 28px;
  align-items: stretch;
}

/* Sidebar */
.sidebar { height: 100%; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; }
.side-section { font-size: 12.5px; font-weight: 700; color: var(--text); padding: 12px 8px 6px; margin-top: 8px; border-top: 1px solid var(--border-faint); text-transform: uppercase; letter-spacing: 0.03em; }
.side-section:first-child { margin-top: 0; border-top: 0; padding-top: 2px; }
.side-group { margin-bottom: 12px; }
.side-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); padding: 4px 8px; margin-bottom: 2px; }
.side-item { display: block; width: 100%; text-align: left; font: inherit; font-size: 13.5px; color: var(--text-muted); background: transparent; border: 0; border-radius: var(--r-sm); padding: 8px 10px; cursor: pointer; transition: background var(--t), color var(--t); }
.side-item:hover { background: var(--surface-2); color: var(--text); }
.side-item.is-active { background: var(--accent-soft); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }

/* Content */
.content { min-width: 0; height: 100%; overflow-y: auto; }
.tool-head { margin-bottom: 18px; }
.tool-head h1 { font-family: var(--font-display); font-size: 27px; letter-spacing: -0.01em; margin-bottom: 5px; }
.tool-head p { color: var(--text-muted); font-size: 15px; }

/* Calculator card — Groww layout: inputs left, chart/result right */
.g-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 28px;
  display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: center;
}
.g-card.solo { grid-template-columns: 1fr; }

/* Sliders */
.g-inputs { display: flex; flex-direction: column; gap: 26px; }
.g-field-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.g-field-top label { font-size: 14px; color: var(--text); font-weight: 500; }
.g-val {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
  border: 1px solid var(--accent-ring); border-radius: var(--r-sm); padding: 6px 10px; font-size: 14px;
}
.g-val input {
  width: 110px; background: transparent; border: 0; color: var(--accent); font: inherit; font-weight: 600; text-align: right;
}
.g-val input:focus { outline: none; }
.g-val .unit { font-size: 12px; }

/* Range track */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: var(--surface-3); cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); }

/* Result side */
.g-result { display: flex; flex-direction: column; align-items: center; }
.donut {
  width: 180px; height: 180px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--pct, 50) * 1%), var(--surface-3) 0);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.donut-hole {
  width: 124px; height: 124px; border-radius: 50%; background: var(--surface);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.donut-hole .donut-emi { font-family: var(--font-display); font-size: 22px; color: var(--text); letter-spacing: -0.01em; }
.donut-hole small { color: var(--text-muted); font-size: 11.5px; }

.legend { display: flex; gap: 18px; margin: 16px 0 6px; font-size: 12.5px; color: var(--text-muted); }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }
.lg-p::before { background: var(--accent); }
.lg-i::before { background: var(--surface-3); }

.g-nums { width: 100%; margin-top: 10px; }
.g-num { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--border-faint); font-size: 14px; }
.g-num:last-child { border-bottom: 0; }
.g-num .k { color: var(--text-muted); }
.g-num .v { color: var(--text); font-weight: 600; }
.g-num.hero .v { color: var(--accent); font-size: 16px; }

/* Plain result stats (eligibility / rate / words) */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.stat { background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; }
.stat .k { font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
.stat .v { font-family: var(--font-display); font-size: 21px; color: var(--text); letter-spacing: -0.01em; }
.stat.hero { background: var(--accent-soft); border-color: var(--accent-ring); }
.stat.hero .v { color: var(--accent); }
.note { color: var(--text-muted); font-size: 13px; margin-top: 16px; }

/* Segmented control */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 22px; }
.seg-btn { font: inherit; font-size: 13px; color: var(--text-muted); background: transparent; border: 0; padding: 7px 16px; border-radius: 7px; cursor: pointer; }
.seg-btn.is-active { background: var(--accent); color: #fff; }

/* Amount in words */
.words-out { margin-top: 8px; min-height: 64px; background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; font-size: 17px; color: var(--text); line-height: 1.5; }
.words-out .muted { color: var(--text-faint); }
.row-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.field-wide { max-width: 360px; }
.field-wide > span { display: block; font-size: 13.5px; color: var(--text-muted); margin-bottom: 6px; }

/* amount hint under money sliders */
.g-hint { margin-top: 7px; font-size: 12px; color: var(--text-faint); }

/* advanced rows in EMI */
.adv { margin-top: 4px; }
.opt-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opt-2 label > span, .mini > span { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 5px; }
.adv .pt-input { padding: 8px 10px; font-size: 13.5px; }
.mini { display: block; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--text-muted); cursor: pointer; margin-top: 4px; }
.chk input { width: 15px; height: 15px; }

/* yearly schedule */
.sched-wrap { max-width: 1240px; margin: 16px auto 0; }
.sched { margin-top: 12px; max-height: 340px; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-md); }
.sched table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sched th, .sched td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--border-faint); }
.sched th:first-child, .sched td:first-child { text-align: left; }
.sched thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--text-muted); font-weight: 600; }

/* formula + definitions block */
.info {
  max-width: 1240px; margin: 18px auto 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px 24px;
}
.info h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); margin-bottom: 12px; }
.formula {
  font-family: var(--font-mono); font-size: 14.5px; color: var(--text);
  background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md);
  padding: 12px 14px; overflow-x: auto;
}
.defs { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 7px; }
.defs li { font-size: 13.5px; color: var(--text-muted); }
.defs b { color: var(--text); font-family: var(--font-mono); }
.info-extra { margin-top: 12px; font-size: 13.5px; color: var(--text-muted); }

/* ---- Date & Time tool styles ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px 26px; }
.card + .card { margin-top: 16px; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.fields.cols-1 { grid-template-columns: 1fr; max-width: 420px; }
.fields.cols-3 { grid-template-columns: repeat(3, 1fr); }
.field { display: block; }
.field > span { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.field input, .field select { color-scheme: dark; }
html.theme-light .field input, html.theme-light .field select { color-scheme: light; }
.big-now { text-align: center; padding: 4px 0 2px; }
.big-now .v { font-family: var(--font-mono); font-size: 30px; color: var(--accent); letter-spacing: -0.01em; }
.big-now .k { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.result { margin-top: 18px; background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; }
.result:empty { display: none; }
.r-line { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--border-faint); font-size: 14px; }
.r-line:last-child { border-bottom: 0; }
.r-line .k { color: var(--text-muted); }
.r-line .v { color: var(--text); font-weight: 600; text-align: right; }
.r-mono .v { font-family: var(--font-mono); }
.hero { text-align: center; margin: 20px 0; font-family: var(--font-display); font-size: 26px; color: var(--accent); letter-spacing: -0.01em; }
.hero small { display: block; font-family: var(--font-sans); font-size: 13px; color: var(--text-muted); font-weight: 400; margin-top: 4px; }
.statbox { background: var(--field); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; text-align: center; }
.statbox .v { font-family: var(--font-display); font-size: 20px; color: var(--text); }
.statbox .k { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .g-card { grid-template-columns: 1fr; gap: 28px; }
  .g-result { order: -1; }
  .stat-row { grid-template-columns: 1fr; }
  .fields, .fields.cols-3 { grid-template-columns: 1fr; }
}
