/* ==========================================================================
   MBBSDirect — Cost calculator page only  (v1.0, Nov 2026)
   Loaded after mbbsdirect.css on /mbbs-abroad-cost-calculator/ and nowhere else.
   Uses the site tokens; every class here starts with "calc-".
   ========================================================================== */
:root {
  --calc-fee: var(--brand);
  --calc-food: #8A7EE8;
  --calc-visa: var(--ink-900);
  --calc-other-a: #C4BBFF;
  --calc-other-b: #EEEBFE;
}

#calc [hidden] { display: none !important; }

/* ---------- Sliders ---------- */
.calc-control { display: flex; flex-direction: column; gap: 6px; }
.calc-control-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.calc-control label { font-weight: 700; font-size: 15px; color: var(--text); }
.calc-control output { font-family: var(--font-head); font-weight: 700; font-size: 18px; color: var(--brand); white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc-control small { color: var(--text-3); font-size: 13px; line-height: 1.45; }
.calc-range { width: 100%; height: 32px; margin: 0; accent-color: var(--brand); cursor: pointer; }
.calc-range:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 2px; border-radius: 6px; }
.calc-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.calc-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.calc-quick button, .calc-filters button, .calc-cmp, .calc-link {
  font: inherit; cursor: pointer; border-radius: 999px; border: 1px solid var(--input-line); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: 14px; padding: 7px 13px; min-height: 36px;
}
.calc-quick button:hover, .calc-filters button:hover, .calc-cmp:hover { border-color: var(--brand); color: var(--brand); }
.calc-quick button[aria-pressed="true"], .calc-filters button[aria-pressed="true"], .calc-cmp[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.calc-quick button:focus-visible, .calc-filters button:focus-visible, .calc-cmp:focus-visible, .calc-link:focus-visible, .calc-remove:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 2px; }
.calc-link { border: 0; background: none; padding: 0; min-height: 0; color: var(--brand); text-decoration: underline; border-radius: 4px; }

/* ---------- Hero card ---------- */
.calc-hero-card { gap: 14px; }
.calc-big, .calc-control output.calc-big { font-family: var(--font-head); font-weight: 700; font-size: clamp(40px, 6vw, 56px); line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.calc-fitline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-weight: 700; font-size: 17px; }
.calc-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc-mini > div { background: var(--bg); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calc-mini span { font-size: 13px; color: var(--text-3); font-weight: 600; }
.calc-mini strong { font-family: var(--font-head); font-size: 18px; }
.calc-mini small { font-size: 13px; color: var(--text-2); }

/* ---------- Planner layout ---------- */
.calc-layout { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.calc-panel { gap: 18px; }
.calc-panel h3 { font-size: 18px; }
.calc-panel hr { border: 0; border-top: 1px solid var(--line); margin: 0; width: 100%; }
@media (min-width: 1000px) {
  .calc-layout { grid-template-columns: 350px minmax(0, 1fr); gap: 28px; }
  .calc-panel { position: sticky; top: 132px; max-height: calc(100vh - 148px); overflow-y: auto; }
}
.calc-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.calc-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.calc-sortbox { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 14px; font-weight: 600; color: var(--text-2); }
.calc-sortbox select { font: inherit; font-weight: 600; font-size: 14px; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--input-line); background: var(--surface); color: var(--text); }
.calc-sortbox label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.calc-sortbox input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.calc-status { font-size: 15px; font-weight: 600; color: var(--text-2); margin-bottom: 10px; }
.calc-status strong { color: var(--brand); }
.calc-msg { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: var(--radius-sm); padding: 10px 14px; font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.calc-empty { background: var(--surface); border: 1px dashed var(--input-line); border-radius: var(--radius); padding: 18px; color: var(--text-2); }

/* Legend and budget ruler */
.calc-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.calc-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.calc-key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.calc-ruler { position: relative; height: 26px; margin: 10px 17px 2px; }
.calc-ruler-mark { position: absolute; top: 0; transform: translateX(-50%); background: var(--text); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; transition: left .35s ease; }
.calc-ruler-mark::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: var(--text); }

/* ---------- Result rows ---------- */
.calc-list { display: flex; flex-direction: column; gap: 10px; }
.calc-row { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; transition: border-color .2s ease, box-shadow .2s ease; }
.calc-row:hover { border-color: var(--brand-soft); box-shadow: 0 8px 22px rgba(19, 11, 74, .08); }
.calc-row-head { display: flex; align-items: flex-start; gap: 12px; }
.calc-rank { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-tint); color: var(--brand); font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.calc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.calc-name a { font-family: var(--font-head); font-weight: 700; font-size: 16px; line-height: 1.3; color: var(--text); text-decoration: none; }
.calc-name a:hover { color: var(--brand); text-decoration: underline; }
.calc-name small { color: var(--text-3); font-size: 13px; }
.calc-total { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; text-align: right; }
.calc-total strong { font-family: var(--font-head); font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.calc-pill { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.calc-pill.is-ok { background: var(--whatsapp-tint); color: #0B6B36; }
.calc-pill.is-over { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-line); }
.calc-bar { position: relative; display: flex; height: 22px; background: var(--line-soft); border-radius: 6px; }
.calc-seg { height: 100%; min-width: 0; transition: width .35s ease; }
.calc-seg:first-child { border-radius: 6px 0 0 6px; }
.calc-seg + .calc-seg { box-shadow: -2px 0 0 var(--surface); }
.calc-seg-fee { background: var(--calc-fee); }
.calc-seg-food { background: var(--calc-food); }
.calc-seg-visa { background: var(--calc-visa); }
.calc-seg-other { background: repeating-linear-gradient(45deg, var(--calc-other-a) 0 4px, var(--calc-other-b) 4px 8px); }
.calc-seg[data-tip]:hover { filter: brightness(1.12); }
.calc-budget-line { position: absolute; top: -5px; bottom: -5px; width: 0; border-left: 2px dashed var(--text); transition: left .35s ease; pointer-events: none; }
.calc-row-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.calc-note { font-size: 14px; color: var(--text-2); flex: 1 1 260px; }
.calc-years summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--brand); list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.calc-years summary::-webkit-details-marker { display: none; }
.calc-years summary::after { content: "+"; font-size: 18px; line-height: 1; }
.calc-years[open] summary::after { content: "−"; }
.calc-years-body { display: flex; flex-direction: column; gap: 16px; padding-top: 14px; }
.calc-cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.calc-col { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.calc-col-val { font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.calc-col-bar { width: 100%; max-width: 46px; height: 110px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.calc-col-bar i { display: block; width: 100%; border-radius: 3px; }
.calc-col-label { font-size: 12px; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.calc-lines { display: flex; flex-direction: column; gap: 8px; }
.calc-lines .price-line span:first-child { min-width: 0; }
.calc-lines .price-line strong { white-space: nowrap; }
@media (max-width: 520px) {
  .calc-col-val { font-size: 11px; }
  .calc-lines .price-line small { display: block; }
}

/* ---------- Tooltip ---------- */
.calc-tip { position: absolute; z-index: 60; background: var(--ink-900); color: #fff; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; box-shadow: 0 8px 20px rgba(19, 11, 74, .25); }

/* ---------- Compare ---------- */
.calc-pickers { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-bottom: 18px; }
@media (min-width: 700px) { .calc-pickers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.calc-picker > span { display: inline-flex; align-items: center; gap: 8px; }
.calc-picker select { width: 100%; }
.calc-table-scroll { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--line); }
.calc-table { border: 0; border-radius: 0; min-width: 560px; font-size: 15px; }
.calc-table th[scope="row"] { background: var(--bg); color: var(--text-2); font-size: 13px; text-transform: none; letter-spacing: 0; font-weight: 700; padding: 14px 16px; border-top: 1px solid var(--line-soft); width: 150px; vertical-align: top; }
.calc-table thead th { font-family: var(--font-head); font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); white-space: nowrap; }
.calc-table thead th .calc-key { margin-right: 8px; }
.calc-table td { padding: 14px 16px; }
.calc-table tr.total td strong { font-family: var(--font-head); font-size: 20px; color: var(--brand); }
.calc-fact { font-size: 14px; color: var(--text-2); }
.calc-remove { font: inherit; margin-left: 8px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--input-line); background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 16px; line-height: 1; }
.calc-remove:hover { border-color: var(--brand); color: var(--brand); }
.calc-key-0 { background: var(--brand); }
.calc-key-1 { background: #8A7EE8; }
.calc-key-2 { background: var(--ink-900); }
.calc-group { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.calc-group-title { font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.calc-group-cols { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.calc-group-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.calc-group-bars { height: 140px; width: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-bottom: 1px solid var(--line); }
.calc-group-bars i { display: block; width: 28%; max-width: 22px; border-radius: 4px 4px 0 0; transition: height .35s ease; }
.calc-group-bars i:hover { filter: brightness(1.15); }

/* ---------- Quote check ---------- */
.calc-quote { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 900px) { .calc-quote { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 28px; } }
.calc-quote-out { display: flex; flex-direction: column; gap: 16px; }
.calc-example { align-self: flex-start; background: var(--brand-tint); color: var(--brand); font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }

/* ---------- Lead block ---------- */
.calc-plan { background: var(--bg); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 14px; color: var(--text-2); }
.calc-plan strong { display: block; color: var(--text); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }

@media (prefers-reduced-motion: reduce) {
  .calc-seg, .calc-budget-line, .calc-ruler-mark, .calc-group-bars i, .calc-row { transition: none; }
}
@media print { .calc-panel, .calc-toolbar, .calc-cmp, .calc-tip { display: none; } }
