/* Shared look for the redesigned pages (body.v2): system fonts, a light
   background, white bordered cards and left-aligned titles. Loaded last so it
   can adjust the older page stylesheets. Page types add their own file or the
   sections below. The cookie box rules apply wherever this file is loaded. */
:root {
  --v2-bg: #f5f6f8; --v2-surface: #fff; --v2-border: #e1e5ea; --v2-control: #cfd6de;
  --v2-text: #1c2430; --v2-muted: #5b6675; --v2-accent: #337ab7; --v2-accent-dark: #1f5f99;
}
/* Guide pages (bölümler, üniversiteler, programlar, kaç net) keep their own
   layout and only take the font and background. */
body.v2, body:has(.guide-shell) {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--v2-bg); color: var(--v2-text);
}
body:has(.guide-shell) .navbar-brand { font-weight: 700; }
.v2 .navbar-brand { font-weight: 700; }
.v2 .breadcrumb { font-size: 13px; margin-bottom: 6px; }
.v2 li.breadcrumb-item, .v2 li.breadcrumb-item.active { font-size: 13px; }
.v2 .form-control, .v2 .form-select { min-height: 44px; font-size: 16px; border-radius: 9px; border-color: var(--v2-control); color: var(--v2-text); }
.v2 h1 { font-size: clamp(24px, 5.6vw, 34px) !important; font-weight: 700 !important; line-height: 1.2; letter-spacing: -.01em; text-align: center !important; }

/* Exam and general calculators (calc-standard.css): same cards, new tokens. */
.v2.calc-page { --calc-bg: var(--v2-bg); --calc-border: var(--v2-border); --calc-muted: var(--v2-muted); --calc-radius: 14px; }
.v2.calc-page h1 { margin: 4px 0 10px; }
.v2.calc-page .calc-intro, .v2.calc-page .ayt-intro, .v2.calc-page .lgs-intro { text-align: left; margin-left: 0; font-size: 15.5px; line-height: 1.55; margin-bottom: 18px; }
.v2.calc-page .btn-success.btn-lg { border-radius: 12px; font-weight: 700; font-size: 17px; }
.v2.calc-page .calc-content h2, .v2.calc-page .calc-content-title, .v2.calc-page h2 { font-weight: 700; }

/* Midterm and final grade calculator (grade-form.njk). */
.grade-v2 .toppading { padding-top: 76px; }
.grade-v2 .calc-first > br, .grade-v2 form > br, .grade-v2 form > hr { display: none; }
.grade-v2 #baslik, .grade-v2 .calc-first > h1 { margin: 6px 0 10px; padding: 0; }
.grade-v2 .calc-first > p { color: var(--v2-muted); font-size: 15.5px; line-height: 1.55; }
.grade-v2 .calc-first p, .grade-v2 .calc-first li { font-size: 16px; line-height: 1.65; }
.grade-v2 form.form-horizontal { background: var(--v2-surface); border: 1px solid var(--v2-border); border-radius: 14px; padding: 14px; }
.grade-v2 form .row { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 0 8px; margin: 0; align-items: start; }
.grade-v2 form .row > * { width: auto; max-width: none; padding: 0; }
.grade-v2 form .row > label, .grade-v2 form .row > span, .grade-v2 form .row > .col-sm-8 { grid-column: 1 / -1; }
.grade-v2 form .row > label, .grade-v2 form .row > span { font-size: 13.5px; font-weight: 600 !important; color: #465264; padding: 0 0 4px; }
.grade-v2 form .row .btn-primary { width: 44px; height: 44px; padding: 0; border-radius: 9px; background: var(--v2-surface); color: var(--v2-accent-dark); border: 1px solid var(--v2-control); font-size: 20px; line-height: 1; }
.grade-v2 form .mb-3 { margin-bottom: 10px !important; }
.grade-v2 form .form-text { font-size: 13px; color: var(--v2-muted); margin-top: 0; }
.grade-v2 #gradePresets .btn { border-radius: 999px; font-size: 13.5px; padding: 6px 12px; color: #465264; border-color: var(--v2-control); background: var(--v2-surface); }
.grade-v2 .calculator { padding: 14px 0 20px; }
.grade-v2 #calcButton { width: 100%; min-height: 52px; border-radius: 12px; font-size: 17px; font-weight: 700; }
.grade-v2 .calc-first h2 { font-size: 22px; font-weight: 700; text-align: left !important; padding-top: 0 !important; margin: 32px 0 10px; }
.grade-v2 .calc-first h3 { font-size: 18px; font-weight: 600; }

/* "What do I need on the final" pages (final-grade.css). */
.fg-v2 .fg-card { background: var(--v2-surface); border: 1px solid var(--v2-border); border-radius: 14px; box-shadow: none; padding: 16px; margin-bottom: 14px; }
.fg-v2 .fg-card h2 { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--v2-muted); margin-bottom: 12px; }
.fg-v2 .fg-wrap label { font-size: 13.5px; font-weight: 600; color: #465264; margin-bottom: 4px; }
.fg-v2 .fg-help { font-size: 13.5px; color: var(--v2-muted); }
.fg-v2 .fg-row { border-bottom-color: var(--v2-border); }
.fg-v2 .fg-actions { padding-top: 6px; }
.fg-v2 .fg-actions .btn-success { max-width: none; min-height: 52px; border-radius: 12px; font-size: 17px; font-weight: 700; }
.fg-v2 .fg-explanation h2 { text-align: left; font-size: 22px; font-weight: 700; }
.fg-v2 .fg-result th { background: #fafbfc; color: var(--v2-muted); border-color: var(--v2-border); font-size: 12.5px; }
.fg-v2 .fg-result td { border-color: var(--v2-border); }
.fg-v2 .fg-wrap > h1 { margin: 6px 0 10px; }
.fg-v2 .fg-intro { color: var(--v2-muted); font-size: 15.5px; line-height: 1.55; text-align: left !important; }

@media (max-width: 500px) {
  .v2 .toppading { padding-top: 64px; }
  .v2 .breadcrumb { padding-left: 4px !important; }
}

/* Cookie box: a slim bar on phones instead of a third of the screen. The
   library sets its phone layout with !important, so these must too. */
@media (max-width: 640px) {
  #cc-main .cm { left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; border-radius: 14px; }
  #cc-main .cm__title { display: none; }
  #cc-main .cm__texts { padding: 10px 0 0; }
  #cc-main .cm__desc { font-size: 13px; line-height: 1.35; margin: 0; padding: 0 12px 8px !important; max-height: none; }
  #cc-main .cm__btns { flex-direction: row !important; gap: 8px; padding: 0 12px 8px !important; border-top: 0 !important; }
  #cc-main .cm__btn-group { flex: 1; flex-direction: row !important; gap: 8px; }
  #cc-main .cm__btn-group + .cm__btn-group, #cc-main .cm__btn + .cm__btn { margin: 0 !important; }
  #cc-main .cm__btn { min-height: 36px; padding: 6px 8px; font-size: 13.5px; border-radius: 9px; }
  #cc-main .cm__footer { padding: 0 0 8px; background: none; border-top: 0; font-size: 12px; }
  #cc-main .cm__links { padding: 0 12px !important; }
}

/* Final pages: the introduction moves below the form on phones, so close the gap. */
@media (max-width: 500px) { .fg-v2 .fg-wrap > h1 + br, .fg-v2 .fg-wrap > br { display: none; } .fg-v2 .fg-wrap > h1 { margin-bottom: 12px; } }

/* Calculator first, at every width: the introduction is shown after the
   calculator and its result instead of above the form. The HTML order (what
   search engines and screen readers get) is unchanged; only the visual order
   moves. Notes that say a result is an estimate stay above the form. */
.v2 .middle, .v2 .calc-first, .v2 .fg-wrap { display: flex; flex-direction: column; }
.v2 .middle > h1 + p, .v2 .middle > h1 + p + p,
.v2 .calc-first > h1 + br + p, .v2 .calc-first > h1 + br + p + p,
.v2 .fg-wrap > .fg-intro, .v2 .fg-wrap > noscript { order: 2; margin-top: 20px; }
.v2 .middle > h1 + p + p, .v2 .calc-first > h1 + br + p + p { margin-top: 0; }
.v2 .middle > #vivenPromoMount ~ *, .v2 .calc-first > #vivenPromoMount ~ *,
.v2 .fg-wrap > .fg-explanation, .v2 .fg-wrap > .fg-explanation ~ * { order: 3; }
.v2 .middle > h1 + br, .v2 .calc-first > h1 + br { display: none; }

.v2.calc-page :has(> :is(.calc-intro, .ayt-intro, .lgs-intro)) { display: flex; flex-direction: column; }
.v2.calc-page :is(.calc-intro, .ayt-intro, .lgs-intro) { order: 1; margin: 24px 0 0 !important; max-width: none; color: var(--v2-text); font-size: 16px; line-height: 1.65; }
.v2.calc-page :is(.calc-intro, .ayt-intro, .lgs-intro) ~ :is(.metugpa-ad, .calc-content, .lgs-explanation),
.v2.calc-page :is(.calc-intro, .ayt-intro, .lgs-intro) ~ :is(.metugpa-ad, .calc-content, .lgs-explanation) ~ * { order: 2; }
.v2.calc-page h1 { margin-bottom: 16px; }

/* ---- Second pass: desktop layout, header, breadcrumb, results ---- */

/* Header: every item on one line at desktop widths. */
.v2 .head, body:has(.guide-shell) .head { padding: 4px 20px; }
.v2 .headElem, body:has(.guide-shell) .headElem { font-size: 14.5px !important; white-space: nowrap; }
@media (min-width: 992px) {
  .v2 .navbar-nav .nav-link, body:has(.guide-shell) .navbar-nav .nav-link { padding-left: 9px; padding-right: 9px; }
}

/* Breadcrumb at the left of the page, in the same place on every calculator
   (where the exam pages already had it), with room under the header. */
.v2 .toppading { padding-top: 92px; }
.v2 .breadcrumb { justify-content: flex-start; padding-left: 5% !important; margin-bottom: 4px; }
.v2 .breadcrumb:not(:has(li)) { display: none; }
.v2 h1 { margin-top: 14px; margin-bottom: 20px; }
.gpa-v2 #caption, .grade-v2 #baslik, .grade-v2 .calc-first > h1, .fg-v2 .fg-wrap > h1, .v2.calc-page h1 { margin: 14px 0 20px; }

/* One reading width for the GPA, grade and final calculators on desktop. */
@media (min-width: 576px) {
  .v2 .toppading > .row > :is(.middle, .calc-first, .fg-wrap) { flex: 0 0 auto; width: 100%; max-width: 680px; margin-left: auto; margin-right: auto; }
  /* The main button keeps its phone height but not the full width. */
  .gpa-v2 #calcButton, .grade-v2 #calcButton, .fg-v2 .fg-actions .btn-success { width: auto; min-width: 280px; flex-basis: auto; }
  .gpa-v2 .calculator, .grade-v2 .calculator { text-align: center; }
}

/* Smooth page-to-page changes; the selected grading system slides like a
   segmented control although each system is its own page. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; }
.gpa-scale-tabs a[aria-current="page"] { view-transition-name: gpa-scale-tab; }
::view-transition-group(gpa-scale-tab) { animation-duration: .22s; }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* GPA result: the strongest element on the page after calculating. */
.gpa-v2 #result > .alert { padding: 0 !important; overflow: hidden; border: 2px solid var(--v2-accent); border-radius: 16px; box-shadow: 0 8px 24px rgba(31, 95, 153, .14); }
.gpa-v2 #result caption { background: var(--v2-accent) !important; color: #fff !important; text-align: center !important; font-size: 13px; font-weight: 700; letter-spacing: .1em; padding: 10px 12px; }
.gpa-v2 #result td { text-align: center; width: 50%; }
.gpa-v2 #result tr:first-of-type td { padding-top: 18px !important; font-size: 13.5px; }
.gpa-v2 #result tr:last-of-type td { padding-bottom: 16px !important; font-size: 44px; line-height: 1.1; color: var(--v2-accent-dark); }
.gpa-v2 #result tr td + td { border-left: 1px solid var(--v2-border) !important; }
.gpa-v2 #result > .alert > p.alert { margin: 0 16px 16px; background: #e8f5ee !important; color: #146c43 !important; font-weight: 600; }
.gpa-v2 #result > .alert > p.gpa-help { margin: 0 16px 14px; }
.gpa-v2 .gpa-low-note { margin: 0 16px 16px; }
.gpa-v2 #gpaNextSteps { margin: 0 !important; padding: 14px 16px 16px; border-top: 1px solid var(--v2-border); background: #fafbfc; }
.gpa-v2 #gpaNextSteps > div { font-size: 12.5px; font-weight: 600 !important; letter-spacing: .06em; text-transform: uppercase; color: var(--v2-muted); margin-bottom: 8px !important; }
.gpa-v2 #gpaNextSteps ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.gpa-v2 #gpaNextSteps a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--v2-surface); border: 1px solid var(--v2-control); border-radius: 10px; color: var(--v2-accent-dark); font-size: 15px; font-weight: 600; text-decoration: none; }
.gpa-v2 #gpaNextSteps a::after { content: "→"; flex: none; }
.gpa-v2 #gpaNextSteps a:hover { border-color: var(--v2-accent); background: #f2f7fc; }

/* Guide pages: Safari ignores min-height on a native select. */
body:has(.guide-shell) select {
  appearance: none; -webkit-appearance: none; height: 44px; padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235b6675' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m3 6 5 5 5-5'/%3e%3c/svg%3e") no-repeat right 12px center / 12px 12px;
}

/* MSÜ total: keep "Toplam net 0,00 / 120" on one baseline in every browser. */
.v2.calc-page .msu-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 6px; }
.v2.calc-page .msu-total output { display: inline-block; }

@media (max-width: 500px) {
  .v2 .toppading { padding-top: 70px; }
  .v2 h1, .gpa-v2 #caption, .grade-v2 #baslik, .fg-v2 .fg-wrap > h1, .v2.calc-page h1 { margin: 10px 0 16px; }
}

/* Small alignment fixes found in the page-by-page review. */
.v2 #diger_hesaplamalar { padding-top: 0; }
.fin-v2 h1 { color: var(--v2-text); }
.fg-v2 .fg-wrap > br { display: none; }
.fin-v2 h1.caption, .fin-v2 h1 { color: var(--v2-text) !important; }
@media (max-width: 500px) { body:has(.guide-shell) { padding-top: 60px; } }

/* Midterm/final result: same card, header strip and link rows as the GPA result. */
.grade-v2 #result > .alert:not(.alert-warning) { padding: 0 !important; overflow: hidden; background: var(--v2-surface) !important; border: 2px solid var(--v2-accent) !important; border-radius: 16px; box-shadow: 0 8px 24px rgba(31, 95, 153, .14); margin: 16px 0 !important; }
.grade-v2 #result .table-responsive, .grade-v2 #result > .alert > div:first-child { overflow: visible; }
.grade-v2 #result table { width: 100% !important; table-layout: fixed; margin: 0; border: 0 !important; }
.grade-v2 #result caption { caption-side: top; background: var(--v2-accent) !important; color: #fff !important; font-size: 13px; font-weight: 700; letter-spacing: .1em; padding: 10px 12px; }
.grade-v2 #result th, .grade-v2 #result td { border: 0 !important; border-bottom: 1px solid var(--v2-border) !important; padding: 10px 6px !important; text-align: center; vertical-align: middle; font-size: 15px; overflow-wrap: anywhere; }
.grade-v2 #result th { font-size: 11.5px; font-weight: 600; color: var(--v2-muted); background: #fafbfc; line-height: 1.3; }
.grade-v2 #result td:first-child, .grade-v2 #result th:first-child { text-align: left; padding-left: 14px !important; font-size: 13px; }
.grade-v2 #result td:nth-child(2) { font-size: 20px; font-weight: 700; color: var(--v2-accent-dark); font-variant-numeric: tabular-nums; }
.grade-v2 #result #requiredFinal { padding: 16px !important; }
.grade-v2 #gradeNextSteps { margin: 0 !important; padding: 14px 16px 16px; background: #fafbfc; }
.grade-v2 #requiredFinal #gradeNextSteps { margin: 14px -16px -16px !important; border-top: 1px solid var(--v2-border); }
.grade-v2 #gradeNextSteps > div, .grade-v2 #gradeNextSteps > .fw-bold { font-size: 12.5px; font-weight: 600 !important; letter-spacing: .06em; text-transform: uppercase; color: var(--v2-muted); margin-bottom: 8px !important; }
.grade-v2 #gradeNextSteps ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.grade-v2 #gradeNextSteps a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--v2-surface); border: 1px solid var(--v2-control); border-radius: 10px; color: var(--v2-accent-dark); font-size: 15px; font-weight: 600; text-decoration: none; }
.grade-v2 #gradeNextSteps a::after { content: "→"; flex: none; }
.grade-v2 #result th:first-child, .grade-v2 #result td:first-child { width: 29%; font-size: 12px; overflow-wrap: normal; hyphens: auto; }

/* GPA pages: no breadcrumb, so the title and tabs stay in place when the
   grading system changes (the AA/BA/BB pages never had one). */
.gpa-v2 .toppading > nav[aria-label="breadcrumb"] { display: none; }
/* Keep the GPA titles to the same number of lines so the tabs do not move. */
.gpa-v2 #caption { font-size: clamp(19px, 5.2vw, 30px) !important; text-wrap: balance; }

/* ---- Buttons and links: one set of colours and shapes across the site ---- */
.v2 .btn-primary { background: var(--v2-accent); border-color: var(--v2-accent); }
.v2 .btn-primary:hover, .v2 .btn-primary:focus { background: var(--v2-accent-dark); border-color: var(--v2-accent-dark); }
.v2 .toppading a:not(.btn):not(.calculator-link), .v2 main a:not(.btn):not(.calculator-link) { color: var(--v2-accent-dark); }
/* Secondary actions (add a row, try the example, clear): white pills. */
.fg-v2 #fg-add-midterm, .fg-v2 #fg-add-other, .fg-v2 #fg-example, .v2.calc-page .calc-actions .btn-outline-secondary {
  background: var(--v2-surface); color: var(--v2-accent-dark); border: 1px solid var(--v2-control); border-radius: 999px; padding: 8px 16px; font-size: 14.5px; font-weight: 600; min-height: 0;
}
.fg-v2 #fg-add-midterm:hover, .fg-v2 #fg-add-other:hover, .fg-v2 #fg-example:hover, .v2.calc-page .calc-actions .btn-outline-secondary:hover { border-color: var(--v2-accent); background: #f2f7fc; color: var(--v2-accent-dark); }
.fg-v2 .fg-actions .btn-link { color: var(--v2-muted); font-size: 14.5px; text-decoration: none; }
.v2.calc-page #msu-form .calc-actions .btn-outline-secondary { min-height: 44px; padding: 8px 20px; border-radius: 999px; }

/* ---- "Finalden kaç almalıyım": the form without the explanatory text ----
   The same points are covered in the explanation under the calculator. The
   curve notes stay: they appear only when the estimated curve is switched on. */
.fg-v2 #fg-scale-help, .fg-v2 #scores-heading + .fg-help, .fg-v2 #fg-others-help, .fg-v2 h3 + .fg-help { display: none; }
.fg-v2 .fg-card h3 { font-size: 13.5px; font-weight: 600; color: #465264; margin: 14px 0 6px; }
.fg-v2 .fg-card h3:first-of-type { margin-top: 0; }
/* One line per exam: name, score, weight and a small remove button. */
.fg-v2 .fg-row { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 8px; align-items: end; margin-bottom: 8px; padding-bottom: 0; border-bottom: 0; }
.fg-v2 .fg-row > div:first-child { grid-column: auto; }
.fg-v2 .fg-row label { font-size: 12px; font-weight: 600; color: var(--v2-muted); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fg-v2 .fg-row ~ .fg-row label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.fg-v2 .fg-row .form-control { padding-left: 10px; padding-right: 8px; }
.fg-v2 .fg-row > button { grid-column: auto; justify-self: stretch; width: 36px; height: 44px; padding: 0; font-size: 0; border: 1px solid var(--v2-control); border-radius: 9px; background: var(--v2-surface); color: var(--v2-muted); }
.fg-v2 .fg-row > button::before { content: "×"; font-size: 20px; line-height: 1; }
.fg-v2 .fg-row > button:hover { color: #a02121; border-color: #a02121; }
.fg-v2 .fg-final-weight { margin-top: 16px; padding-top: 14px; border-top-color: var(--v2-border); }
.fg-v2 .fg-weight, .fg-v2 #fg-target-summary { font-size: 13.5px; color: var(--v2-muted); margin: 8px 0 0; }
.fg-v2 .fg-curve-toggle { margin-top: 14px; }
.fg-v2 #fg-scale-details { margin-top: 10px; font-size: 14.5px; }
.fg-v2 .fg-actions { justify-content: center; gap: 10px; padding-top: 16px; }
/* Result: same accent card as the GPA and grade results. */
.fg-v2 .fg-result { border: 2px solid var(--v2-accent); border-radius: 16px; box-shadow: 0 8px 24px rgba(31, 95, 153, .14); }
.fg-v2 .fg-result > h2:first-child { color: var(--v2-text); font-size: 15px; letter-spacing: 0; text-transform: none; font-weight: 600; }
.fg-v2 .fg-score { color: var(--v2-accent-dark); font-size: 44px; font-weight: 700; line-height: 1.1; }
.fg-v2 .fg-result:focus, .fg-v2 .fg-result:focus-visible { outline: none; }
.fg-v2 .fg-result table { margin-top: 10px; font-size: 14.5px; }
.fg-v2 #fgNextSteps { margin: 16px -16px -16px; padding: 14px 16px 16px; border-top: 1px solid var(--v2-border); background: #fafbfc; border-radius: 0 0 14px 14px; }
.fg-v2 #fgNextSteps > :first-child:not(ul) { font-size: 12.5px; font-weight: 600 !important; letter-spacing: .06em; text-transform: uppercase; color: var(--v2-muted); margin: 0 0 8px !important; }
.fg-v2 #fgNextSteps ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.fg-v2 #fgNextSteps a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; background: var(--v2-surface); border: 1px solid var(--v2-control); border-radius: 10px; color: var(--v2-accent-dark); font-size: 15px; font-weight: 600; text-decoration: none; }
.fg-v2 #fgNextSteps a::after { content: "→"; flex: none; }

/* ---- Exam and general calculators: same rules as the GPA and grade pages ---- */
/* Rule-of-thumb help ("4 yanlış 1 doğruyu götürür…") sits under the table,
   just above the button, instead of above the form. */
.v2.calc-page form.calc-form, .v2.calc-page #lgs-form { display: flex; flex-direction: column; }
.v2.calc-page form.calc-form > p.calc-help:not(#alesNets), .v2.calc-page #lgs-input-help { order: 1; margin: 10px 2px 0; font-size: 13px; color: var(--v2-muted); }
.v2.calc-page form.calc-form > .calc-actions, .v2.calc-page #lgs-form > .lgs-actions { order: 2; }
.v2.calc-page .calc-note, .v2.calc-page .lgs-model-note { font-size: 13px; line-height: 1.5; padding: 10px 14px; margin-bottom: 16px; border-radius: 12px; }

/* Buttons: one primary size, white pills for secondary actions. */
.v2.calc-page .btn-success.btn-lg, .v2.calc-page #calcButton { min-height: 52px; min-width: 280px; border-radius: 12px; font-size: 17px; font-weight: 700; }
.v2.calc-page .btn-outline-secondary { background: var(--v2-surface); color: var(--v2-accent-dark); border: 1px solid var(--v2-control); border-radius: 999px; padding: 8px 16px; font-size: 14.5px; font-weight: 600; min-height: 0; }
.v2.calc-page .btn-outline-secondary:hover { border-color: var(--v2-accent); background: #f2f7fc; color: var(--v2-accent-dark); }
.v2.calc-page .okul-add { align-self: flex-start; margin-top: 10px; }
.v2.calc-page .calc-actions, .v2.calc-page .lgs-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.v2.calc-page .calc-actions .btn, .v2.calc-page .lgs-actions .btn { margin: 0; }
@media (max-width: 575px) {
  .v2.calc-page .btn-success.btn-lg, .v2.calc-page #calcButton { min-width: 0; }
  .v2.calc-page .calc-actions .btn-success, .v2.calc-page .lgs-actions .btn-success { flex: 1; }
  .v2.calc-page .calculator #calcButton, .v2.calc-page .calculator .btn-success { width: 100%; }
}

/* Results: the accent card used on the GPA page. */
.v2.calc-page .calc-result, .v2.calc-page .lgs-result, .v2.calc-page .yks-result-card { border: 2px solid var(--v2-accent); border-radius: 16px; box-shadow: 0 8px 24px rgba(31, 95, 153, .14); }
.v2.calc-page .calc-result--error { border-color: var(--calc-error); box-shadow: none; }
.v2.calc-page .calc-result h2, .v2.calc-page .calc-main .calc-result h2 { font-weight: 700; }
.v2.calc-page .calc-result p > span:last-child { color: var(--v2-accent-dark); font-weight: 700; }
.v2.calc-page .calc-result p > span.okul-fail { color: #b3261e; }
/* A long value (for example a list of failed courses) wraps under its label
   instead of squeezing the label to one letter per line. */
.v2.calc-page .calc-result p { flex-wrap: wrap; }
.v2.calc-page .calc-result p > span:first-child { flex: 1 1 45%; min-width: 45%; }
.v2.calc-page .calc-result p > span:last-child { flex: 0 1 auto; max-width: 100%; }

/* Desktop: exam calculators with a short table use the narrower reading width
   instead of stretching a two-row table across 1100px. */
@media (min-width: 992px) { .v2.calc-page main.calc-main { max-width: 760px; } }

/* Midterm/final calculator: rows are added with a labelled button under the
   group (as on the GPA and final pages), not a bare "+" beside the first row. */
.grade-v2 form .row { grid-template-columns: 1fr 1fr; }
.grade-v2 .grade-add { display: inline-block; margin: 0 0 14px; background: var(--v2-surface); color: var(--v2-accent-dark); border: 1px solid var(--v2-control); border-radius: 999px; padding: 8px 16px; font-size: 14.5px; font-weight: 600; }
.grade-v2 .grade-add:hover { border-color: var(--v2-accent); background: #f2f7fc; color: var(--v2-accent-dark); }
.grade-v2 #midterms > .mb-3:last-child, .grade-v2 #others > :last-child { margin-bottom: 8px !important; }
.grade-v2 #others > .mt-3 { margin-top: 0 !important; }

/* ---- Finance calculators: form in a card, results in the accent card ---- */
.fin-v2 .tableOuter { background: var(--v2-surface); border: 1px solid var(--v2-border); border-radius: 14px; padding: 16px; margin: 0 0 16px; }
.fin-v2 .tableOuter hr { margin: 10px 0; border-color: var(--v2-border); opacity: 1; }
.fin-v2 .tableOuter label { font-size: 13.5px; font-weight: 600 !important; color: #465264; }
.fin-v2 .tableOuter .row { margin-bottom: 10px !important; }
.fin-v2 .tableOuter .btn-primary { border-radius: 9px; min-width: 56px; font-weight: 600; }
.fin-v2 .results { margin: 16px 0 0; padding: 14px 16px; background: var(--v2-surface); border: 2px solid var(--v2-accent); border-radius: 14px; box-shadow: 0 8px 24px rgba(31, 95, 153, .14); }
.fin-v2 .results hr { display: none; }
.fin-v2 .results :is(span, output, strong + span, .value), .fin-v2 ul.result li { color: var(--v2-accent-dark); font-weight: 700; font-variant-numeric: tabular-nums; }
.fin-v2 .leftTable { border: 1px solid var(--v2-border); border-radius: 14px; overflow: hidden; background: var(--v2-surface); }
.fin-v2 .leftTable .list-group-item, .fin-v2 .leftTable .link { border-left: 0; border-right: 0; font-size: 14.5px; }
.fin-v2 .leftTable .active, .fin-v2 .leftTable .list-group-item.active { background: var(--v2-accent); border-color: var(--v2-accent); }
.fin-v2 .col-md-4 > h3, .fin-v2 .col-md-4 > h4, .fin-v2 .col-md-4 .leftHead { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--v2-muted); }
.fin-v2 .col-md-8 :is(h2, h3) { font-size: 22px; font-weight: 700 !important; color: var(--v2-text); margin: 28px 0 10px; }
.fin-v2 .col-md-8 h4, .fin-v2 .col-md-8 h4 strong { font-size: 17px; font-weight: 600; color: var(--v2-text); }
.fin-v2 .col-md-8 p, .fin-v2 .col-md-8 li { font-size: 16px; line-height: 1.65; }
.fin-v2 blockquote { margin: 0; }
.fin-v2 .nav-tabs .nav-link { border-radius: 999px; border: 1px solid transparent; padding: 6px 12px; font-size: 14.5px; font-weight: 600; }
.fin-v2 .nav-tabs { border-bottom: 0; gap: 4px; margin-bottom: 12px; }
.fin-v2 .nav-tabs .nav-link.active { background: var(--v2-surface); border-color: var(--v2-control); color: var(--v2-accent-dark); }
/* Finance results and menu: readable values, visible active item. */
.fin-v2 .results h4 { font-size: 12.5px; font-weight: 700 !important; letter-spacing: .08em; text-transform: uppercase; color: var(--v2-muted); margin: 0 0 8px; }
.fin-v2 .results ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fin-v2 .results ul:last-child { margin-bottom: 0; }
.fin-v2 .results li { margin: 0; font-size: 15px; letter-spacing: 0; text-transform: none; }
.fin-v2 .results li strong { font-weight: 500; color: var(--v2-text); }
.fin-v2 .results li[id], .fin-v2 .results li[id] *, .fin-v2 .results li:last-child:not(:first-child) { font-size: 20px; letter-spacing: 0; text-transform: none; margin: 0; font-weight: 700; color: var(--v2-accent-dark); font-variant-numeric: tabular-nums; }
.fin-v2 .leftTable .fincalcs { color: var(--v2-muted) !important; font-size: 12.5px !important; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 14px 16px 8px !important; margin: 0 !important; }
.fin-v2 .leftTable .link { width: 100%; }
.fin-v2 .leftTable .link.active { color: #fff !important; }
.fin-v2 .col-md-8 :is(h2, h3), .fin-v2 .col-md-8 :is(h2, h3) * { color: var(--v2-text) !important; }
.fin-v2 .mainHead a { font-size: 17px; font-weight: 600; }

/* Midterm/final calculator: added rows carry a small remove button. While any
   exists, every row keeps the same third column so the inputs stay aligned. */
.grade-v2 form:has(.grade-remove) .row { grid-template-columns: 1fr 1fr 36px; }
.grade-v2 .grade-remove { width: 36px; height: 44px; padding: 0; font-size: 20px; line-height: 1; background: var(--v2-surface); color: var(--v2-muted); border: 1px solid var(--v2-control); border-radius: 9px; }
.grade-v2 .grade-remove:hover { color: #a02121; border-color: #a02121; background: var(--v2-surface); }

/* Finance result tables (stock calculators): fit the card instead of a fixed
   350px width that was cut off on phones. */
.fin-v2 .tableOuter .container-fluid { padding-left: 0; padding-right: 0; }
.fin-v2 .tableOuter table { width: 100% !important; table-layout: fixed; margin: 6px 0 0; }
.fin-v2 .tableOuter table th, .fin-v2 .tableOuter table td { padding: 8px 6px; font-size: 14.5px; text-align: right; overflow-wrap: anywhere; border-color: var(--v2-border); }
.fin-v2 .tableOuter table th:first-child, .fin-v2 .tableOuter table td:first-child { text-align: left; }
.fin-v2 .tableOuter table thead th { font-size: 12.5px; font-weight: 600; color: var(--v2-muted); }
.fin-v2 .tableOuter table td[id] { font-weight: 700; color: var(--v2-accent-dark); font-variant-numeric: tabular-nums; }

/* Stock calculators whose result is a bare list (WACC, holding period return…):
   the same accent card as the other finance results. */
.fin-v2 .tableOuter form > h4 { font-size: 12.5px; font-weight: 700 !important; letter-spacing: .08em; text-transform: uppercase; color: var(--v2-muted); margin: 14px 0 8px; }
.fin-v2 .tableOuter form > h4 + hr, .fin-v2 .tableOuter form > h4 + hr + br, .fin-v2 .tableOuter form > hr:has(+ h4) { display: none; }
.fin-v2 .tableOuter .row:has(> ul.result) { display: block; margin: 0 !important; padding: 14px 16px; background: var(--v2-surface); border: 2px solid var(--v2-accent); border-radius: 14px; box-shadow: 0 8px 24px rgba(31, 95, 153, .14); }
.fin-v2 ul.result { list-style: none; margin: 0 !important; padding: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.fin-v2 ul.result label { width: auto !important; padding: 0; font-size: 15px; font-weight: 500 !important; color: var(--v2-text); }
.fin-v2 ul.result li[id] { font-size: 20px; font-weight: 700; color: var(--v2-accent-dark); font-variant-numeric: tabular-nums; }
.fg-v2 .fg-row label { font-size: 11.5px; }
