﻿      body { background: #f7f7f7; min-width: 320px; overflow-x: auto; color: #212529; }
      html.theme-dark { background: #121212; color: #f8f9fa; }
      html.theme-dark .card { background: #1b1b1b; border-color: #2b2b2b; }
      html.theme-dark .table { color: #f8f9fa; }
      html.theme-dark .table thead th { background: #1b1b1b; }
      html.theme-dark .table > :not(caption) > * > * {
        background: #1b1b1b;
        color: #e9ecef;
        border-color: #2b2b2b;
      }
      html.theme-dark .table-striped > tbody > tr:nth-of-type(odd) > * {
        background: #202020;
      }
      html.theme-dark .table-primary > * {
        background: #0d2a4d !important;
        color: #f8f9fa;
      }
      html.theme-dark .text-danger { color: #ff6b6b !important; }
      html.theme-dark .form-label,
      html.theme-dark .fw-semibold,
      html.theme-dark .small-help,
      html.theme-dark .price-value,
      html.theme-dark .price-value-sm,
      html.theme-dark .dep-value,
      html.theme-dark .text-muted,
      html.theme-dark .text-white-50,
      html.theme-dark .scenario-meta,
      html.theme-dark .form-check-label { color: #cfd4da !important; }
      html.theme-dark .form-control,
      html.theme-dark .form-select,
      html.theme-dark .input-group-text {
        background: #141414;
        color: #f8f9fa;
        border-color: #2b2b2b;
      }
      html.theme-dark .price-sheet-panel,
      html.theme-dark .price-modal-panel { background: #1b1b1b; color: #f8f9fa; border: 1px solid #2b2b2b; }
      html.theme-dark .price-wheel { background: #161616; }
      html.theme-dark .price-chip { background: #202020; color: #f8f9fa; border-color: #2b2b2b; }
      html.theme-dark .info-popover { background: #1b1b1b; color: #f8f9fa; border-color: #2b2b2b; }
      html.theme-dark .scenario-row { border-bottom-color: #2b2b2b; }
      html.theme-dark .topbar { background: #242424; }
      html.theme-dark .nav-pills .nav-link { background: rgba(255,255,255,0.08); color: #e9ecef; }
      html.theme-dark .nav-pills .nav-link.active { background: #000000; color: #ffffff; }
      html.theme-dark .nav-pills .nav-link.help-tab {
        background: #ffd43b;
        color: #0d6efd;
      }
      html.theme-dark .nav-pills .nav-link.help-tab.active {
        background: #000000;
        color: #ffffff;
      }
      .scenario-name-banner {
        color: #0d6efd;
        font-size: clamp(1.2rem, 4.8vw, 2rem);
        font-weight: 700;
        line-height: 1.08;
        letter-spacing: 0.01em;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
      }
      .container { min-width: 320px; }
      .container-narrow { max-width: 1280px; }
      .card { border-radius: 16px; margin-top: 0.75rem; }
      .card-tight { margin-top: 0 !important; }
      .nav-pills .nav-link { border-radius: 999px; }
      .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
      .table-scroll { max-height: 65vh; overflow: auto; }
      .small-help { font-size: 0.9rem; color: #495057; }
      input[type="number"] { font-variant-numeric: tabular-nums; }
      .sticky-nav { position: static; }
      .topbar {
        background: #0d6efd;
        border-radius: 0;
        padding: 0.75rem 0 0;
        color: #fff;
        box-shadow: none;
      }
      .topbar-shell {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
        padding-top: env(safe-area-inset-top);
      }
      .content-shell {
        padding-top: 0;
        padding-bottom: 0.5rem;
        margin-top: -2px;
      }
      .content-shell > .card:first-child {
        margin-top: 0;
        border-top-left-radius: 0;
        border-top-right-radius: 0;
      }
      .content-shell > *:first-child { margin-top: 10px; }
      .app-footer {
        text-align: center;
        font-size: 0.85rem;
        color: #6c757d;
        padding: 0.85rem 0 1.25rem;
      }
      html.theme-dark .app-footer {
        color: #9aa1a8;
      }
      .brand { display: flex; align-items: center; gap: 0.6rem; }
      .logo {
        width: clamp(64px, 10vw, 100px);
        height: clamp(64px, 10vw, 100px);
        background: transparent;
        border: 1px solid rgba(255,255,255,0.28);
        border-radius: 18px;
        display: grid; place-items: center;
        overflow: hidden;
      }
      .logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
      }
      .brand h1 { font-size: 0.85rem;\n  font-weight: 600;\n  padding: 6px 10px;\n  border-radius: 8px; margin: 0; font-weight: 700; }
      .brand .sub { font-size: 0.85rem; opacity: 0.9; margin: 0; }
      .tabs {
        grid-area: tabs;
        margin-top: 0.2rem;
        margin-bottom: 0;
        padding: 0;
        align-self: end;
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
      }
      .tabs::-webkit-scrollbar {
        width: 0;
        height: 0;
        display: none;
      }
      .nav-pills {
        flex-wrap: nowrap;
        white-space: nowrap;
        width: max-content;
        margin-bottom: -2px;
        align-items: flex-end;
      }
      .nav-pills .nav-link {
        background: #58a0ff;
        color: #fff;
        border-radius: 12px 12px 0 0;
        padding: 0.7rem 0.9rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 2.6rem;
      }
      .nav-pills .nav-link.active:not(.help-tab) {
        background: #ffffff;
        color: #0d6efd;
        margin-bottom: 0;
        border-bottom: 1px solid #ffffff;
        box-shadow: 0 1px 0 #ffffff;
      }
      html.theme-dark .nav-pills .nav-link.active:not(.help-tab) {
        border-bottom: 1px solid #000000;
        box-shadow: 0 1px 0 #000000;
      }
      .nav-pills .nav-link.help-tab {
        background: #ffd43b;
        color: #0d6efd;
        font-weight: 700;
        min-width: 2.4rem;
        line-height: 1;
        height: 47px;
        min-height: 47px;
      }
      .nav-pills .nav-link.help-tab.active {
        background: #ffd43b;
        color: #0d6efd;
      }
      @media (min-width: 577px) {
        .nav-pills .nav-link.help-tab {
          height: 47px;
          min-height: 47px;
          min-width: 2.6rem;
          padding: 0.7rem 0.9rem;
        }
      }
      .tab-short { display: none; }
      .table { font-size: 0.92rem; }
      .th-vertical {
        width: 28px;
        padding: 0.2rem 0.15rem;
        vertical-align: middle;
        text-align: center;
      }
      .th-vertical span {
        display: inline-block;
        writing-mode: vertical-rl;
        text-orientation: mixed;
        font-size: 0.75rem;
        line-height: 1;
      }
      .payment-block { text-align: left; }
      @media (max-width: 430px) {
        .brand { min-width: 0; width: 100%; }
        .nav-pills .nav-link { flex: 0 0 auto; text-align: center; }
      }
      @media (max-width: 576px) {
        .topbar { padding: 0.5rem 0 0; }
        .topbar-shell { padding-left: 0.6rem; padding-right: 0.6rem; }
        .topbar-inner { gap: 8px; }
        .brand { gap: 8px; }
        .logo { width: clamp(56px, 14vw, 64px); height: clamp(56px, 14vw, 64px); border-radius: 12px; }
        .logo img { width: 100%; height: 100%; }
        .tabs { margin-top: 0; }
        .nav-pills { gap: 6px !important; }
        .nav-pills .nav-link { padding: 0.35rem 0.65rem; font-size: 0.9rem; }
        .nav-pills .nav-link.help-tab {
          height: auto;
          min-height: 2.6rem;
        }
        .tab-full { display: none; }
        .tab-short { display: inline; }
        .topbar-controls { gap: 0.4rem; }
        .header-action-btn { width: 40px; height: 40px; }
        .currency-btn { font-size: 1rem; }
      }
      @media (max-width: 576px) {
        .table { font-size: 0.85rem; }
        .card-body { padding: 0.9rem; }
        .hide-mobile { display: none !important; }
        .content-shell {
          max-width: none !important;
          width: 100%;
          padding-left: 0 !important;
          padding-right: 0 !important;
        }
        .content-shell .card {
          margin-top: 0 !important;
          border: 0;
          border-radius: 0;
          box-shadow: none !important;
          background: transparent;
        }
        html.theme-dark .content-shell .card {
          background: transparent;
          border-color: transparent;
        }
        .content-shell .card-body {
          padding: 0.8rem 0.6rem;
        }
      }
    
      /* Sticky table headers in scroll containers */
      .table-wrap table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
        background: #fff;
      }

      /* Bigger slider thumb for touch */
      input[type="range"].form-range { height: 1.4rem; }
      input[type="range"].form-range::-webkit-slider-runnable-track { height: 10px; }
      input[type="range"].form-range::-webkit-slider-thumb {
        width: 28px; height: 28px; margin-top: -9px;
      }
      input[type="range"].form-range::-moz-range-track { height: 10px; }
      input[type="range"].form-range::-moz-range-thumb { width: 28px; height: 28px; }
      input[type="range"].form-range::-ms-track { height: 10px; }
      input[type="range"].form-range::-ms-thumb { width: 28px; height: 28px; }

      /* Price picker sheet */
      .price-picker {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.75rem;
        padding: 0.35rem 0.25rem;
        border: none;
        background: transparent;
      }
      .price-picker-row {
        display: grid;
        grid-template-columns: max-content max-content;
        align-items: center;
        gap: 0.6rem;
        justify-content: center;
        justify-items: center;
      }
      .price-field-compact { min-width: 0; }
      .price-picker-stack {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.15rem;
      }
      .price-picker-compact {
        flex-direction: column;
        gap: 0.08rem;
        width: 100%;
        min-width: 0;
        padding: 0.2rem 0.1rem;
      }
      .price-picker-compact .price-value {
        font-size: clamp(1.05rem, 5.2vw, 1.7rem);
        line-height: 1.02;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .price-picker-compact .price-value::after { content: none; }
      .picker-arrow {
        font-size: 0.82rem;
        line-height: 1;
        color: rgba(13,110,253,0.62);
      }
      .price-custom-link.compact-link {
        margin-top: 0.1rem;
        font-size: 0.82rem;
        line-height: 1;
      }
      .field-divider {
        margin: 0.15rem 0 0.2rem;
        border: 0;
        border-top: 2px solid rgba(13,110,253,0.52);
      }
      .apr-inline-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
      }
      .apr-inline-row .input-group {
        width: auto;
        margin-left: auto;
      }
      .apr-inline-row .apr-input {
        width: clamp(4.6rem, 16vw, 6.2rem);
        min-width: 4.6rem;
        text-align: center;
        font-size: 1.1rem;
        font-weight: 700;
      }
      .apr-compact-actions {
        display: inline-flex;
        gap: 0.5rem;
        margin-top: 0.1rem;
      }
      .apr-compact-actions .btn {
        font-size: 0.82rem;
        padding: 0;
      }
      .apr-field {
        display: flex;
        align-items: center;
      }
      .apr-field .price-picker-stack { width: 100%; }
      .apr-trigger {
        width: auto;
        min-width: 0;
      }
      .apr-trigger .price-value {
        font-size: 1.5rem !important;
      }
      #loan_term_display::after {
        content: " months";
        font-size: 0.55em;
        font-weight: 600;
        opacity: 0.78;
        margin-left: 0.25rem;
      }
      .price-picker:focus-visible {
        outline: 2px solid rgba(13,110,253,0.45);
        outline-offset: 4px;
        border-radius: 10px;
      }
      .price-picker .price-value {
        font-weight: 700;
        font-size: 2rem;
        color: #0d6efd;
        text-align: center;
        width: 100%;
        letter-spacing: 0.01em;
      }
      .price-picker .price-value.price-value-sm { font-size: 0.85rem;\n  font-weight: 600;\n  padding: 6px 10px;\n  border-radius: 8px; }
      .dep-picker {
        justify-content: flex-start;
        padding-left: 0;
        width: auto;
      }
      .dep-picker .dep-value {
        font-size: 1rem;
      }
      .dep-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
      }
      .dep-setall {
        background: #0d6efd;
        color: #fff;
        padding: 0.25rem 0.6rem;
        margin-left: 0.7rem;
        border-radius: 999px;
        font-size: 0.85rem;
        font-weight: 600;
        text-decoration: none;
      }
      .dep-setall:hover { background: #0b5ed7; color: #fff; }
      .apr-inline {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        flex-wrap: wrap;
      }
      .apr-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        flex-wrap: wrap;
      }
      .apr-input {
        width: 3.2rem;
        min-width: 3.2rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        text-align: center;
      }
      .apr-input-group { width: auto; }
      .apr-input-group .form-control {
        flex: 0 0 auto;
      }
      .apr-input-group .input-group-text {
        padding-left: 0.4rem;
        padding-right: 0.4rem;
      }
      .apr-actions {
        display: inline-flex;
        gap: 0.5rem;
      }
      .price-sheet {
        position: fixed;
        inset: 0;
        display: none;
        z-index: 1050;
      }
      .price-sheet.open { display: block; }
      .price-sheet-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.35);
      }
      .price-sheet-panel {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: 0;
        width: min(560px, 100%);
        background: #fff;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        box-shadow: 0 -10px 30px rgba(0,0,0,0.18);
        padding: 0.9rem 1rem 1rem;
      }
      .price-custom-link {
        color: #6c757d;
        font-weight: 600;
        text-decoration: none;
        text-transform: lowercase;
      }
      .price-custom-link:hover { text-decoration: underline; }
      .price-sheet-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.6rem;
      }
      .price-wheel {
        max-height: 320px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: y mandatory;
        border: 1px solid rgba(13,110,253,0.2);
        border-radius: 14px;
        padding: 0.4rem 0.35rem;
        background: #f8fbff;
      }
      .price-chip {
        width: 100%;
        text-align: center;
        scroll-snap-align: center;
        border: 1px solid rgba(13,110,253,0.15);
        background: #fff;
        color: #0d6efd;
        border-radius: 10px;
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
        margin: 0.35rem 0;
      }
      .price-chip-year {
        background: rgba(25,135,84,0.08);
        border-color: rgba(25,135,84,0.45);
        color: #198754;
        font-weight: 700;
      }
      .price-chip.active {
        background: #0d6efd;
        color: #fff;
        border-color: #0d6efd;
        box-shadow: 0 6px 16px rgba(13,110,253,0.25);
      }
      .info-trigger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        height: 18px;
        margin-left: 0.3rem;
        border-radius: 999px;
        border: 1px solid rgba(13,110,253,0.35);
        background: #fff;
        color: #0d6efd;
        font-weight: 700;
        font-size: 0.7rem;
        line-height: 1;
        padding: 0;
      }
      .info-trigger:focus-visible {
        outline: 2px solid rgba(13,110,253,0.45);
        outline-offset: 2px;
      }
      .info-popover {
        display: none;
        position: absolute;
        z-index: 5;
        top: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        margin-left: 0;
        min-width: 260px;
        max-width: min(360px, 92vw);
        padding: 0.5rem 0.6rem;
        border-radius: 10px;
        background: #fff;
        border: 1px solid rgba(13,110,253,0.2);
        color: #495057;
        font-size: 0.85rem;
        box-shadow: 0 6px 16px rgba(0,0,0,0.08);
      }
      .info-popover.open { display: block; }
      .info-wrap { position: relative; }
      .info-anchor { position: relative; display: inline-flex; align-items: center; }
      .metric-help .info-trigger {
        margin-left: 0.35rem;
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
      }
      .metric-label {
        display: flex;
        align-items: flex-start;
        gap: 0.45rem;
      }
      .metric-text {
        display: inline-block;
        min-width: 0;
      }
      .cookie-banner {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 2000;
        background: #ffffff;
        border-top: 1px solid rgba(0,0,0,0.08);
        box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
        padding: 0.7rem 0.9rem;
      }
      .cookie-banner .cookie-inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        flex-wrap: wrap;
      }
      .cookie-banner .cookie-text {
        font-size: 0.9rem;
        color: #495057;
        max-width: 760px;
      }
      html.theme-dark .cookie-banner {
        background: #1b1b1b;
        border-top-color: #2b2b2b;
        box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
      }
      html.theme-dark .cookie-banner .cookie-text {
        color: #cfd4da;
      }

      .price-modal {
        position: fixed;
        inset: 0;
        display: none;
        z-index: 1060;
      }
      .price-modal.open { display: block; }
      .price-modal-backdrop {
        position: absolute;
        inset: 0;
        background: rgba(0,0,0,0.45);
      }
      .price-modal-panel {
        position: absolute;
        left: 50%;
        top: calc(env(safe-area-inset-top) + 0.75rem);
        transform: translateX(-50%);
        width: min(420px, 92vw);
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 18px 40px rgba(0,0,0,0.2);
        padding: 1rem 1rem 1.1rem;
        max-height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1.5rem);
        overflow-y: auto;
      }
      @media (max-width: 576px) {
        #set_payment_modal .price-modal-panel {
          width: min(420px, 96vw);
        }
      }
      #scenario_modal .price-modal-panel {
        width: min(560px, 94vw);
      }
      #scenario_name_modal .price-modal-panel {
        transform: translateX(-50%);
      }
      #scenario_slots {
        max-height: none;
        overflow: visible;
      }
.price-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.offline-modal .price-modal-panel {
  width: min(420px, 92vw);
  text-align: center;
  margin: 0 auto;
}
.offline-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.offline-image {
  max-width: min(260px, 70vw);
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 16px;
}
.offline-text {
  font-weight: 600;
  font-size: 1.05rem;
}

      .topbar-inner {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
          "brand brand"
          "monthly controls"
          "tabs controls";
        gap: 10px;
        align-items: center;
      }
      .brand { grid-area: brand; display:flex; align-items:center; gap: 12px; min-width: 240px; justify-content: space-between; }
      .brand-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
      .brand-title { line-height: 1.15; }
      .monthly-block {
        grid-area: monthly;
        background: #58a0ff;
        color: #fff;
        border-radius: 12px;
        padding: 0.35rem 0.6rem;
        width: 85%;
        max-width: 160px;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        min-height: 40px;
      }
      #monthly_payment_value { font-size: 1.5rem !important; }
      .monthly-label {
        font-size: 0.72rem;
        font-weight: 700;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        color: rgba(255,255,255,0.75);
      }
      .payment-row {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        justify-content: center;
        width: 100%;
      }
      .payment-set-btn {
        border: 0;
        background: rgba(255,255,255,0.2);
        color: #fff;
        border-radius: 999px;
        padding: 0.15rem 0.5rem;
        font-size: 0.8rem;
        font-weight: 600;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
      .payment-set-btn:hover { background: rgba(255,255,255,0.32); }
      .payment-icon { width: 16px; height: 16px; display: block; fill: currentColor; }
      .topbar-controls {
        grid-area: controls;
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
      }
      .header-action-btn {
        border: 0;
        background: #ffd43b;
        color: #0d6efd;
        border-radius: 12px;
        width: 42px;
        height: 42px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 800;
      }
      .header-action-btn:hover { background: #f7c21a; }
      .share-btn { width: 38px; height: 38px; }
      .currency-btn {
        font-size: 1.1rem;
      }
      .scenario-btn {
        font-size: 0.95rem;
      }
      .theme-toggle {
        font-size: 0.85rem;
      }
      .theme-toggle.theme-light {
        background: #ffd43b;
        color: #0d6efd;
      }
      .theme-toggle.theme-light:hover { background: #f7c21a; }
      .theme-toggle.theme-dark {
        background: #111;
        color: #f8f9fa;
      }
      .theme-toggle.theme-dark:hover { background: #000; }
      .theme-toggle.theme-light .theme-icon { fill: #f59f00; }
      .theme-toggle.theme-dark .theme-icon { fill: #3d3d3d; }
      .theme-img { width: 18px; height: 18px; display: block; object-fit: contain; }
      .theme-icon { width: 18px; height: 18px; display: block; fill: currentColor; }
      .lang-picker {
        position: relative;
      }
      .lang-btn {
        width: 42px;
        height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
      }
      .lang-code {
        font-size: 0.85rem;
        font-weight: 700;
        letter-spacing: 0.04em;
      }
      .lang-menu {
        position: absolute;
        right: 0;
        top: calc(100% + 6px);
        min-width: 150px;
        background: #ffffff;
        border: 1px solid #e6e6e6;
        border-radius: 12px;
        padding: 6px;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
        display: none;
        z-index: 50;
        color: #212529;
      }
      .lang-menu.open {
        display: block;
      }
      .lang-option {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 6px 10px;
        border-radius: 8px;
        text-decoration: none;
        color: inherit;
        font-size: 0.9rem;
      }
      .lang-option:hover,
      .lang-option.active {
        background: rgba(13, 110, 253, 0.12);
      }
      .theme-dark .lang-menu {
        background: #1f1f1f;
        border-color: #2f2f2f;
        box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
        color: #f8f9fa;
      }
      .theme-dark .lang-option:hover,
      .theme-dark .lang-option.active {
        background: rgba(255, 255, 255, 0.12);
      }
      .scenario-btn:focus-visible {
        outline: 2px solid rgba(255,255,255,0.65);
        outline-offset: 2px;
      }
      .scenario-icon {
        width: 18px;
        height: 18px;
        display: block;
        fill: currentColor;
      }
      .scenario-row {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0.45rem 0;
        border-bottom: 1px solid #e9ecef;
      }
      .scenario-row:last-child { border-bottom: 0; }
      .scenario-name { font-weight: 700; }
      .scenario-name-click { cursor: pointer; }
      .scenario-name-click:hover { text-decoration: underline; }
      .scenario-unsaved-tag {
        margin-left: 0.5rem;
        background: #fff3cd;
        color: #664d03;
        border: 1px solid #ffe69c;
        border-radius: 999px;
        padding: 0.1rem 0.45rem;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.02em;
        cursor: pointer;
      }
      html.theme-dark .scenario-unsaved-tag {
        background: #2b2414;
        border-color: #5c4a1e;
        color: #f7e7b0;
      }
      .scenario-name-banner {
        display: grid;
        grid-template-columns: auto auto 1fr auto;
        align-items: center;
        gap: 0.5rem;
        max-width: 520px;
        width: 100%;
        margin: 0 auto;
        position: relative;
      }
      .scenario-name-banner:not(.center-title) .scenario-name-wrap {
        justify-self: center;
      }
      .scenario-name-banner-compact {
        grid-template-columns: 1fr;
        justify-items: center;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
      }
      .scenario-name-banner.center-title {
        grid-template-columns: 1fr;
      }
      .scenario-name-banner.center-title .scenario-name-wrap {
        justify-self: center;
      }
      .scenario-name-wrap {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        text-align: center;
        min-width: 0;
        justify-self: center;
        max-width: 100%;
      }
      .scenario-name-banner-compact .scenario-name-wrap {
        width: 100%;
      }
      .scenario-name-wrap #scenario_name_text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
        padding-bottom: 2px;
      }
      .scenario-name-banner-compact .scenario-name-wrap #scenario_name_text {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
      }
      .scenario-nav-btn {
        border: 0;
        background: transparent;
        color: #0d6efd;
        font-size: 0.85rem;
        font-weight: 600;
        padding: 6px 10px;
        border-radius: 8px;
        line-height: 1;
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
      }
      .scenario-nav-new .scenario-nav-icon {
        font-weight: 700;
        font-size: 1.6rem;
        line-height: 1;
        position: relative;
        top: -2px;
        left: 1px;
      }
      .scenario-nav-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 1em;
        height: 1em;
        line-height: 1;
      }
      .scenario-nav-btn:disabled {
        opacity: 0.35;
        cursor: not-allowed;
      }
      html.theme-dark .scenario-nav-btn {
        background: transparent;
        color: #8fb8ff;
      }
      @media (max-width: 576px) {
        .scenario-name-banner {
          max-width: 100%;
          width: 100%;
        }
      }
      .scenario-nav-btn.scenario-nav-new {
        width: 30px;
        height: 30px;
        background: #ffd43b;
        color: #212529;
        padding: 0;
      }
      .scenario-nav-btn.scenario-nav-new:hover {
        background: #ffca2c;
      }
      html.theme-dark .scenario-nav-btn.scenario-nav-new {
        background: #2f2f2f;
        color: #ffffff;
      }
      html.theme-dark .scenario-nav-btn.scenario-nav-new:hover {
        background: #3a3a3a;
      }
      .scenario-meta { font-size: 0.9rem; color: #6c757d; }
      .scenario-actions { display: flex; align-items: center; gap: 0.5rem; }
      .scenario-actions { margin-left: auto; }
      .compare-row {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.4rem 0.5rem;
        border: 1px solid #e9ecef;
        border-radius: 10px;
        cursor: pointer;
        background: #fff;
        transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
      }
      .compare-row input {
        margin-top: 0;
      }
      .compare-row:hover {
        border-color: #b6d4fe;
        box-shadow: 0 6px 18px rgba(13,110,253,0.12);
        transform: translateY(-1px);
      }
      .compare-row:has(input:checked) {
        border-color: #0d6efd;
        box-shadow: 0 6px 18px rgba(13,110,253,0.18);
      }
      #compare_list {
        max-height: 42vh;
        overflow-y: auto;
        padding-right: 0.25rem;
      }
      html.theme-dark .compare-row {
        border-color: #2b2b2b;
        background: #1b1b1b;
      }
      html.theme-dark .compare-row:hover {
        border-color: #3d5afe;
        box-shadow: 0 6px 18px rgba(61,90,254,0.2);
      }
      html.theme-dark .compare-row:has(input:checked) {
        border-color: #3d5afe;
        box-shadow: 0 6px 18px rgba(61,90,254,0.3);
      }
      .scenario-select { margin-bottom: 0; }
      .scenario-select .form-check-input { cursor: pointer; }
      .scenario-select .form-check-label { cursor: pointer; }
      html.theme-dark .monthly-block {
        background: rgba(255,255,255,0.08);
        color: #e9ecef;
      }
      html.theme-dark .monthly-label { color: #cfd4da; }
      html.theme-dark .payment-set-btn {
        background: rgba(255,255,255,0.12);
        color: #e9ecef;
      }
      html.theme-dark .payment-set-btn:hover { background: rgba(255,255,255,0.2); }
      @media (min-width: 992px) {
        .topbar-inner {
          grid-template-columns: minmax(0, 1fr) auto;
          grid-template-areas:
            "brand brand"
            "monthly monthly"
            "tabs controls";
        }
        .topbar-controls {
          position: relative;
        }
      }
      @media (min-width: 768px) {
        .price-field-compact > .form-label {
          width: 100%;
          text-align: center;
          display: flex;
          align-items: center;
          justify-content: center;
          gap: 0.35rem;
        }
      }
      @media (min-width: 577px) {
        .topbar-controls {
          margin-bottom: 0.45rem;
        }
      }
      @media (max-width: 576px) {
        .topbar-inner {
          grid-template-columns: minmax(0, 1fr) auto;
          grid-template-areas:
            "brand brand"
            "monthly controls"
            "tabs tabs";
        }
        .price-modal-panel {
          top: calc(env(safe-area-inset-top) + 0.75rem);
          transform: translateX(-50%);
          width: min(480px, 100%);
          max-height: calc(var(--vvh, 100dvh) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1.5rem);
        }
      }

/* About modal */
.about-panel {
  max-width: 720px;
}

.about-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.about-logo {
  width: 72px;
  height: 72px;
}

.about-title {
  font-size: 1.35rem;
  font-weight: 700;
}

.about-body p {
  margin-bottom: 0.85rem;
  color: #495057;
}

html.theme-dark .about-body p {
  color: #cbd5f5;
}


/* Promo + Cookie Notice */
.promo-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px auto 0;
  max-width: 980px;
  padding: 0 16px;
}

.promo-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 16px 18px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.promo-ad {
  border-style: dashed;
}

.promo-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6c757d;
  font-weight: 600;
  margin-bottom: 6px;
}

.promo-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.promo-body {
  font-size: 0.92rem;
  color: #495057;
  margin-bottom: 8px;
}

.promo-link {
  color: #0d6efd;
  text-decoration: none;
  font-weight: 600;
}

.promo-link:hover {
  text-decoration: underline;
}


/* Promo + Cookie Notice (Dark Mode) */
html.theme-dark .promo-card {
  background: #151922;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

html.theme-dark .promo-ad {
  border-color: rgba(255, 255, 255, 0.22);
}

html.theme-dark .promo-body,
html.theme-dark .promo-label {
  color: #cbd5f5;
}

html.theme-dark .promo-title {
  color: #f8fafc;
}

html.theme-dark .promo-link {
  color: #7dd3fc;
}

.promo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.promo-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.promo-button {
  display: flex;
  justify-content: center;
}


.promo-support {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-compact .card-body {
  padding-top: 0;
  padding-bottom: 0;
}
.card-compact .fw-semibold {
  margin-bottom: 0.25rem;
}
.card-compact .small-help {
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
}
.loan-title-spacer {
  height: 5px;
}

.footer-sep {
  margin: 0 8px;
}
@media (max-width: 576px) {
  .footer-sep {
    display: none;
  }
}




.about-close {
  margin-left: auto;
}


.feedback-icon {
  width: 36px;
  height: 36px;
  margin-right: 8px;
  flex-shrink: 0;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}


.feedback-banner {
  background: #ffd43b;
  color: #111827;
  padding: 12px 14px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.feedback-link {
  background: #0d6efd;
  color: #ffd43b;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  border: 0;
}

.feedback-link:hover {
  background: #0b5ed7;
}

html.theme-dark .feedback-link {
  background: #ffd43b;
  color: #111827;
}

html.theme-dark .feedback-link:hover {
  background: #f6c21f;
}

.feedback-note {
  color: #111827;
}

html.theme-dark .feedback-banner {
  background: #2b2f36;
  color: #f8fafc;
}

html.theme-dark .feedback-note {
  color: #f8fafc;
}


