/* =====================================================================
   Unifour tool pages (EMI, late VAT, Preeti converter) - loaded after kb.css
   ===================================================================== */
.kb-tool.t-tool { padding: 0; background: transparent; border: 0; box-shadow: none; }
.t-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 22px; }
@media (max-width: 860px) { .t-grid { grid-template-columns: minmax(0, 1fr); } }
.t-panel { background: #fff; border: 1px solid var(--u-line); border-radius: var(--u-radius); box-shadow: var(--u-shadow); padding: 26px; min-width: 0; }
.t-panel h2 { font-family: var(--u-head); font-size: 18px; font-weight: 700; color: var(--u-navy); margin: 0 0 18px; }
.t-field { margin-bottom: 22px; }
.t-field:last-child { margin-bottom: 0; }
.t-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.t-row label, .t-label { font-weight: 600; font-size: 14.5px; color: var(--u-ink); margin: 0; }
.t-hint { font-size: 12.5px; color: var(--u-muted); margin-top: 6px; }
.t-input { display: flex; align-items: center; border: 1px solid var(--u-line); border-radius: 10px; background: #fff;
  transition: border-color .15s, box-shadow .15s; overflow: hidden; }
.t-input:focus-within { border-color: var(--u-blue); box-shadow: 0 0 0 4px rgba(2,116,179,.12); }
.t-input input { border: 0; outline: 0; padding: 10px 12px; font-size: 15.5px; font-weight: 600; color: var(--u-navy);
  width: 100%; min-width: 0; background: transparent; text-align: right; font-variant-numeric: tabular-nums; }
.t-input.t-left input { text-align: left; }
.t-input .t-affix { padding: 0 12px; font-size: 13px; font-weight: 700; color: var(--u-muted); background: var(--u-soft);
  align-self: stretch; display: flex; align-items: center; white-space: nowrap; }
.t-row .t-input { width: 200px; flex: none; }
.t-row .t-input.t-sm { width: 150px; }
.t-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; outline: none; margin: 4px 0 0;
  background: linear-gradient(to right, var(--u-blue) 0%, var(--u-blue) var(--p, 0%), #dbe4ee var(--p, 0%), #dbe4ee 100%); }
.t-range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  border: 3px solid var(--u-blue); box-shadow: 0 2px 6px rgba(2,116,179,.35); cursor: pointer; }
.t-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--u-blue); cursor: pointer; }
.t-scale { display: flex; justify-content: space-between; font-size: 11.5px; color: #94a3b8; margin-top: 8px; }
.t-seg { display: inline-flex; background: var(--u-soft); border-radius: 10px; padding: 3px; gap: 2px; }
.t-seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 700;
  color: var(--u-muted); cursor: pointer; }
.t-seg button.on { background: #fff; color: var(--u-blue); box-shadow: 0 1px 3px rgba(15,35,60,.12); }
.t-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--u-blue); background: var(--u-blue); color: #fff;
  border-radius: 10px; padding: 10px 18px; font-weight: 700; font-size: 14.5px; cursor: pointer; transition: all .15s; }
.t-btn:hover { background: var(--u-blue-d); border-color: var(--u-blue-d); }
.t-btn.ghost { background: #fff; color: var(--u-blue); }
.t-btn.ghost:hover { background: var(--u-soft); }
.t-btn.sm { padding: 7px 12px; font-size: 13px; }
.t-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

.t-result { background: linear-gradient(160deg, #0b2545 0%, #0274b3 120%); color: #fff; border: 0; position: relative; overflow: hidden; }
.t-result::after { content: ""; position: absolute; right: -80px; top: -80px; width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255,255,255,.06); pointer-events: none; }
.t-result h2 { color: rgba(255,255,255,.85); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }
.t-big { font-family: var(--u-head); font-size: clamp(26px, 2.6vw, 40px); overflow-wrap: anywhere; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.t-big small { font-size: 15px; font-weight: 600; opacity: .75; margin-left: 6px; white-space: nowrap; }
@media (max-width: 860px) { .t-big { font-size: 34px; } }
.t-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 20px; }
.t-stat { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 12px 14px; }
.t-stat > span { display: block; font-size: 12px; opacity: .8; margin-bottom: 4px; }
.t-stat b { font-size: 17px; font-variant-numeric: tabular-nums; }
.t-result .t-btn.ghost { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.35); color: #fff; }
.t-result .t-btn.ghost:hover { background: rgba(255,255,255,.2); }
.t-chart { display: flex; align-items: center; gap: 20px; margin-top: 22px; }
.t-chart canvas { width: 150px !important; height: 150px !important; flex: none; }
.t-legend { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.t-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 8px; vertical-align: -1px; }

.t-section { margin-top: 22px; }
.t-section .t-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.t-section .t-head h2 { margin: 0; }
.t-table-wrap { overflow-x: auto; border: 1px solid var(--u-line); border-radius: 12px; }
.t-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.t-table th { background: var(--u-soft); color: var(--u-navy); font-weight: 700; text-align: right; padding: 11px 14px; white-space: nowrap; }
.t-table th:first-child, .t-table td:first-child { text-align: left; }
.t-table td { padding: 10px 14px; text-align: right; border-top: 1px solid var(--u-line); white-space: nowrap; }
.t-table tr.t-year { cursor: pointer; font-weight: 700; color: var(--u-navy); }
.t-table tr.t-year:hover td { background: #f8fbfe; }
.t-table tr.t-year td:first-child .t-caret { display: inline-block; width: 18px; color: var(--u-blue); transition: transform .15s; transform: rotate(-90deg); }
.t-table tr.t-year.open td:first-child .t-caret { transform: rotate(0); }
.t-table tr.t-month td { color: #475569; font-size: 13.5px; background: #fcfdfe; }
.t-table tr.t-month td:first-child { padding-left: 34px; }
.t-bar { display: inline-block; vertical-align: middle; width: 70px; height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-right: 8px; }
.t-bar i { display: block; height: 100%; background: var(--u-green); border-radius: 999px; }

.t-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--u-blue);
  background: rgba(2,116,179,.08); border-radius: 999px; padding: 4px 10px; margin-top: 8px; }
.t-badge:empty { display: none; }
.t-error { display: none; margin-top: 14px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; border-radius: 10px;
  padding: 10px 14px; font-size: 14px; }
.t-error.show { display: block; }
.t-note { font-size: 13px; color: var(--u-muted); background: var(--u-soft); border-radius: 10px; padding: 12px 14px; margin-top: 18px; line-height: 1.6; }
.t-result .t-note { background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); }
.t-muted { opacity: .75; font-size: 15px; margin-top: 8px; }

.t-conv { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 860px) { .t-conv { grid-template-columns: minmax(0, 1fr); } .t-swap .t-btn .fa { transform: rotate(90deg); } }
.t-pane { display: flex; flex-direction: column; min-width: 0; }
.t-pane .t-row { margin-bottom: 8px; }
.t-text { width: 100%; flex: 1; min-height: 280px; resize: vertical; border: 1px solid var(--u-line); border-radius: 12px; padding: 14px 16px;
  font-size: 17px; line-height: 1.7; color: var(--u-ink); background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.t-text:focus { border-color: var(--u-blue); box-shadow: 0 0 0 4px rgba(2,116,179,.12); }
.t-text[readonly] { background: #f8fafc; }
.t-count { font-size: 12px; color: #94a3b8; }
.t-swap { display: flex; align-items: center; justify-content: center; }
.t-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: var(--u-navy); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; opacity: 0; transition: all .2s; z-index: 2000; pointer-events: none; }
.t-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- intro / context under each tool ---------- */
.t-info { margin-top: 22px; padding: clamp(22px, 4vw, 40px); }
.t-info h2 { font-size: 22px; margin: 1.6em 0 .6em; }
.t-info h2:first-child { margin-top: 0; }
.t-info details { border: 1px solid var(--u-line); border-radius: 12px; padding: 0 16px; margin: 10px 0; background: #fff; }
.t-info details[open] { background: #fbfdff; }
.t-info summary { cursor: pointer; font-weight: 700; color: var(--u-navy); padding: 13px 0; list-style: none; position: relative; padding-right: 26px; }
.t-info summary::-webkit-details-marker { display: none; }
.t-info summary::after { content: "+"; position: absolute; right: 2px; top: 10px; font-size: 20px; color: var(--u-blue); font-weight: 400; }
.t-info details[open] summary::after { content: "\2212"; }
.t-info details p { margin: 0 0 14px; }
.t-info pre { font-size: 15px; }
