*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: auto; }
body, input, button, textarea, select { font-family: 'Inter', sans-serif; }
body { background: #fff; color: #000; }
button { outline: none; cursor: pointer; }
button:focus-visible { outline: 2px solid #1a1a18; outline-offset: 2px; }
input:focus-visible { outline: 2px solid #1a1a18; outline-offset: 1px; }

/* ── LAYOUT ── */
.page { max-width: 720px; margin: 0 auto; padding: 2rem 1rem 2rem; }

/* Lang button */
.lang-btn { position: absolute; top: 0; right: 0; background: transparent; color: #6b6960; border: 1px solid rgba(26,26,24,.13); padding: .25rem .65rem; font-size: .65rem; font-weight: 600; letter-spacing: .1em; transition: all .2s; cursor: pointer; z-index: 10; }
.lang-btn:hover { background: #1a1a18; color: #fff; }

/* Header */
.header-wrap { position: relative; margin-bottom: 1.75rem; }
.header-tag { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: #6b6960; font-weight: 500; margin-bottom: .6rem; }
.header h1 { font-size: 28px; font-weight: 400; color: #000000; line-height: 1.25; margin-bottom: .6rem; }
.header p { font-size: 14px; color: #000000; line-height: 1.65; }

/* Section label */
.slbl { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #6b6960; font-weight: 500; margin-bottom: .85rem; }

/* ── DESKTOP LAYOUT: side by side ── */
.calculator-wrap { display: flex; gap: 0; align-items: flex-start; }
.inputs-col { flex: 1 1 auto; min-width: 0; }
.results-col { flex: 0 0 320px; margin-left: 16px; display: none; /* shown on desktop when revealed */ }

/* Input box */
.inputs-box { background: #F7F6F0; border: none; padding: 1.25rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: end; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field-header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: .2rem; min-height: 2.2rem; }
.fname { font-size: 12px; color: #6b6960; line-height: 1.35; flex: 0 0 100%; }
.fval { font-size: 16px; font-weight: 500; color: #1a1a18; white-space: nowrap; }
.funit { font-size: 12px; color: #6b6960; }
input[type=range] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 20px;
  background: transparent;
  cursor: pointer;
  display: block;
  padding: 0;
  margin: 2px 0;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: linear-gradient(to right, #1a1a18 var(--fill, 0%), #c8c29f var(--fill, 0%));
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a1a18;
  cursor: pointer;
  margin-top: -9px;
}
input[type=range]::-moz-range-track {
  height: 2px;
  background: #c8c29f;
  border-radius: 1px;
}
input[type=range]::-moz-range-progress {
  height: 2px;
  background: #1a1a18;
  border-radius: 1px;
}
input[type=range]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1a1a18;
  cursor: pointer;
  border: none;
}
.divider { border: none; border-top: 0.5px solid #c8c29f; margin: 1rem 0; }
.tip-text { margin-top: .85rem; font-size: 11px; color: #6b6960; line-height: 1.55; opacity: .8; }

/* Prompt hint — shown before interaction */
.prompt-bar { background: #F7F6F0; border: none; padding: .7rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.prompt-text { font-size: 12px; color: #6b6960; }
.prompt-hint { font-size: 11px; color: #a8a27f; font-weight: 500; display: flex; align-items: center; gap: .3rem; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:.5;} 50%{opacity:1;} }

/* ── DESKTOP results panel (right column) ── */
.results-panel { background: transparent; border: none; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.results-panel .slbl { margin-bottom: .5rem; }

/* Scenario mini cards */
.sc-mini { display: flex; flex-direction: column; gap: 6px; }
.sc-mini-card { border: 0.5px solid rgba(200,194,159,.35); padding: .75rem .9rem; background: #fff; }
.sc-mini-card.good { background: #F7F6F0; border: none; }
.sc-mini-header { margin-bottom: .4rem; }
.sc-mini-tag { display: block; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; font-weight: 500; color: #6b6960; white-space: nowrap; margin-bottom: .15rem; }
.sc-mini-rate { display: block; font-size: 17px; font-weight: 500; color: #1a1a18; white-space: nowrap; }
.sc-mini-rows { display: flex; flex-direction: column; gap: 4px; }
.sc-mini-row { display: flex; justify-content: space-between; border-top: 0.5px solid rgba(200,194,159,.35); padding-top: 4px; }
.sc-mini-lbl { font-size: 10px; color: #6b6960; }
.sc-mini-val { font-size: 11px; font-weight: 500; color: #1a1a18; }

/* Delta in panel */
.delta-mini { border: none; border-left: 2px solid #440301; padding: .7rem .9rem; background: #F7F6F0; }
.delta-mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: .6rem; align-items: start; }
.d-lbl { font-size: 10px; color: #6b6960; margin-bottom: .2rem; }
.d-val { font-size: 18px; font-weight: 500; color: #440301; line-height: 1.1; }
.d-sub { font-size: 10px; color: #6b6960; margin-top: .15rem; }
.d-text { font-size: 11px; color: #6b6960; line-height: 1.6; border-top: 0.5px solid rgba(200,194,159,.35); padding-top: .6rem; }
.d-text strong { font-weight: 500; color: #1a1a18; }

/* Inverted-rate message (when secured rate > unsecured rate) */
/* delta-area / mob-delta-area act as position anchors so the inverted overlay
   never changes the document height — the hidden delta-normal still holds its space */
.delta-area { position: relative; }
.d-inverted { position: absolute; top: 0; left: 0; right: 0; padding: .7rem .9rem; background: #fdf7e8; border: none; font-size: 11px; color: #7a4a00; line-height: 1.65; visibility: hidden; }
.d-inverted strong { color: #b07030; font-weight: 500; }
.mob-delta-area { position: relative; }
.mob-d-inverted { position: absolute; top: 0; left: 0; right: 0; padding: .8rem .9rem; background: #fdf7e8; border: none; font-size: 12px; color: #7a4a00; line-height: 1.65; visibility: hidden; }
.mob-d-inverted strong { color: #b07030; font-weight: 500; }

/* CTA in panel */
.cta-panel { }
.cta-panel-h { font-size: 13px; font-weight: 500; color: #1a1a18; margin-bottom: .3rem; line-height: 1.3; }
.cta-panel-s { font-size: 11px; color: #1a1a18; opacity: .65; margin-bottom: .75rem; line-height: 1.5; }
.cta-btn { background: #1a1a18; color: #f4f3ec; border: none; padding: .7rem 1.1rem; font-size: .78rem; font-weight: 500; cursor: pointer; width: 100%; transition: opacity .15s; min-height: 44px; letter-spacing: .03em; }
.cta-btn:hover { opacity: .82; }

/* Disclaimer */
.disclaimer { font-size: 10px; color: #6b6960; margin-top: 1.25rem; line-height: 1.6; border-top: 0.5px solid #c8c29f; padding-top: .85rem; opacity: .75; }

/* ── MOBILE BOTTOM PANEL ── */
.mobile-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 100; opacity: 0; transition: opacity .3s; }
.mobile-overlay.show { opacity: 1; }

.mobile-panel {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 101;
  background: #fff;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.32,.72,0,1);
  border-top: none;
}
.mobile-panel.show { transform: translateY(0); }

.panel-handle-bar { display: flex; justify-content: center; padding: .75rem 0 .5rem; background: #fff; position: sticky; top: 0; z-index: 2; border-bottom: 0.5px solid #c8c29f; }
.panel-handle { width: 36px; height: 4px; background: #c8c29f; border-radius: 2px; }
.panel-close { position: absolute; right: 1rem; top: .6rem; background: transparent; border: none; font-size: 1.1rem; color: #6b6960; cursor: pointer; padding: .2rem .4rem; line-height: 1; }

.panel-body { padding: 1rem 1rem 2rem; display: flex; flex-direction: column; gap: 1rem; }

/* Mobile scenario cards */
.mob-scenarios { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mob-sc { border: none; padding: .85rem .9rem; }
.mob-sc.good { background: #F7F6F0; }
.mob-sc.bad { background: #fff; }
.mob-sc-tag { font-size: 9px; letter-spacing: .07em; text-transform: uppercase; font-weight: 500; color: #6b6960; margin-bottom: .3rem; }
.mob-sc-zins { font-size: 22px; font-weight: 300; color: #1a1a18; margin-bottom: .5rem; display: block; }
.mob-sc-rows { display: flex; flex-direction: column; gap: 5px; }
.mob-sc-row { display: flex; justify-content: space-between; border-top: 0.5px solid #c8c29f; padding-top: 5px; gap: .3rem; }
.mob-sc-lbl { font-size: 10px; color: #6b6960; flex-shrink: 0; }
.mob-sc-val { font-size: 11px; font-weight: 500; color: #1a1a18; text-align: right; }

/* Mobile delta */
.mob-delta { border: none; padding: .8rem .9rem; background: #F7F6F0; }
.mob-delta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .65rem; align-items: start; }
.mob-d-lbl { font-size: 10px; color: #6b6960; margin-bottom: .2rem; min-height: 2.4em; display: flex; align-items: flex-end; }
.mob-d-val { font-size: 22px; font-weight: 500; color: #440301; line-height: 1.1; }
.mob-d-sub { font-size: 10px; color: #6b6960; margin-top: .2rem; }
.mob-d-text { font-size: 12px; color: #6b6960; line-height: 1.65; border-top: 0.5px solid #c8c29f; padding-top: .65rem; }
.mob-d-text strong { font-weight: 500; color: #1a1a18; }

/* Mobile CTA */
.mob-cta { }
.mob-cta-h { font-size: 14px; font-weight: 500; color: #1a1a18; margin-bottom: .3rem; line-height: 1.3; }
.mob-cta-s { font-size: 12px; color: #1a1a18; opacity: .65; margin-bottom: .85rem; line-height: 1.5; }
.mob-cta-btn { background: #1a1a18; color: #f4f3ec; border: none; padding: .85rem 1.1rem; font-size: .82rem; font-weight: 500; cursor: pointer; width: 100%; min-height: 44px; letter-spacing: .03em; }
.mob-cta-btn:hover { opacity: .82; }

/* Mobile disclaimer */
.mob-disc { font-size: 10px; color: #6b6960; line-height: 1.6; opacity: .7; }

/* ── BREAKPOINTS ── */
@media (min-width: 640px) {
  .mobile-overlay, .mobile-panel { display: none !important; }
  .prompt-bar { display: none; }
  .disclaimer-mobile { display: none; }
}

@media (max-width: 639px) {
  /* Mobile: stack inputs + results vertically, no overlay/bottom-sheet */
  .mobile-overlay, .mobile-panel { display: none !important; }
  .calculator-wrap { flex-direction: column; }
  .results-col { flex: none; width: 100%; margin: 16px 0 0; }
  .page { padding: 1.25rem .85rem 1.5rem; }
  .grid2 { grid-template-columns: 1fr; gap: 1rem; }
  .field-header { min-height: unset; }
  /* Move disclaimer below the calculations block */
  #disc { display: none; }
  .disclaimer-mobile { display: block; }
}

@media (max-width: 380px) {
  .delta-mini-grid { grid-template-columns: 1fr; gap: .5rem; }
}
