/* ======================================================
   TOKENS / BRAND (ONE SOURCE OF TRUTH)
   ====================================================== */
:root{
  /* ======================================================
     BRAND
     ====================================================== */
  --brand-yellow: #FACC15;
  --brand-yellow-600: #EAB308;

  /* ======================================================
     DARK THEME BASE (brand navy)
     ====================================================== */
  --bg-dark:   #0B0F15;  /* “navy” */
  --bg-dark-2: #121720;  /* “navy 2” */

  /* ======================================================
     SURFACES (app)
     ====================================================== */
  --surface-1: #0f0f10;  /* page background */
  --surface-2: #18181b;  /* app/card background */
  --surface-3: #1f1f1f;  /* panel background */

  /* NEW: common surfaces used in your CSS (previously hardcoded) */
  --surface-input:  #2e2e2e;  /* table row inputs */
  --surface-modal:  #111827;  /* modal cards / chooser */
  --surface-navy:   #0b1220;  /* deep navy surface (forms etc.) */
  --surface-muted:  #121214;  /* segmented bg */

  /* Download/report modals: neutral app surfaces */
  --download-modal-overlay: rgba(0,0,0,.78);
  --download-modal-surface: #1b1b1b;
  --download-modal-control: #262626;
  --download-modal-control-hover: #303030;
  --download-modal-border: #444;
  --download-modal-divider: #333;
  --download-modal-muted: #b3b3b3;

  /* ======================================================
     TEXT
     ====================================================== */
  --text:  #f4f4f5;
  --muted: #a1a1aa;

  /* NEW: state colors (optional but useful in reports) */
  --success: #22C55E;
  --danger:  #EF4444;

  /* ======================================================
     BORDERS / LINES
     ====================================================== */
  --border:   #27272a;
  --border-2: #334155;

  /* NEW: “hairlines” used around sections */
  --line:        #333;
  --line-strong: #444;

  /* ======================================================
     MISC
     ====================================================== */
  --ink: #111213;

  /* Overlay / glass */
  --overlay: rgba(0,0,0,.50);
  --overlay-navy: rgba(15,23,42,.95);

  /* Chart sizing */
  --chart-h: clamp(380px, 55vh, 560px);

  --z-modal: 11000;
  --z-loading: 12000;
  --z-menu: 9000; /* menu EI overlayn yli */

  /* ======================================================
     LEGACY ALIASES (keep old code working)
     ====================================================== */
  --accent: var(--brand-yellow);
  --bg:     var(--surface-1);
  --card:   var(--surface-2);
  --panel:  var(--surface-3);

  /* Old names that may exist elsewhere */
  --pale-yellow:   #FFF1A8;
  --pale-yellow-2: #FFE67A;
  --navy:   var(--bg-dark);
  --navy-2: var(--bg-dark-2);

  /* Radiukset: eri elementeille eri fiilis */
  --radius-table: 0px;          /* kirjaukset/taulukot: terävä */
  --radius-input: 10px;         /* lomakekentät */
  --radius-card: 12px;          /* app-container / kortit */
  --radius-modal: 16px;         /* modal-kortit */
  --radius-btn: 999px;          /* pill-napit */

  /* =========================
   Password create/reset page
   ========================= */
  /* fallback brand accent */
  --ps-accent: var(--ps-yellow, var(--brand-yellow, #f6c400));
  --ps-bg: #0b0c10;
  --ps-card-line: rgba(255,255,255,.10);
  --ps-text: #f3f4f6;
  --ps-muted: rgba(243,244,246,.72);

}

.purchase-template-selectors {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.purchase-template-selectors label {
  font-weight: 700;
}

.purchase-template-selectors select {
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line, #d8d2c4);
  border-radius: 10px;
  background: #fff;
  color: inherit;
  font: inherit;
}

/* ======================================================
   BASE / RESET
   ====================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;                     /* ✅ tarvitaan 100vh/100% layouttiin */
}

[hidden] { display: none !important; }


/* ======================================================
   GLOBAL BODY & SCROLL BEHAVIOR
   ====================================================== */

/* Estä layoutin leveyshyppy scrollbarin ilmestyessä */
html {
  scrollbar-gutter: stable both-edges;
}

/* ✅ EI body-scrollia → scroll vain “kortissa” */
body {
  min-height: 100vh;
  overflow: hidden;                 /* ✅ scroll EI bodylle */
  scrollbar-gutter: stable;         /* ✅ estää leveyden heilahtelun */
  color: var(--text);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background:
    radial-gradient(1200px 800px at 20% 0%, rgba(250,204,21,.08), transparent 45%),
    radial-gradient(900px 700px at 85% 10%, rgba(59,130,246,.06), transparent 50%),
    var(--bg);
}

a { color: var(--accent); }
a:hover { text-decoration: underline; }

.app-header h1 { color: var(--text); }

/* =========================
   APP MAIN TITLE (brand)
   ========================= */

body.page-talous .app-header h1,
body.page-saasto .app-header h1,
body.page-oman .app-header h1 {
  color: var(--accent); /* PolkuSolutions keltainen */
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-shadow: 0 2px 18px rgba(250,204,21,.12);
}

.report-tabs .report-btn,
.total-display,
.total-line .total-label,
.total-line .total-value { color: var(--accent); }

/* ======================================================
   APP SHELL (lukittu näkymä, scroll kortissa)
   ====================================================== */

/* ✅ “Kuori” täyttää aina ruudun, ei heilu */
.app-shell{
  height: 100vh;                    /* ✅ täyttää aina ruudun */
  display: flex;
  justify-content: center;
  align-items: stretch;             /* ✅ venytä korkeussuunnassa */
  padding: 18px;
  box-sizing: border-box;
}

/* ✅ Varsinainen kortti: scroll sisällä + card-look + variants + scrollbar hidden */
.app-container{
  /* layout */
  margin: 0 auto;
  width: 100%;
  height: 100%;                     /* ✅ täyttää app-shellin */
  max-width: 900px;                 /* oletus: talous + säästö */

  /* scroll */
  overflow-y: auto;                 /* ✅ scroll kortin sisällä */
  overflow-x: hidden;
  scrollbar-gutter: stable;

  /* hide scrollbar but keep scroll */
  scrollbar-width: none;            /* Firefox */
  -ms-overflow-style: none;         /* vanha Edge/IE */

  /* card look */
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius-card);
  box-shadow: 0 4px 10px rgba(0,0,0,.6);
}

/* ======================================================
   GLOBAL: piilota scrollbarit kaikkialta (mutta scroll toimii)
   ====================================================== */

/* Firefox */
*{
  scrollbar-width: none !important;
}

/* vanha Edge/IE */
*{
  -ms-overflow-style: none !important;
}

/* Chrome/Safari/Edge (webkit) */
*::-webkit-scrollbar{
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

/* Raportit ja suunnitelmat ovat kompaktimmat */
#reportsApp.app-container,
#plansApp.app-container{
  max-width: 900px;
}

/* Plans: halutessa “pidempi” ja vähän lisää ilmaa alas */
#plansApp.app-container{
  min-height: calc(100vh - 40px);
  padding-bottom: 28px;
}

/* Mobiili: container saa vähän ilmaa reunoille */
@media (max-width: 600px){
  .app-container{
    padding: 16px;
    margin: 0 10px;
  }
}

/* Checkoutin tiiviit, erilliset hyväksynnät. */
.page-purchase .purchase-legal{
  display:grid;
  gap:.8rem;
  min-width:0;
  margin:1.1rem 0 0;
  padding:0;
  border:0;
  background:transparent;
}

.page-purchase .purchase-consent{
  display:grid;
  grid-template-columns:1.25rem minmax(0, 1fr);
  gap:.7rem;
  align-items:center;
}

.page-purchase .purchase-consent input[type="checkbox"]{
  width:1.15rem;
  height:1.15rem;
  margin:0;
  padding:0;
  accent-color:var(--purchase-gold-dark);
}

.page-purchase .purchase-consent__main{
  display:block;
  min-width:0;
  margin:0;
  color:var(--purchase-ink);
  font-weight:600;
  line-height:1.45;
  overflow-wrap:anywhere;
}

.page-purchase .purchase-consent__detail{
  margin:.25rem 0 0;
  color:var(--purchase-muted);
  font-size:.88rem;
  line-height:1.45;
}

.page-purchase .purchase-legal[aria-invalid="true"]{
  color:#7a271a;
}

.page-purchase .purchase-legal[aria-invalid="true"] .purchase-consent__main{
  color:#7a271a;
}

.page-purchase .purchase-legal[aria-invalid="true"] input[type="checkbox"]{
  outline:2px solid rgba(180,35,24,.35);
  outline-offset:2px;
}

.page-withdrawal .purchase-checkout form{
  display:grid;
  gap:0;
}

.page-withdrawal .purchase-checkout form .action-row{
  margin-top:.75rem;
}

.withdrawal-summary{
  display:grid;
  grid-template-columns:minmax(10rem, .8fr) minmax(0, 1.2fr);
  gap:.45rem 1rem;
  margin:1rem 0;
}

.withdrawal-summary dt{
  font-weight:700;
}

.withdrawal-summary dd{
  margin:0;
  overflow-wrap:anywhere;
}

@media (max-width: 520px){
  .withdrawal-summary{
    grid-template-columns:1fr;
    gap:.2rem;
  }

  .withdrawal-summary dd{
    margin-bottom:.65rem;
  }
}

/* ======================================================
   (Pidetään ennallaan: nämä ovat sun nykyisessä rootissa)
   ====================================================== */
#plansApp .tab-panel,
#plansApp .calc-card,
#reportsApp .tab-panel,
#reportsApp .calc-card,
#mainApp .tab-panel,
#mainApp .calc-card{
  overflow: visible;
  height: auto;
}

/* ======================================================
   FORMS + ROWS (shared)
   ====================================================== */

/* inputit + nappien kontit */
.input-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* Perusrivit (yleinen) */
.row {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

/* Perus input (yleinen, EI listaspesifi) */
input {
  padding: 6px;
  flex: 1;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-input);
}

input::placeholder {
  color: #aaa;
}

/* input-row:n sisällä: ellipsis (älä ylikirjoita värejä/bordereita) */
.input-row input {
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Poista numerokenttien nuolet */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ======================================================
   TABLE / LIST ROW INPUTS
   (Talous: tulot & menot
    Säästö: kirjaukset & nostot)
   ====================================================== */

/* Listarivien input-look = talous-tyyli */
.table .row input[type="text"],
.table .row input[type="number"]{
  width: 100%;
  padding: 6px;                 /* yksi totuus */
  background: var(--surface-input);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-table);
  flex: 1;
  min-width: 0;
}

/* Numerot oikealle (kirjanpitotyyli) */
.table .row input[type="number"]{
  text-align: right;
}
.table .row input[type="number"]::placeholder{
  text-align: left;
}

/* Viimeinen rivi: ei extraa */
.table .row:last-child{
  margin-bottom: 0;
}

/* Lisää-rivi-napit: sama rytmi kaikkialla */
#addRow,
#addWithdrawRow,
#addIncomeRow,
#addExpenseRow{
  margin-bottom: 8px;
  margin-top: 10px;
}

/* ======================================================
   Special inputs (shared components)
   ====================================================== */

/* Kenttäblokki (esim. lomakkeet joissa oma wrapper .field) */
.field input {
  background: var(--card);
  color: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  outline: none;
}
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(250,204,21,.2);
}

/* Download/link input */
.dl-input {
  width: 100%;
  background: var(--download-modal-control);
  color: var(--text);
  border: 1px solid var(--download-modal-border);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  outline: none;
}
.dl-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(250,204,21,.2);
}

/* Inline-field */
.inline-field input {
  width: 140px;
  text-align: right;
}

/* ======================================================
   Autofill fix (shared)
   ====================================================== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--card) inset !important;
  box-shadow: 0 0 0 1000px var(--card) inset !important;
  -webkit-text-fill-color: var(--text) !important;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
.field input:-webkit-autofill{
  -webkit-box-shadow: 0 0 0 1000px var(--card) inset !important;
  box-shadow: 0 0 0 1000px var(--card) inset !important;
}

/* ======================================================
   Landing page autofill: pidä sama tausta kuin normaalisti
   ====================================================== */
.landing input:-webkit-autofill,
.landing input:-webkit-autofill:hover,
.landing input:-webkit-autofill:focus,
.landing input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #212124 inset !important;
  box-shadow: 0 0 0 1000px #212124 inset !important;
  -webkit-text-fill-color: #fff !important;
  caret-color: #fff;
}

/* ======================================================
   BUTTONS (shared) – unified for new HTML + legacy
   Supports:
   - New: .btn + .primary / .ghost / .btn-outline / .notice / .warning
   - Legacy: .btn-primary / .btn-ghost / .btn-secondary
   ====================================================== */

/* 1) Base button reset / default look */
button,
.btn{
  appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);   /* muut napit voi olla pill */
  padding: 10px 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  transition:
    background-color .15s ease,
    color .15s ease,
    border-color .15s ease,
    transform .06s ease,
    filter .15s ease;
}

button:hover,
.btn:hover{
  background: rgba(255,255,255,0.08);
  border-color: var(--border-2);
}

button:active,
.btn:active{
  transform: translateY(1px);
}

button:focus-visible,
.btn:focus-visible{
  outline: 2px solid var(--brand-yellow);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(250,204,21,.20);
}

:where(
  a[href],
  input,
  select,
  textarea,
  summary,
  [role="button"],
  [role="link"],
  [tabindex]:not([tabindex="-1"]),
  [contenteditable="true"]
):focus-visible{
  outline: 2px solid var(--brand-yellow);
  outline-offset: 2px;
}

/* Disabled */
button:disabled,
.btn:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

/* 2) Primary action (yellow) — KOMPAKTIMPI */
.btn.primary,
.btn-primary,
button.btn-primary{
  border-radius: 8px;
  background: var(--brand-yellow);
  color: var(--ink);
  border-color: transparent;
  font-weight: 700;

  /* 🔽 PIENEMPI KORKEUS */
  height: 32px;
  min-height: 32px;

  /* 🔽 vähemmän vaakapaddingia */
  padding: 0 12px;

  /* keskitys */
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* ei globaaleja marginaaleja */
  margin-top: 0;

  line-height: 1;
}

.btn.primary:hover,
.btn-primary:hover,
button.btn-primary:hover{
  background: var(--brand-yellow-600);
  filter: none;
}

/* Tallenna nappi – erottuvampi */
#saveButton{
  background: #f5c518;
  color: #000;

  font-weight: 700;
  font-size: 15px;

  padding: 12px 28px;   /* suurempi kuin muissa */
  border-radius: 8px;
  border: none;

  box-shadow: none;     /* poistetaan glow */
}

#saveButton:hover{
  background:#eab308;
}

#saveButton:active{
  transform: translateY(1px);
}

/* 3) Ghost / topbar (pidä topbarin napit tällaisina) */
.btn.ghost,
.btn-ghost,
button.btn-ghost{
  background: transparent;
  color: var(--brand-yellow);
  border-color: var(--border);
}

.btn.ghost:hover,
.btn-ghost:hover,
button.btn-ghost:hover{
  background: rgba(250, 204, 21, 0.12);
  border-color: var(--border-2);
}

/* 4) Outline (used in topbar: "Lataa") */
.btn.btn-outline{
  background: transparent;
  color: var(--text);
  border-color: rgba(250,204,21,.35);
}

.btn.btn-outline:hover{
  background: rgba(250,204,21,.10);
  border-color: rgba(250,204,21,.45);
}

/* 5) Notice (copyPrev) */
.btn.notice{
  background: rgba(250,204,21,.10);
  color: var(--text);
  border-color: rgba(250,204,21,.25);
}

.btn.notice:hover{
  background: rgba(250,204,21,.14);
}

/* 6) Warning (cashout etc.) */
.btn.warning{
  background: rgba(245,158,11,.12);
  color: var(--text);
  border-color: rgba(245,158,11,.30);
}

.btn.warning:hover{
  background: rgba(245,158,11,.16);
  border-color: rgba(245,158,11,.40);
}

/* 7) Optional: subtle / secondary – LEGACY */
.btn-secondary,
button.btn-secondary{
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover,
button.btn-secondary:hover{
  filter: brightness(1.07);
}

/* 8) Full-width helpers (use in layouts when needed) */
.button-row{
  display: flex;
  gap: 10px;
  width: 100%;
}
.button-row > button,
.button-row > .btn{
  flex: 1;
}

/* Action row: vasen nappi vasemmalle, oikea nappi oikeaan reunaan */
.action-row{
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 18px;
  justify-content: space-between; /* ✅ varma: äärilaitoihin */
}

/* Varmista ettei napit veny täysleveiksi mistään muualta */
.action-row > button,
.action-row > .btn{
  flex: 0 0 auto;
  width: auto;
}

/* (ei pakollinen enää, mutta ei haittaa) */
.action-row > :last-child{
  margin-left: auto;
}

/* Rivikohtainen "Poista" – KOMPAKTI */
.table .row button{
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--border);
  font-weight: 600;

  height: 32px;
  min-height: 32px;
  padding: 0 12px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;

  transition: background .15s ease, border-color .15s ease;
}

.table .row button:hover{
  background: rgba(255,255,255,0.08);
  border-color: var(--border-2);
}

/* Legacy ghost ids */
#logoutButton{
  background: transparent;
  color: var(--brand-yellow);
  border: 1px solid var(--border);
  border-radius: 8px;
  align-self: flex-end;
}

#logoutButton:hover{
  background: rgba(250, 204, 21, 0.12);
}

/* Topbar / nav buttons that should look ghost */
.app-header nav #reportsLink,
.app-header nav #downloadButton,
.app-header nav #plansLink,
#compareDownloadButton,
#scHistoryButton,
#scDownloadButton {
  background: transparent;
  color: var(--brand-yellow);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
}
.app-header nav #reportsLink:hover,
.app-header nav #downloadButton:hover,
.app-header nav #plansLink:hover,
#compareDownloadButton:hover,
#scHistoryButton:hover,
#scDownloadButton:hover {
  background: rgba(250, 204, 21, 0.12);
}

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

.total-line{
  display:flex;
  align-items: center;   /* ✅ keskelle, ei baseline */
  gap: 6px;
  line-height: 1;        /* ✅ ei “nouse” fonttibaselineen */
}
.total-line .total-label,
.total-line .total-value{
  color: var(--accent);
  font-weight:700;
}

/* Lukittu integraatio Poista nappi */
.row.is-derived-row .delete-btn{
  background: #1e1e1e;      /* lähes sama kuin kortin tausta */
  border-color: #2a2a2a;
  color: #8a8a8a;           /* himmeä teksti */
  cursor: not-allowed;
  opacity: 0.85;
}

/* hover ei muuta mitään */
.row.is-derived-row .delete-btn:hover{
  background: #1e1e1e;
  border-color: #2a2a2a;
}

/* Bundle / integraatiofilteri */
/* Näytä-filteri pill-nappeina */
#omanFilterWrap{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

.oman-filter-label{
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  opacity: 0.9;
}

.oman-pill-group{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
}

.oman-pill{
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(244,244,245,.82);
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, opacity .15s ease;
}

.oman-pill:hover{
  background: rgba(255,255,255,.06);
  color: rgba(244,244,245,.96);
}

.oman-pill.is-active{
  background: var(--brand-yellow);
  color: var(--ink);
}

.oman-pill:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(250,204,21,.20);
}

/* Tyhjennä taulukko */
#clearButton{
  background: transparent !important;
  color: #d1d5db !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  border-radius: 10px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 14px !important;
  font-weight: 600 !important;
  box-shadow: none !important;
}

/* hover */
#clearButton:hover{
  background: rgba(255,255,255,.06) !important;
  color: #d1d5db !important;
  border-color: rgba(255,255,255,.20) !important;
  filter: none !important;
}

/* active */
#clearButton:active{
  transform: translateY(1px);
}
/*Täytä edelliset */
.copy-prev{
  background: none !important;
  border: none !important;
  box-shadow: none !important;

  padding: 6px 0 !important;
  margin-top: 10px;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1px;
  line-height: 1.35;

  cursor: pointer;
  transform: none !important;
  transition: color .15s ease, opacity .15s ease;
}

.copy-prev::before{
  content: "↺";
  font-size: 0.9em;
  line-height: 1;
  color: currentColor;
  transform: translateY(-1px);
}

.copy-prev:hover{
  background: none !important;
  color: #e5e7eb;
  transform: none !important;
  filter: none !important;
}

.copy-prev:hover::before{
  color: #cbd5e1;
}

.copy-prev:active{
  transform: none !important;
  opacity: .9;
}

/* ======================================================
   REPORT TABS – kevyempi fontti, enemmän väliä,
   ja “{”-henkinen korostus koko tekstin alla
   (korvaa aiempi report-tabs pätkä tällä)
   ====================================================== */

/* Tabs-rivi: enemmän tilaa nappien väliin */
.report-tabs{
  display: flex;
  gap: 28px;                 /* ✅ lisää väliä */
  margin: 0 0 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

/* Tab-napit/otsikot */
.report-tabs button,
.report-tabs .report-btn,
.report-tabs > *{
  position: relative;
  background: transparent !important;
  border: 0 !important;

  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 500;          /* pehmeämpi kuin Montserrat 600 */
  font-size: 16px;           /* ✅ koko ok */
  letter-spacing: .08px;     /* ✅ yksi arvo, ei tuplaa */
  color: rgba(250,204,21,.92);

  padding: 8px 2px 14px;     /* tilaa “kaarelle” alle */

  filter: none !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Hover: vain pieni kirkastus */
.report-tabs button:hover,
.report-tabs .report-btn:hover,
.report-tabs > *:hover{
  color: rgba(250,204,21,1);
  background: transparent !important;
}

/* Active ei painallusta */
.report-tabs button:active,
.report-tabs .report-btn:active,
.report-tabs > *:active{
  transform: none !important;
}

/* Aktiivinen: “{”-henkinen kaari KOKO tekstin leveydellä */
.report-btn.is-active::after,
.report-tabs > *.is-active::after,
.report-tabs > *[aria-current="true"]::after{
  content: "";
  position: absolute;
  left: 0;                   /* ✅ koko tekstin alle */
  right: 0;
  bottom: 5px;

  height: 10px;              /* “kaaren” alue */
  border-bottom: 2px solid rgba(250,204,21,.95);

  /* tekee siitä kevyen ja “{”-tyylisen, ei tönkköä puolikaarta */
  border-bottom-left-radius: 600px;
  border-bottom-right-radius: 600px;

  opacity: .95;
}

/* Mobiili: gap hieman pienemmäksi */
@media (max-width: 760px){
  .report-tabs{ gap: 16px; }

  .report-tabs button,
  .report-tabs .report-btn,
  .report-tabs > *{
    font-size: 15px;
    padding: 8px 2px 12px;
  }

  .report-btn.is-active::after,
  .report-tabs > *.is-active::after,
  .report-tabs > *[aria-current="true"]::after{
    height: 9px;
    border-bottom-width: 2px;
  }
}

/* ======================================================
   REPORT CONTROLS – pehmeämpi typografia
   + Tulot/Menot tekstinä (ei pillinappeja)
   + poista periodSelect “active” highlight
   + poista “Näytä viivadiagrammi…” kehyspilleri
   ====================================================== */

/* 1) Ajanjakso + “Näytä viivadiagrammi…” tekstit pienemmäksi & pehmeämmäksi */
#reportsApp .report-controls label[for="periodSelect"],
#reportsApp .toggle-line span{
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.92rem;                 /* pienempi */
  font-weight: 500;                   /* pehmeä */
  letter-spacing: .05px;
  color: rgba(244,244,245,.85);       /* ei huuda valkoisena */
}

/* Ajanjakso-labelille vähän väliä valikkoon */
#reportsApp .report-controls label[for="periodSelect"]{
  margin-right: 6px;
}

#reportsApp .report-controls{
  margin-bottom: 14px;   /* säädä: 12–18px */
}

/* pidä tämä ennallaan (ei jää focus-efektejä) */
#reportsApp #periodSelect:focus,
#reportsApp #periodSelect:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(250,204,21,.20);
}

/* 3) Tulot/Menot: napit samaksi kuin säästössä */
#reportsApp #reportIncomeBtn,
#reportsApp #reportExpenseBtn{
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(244,244,245,.92);
  border-radius: 999px;
  height: 34px;
  padding: 0 14px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background .15s ease,
    border-color .15s ease,
    color .15s ease,
    opacity .15s ease,
    transform .06s ease;
}

#reportsApp #reportIncomeBtn:hover,
#reportsApp #reportExpenseBtn:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.22);
  color: rgba(244,244,245,.98);
  opacity: .98;
}

#reportsApp #reportIncomeBtn:active,
#reportsApp #reportExpenseBtn:active{
  transform: translateY(1px);
}

#reportsApp #reportIncomeBtn.active,
#reportsApp #reportExpenseBtn.active,
#reportsApp #reportIncomeBtn[aria-pressed="true"],
#reportsApp #reportExpenseBtn[aria-pressed="true"]{
  background: transparent;
  border-color: rgba(250,204,21,.90);
  color: rgba(244,244,245,.98);
  opacity: 1;
  text-decoration: none;
}

#reportsApp #reportIncomeBtn:not(.active):not([aria-pressed="true"]),
#reportsApp #reportExpenseBtn:not(.active):not([aria-pressed="true"]){
  opacity: .82;
}

#reportsApp #reportIncomeBtn:focus-visible,
#reportsApp #reportExpenseBtn:focus-visible{
  outline: 2px solid rgba(250,204,21,.35);
  outline-offset: 2px;
}

/* 4) Tulot/Menot summat hieman sirommiksi ja tasalinjaan */
#reportsApp .report-val{
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.98rem;
  font-weight: 600;                  /* ei liian bold */
  color: rgba(244,244,245,.92);
  margin: 0 10px 0 8px;
}

/* Saldo-rivi pehmeämmäksi (bold vain “Saldo” jos haluat pitää) */
#reportsApp #reportBalanceRow{
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.98rem;
  color: rgba(244,244,245,.90);
}
#reportsApp #reportBalanceRow b{
  font-weight: 700;
}

/* ennen: pill-tausta + border -> nyt: ei mitään kehystä */
#reportsApp .toggle-line{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;              /* ✅ pois */
  border-radius: 0;        /* ✅ pois */
  background: transparent; /* ✅ pois */
  border: 0;               /* ✅ pois */
}

/* checkbox: pysyy valkoisena, ei keltaiseksi */
#reportsApp .toggle-line input[type="checkbox"]{
  width: 16px;
  height: 16px;
  accent-color: #ffffff;   /* ✅ valkoinen */
}

/* 6) Vähän lisää “ilmaa” report-controls riville */
#reportsApp .report-controls{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;   /* ✅ erottaa elementit, ei pötköksi */
}


/* ======================================================
   TABS (shared: otsikot + aktiivisuus)
   - käytetään Raporteissa JA Plans/Ennusteissa
   ====================================================== */
/* Tab content panels: always expand layout */
.tab-panel{
  display: block;
  height: auto;
  overflow: visible;
  min-height: 0;
}

/* ======================================================
   Mobile (shared) – pidä rootissa vain jos sama molemmissa
   (tämä osuus ok jos auth + button-row toimii samoilla luokilla)
   ====================================================== */
@media (max-width:600px){
  body.page-talous .row,
  body.page-talous .month-selector{
    flex-direction: column;
  }


  .month-selector label,
  .month-selector select,
  .month-selector input,
  .month-selector button {
    width: 100%;
    margin-bottom: 12px;
  }

  .auth-container .input-row,
  .auth-container .button-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }

  .input-row input,
  .button-row button {
    width: 100%;
  }

  #forgotPasswordLink {
    text-align: center;
    display: block;
    margin-top: 12px;
    color: var(--accent);
  }
}

/* ======================================================
   HEADER / TOPBAR (shared)
   ====================================================== */

.app-header{
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  width: 100%;
  padding: 26px 0 12px;
  border-bottom: 1px solid #333;
  margin-bottom: 16px;
  text-align: initial;
}

.app-header h1{
  margin: 0;
  line-height: 1.1;
  text-align: left;
}

body.page-talous .app-header .app-title-block,
body.page-saasto .app-header .app-title-block{
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding-left: 70px;
  transform: translateY(-4px);
}

body.page-talous .app-header .app-brand-kicker,
body.page-saasto .app-header .app-brand-kicker{
  margin: 0;
  color: var(--brand-yellow);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body.page-talous .app-header .app-title-block h1,
body.page-saasto .app-header .app-title-block h1{
  margin: 0;
  padding-left: 0;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
  text-shadow: none;
}

/* Oikean reunan napit */
.app-header nav,
.app-header .topbar-actions{
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.app-header-followup{
  display: grid;
  row-gap: 30px;
  margin-top: 30px;
}

.app-header-followup > #omanFilterWrap{
  justify-self: start;
  margin: 0;
}

.app-header-followup > .section,
.app-header-followup > #monthSection > .month-selector{
  margin-top: 0;
}

/* ======================================================
   MONTH SELECTOR (Vuosi + Kuukausi + Alkusaldo samalle riville)
   ====================================================== */
#monthSection .month-selector{
  display: flex;
  flex-wrap: nowrap;        /* ✅ EI rivinvaihtoa */
  align-items: center;
  gap: 16px;
  margin-top: 12px;
  margin-bottom: 12px;
}

/* Kevennä ja pienennä label-tekstiä */
#monthSection .month-selector label{
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.85;
  white-space: nowrap;
  letter-spacing: .05px;
}

/* Select + input samaa mittakaavaa */
#monthSection .month-selector select,
#monthSection .month-selector input{
  font-weight: 500;
  font-size: 0.9rem;
}

/* Field-inline: varmistetaan rivitys */
#monthSection .month-selector .field-inline{
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

/* Yhtenäinen leveys */
#monthSection{
  --ms-field-w: 90px;
}

#monthSection .month-selector select,
#monthSection #openingBalance,
#monthSection #initialCapital{
  width: var(--ms-field-w);
  min-width: var(--ms-field-w);
  max-width: var(--ms-field-w);
}

#monthSection #openingBalance,
#monthSection #initialCapital{
  text-align: right;
}

/* Poista selectien focus/active korostus (ei jää “päälle”) */
#monthSection .month-selector select:focus,
#monthSection .month-selector select:focus-visible{
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(250,204,21,.20);
}

/* ✅ Rivi: Täytä + Yhteensä (sama korkeus + keskitys) */
#monthSection .section-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;         /* lisää ilmaa month-rivin alle */
}

/* poista globaali .btn.primary margin-top vain tässä */
#monthSection .section-header .btn{
  margin-top: 0 !important;
  height: 32px;              /* ✅ sama kuin Poista */
  min-height: 32px;
  padding: 0 12px;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Yhteensä samalle korkeudelle */
#monthSection .section-header .total-line{
  height: 32px;
  display: inline-flex;
  align-items: center;
  font-size: 18px;
  line-height: 1;
}

#monthSection .section-header .total-line .total-label,
#monthSection .section-header .total-line .total-value{
  font-size: 18px;
}

body.page-talous #monthSection .section-header .header-right .total-line,
body.page-saasto #monthSection .section-header .header-right .total-line,
body.page-talous #monthSection .section-header .header-right .total-line .total-label,
body.page-saasto #monthSection .section-header .header-right .total-line .total-label,
body.page-talous #monthSection .section-header .header-right .total-line .total-value,
body.page-saasto #monthSection .section-header .header-right .total-line .total-value{
  font-size: 20px !important;
}

/* Mobiili */
@media (max-width: 700px){
  .app-header{
    flex-direction: column;
    align-items: flex-start;
  }
  .app-header nav,
  .app-header .topbar-actions{
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px){
  body.page-talous .app-header .app-title-block,
  body.page-saasto .app-header .app-title-block{
    padding-left: 66px;
  }

  body.page-talous .app-header .app-title-block h1,
  body.page-saasto .app-header .app-title-block h1{
    font-size: 1.25rem;
  }
}

/* ======================================================
   MONTH NAV BUTTONS (shared: Talous + Säästö)
   ====================================================== */

#monthSection .month-selector.month-selector--nav{
  display: grid;
  grid-template-columns: auto auto auto auto 1fr auto;
  align-items: center;
  gap: 16px;
  width: 100%;
}

#monthSection .month-selector.month-selector--nav > #prevMonth{
  grid-column: 1;
  justify-self: start;
}

#monthSection .month-selector.month-selector--nav > .field-inline:nth-of-type(1){
  grid-column: 2; /* Vuosi */
}

#monthSection .month-selector.month-selector--nav > .field-inline:nth-of-type(2){
  grid-column: 3; /* Kuukausi */
}

#monthSection .month-selector.month-selector--nav > .field-inline:nth-of-type(3),
#monthSection .month-selector.month-selector--nav > .field-inline--initial{
  grid-column: 4; /* Alkupääoma heti Kuukauden jälkeen */
  justify-self: start;
}

#monthSection .month-selector.month-selector--nav > #nextMonth{
  grid-column: 6;
  justify-self: end;
}

#monthSection .month-nav-btn{
  appearance: none;
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: rgba(244,244,245,.92);

  font-size: 18px;
  line-height: 1;
  cursor: pointer;

  transition:
    background .15s ease,
    border-color .15s ease,
    color .15s ease,
    transform .06s ease;
}

#monthSection .month-nav-btn:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.22);
  color: rgba(244,244,245,.98);
}

#monthSection .month-nav-btn:active{
  transform: translateY(1px);
}

#monthSection .month-nav-btn:focus-visible{
  outline: 2px solid rgba(250,204,21,.35);
  outline-offset: 2px;
}

#monthSection .month-nav-btn:disabled{
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 700px){
  #monthSection .month-selector.month-selector--nav{
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "prev year next"
      "prev month next"
      "prev opening next";
    align-items: center;
    gap: 10px 12px;
  }

  #monthSection .month-selector.month-selector--nav > #prevMonth{
    grid-area: prev;
    align-self: start;
  }

  #monthSection .month-selector.month-selector--nav > #nextMonth{
    grid-area: next;
    align-self: start;
  }

  #monthSection .month-selector.month-selector--nav > .field-inline:nth-of-type(1){
    grid-area: year;
  }

  #monthSection .month-selector.month-selector--nav > .field-inline:nth-of-type(2){
    grid-area: month;
  }

  #monthSection .month-selector.month-selector--nav > .field-inline:nth-of-type(3){
    grid-area: opening;
  }
}

/* ======================================================
   DATALIST HINTS (shared, intentional)
   ====================================================== */

/* Näytä vain kun rivi aktiivinen + syöte fokuksessa
   (vaihda block jos joskus haluat näkyviin) */
.row:focus-within .datalist-hint,
.row:focus-within [data-datalist-hint]{
  display: none;
}
/* ======================================================
   SECTIONS / HEADERS / TABLES (shared patterns)
   ====================================================== */

/* Yhteiset section-tyylit */
.section { margin-top: 30px; }

.section-title { margin: 30px 0 20px; }

.section-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.header-left{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-right{
  display: flex;
  align-items: center;
  gap: 12px;
  align-items: center;
}

.total-display{
  font-weight: 700;
  color: var(--accent);
}

body.page-talous #incomeSection .section-header h3,
body.page-talous #expenseSection .section-header h3,
body.page-saasto #savingsSection .section-header h3,
body.page-saasto #withdrawSection .section-header h3{
  color: var(--text);
  font-weight: 600;
}

body.page-talous #incomeSection .section-header .total-display,
body.page-talous #expenseSection .section-header .total-display,
body.page-saasto #savingsSection .section-header .total-display,
body.page-saasto #withdrawSection .section-header .total-display{
  color: var(--text);
  font-weight: 600;
}

/* Otsikkoteksti (jos table-head käytössä) vasemmalle */
.table-head span:nth-child(2){
  text-align: left;
  justify-self: start;
}

/* ======================================================
   TABLE WRAPPER BEHAVIOR
   ====================================================== */

/* Lista ei ole grid – vain yksittäiset rivit ovat */
#savingsSection .table{
  display: block;
  margin-top: 0; /* lopullinen totuus (poistaa aiemmat 8px/0 ristiriidat) */
}

/* “isompi hengitys” otsikon alle ennen rivejä (talous) */
#incomeSection .table,
#expenseSection .table{
  margin-top: 12px;
}

/* ======================================================
   SAVINGS-SPECIFIC ALIGNMENTS (still ok here if shared file includes these)
   ====================================================== */

/* Säästölaskurin month-selector tiiviimmäksi */
#savingsSection .month-selector{
  margin-top: 8px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

/* label + kenttä -parit */
#savingsSection .month-selector .field-inline{
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Amount-kenttä aina vasemmalle */
#savingsList .row input.amount-input,
#savingsList .row input[type="number"].amount-input,
.section .table .row input.amount-input{
  text-align: left;
  direction: ltr;
}

/* ======================================================
   MOBILE OVERRIDES (saasto)
   ====================================================== */

/* SÄÄSTÖ: kumoa globaalit mobiilipinot tällä sivulla */
@media (max-width:600px){
  body.page-saasto .month-selector,
  body.page-saasto .section-header{
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
  }

  /* Pidä 3-sarakerivi myös mobiilissa */
  body.page-saasto #savingsList .row,
  body.page-saasto #withdrawList .row{
    display: grid;
    grid-template-columns: minmax(140px,1fr) minmax(120px,180px) auto;
    column-gap: 14px;
    align-items: center;
    margin: 0 0 8px 0;
  }

  /* Nappi ei täysleveä */
  body.page-saasto #savingsList .row button,
  body.page-saasto #withdrawList .row button{
    width: auto;
    justify-self: end;
  }
}

/* ======================================================
   MODAL (shared)
   ====================================================== */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: var(--overlay);
  z-index: var(--z-modal);
}

.modal.is-open{ display: grid; }

.modal-card{
  width: min(520px, 92vw);
  background: var(--surface-modal);
  color: #fff;
  border-radius: var(--radius-modal);
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  border: 1px solid var(--border-2);
}

.modal-header,
.modal-footer{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.modal-header{
  border-bottom: 1px solid var(--border-2);
}

.modal-footer{
  border-top: 1px solid var(--border-2);
}

.modal-body{
  display: grid;
  gap: 12px;
  padding: 16px;
}

/* Modal close / icon buttons */
.icon-btn{
  background: none;
  border: none;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.icon-btn:hover{
  filter: brightness(1.1);
}

/* Field wrapper (layout only; input styles already elsewhere) */
.field{
  display: grid;
  gap: 6px;
}

/* ======================================================
   MONTH DETAILS (shared)
   ====================================================== */
.month-details{
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.month-details .detail-card{
  background: var(--surface-3);
  border-radius: var(--radius-card);
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.month-details table{
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}
.month-details th,
.month-details td{
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.month-details th{
  text-align: left;
  color: var(--accent);
}
.month-details .sum-row{ font-weight: 600; }
.month-details .pos{ color: #22C55E; }
.month-details .neg{ color: #EF4444; }

.close-detail{
  position: absolute;
  top: 6px;
  right: 6px;
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 1rem;
  cursor: pointer;
}
.close-detail:hover{ color: #fff; }

/* ======================================================
   FORGOT PASSWORD (shared)
   ====================================================== */
.forgot-password{
  text-align: center;
  margin-top: 18px;
}
.forgot-password a{
  color: var(--accent);
  text-decoration: none;
}
.forgot-password a:hover{
  text-decoration: underline;
}

/* ======================================================
   CHART BOX (shared)
   - uses --chart-h token
   ====================================================== */
.chart-box{
  position: relative;
  width: 100%;
  margin: 16px auto 0;
  height: var(--chart-h);
}

.chart-box canvas{
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  display: block;
}

/* By-category canvas */
#byCategoryChart{
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-width: 100%;
  margin: 0 auto;
}

/* ======================================================
   DOWNLOAD / REPORT MODAL (shared)
   ====================================================== */

/* Neutral overlay shared by all report download flows. */
.download-modal{
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: var(--download-modal-overlay);
  padding: 16px;
  z-index: var(--z-modal);
  animation: fadeIn .15s ease-out;
}
.download-modal.is-open{ display: grid; }

/* Neutral dark card matching the current app surfaces. */
.dl-card{
  width: 560px;
  max-width: 100%;
  background: var(--download-modal-surface);
  color: var(--text);
  border: 1px solid var(--download-modal-border);
  border-radius: var(--radius-modal);
  box-shadow: 0 18px 50px rgba(0,0,0,.55);
}

/* Header / footer: sama reunaviiva */
.dl-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--download-modal-divider);
}
.dl-body{ padding: 16px 20px 8px 20px; }
.dl-footer{
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--download-modal-divider);
}

/* Labelit sirommaksi (kuten Ajanjakso/Vuosi muualla) */
.dl-label{
  display: block;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 600;
  letter-spacing: .05px;
  color: var(--text);
  margin-bottom: 8px;
}
.dl-sub{
  display: block;
  font-size: .9rem;
  color: var(--download-modal-muted);
  margin-bottom: 6px;
}
.dl-field{ margin-bottom: 16px; }

.two-col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Keep filled and autofill states on the same neutral surface. */
.download-modal .dl-input {
  background: var(--download-modal-control);
  border-color: var(--download-modal-border);
  color: var(--text);
}

.download-modal .dl-input:hover {
  background: var(--download-modal-control-hover);
  border-color: #555;
}

.download-modal .dl-input:focus,
.download-modal .dl-input:focus-visible {
  background: var(--download-modal-control-hover);
  border-color: var(--brand-yellow);
  outline: none;
  box-shadow: none;
}

/* Chrome / Edge / Safari autofill override */
.download-modal .dl-input:-webkit-autofill,
.download-modal .dl-input:-webkit-autofill:hover,
.download-modal .dl-input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--download-modal-control) inset !important;
  box-shadow: 0 0 0 1000px var(--download-modal-control) inset !important;
  background: var(--download-modal-control) !important;
  border: 1px solid var(--download-modal-border) !important;
  caret-color: var(--text) !important;
  transition: background-color 9999s ease-out 0s;
}

.download-modal .dl-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--download-modal-control-hover) inset !important;
  box-shadow: 0 0 0 1000px var(--download-modal-control-hover) inset !important;
  background: var(--download-modal-control-hover) !important;
  border-color: var(--brand-yellow) !important;
}

@media (max-width: 560px){
  .two-col{ grid-template-columns: 1fr; }
}

/* ======================================================
   DOWNLOAD MODAL – Aikaväli ilman kehystä + square tabs
   ====================================================== */

/* Poista “kehyslaatikko” aikavälin ympäriltä */
.download-modal .segmented{
  display: inline-flex;
  gap: 10px;
  background: transparent;                 /* ✅ ei kehystä */
  border: 0;                               /* ✅ ei reunaa */
  padding: 0;                              /* ✅ ei sisäpaddia */
  border-radius: 0;
}

/* Koko vuosi / Mukautettu = neutral square tabs */
.download-modal .seg-btn{
  border: 1px solid var(--download-modal-border);
  background: var(--download-modal-control);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;                      /* ✅ “neliskulmainen” fiilis */
  cursor: pointer;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .06s ease;
}

/* Hover stays neutral; selection uses the brand accent. */
.download-modal .seg-btn:hover{
  background: var(--download-modal-control-hover);
  border-color: #555;
}

/* Active selection uses the shared gold accent. */
.download-modal .seg-btn.is-active,
.download-modal .seg-btn[aria-selected="true"]{
  background: var(--brand-yellow);
  border-color: var(--brand-yellow);
  color: var(--ink);
  box-shadow: none;
}

.download-modal .seg-btn:active{ transform: translateY(1px); }

.download-modal .seg-btn:focus-visible,
.download-modal .chip:focus-visible,
.download-modal .dl-footer .btn:focus-visible,
.download-modal .icon-btn:focus-visible{
  outline: 2px solid var(--brand-yellow);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(250,204,21,.20);
}

/* Download modal title brand-yellow */
.download-modal .dl-header h3{
  color: var(--brand-yellow);
}

/* Download modal footer buttons unified */
.download-modal .dl-footer .btn.ghost{
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(250,204,21,.35);
  border-radius: var(--radius-btn);
  padding: 8px 16px;
  font-weight: 700;
}

/* Hover sama kuin Lataa */
.download-modal .dl-footer .btn.ghost:hover{
  background: rgba(250,204,21,.10);
  border-color: rgba(250,204,21,.45);
}

/* Chips (PDF/Excel): sama fiilis kuin topbar/ghost, valittu = keltainen */
.chip-group{ display:flex; gap:10px; }

.chip{
  border: 1px solid rgba(250,204,21,.35);
  background: transparent;
  color: var(--brand-yellow);
  padding: 10px 14px;
  border-radius: var(--radius-btn);     /* pill */
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .06s ease;
}
.chip:hover{
  background: rgba(250, 204, 21, 0.12);
  border-color: rgba(250,204,21,.45);
}
.chip:active{ transform: translateY(1px); }

.chip[aria-pressed="true"],
.chip.is-selected{
  background: var(--brand-yellow);
  color: var(--ink);
  border-color: transparent;
  box-shadow: none;
}

/* Close-ikoni hillityksi */
.dl-card .icon-btn{
  color: rgba(244,244,245,.65);
  font-size: 22px;
}
.dl-card .icon-btn:hover{ color: rgba(244,244,245,.92); }

@keyframes fadeIn{
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.dl-hint{
  margin-top: 6px;
  font-size: 0.8rem;
  opacity: .95;
}
.dl-hint.is-error{
  color: var(--text)
}

/* ======================================================
   LOADING OVERLAY (shared)
   ====================================================== */
.loading{
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  display: grid;
  place-items: center;
  background: var(--bg-dark);

  /* ✅ fade without "display" snap */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity .22s ease, visibility 0s linear .22s;
  will-change: opacity;
}

.loading.is-visible{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transition: opacity .22s ease;
}

/* ✅ optional: subtle "rise" + fade for inner (feels smoother) */
.loading-inner{
  display: grid;
  gap: 14px;
  justify-items: center;

  opacity: 0;
  transform: translateY(6px);
  transition: opacity .22s ease, transform .22s ease;
  will-change: opacity, transform;
}

.loading.is-visible .loading-inner{
  opacity: 1;
  transform: translateY(0);
}

.loading-logo{
  width: 56px;
  height: auto;
  opacity: .9;
}

.spinner{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #333;
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}

.loading .loading-text,
.loading p{
  margin: 0;
  min-height: 1.35em;
  display: block;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .20px;
  color: rgba(255,255,255,.78);
  text-align: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

@keyframes spin{ to{ transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce){
  .spinner{ animation: none; }
  .loading,
  .loading-inner{
    transition: none;
    transform: none;
  }
}

/* Range-tabs (shared) */
.chart-wrap .range-tabs{
  position: static !important;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px !important;
}

.chart-wrap .range-tabs .tab{
  height: 32px;
  line-height: 32px;
  padding: 0 14px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  cursor: pointer;
}

.chart-wrap .range-tabs .tab.is-active,
.chart-wrap .range-tabs .tab[aria-pressed="true"]{
  background: rgba(250,204,21,0.18);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(250,204,21,0.25);
}

.chart-wrap .range-tabs .tab:hover{ filter: brightness(1.08); }

/* Mobiilissa aavistuksen pienempi */
@media (max-width: 640px){
  .chart-wrap .range-tabs .tab{
    height: 28px;
    line-height: 28px;
    padding: 0 10px;
    font-size: 12px;
  }
}

/* Piilota login kunnes auth on tarkistettu */
body.landing.page-login:not([data-auth-ready="1"]) .grid { visibility: hidden;}

/* Kun paywall on auki, piilota login-kortti/grid (mutta jätä hero näkyviin) */
body.ps-paywall-open .grid {
  display: none !important;
}

/* Base styles */
.landing {
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--surface-1);
  color: var(--text);
  margin: 0;
}

/* Reset box sizing */
.landing *,
.landing *::before,
.landing *::after {
  box-sizing: border-box;
}

/* Muted text */
.landing .muted {
  color: #9ca3af;
}

/* Layout wrapper */
.landing .wrapper {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Hero section */
.landing .hero {
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 2rem;
  background: #0f0f10;
}
.landing .hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 6vw, 48px);
  color: #facc15;
}
.landing.page-login .hero .login-brand {
  display: block;
  width: 22rem;
  height: 5.333rem;
  margin: 0 auto -1.933rem;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
  transform: none;
}
.landing.page-login .hero .login-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 49%;
}
.landing.page-login .purchase-login-context {
  margin: -.15rem 0 1.25rem;
  padding: .8rem 1rem;
  border-left: .25rem solid var(--brand-yellow);
  border-radius: .35rem;
  background: rgba(250, 204, 21, .09);
  color: var(--text);
  font-weight: 650;
  line-height: 1.5;
}
.landing.page-login .purchase-login-context[hidden] {
  display: none;
}
.landing .hero p {
  margin: 0;
  font-size: clamp(16px, 3vw, 20px);
  color: #9ca3af;
}

@media (max-width: 31rem) {
  .landing.page-login .hero .login-brand {
    width: 11.5rem;
    height: 3.2rem;
    margin-bottom: -.2rem;
    transform: translateY(.2rem);
  }
}

/* Grid layout for cards */
/* Container for cards: flex layout so single card centers automatically */
.landing .grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 24px;
}
@media (max-width: 600px) {
  .landing .grid {
    /* Stack cards vertically on small screens */
    flex-direction: column;
    align-items: center;
  }
}

/* Card styling */
.landing .card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  /* Constrain the width of cards and center them */
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.purchase-state {
  display: grid;
  gap: 16px;
}

.purchase-state[hidden] {
  display: none;
}

.purchase-state__ingress {
  margin: 0;
  color: var(--purchase-ink-soft, var(--muted, #667085));
}

.page-purchase .customer-confirmation-card,
.page-success .customer-confirmation-card {
  min-width: 0;
  padding: clamp(1.2rem, 3vw, 1.75rem);
  color: var(--purchase-ink);
  background: var(--purchase-paper);
  border: 1px solid var(--purchase-line);
  border-radius: 1rem;
  box-shadow: 0 .7rem 2rem rgba(23, 23, 20, .055);
  overflow-wrap: anywhere;
}

.page-purchase .customer-confirmation-card h3,
.page-success .customer-confirmation-card h3 {
  margin: 0;
  color: var(--purchase-ink);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.page-purchase .purchase-info-card__rows {
  display: grid;
  gap: 0;
  min-width: 0;
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--purchase-line);
}

.page-purchase .purchase-info-card__row {
  display: grid;
  grid-template-columns: minmax(10rem, .7fr) minmax(0, 1.3fr);
  gap: 0 1.5rem;
  min-width: 0;
  border-bottom: 1px solid var(--purchase-line);
}

.page-purchase .purchase-info-card dt,
.page-purchase .purchase-info-card dd {
  min-width: 0;
  padding: .8rem 0;
  line-height: 1.45;
}

.page-purchase .purchase-info-card dt {
  color: var(--purchase-muted);
  font-weight: 600;
}

.page-purchase .purchase-info-card dd {
  margin: 0;
  color: var(--purchase-ink);
  font-weight: 650;
}

.page-purchase .purchase-info-card dd small {
  display: block;
  margin-top: .15rem;
  color: var(--purchase-muted);
  font-size: .9em;
  font-weight: 500;
}

.purchase-state__fallback {
  color: var(--muted, #667085);
  font-size: .9rem;
  margin: -6px 0 0;
}

.purchase-product-info {
  width: 100%;
  min-width: 0;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  overflow-wrap: anywhere;
}

.purchase-product-info h3 {
  margin: 0 0 8px;
  color: var(--brand-yellow);
}

.purchase-product-info__price {
  margin: 0 0 12px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.purchase-product-info ul {
  margin: 0;
  padding-left: 20px;
}

.purchase-product-info li {
  margin: 6px 0;
  line-height: 1.4;
}

@media (max-width: 520px) {
  .purchase-product-info {
    padding: 14px;
  }

  .purchase-product-info__price {
    font-size: 1.25rem;
  }
}

.purchase-confirmation__actions {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.purchase-confirmation__actions > .btn {
  width: auto;
  max-width: 100%;
  min-height: 40px;
  height: auto;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}

.purchase-confirmation__actions > :last-child {
  margin-left: 0;
}

@media (max-width: 520px) {
  .purchase-confirmation__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .purchase-confirmation__actions > .btn {
    width: 100%;
    margin-left: 0;
  }

  .purchase-confirmation__actions > :last-child {
    margin-left: 0;
  }
}

.landing h1 {
  margin: 0 0 8px;
  font-size: clamp(22px, 4.8vw, 28px);
  color: #facc15;
}
.landing h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: #facc15;
}

/* Segment button group */
.landing .segment {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 6px 0 12px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.landing .seg-btn {
  border: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  color: #e5e7eb;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.landing .seg-btn:hover {
  background: var(--surface-input);
}
.landing .seg-btn.is-active {
  background: #facc15;
  color: #111827;
}

/* Form labels and inputs */
.landing label {
  display: block;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 4px;
}
.landing input[type="email"],
.landing input[type="password"] {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.landing input:focus {
  outline: none;
  border-color: #facc15;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.2);
}

/* Button row */
body.landing .action-row {
  display: flex;
  align-items: center;              /* sama taso */
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
}

/* Primary action */
body.landing .btn.primary {
  background: var(--brand-yellow);
  color: var(--ink);
  height: 38px;                     /* kiinteä korkeus */
  min-height: 38px;
  padding: 0 16px;
  font-weight: 600;
  border-radius: 10px;
  line-height: 1;
  margin-top: 0 !important;         /* kumoa globaali */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body.landing .btn.primary:hover{
  background: var(--brand-yellow-600);
  filter: none;
}

/* Ostosivun paluu on tekstilinkki, ei pillipainike. */
body.landing #purchaseBack{
  width:auto;
  height:auto;
  min-height:0;
  padding:2px 0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
  color:var(--text);
  line-height:1.25;
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
  transform:none;
}

body.landing #purchaseBack:hover,
body.landing #purchaseBack:focus-visible{
  border:0;
  background:transparent;
  box-shadow:none;
  color:var(--brand-yellow);
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:3px;
  filter:none;
  transform:none;
}

/* "Unohditko salasanan?" */
body.landing #forgotBtn{
  background: transparent;
  border: 0;
  height: 38px;                     /* sama korkeus */
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Link hover */
.landing #forgotBtn:hover {
  text-decoration: underline;
}

/* Näppäimistöfokus (saavutettavuus) */
.landing #forgotBtn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(250,204,21,.20);
  border-radius: 8px;
}

body.landing .login-actions {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

body.landing .login-actions > .btn,
body.landing .login-actions > button,
body.landing .login-actions > a {
  max-width: 100%;
  min-height: 40px;
  height: auto;
  white-space: normal;
  line-height: 1.25;
  text-align: center;
}

body.landing .login-actions > #forgotBtn {
  min-height: 40px;
  height: auto;
  line-height: 1.25;
}

@media (max-width: 520px) {
  body.landing .login-actions {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
  }

  body.landing .login-actions > .btn,
  body.landing .login-actions > button,
  body.landing .login-actions > a {
    width: 100%;
    margin-left: 0;
  }

  body.landing .login-actions > :last-child {
    margin-left: 0;
  }
}

/* Kun chooser auki login-sivulla: piilota vain kirjautumiskortti, jätä PolkuSolutions näkyviin */
body.landing.ps-chooser-open .grid{
  display: none;
}

/* Kun appia klikataan: piilota landing-sisältö heti (ei välähdystä) */
body.landing.ps-loading .hero,
body.landing.ps-loading .grid{
  visibility: hidden;
}

/* (valinnainen) varmistaa ettei mitään voi klikata enää */
body.landing.ps-loading{
  pointer-events: none;
}

/* Kun vaihdetaan sovellusta → piilota nykyinen UI heti */
body.ps-loading .app-container{
  opacity: 0;
  pointer-events: none;
}

/* Näytä loading overlay heti kovapäivityksessä sovellussivuilla */
body.page-saasto.ps-loading #loadingOverlay,
body.page-talous.ps-loading #loadingOverlay,
body.page-oma.ps-loading #loadingOverlay{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.page-saasto.ps-loading #loadingOverlay .loading-inner,
body.page-talous.ps-loading #loadingOverlay .loading-inner,
body.page-oma.ps-loading #loadingOverlay .loading-inner{
  opacity: 1;
  transform: translateY(0);
}

/* Notification messages */
.landing .note {
  display: none;
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid #ffe69c;
  background: #fff3cd;
  color: #433600;
  border-radius: 8px;
}
.landing .error {
  color: #ef4444;
  margin-top: 8px;
}

/* CTA text below login form */
/* CTA container below login form */
.landing .cta {
  margin-top: 20px;
  font-size: 14px;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* CTA link (optional) */
.landing .cta a {
  color: #facc15;
  font-weight: 600;
  text-decoration: none;
}
.landing .cta a:hover {
  text-decoration: underline;
}

/* Suurenna kirjautumiskorttia ja tekstikokoja puhelimissa */
@media (max-width: 600px) {
  /* Kortti täyttää lähes koko näytön leveyden */
  .landing .card {
    max-width: none;
    width: 100%;
    padding: 2rem;          /* Lisää tilaa sisäpuolelle */
  }

  /* Voit halutessasi kasvattaa otsikoiden ja tekstikenttien fonttikokoja */
  .landing h2 {
    font-size: 22px;
  }
  .landing label {
    font-size: 16px;
  }
  .landing input[type="email"],
  .landing input[type="password"] {
    font-size: 16px;
    padding: 12px 14px;
  }
  .landing .btn {
    padding: 12px 18px;
    font-size: 16px;
  }
}

/* ======================================================
   LOGIN PAGE — responsive viewport-centred composition
   ====================================================== */
body.landing.page-login {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

.landing.page-login .wrapper {
  display: flex;
  width: min(100%, 29rem);
  max-width: none;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.25rem, 4vh, 3rem) clamp(1rem, 4vw, 1.5rem);
}

.landing.page-login .hero {
  flex: 0 0 auto;
  margin: 0 0 clamp(.9rem, 2vh, 1.35rem);
  padding: 0;
  background: transparent;
}

.landing.page-login .grid {
  width: 100%;
  flex: 0 0 auto;
}

.landing.page-login .grid > .card {
  width: min(100%, 26rem);
  max-width: 26rem;
  margin: 0 auto;
  padding: clamp(1.5rem, 3vw, 2rem);
}

.landing.page-login .card h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.4rem, 1.6vw, 1.55rem);
  line-height: 1.2;
}

.landing.page-login .card label {
  margin-top: 1rem;
  margin-bottom: .4rem;
  font-size: 1rem;
  line-height: 1.35;
}

.landing.page-login .card input[type="email"],
.landing.page-login .card input[type="password"] {
  min-width: 0;
  min-height: 3.25rem;
  padding: 0 1rem;
  font-size: 1rem;
}

.landing.page-login .login-actions {
  flex-wrap: nowrap;
  margin-top: 1.5rem;
}

.landing.page-login .login-actions > .btn,
.landing.page-login .login-actions > button,
.landing.page-login .login-actions > a,
.landing.page-login .login-actions > #forgotBtn {
  min-height: 2.75rem;
  padding: .7rem 1rem;
  font-size: .95rem;
}

.landing.page-login .login-actions > #forgotBtn {
  padding-inline: .625rem;
}

.landing.page-login .cta {
  flex-wrap: wrap;
  margin-top: 1.5rem;
  font-size: .925rem;
  line-height: 1.5;
}

@media (max-width: 37.5rem) {
  .landing.page-login .wrapper {
    padding-block: clamp(1rem, 4vh, 2rem);
  }

  .landing.page-login .hero {
    margin-bottom: .75rem;
  }

  .landing.page-login .grid > .card {
    padding: clamp(1.5rem, 7vw, 2rem);
  }

  .landing.page-login .card input[type="email"],
  .landing.page-login .card input[type="password"] {
    min-height: 3rem;
  }
}

body.landing[data-env="test"]::before{
  content:"DEMO";
  position:fixed;
  top:10px;
  right:10px;
  padding:6px 10px;
  border-radius:999px;
  background:#ffcc00;
  color:#000;
  font-weight:800;
  z-index:2147483647;
  pointer-events:none;
}

/* ======================================================
   PURCHASE PAGE — PolkuSolutions website design system
   ====================================================== */
body.landing.page-purchase{
  --purchase-ink: #171714;
  --purchase-ink-soft: #353532;
  --purchase-paper: #fffefa;
  --purchase-mist: #f4f3ee;
  --purchase-line: #deddd5;
  --purchase-muted: #686861;
  --purchase-gold: #f7b900;
  --purchase-gold-dark: #8a6500;
  --purchase-shell-width: 55rem;
  --purchase-copy-size: 1rem;
  --purchase-hero-pad-top: 2rem;
  --purchase-hero-pad-bottom: 2.25rem;
  --purchase-logo-gap: 1rem;
  --purchase-heading-gap: .5rem;
  --purchase-body-pad-top: 2rem;
  --purchase-body-pad-bottom: 5rem;
  --purchase-card-pad-top: 2.75rem;
  --purchase-card-pad-inline: 2.75rem;
  --purchase-card-pad-bottom: 2.75rem;
  --purchase-summary-padding: 2.25rem;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  height: auto;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--purchase-ink);
  background: var(--purchase-paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}

.page-purchase .purchase-page{
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
}

.landing .purchase-alert {
  display: block;
  margin: .9rem 0 0;
  padding: .85rem 1rem;
  color: var(--purchase-ink, #171714);
  background: var(--purchase-paper, #fff);
  border: 1px solid var(--purchase-line, #deddd5);
  border-left-width: .3rem;
  border-radius: .75rem;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.landing .purchase-alert:empty,
.landing .purchase-alert[hidden] {
  display: none !important;
}

.landing .purchase-alert--info {
  background: #fff9e8;
  border-color: #d7a300;
}

.landing .purchase-alert--warning {
  background: #fff5df;
  border-color: #b97300;
}

.landing .purchase-alert--error {
  background: #fff0ef;
  border-color: #b42318;
  color: #7a271a;
}

.landing .purchase-alert--success {
  background: #eef9f0;
  border-color: #2f7d32;
  color: #245b27;
}

.purchase-resume-transition{
  display: none;
}

html.purchase-resume-active body.page-purchase{
  overflow: hidden;
}

html.purchase-initializing .page-purchase .purchase-page{
  visibility: hidden;
}

html.purchase-resume-active .page-purchase .purchase-page{
  visibility: hidden;
}

html.purchase-resume-active .page-purchase .purchase-resume-transition{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  color: var(--purchase-ink, #171714);
  background: var(--purchase-mist, #f4f3ee);
}

.purchase-resume-transition__card{
  width: min(100%, 28rem);
  padding: clamp(2rem, 5vh, 3rem);
  text-align: center;
  background: #ffffff;
  border: 1px solid var(--purchase-line, #deddd5);
  border-radius: 1.25rem;
  box-shadow: 0 1.5rem 4rem rgba(23, 23, 20, .09);
}

.purchase-resume-transition__spinner{
  display: block;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto 1.15rem;
  border: .25rem solid var(--purchase-line, #deddd5);
  border-top-color: var(--purchase-gold, #f7b900);
  border-radius: 50%;
  animation: purchase-resume-spin .8s linear infinite;
}

.purchase-resume-transition__title{
  margin: 0;
  color: var(--purchase-ink, #171714);
  font-size: 1.35rem;
  font-weight: 750;
}

.purchase-resume-transition__title + p{
  margin: .45rem 0 0;
  color: var(--purchase-muted, #686861);
}

@keyframes purchase-resume-spin{
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce){
  .purchase-resume-transition__spinner{
    animation: none;
  }
}

.page-purchase .purchase-hero{
  position: relative;
  padding: var(--purchase-hero-pad-top) 0 var(--purchase-hero-pad-bottom);
  overflow: hidden;
  color: #ffffff;
  background: var(--purchase-ink);
  border-bottom: 1px solid #353532;
}

.page-purchase .purchase-hero::after{
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(31%, 24rem);
  height: .3rem;
  background: var(--purchase-gold);
}

.page-purchase .purchase-hero__inner{
  width: min(calc(100% - 3rem), 74rem);
  margin-inline: auto;
}

.page-purchase .purchase-logo{
  display: block;
  width: clamp(14.5rem, 19vw, 17rem);
  height: 4.15rem;
  margin-bottom: var(--purchase-logo-gap);
  overflow: hidden;
}

.page-purchase .purchase-logo img{
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 49%;
}

.page-purchase .purchase-heading{
  max-width: 48rem;
}

.page-purchase .purchase-heading h1{
  margin: 0 0 var(--purchase-heading-gap);
  color: #ffffff;
  font-size: clamp(3.4rem, 6.2vw, 5.5rem);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: .98;
}

.page-purchase .purchase-heading .muted{
  margin: 0;
  color: #cecdc6;
  font-size: clamp(1.125rem, 1.7vw, 1.35rem);
}

.page-purchase .purchase-body{
  flex: 1 0 auto;
  padding: var(--purchase-body-pad-top) 0 var(--purchase-body-pad-bottom);
  background: var(--purchase-mist);
}

.page-purchase .purchase-shell{
  display: grid;
  width: min(calc(100% - 3rem), var(--purchase-shell-width));
  max-width: none;
  gap: clamp(2rem, 5vh, 5rem);
  padding: 0;
  margin-inline: auto;
}

.page-purchase .purchase-shell:has(.purchase-preview:not([hidden])){
  width: min(calc(100% - 2.5rem), 72rem);
  grid-template-columns: minmax(20rem, .92fr) minmax(20rem, 1.08fr);
  align-items: center;
}

.page-purchase .purchase-checkout{
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: var(--purchase-card-pad-top) var(--purchase-card-pad-inline) var(--purchase-card-pad-bottom);
  overflow: hidden;
  font-size: var(--purchase-copy-size);
  color: var(--purchase-ink);
  background: #ffffff;
  border: 1px solid var(--purchase-line);
  border-radius: 1.25rem;
  box-shadow: 0 1.5rem 4rem rgba(23, 23, 20, .09);
}

.page-purchase .purchase-checkout::before{
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: .28rem;
  background: var(--purchase-gold);
}

.page-purchase label,
.page-purchase .purchase-option-label{
  display: block;
  margin: 1.1rem 0 .45rem;
  color: var(--purchase-ink-soft);
  font-size: 1rem;
  font-weight: 750;
}

.page-purchase #buyEmail{
  width: 100%;
  min-height: 3rem;
  padding: .55rem .875rem;
  font: inherit;
  font-size: 1rem;
  color: var(--purchase-ink);
  background: var(--purchase-paper);
  border: 1px solid var(--purchase-line);
  border-radius: .8rem;
  caret-color: var(--purchase-gold-dark);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.page-purchase #buyEmail::placeholder{
  color: #8b8b84;
}

.page-purchase #buyEmail:hover{
  background: #ffffff;
  border-color: #b9b8b0;
}

.page-purchase #buyEmail:focus,
.page-purchase #buyEmail:focus-visible{
  outline: none;
  background: #ffffff;
  border-color: var(--purchase-gold-dark);
  box-shadow: 0 0 0 .22rem rgba(247, 185, 0, .2);
}

.page-purchase #buyEmail:-webkit-autofill{
  box-shadow: 0 0 0 1000px var(--purchase-paper) inset !important;
  -webkit-text-fill-color: var(--purchase-ink) !important;
  caret-color: var(--purchase-gold-dark);
}

.page-purchase .purchase-options{
  margin-top: 2.25rem;
}

.page-purchase .segment{
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .3125rem;
  margin: 0;
  padding: .1875rem;
  background: var(--purchase-mist);
  border: 1px solid var(--purchase-line);
  border-radius: .9rem;
}

.page-purchase .purchase-product-segment{
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-purchase .seg-btn{
  display: inline-flex;
  min-width: 0;
  min-height: 2.375rem;
  align-items: center;
  justify-content: center;
  padding: .55rem .75rem;
  color: var(--purchase-ink-soft);
  background: #ffffff;
  border: 1px solid transparent;
  border-radius: .68rem;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.15;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.page-purchase .seg-btn:hover{
  color: var(--purchase-ink);
  background: var(--purchase-paper);
  border-color: #c9c8c0;
}

.page-purchase .seg-btn:focus-visible{
  outline: .18rem solid var(--purchase-gold);
  outline-offset: .15rem;
  box-shadow: none;
}

.page-purchase .seg-btn.is-active,
.page-purchase .seg-btn.is-active:hover{
  color: var(--purchase-ink);
  background: var(--purchase-gold);
  border-color: var(--purchase-gold);
}

.page-purchase .purchase-product-info{
  margin: 0;
  padding: var(--purchase-summary-padding);
  color: var(--purchase-ink-soft);
  background: var(--purchase-mist);
  border: 1px solid var(--purchase-line);
  border-radius: 1rem;
}

.page-purchase .purchase-product-info h3{
  margin: 0 0 .5rem;
  color: var(--purchase-ink);
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.page-purchase .purchase-product-info__price{
  margin: 0 0 1.35rem;
  color: var(--purchase-gold-dark);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.025em;
  line-height: 1.15;
}

.page-purchase .purchase-product-info ul{
  display: grid;
  gap: .8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-purchase .purchase-product-info li{
  position: relative;
  margin: 0;
  padding-left: 1.7rem;
  line-height: 1.5;
}

.page-purchase .purchase-product-info li::before{
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--purchase-gold-dark);
  font-weight: 850;
}

.page-purchase .purchase-state{
  color: var(--purchase-ink-soft);
}

.page-purchase .purchase-state h2{
  margin-bottom: .75rem;
  color: var(--purchase-ink);
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  font-weight: 650;
  letter-spacing: -.035em;
}

.page-purchase .purchase-state__fallback{
  color: var(--purchase-muted);
}

.page-purchase .action-row{
  margin-top: 1.25rem;
}

.page-purchase .action-row #buyBtn{
  flex: 0 0 auto;
  width: auto;
  min-width: 7.5rem;
  min-height: 2.875rem;
  height: auto;
  padding: .6rem 1.15rem;
  color: var(--purchase-ink);
  background: var(--purchase-gold);
  border: 1px solid var(--purchase-gold);
  border-radius: .75rem;
  font-size: 1rem;
  font-weight: 800;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.page-purchase .action-row #buyBtn:hover{
  background: #e6ab00;
  border-color: #e6ab00;
  transform: translateY(-.1rem);
}

.page-purchase .action-row #buyBtn:focus-visible{
  outline: .18rem solid var(--purchase-gold);
  outline-offset: .2rem;
  box-shadow: 0 0 0 .18rem rgba(169,126,28,.24);
}

body.landing.page-purchase #purchaseBack{
  color: var(--purchase-ink);
  font-size: 1rem;
  font-weight: 750;
  text-decoration-color: var(--purchase-gold);
  text-decoration-thickness: .12rem;
}

body.landing.page-purchase #purchaseBack:hover,
body.landing.page-purchase #purchaseBack:focus-visible{
  color: var(--purchase-gold-dark);
}

/* Statutory withdrawal form: keep light website controls isolated from app CSS. */
.page-withdrawal .purchase-checkout h2{
  margin: 0 0 .75rem;
  color: var(--purchase-ink);
  font-size: clamp(1.65rem, 5vw, 2.25rem);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.15;
}

.page-withdrawal .purchase-checkout p{
  color: var(--purchase-ink-soft);
}

.page-withdrawal .purchase-checkout .field-help{
  margin: .35rem 0 0;
  color: var(--purchase-muted);
  font-size: .875rem;
  line-height: 1.45;
}

.page-withdrawal .purchase-checkout input{
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: .55rem .875rem;
  font: inherit;
  font-size: 1rem;
  color: var(--purchase-ink);
  background: var(--purchase-paper);
  border: 1px solid var(--purchase-line);
  border-radius: .8rem;
  caret-color: var(--purchase-gold-dark);
  transition: background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.page-withdrawal .purchase-checkout input::placeholder{
  color: #8b8b84;
  opacity: 1;
}

.page-withdrawal .purchase-checkout input:hover{
  background: #ffffff;
  border-color: #b9b8b0;
}

.page-withdrawal .purchase-checkout input:focus,
.page-withdrawal .purchase-checkout input:focus-visible{
  outline: none;
  background: #ffffff;
  border-color: var(--purchase-gold-dark);
  box-shadow: 0 0 0 .22rem rgba(247, 185, 0, .2);
}

.page-withdrawal .purchase-checkout input:-webkit-autofill,
.page-withdrawal .purchase-checkout input:-webkit-autofill:hover,
.page-withdrawal .purchase-checkout input:-webkit-autofill:focus,
.page-withdrawal .purchase-checkout input:-webkit-autofill:active{
  -webkit-box-shadow: 0 0 0 1000px var(--purchase-paper) inset !important;
  box-shadow: 0 0 0 1000px var(--purchase-paper) inset !important;
  -webkit-text-fill-color: var(--purchase-ink) !important;
  caret-color: var(--purchase-gold-dark);
}

.page-withdrawal .note:empty{
  display: none;
}

.page-withdrawal .action-row .btn{
  display: inline-flex;
  width: auto;
  min-height: 2.875rem;
  height: auto;
  align-items: center;
  justify-content: center;
  padding: .65rem 1.15rem;
  color: var(--purchase-ink);
  border-radius: .75rem;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.page-withdrawal .action-row .btn.primary{
  min-height: 2.875rem;
  height: auto;
  color: var(--purchase-ink);
  background: var(--purchase-gold);
  border: 1px solid var(--purchase-gold);
}

.page-withdrawal .action-row .btn.primary:hover{
  color: var(--purchase-ink);
  background: #e6ab00;
  border-color: #e6ab00;
  text-decoration: none;
}

.page-withdrawal .action-row .btn:not(.primary){
  color: var(--purchase-ink);
  background: #ffffff;
  border: 1px solid var(--purchase-line);
}

.page-withdrawal .action-row .btn:not(.primary):hover{
  color: var(--purchase-gold-dark);
  background: var(--purchase-paper);
  border-color: #b9b8b0;
  text-decoration: none;
}

.page-purchase .purchase-confirmation__actions .btn:not(.primary){
  min-height: 3.25rem;
  padding: .8rem 1.4rem;
  color: var(--purchase-ink);
  background: #ffffff;
  border: 1px solid var(--purchase-line);
  border-radius: 999px;
  font-weight: 750;
}

.page-purchase .purchase-preview{
  min-width: 0;
  margin: 0;
  padding: clamp(1rem, 3vh, 2rem);
  background: #ffffff;
  border: 1px solid var(--purchase-line);
  border-radius: 1.25rem;
  box-shadow: 0 1.5rem 4rem rgba(23, 23, 20, .09);
}

.page-purchase .purchase-preview img{
  display: block;
  width: 100%;
  height: auto;
  border-radius: .8rem;
}

@media (min-width: 801px){
  body.landing.page-purchase{
    --purchase-shell-width: 60rem;
    --purchase-copy-size: 1.1875rem;
    --purchase-card-pad-top: 3.5rem;
    --purchase-card-pad-inline: 4rem;
    --purchase-card-pad-bottom: 4rem;
    --purchase-summary-padding: 2rem;
  }

  .page-purchase .purchase-product-info h3,
  .page-purchase .purchase-product-info__price{
    font-size: 2.125rem;
  }

  .page-purchase .purchase-product-info__price{
    margin-bottom: 1.3rem;
  }

  .page-purchase .purchase-product-info ul{
    gap: .75rem;
  }

  .page-purchase .purchase-product-info li{
    font-size: 1.125rem;
    line-height: 1.5;
  }

  .page-purchase .purchase-options{
    margin-top: 5.5rem;
  }

  .page-purchase label,
  .page-purchase .purchase-option-label{
    margin: 1.125rem 0 .45rem;
    font-size: 1rem;
  }

  .page-purchase .purchase-options > .purchase-option-label:first-child{
    margin-top: 0;
  }

  .page-purchase .seg-btn{
    min-height: 2.375rem;
    padding: .45rem .75rem;
    font-size: 1rem;
  }

  .page-purchase #buyEmail{
    min-height: 3rem;
    padding: .55rem .875rem;
    font-size: 1rem;
  }

  .page-purchase .action-row{
    margin-top: 1.375rem;
  }

  .page-purchase .action-row #buyBtn{
    font-size: 1rem;
  }
}

@media (min-width: 1024px){
  body.landing.page-purchase{
    --purchase-hero-pad-top: clamp(1.5rem, 3.4vh, 2rem);
    --purchase-hero-pad-bottom: clamp(1.65rem, 3.8vh, 2.25rem);
    --purchase-logo-gap: clamp(.75rem, 1.8vh, 1rem);
    --purchase-body-pad-top: clamp(1.5rem, 3.5vh, 2rem);
    --purchase-card-pad-top: clamp(2.25rem, 6.5vh, 3.5rem);
    --purchase-card-pad-bottom: clamp(2.5rem, 7vh, 4rem);
    --purchase-summary-padding: clamp(1.5rem, 3.8vh, 2rem);
  }

  .page-purchase .purchase-logo{
    width: 16.5rem;
  }

  .page-purchase .purchase-heading h1{
    font-size: clamp(4rem, 5vw, 4.5rem);
  }

  .page-purchase .purchase-heading .muted{
    font-size: 1.25rem;
  }
}

@media (max-width: 800px){
  .page-purchase .purchase-shell:has(.purchase-preview:not([hidden])){
    width: min(calc(100% - 2rem), 38rem);
    grid-template-columns: 1fr;
  }

  .page-purchase .purchase-checkout{
    order: 1;
  }

  .page-purchase .purchase-preview{
    order: 2;
  }
}

@media (max-width: 520px){
  body.landing.page-purchase{
    --purchase-hero-pad-top: 1.25rem;
    --purchase-hero-pad-bottom: 1.4rem;
    --purchase-logo-gap: .75rem;
    --purchase-body-pad-top: 1rem;
    --purchase-body-pad-bottom: 3rem;
    --purchase-card-pad-top: 1.1rem;
    --purchase-card-pad-inline: 1.1rem;
    --purchase-card-pad-bottom: 1.35rem;
    --purchase-summary-padding: 1.05rem;
  }

  .page-purchase .purchase-hero__inner,
  .page-purchase .purchase-shell{
    width: min(calc(100% - 2rem), 46rem);
  }

  .page-purchase .purchase-logo{
    width: 10.7rem;
    height: 3rem;
  }

  .page-purchase .purchase-checkout{
    border-radius: 1rem;
  }

  .page-purchase .purchase-heading h1{
    margin-bottom: .5rem;
    font-size: clamp(2rem, 11vw, 2.65rem);
  }

  .page-purchase .seg-btn{
    min-height: 2.75rem;
    padding-inline: .45rem;
    font-size: .9rem;
  }

  .page-purchase .purchase-product-info h3,
  .page-purchase .purchase-product-info__price{
    font-size: 1.55rem;
  }

  .page-purchase .action-row{
    flex-direction: column;
    align-items: stretch;
  }

  .page-purchase .action-row #buyBtn{
    width: 100%;
  }

  body.landing.page-purchase #purchaseBack{
    align-self: center;
    margin-left: 0;
    padding: .55rem;
  }

  .page-withdrawal .action-row > .btn{
    width: 100%;
    margin-left: 0;
  }
}
/* =========================
   PolkuSolutions App Chooser
   ========================= */

.ps-chooser-host { display: none; }

/* Backdrop (modal) */
.ps-chooser-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.58);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
}

/* Card */
.ps-chooser-card{
  width: min(540px, calc(100% - 28px));
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
  color: #e5e7eb;
}

/* Header */
.ps-chooser-title{
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 20px;
  font-weight: 600;               /* ✅ sirompi */
  letter-spacing: .2px;
  color: var(--accent);
  margin: 0 0 14px;
}

.ps-chooser-sub{
  margin: 0 0 12px;
  color: #9ca3af;
  font-size: 13px;
}

/* Buttons grid */
.ps-chooser-btns{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 520px){
  .ps-chooser-btns{ grid-template-columns: 1fr 1fr; }
}

/* App button (brand-yhtenäinen) */
.ps-chooser-btn{
  width: 100%;
  border: 1px solid rgba(250,204,21,.35);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 12px;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color .15s ease, border-color .15s ease, transform .05s ease;
}
.ps-chooser-btn:hover{ background: rgba(250,204,21,.10); border-color: rgba(250,204,21,.45); }
.ps-chooser-btn:active{ transform: translateY(1px); }
.ps-chooser-btn:focus:not(:focus-visible){
  outline: none;
  box-shadow: none;
}
.ps-chooser-btn:focus-visible{
  outline: 2px solid var(--brand-yellow);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(250,204,21,.20);
}
.ps-chooser-btn.ps-chooser-btn--initial-focus-silent:focus,
.ps-chooser-btn.ps-chooser-btn--initial-focus-silent:focus-visible{
  outline: none;
  outline-offset: 0;
  box-shadow: none;
}
.ps-chooser-btn.ps-chooser-btn--initial-focus-silent:focus:not(:hover),
.ps-chooser-btn.ps-chooser-btn--initial-focus-silent:focus-visible:not(:hover){
  border-color: rgba(250,204,21,.35);
  background: rgba(255,255,255,.04);
}
.ps-chooser-btn .ps-chooser-pill{
  font-weight: 800;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(250,204,21,.18);
  color: var(--brand-yellow);
  border: 1px solid rgba(250,204,21,.20);
}

/* Close row */
.ps-chooser-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.ps-chooser-linkbtn{
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 700;
}

.ps-chooser-linkbtn:hover{
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.18);
  filter: none;
}

/* =========================
   In-app hamburger menu
   ========================= */

/* App-container toimii ankkurina (TALOUS yliajaa tämän muuten pois) */
body.page-talous .app-container,
body.page-saasto .app-container{
  position: relative;
}

/* ✅ ÄLÄ pienennä koko headeria – siirrä vain otsikkoa hampparin alta */
body.page-talous .app-header,
body.page-saasto .app-header{
  min-height: 56px;  /* pidä tämä jos haluat */
}

/* siirrä vain h1 sivuun */
body.page-talous .app-header h1,
body.page-saasto .app-header h1{
  padding-left: 70px;  /* 46px nappi + marginaalit */
}

/* mobiilissa vähän pienempi */
@media (max-width: 600px){
  body.page-talous .app-header h1,
  body.page-saasto .app-header h1{
    padding-left: 66px;
  }
}

/* varmistus: jos sun headerissä on nappirivi, sallitaan tarvittaessa rivittyä */
body.page-saasto .topbar-actions,
body.page-talous .topbar-actions{
  flex-wrap: wrap;
}

/* Hamppari pysyy sovelluskortin sisällä (EI seuraa viewporttia) */
.ps-appmenu{
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: var(--z-menu);
  width: fit-content;
}

/* Hamppari-nappi */
.ps-appmenu-btn{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  background: var(--surface-2);
  color: #e5e7eb;
  cursor: pointer;
  display: grid;
  place-items: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  transition: background .15s ease, border-color .15s ease;
}

/* hover – EI keltaista */
.ps-appmenu-btn:hover{
  background: var(--surface-3);
  border-color: var(--border);
}

.ps-appmenu-btn:focus-visible{
  outline: 2px solid var(--brand-yellow);
  outline-offset: 2px;
}

/* 3 viivan ikoni */
.ps-appmenu-icon{
  width: 18px;
  height: 12px;
  position: relative;
}
.ps-appmenu-icon span,
.ps-appmenu-icon::before,
.ps-appmenu-icon::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 999px;
  background: rgba(229,231,235,.92);
}
.ps-appmenu-icon::before{ top: 0; }
.ps-appmenu-icon span{ top: 5px; }
.ps-appmenu-icon::after{ bottom: 0; }

/* Dropdown panel */
.ps-appmenu-panel{
  position: absolute;
  top: 56px;
  left: 0;
  min-width: 260px;
  max-width: min(360px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(24,24,27,.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
  display: none;
}

.ps-appmenu.is-open .ps-appmenu-panel{ display: block; }

.ps-appmenu-head{
  font-weight: 700;
  color: #facc15;
  margin-bottom: 10px;
}
.ps-appmenu-list{
  display: grid;
  gap: 10px;
}

.ps-appmenu-item{
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: var(--surface-3);
  color: #e5e7eb;
  cursor: pointer;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease;
}
.ps-appmenu-item:hover{
  background: var(--surface-input);
  border-color: var(--border);
}
.ps-appmenu-item.is-current{
  border-color: rgba(250,204,21,.55);
  box-shadow: inset 0 0 0 1px rgba(250,204,21,.20);
}

@media (max-width: 600px){
  .ps-appmenu{ top: 10px; left: 10px; }
  .ps-appmenu-panel{ top: 54px; }

  /* mobiilissa vähän tiukempi vasen padding */
  body.page-talous .app-header,
  body.page-saasto .app-header{
    min-height: 54px;
  }
}
/* Piilota hamppari kun loading on päällä */
body.ps-loading .ps-appmenu{
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

/* pieni pehmennys kun tulee esiin */
.ps-appmenu{
  transition: opacity .15s ease, transform .15s ease;
}
/* Ei hampparia kirjautumissivulla */
body.landing .ps-appmenu{
  display: none !important;
}
/*Välilehdet näkyvät vasta kun kaikki ladattu*/
.no-paint { visibility: hidden; }

/* ======================================================
   SUCCESS PAGE — reuse the purchase page design system
   ====================================================== */
body.landing.page-success.success-pending {
  background: #f4f3ee;
}

.page-success .success-pending-view {
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
  place-items: center;
  padding: 1.5rem;
  background: var(--purchase-mist, #f4f3ee);
}

.page-success .success-pending-view .purchase-resume-transition__card {
  width: min(100%, 28rem);
}

body.landing.page-success {
  --purchase-shell-width: 60rem;
  --purchase-body-pad-top: clamp(2rem, 5vw, 4rem);
  --purchase-body-pad-bottom: clamp(3rem, 8vw, 6rem);
}

.page-success .success-hero {
  flex: 0 0 auto;
}

.page-success .success-logo {
  margin-bottom: 0;
  text-decoration: none;
}

.page-success .success-body {
  min-width: 0;
}

.page-success .success-shell {
  min-width: 0;
}

.page-success .success-card {
  min-width: 0;
  color: var(--purchase-ink);
  overflow-wrap: anywhere;
}

.page-success .success-card h2 {
  margin: 0 0 .9rem;
  color: var(--purchase-ink);
  font-size: clamp(2.35rem, 5.5vw, 3.85rem);
  font-weight: 650;
  letter-spacing: -.045em;
  line-height: 1.04;
}

.page-success .success-card > #successMessage,
.page-success .customer-confirmation__ingress {
  margin: 0;
  color: var(--purchase-ink-soft);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.6;
}

.page-success #successDeliveryHint {
  margin: 1.35rem 0 0;
  padding: 1rem 0 0;
  color: var(--purchase-ink-soft);
  border-top: 1px solid var(--purchase-line);
  line-height: 1.6;
}

.page-success .purchase-receipt {
  min-width: 0;
  margin: 2rem 0 0;
}

.page-success .purchase-receipt h3 {
  margin: 0;
  color: var(--purchase-ink);
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.page-success .purchase-receipt > [role="status"]:not(.purchase-alert) {
  margin: .5rem 0 0;
  color: var(--purchase-muted);
  font-size: .95rem;
  line-height: 1.5;
}

.page-success .purchase-receipt dl {
  display: grid;
  grid-template-columns: minmax(11.5rem, .7fr) minmax(0, 1.3fr);
  gap: 0 1.5rem;
  min-width: 0;
  margin: 1.25rem 0 0;
  border-top: 1px solid var(--purchase-line);
}

.page-success .purchase-receipt dt,
.page-success .purchase-receipt dd {
  min-width: 0;
  padding: .8rem 0;
  border-bottom: 1px solid var(--purchase-line);
  line-height: 1.45;
}

.page-success .purchase-receipt dt {
  color: var(--purchase-muted);
  font-weight: 600;
}

.page-success .purchase-receipt dd {
  margin: 0;
  color: var(--purchase-ink);
  font-weight: 650;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.page-success .subscription-change-detail__hint {
  display: inline-block;
  margin-top: .15rem;
  color: var(--purchase-muted);
  font-size: .9em;
  font-weight: 500;
}

.page-success #receiptDownload {
  margin: 1.35rem 0 0;
}

body.landing.page-success #receiptDownloadLink,
.page-success .success-card .cta-link a {
  display: inline-flex;
  width: auto;
  min-height: 3rem;
  height: auto;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.2rem;
  color: var(--purchase-ink);
  background: var(--purchase-gold);
  border: 1px solid var(--purchase-gold);
  border-radius: .75rem;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

body.landing.page-success #receiptDownloadLink:hover,
.page-success .success-card .cta-link a:hover {
  color: var(--purchase-ink);
  background: #e6ab00;
  border-color: #e6ab00;
  text-decoration: none;
  transform: translateY(-.1rem);
}

body.landing.page-success #receiptDownloadLink:focus-visible,
.page-success .success-card .cta-link a:focus-visible {
  outline: .18rem solid var(--purchase-gold);
  outline-offset: .2rem;
  box-shadow: 0 0 0 .18rem rgba(169, 126, 28, .24);
}

.page-success #statutoryWithdrawalRow {
  margin: 1.35rem 0 0;
  font-size: .98rem;
}

.page-success #statutoryWithdrawalLink {
  color: var(--purchase-ink-soft);
  font-weight: 650;
  text-decoration-color: var(--purchase-gold);
  text-decoration-thickness: .12rem;
  text-underline-offset: .2rem;
}

.page-success #statutoryWithdrawalLink:hover,
.page-success #statutoryWithdrawalLink:focus-visible {
  color: var(--purchase-gold-dark);
}

.page-success .success-card .cta-link {
  margin: 1.5rem 0 0;
}

@media (max-width: 520px) {
  body.landing.page-success {
    --purchase-body-pad-top: 1rem;
    --purchase-body-pad-bottom: 3rem;
  }

  .page-success .success-card h2 {
    font-size: clamp(2rem, 10vw, 2.65rem);
  }

  .page-success .purchase-receipt {
    margin-top: 1.5rem;
    padding: 1.05rem;
  }

  .page-purchase .purchase-info-card__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .page-purchase .purchase-info-card dt {
    padding: .75rem 0 .15rem;
  }

  .page-purchase .purchase-info-card dd {
    padding: 0 0 .75rem;
  }

  .page-success .purchase-receipt dl {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .page-success .purchase-receipt dt {
    padding: .75rem 0 .15rem;
    border-bottom: 0;
  }

  .page-success .purchase-receipt dd {
    padding: 0 0 .75rem;
  }

  body.landing.page-success #receiptDownloadLink,
  .page-success .success-card .cta-link a {
    width: 100%;
    min-height: 3.25rem;
  }
}

body.page-reset{
  margin:0;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--ps-text);
  background:
    radial-gradient(1200px 800px at 20% 10%, rgba(255,255,255,.08) 0%, rgba(0,0,0,0) 55%),
    radial-gradient(900px 700px at 80% 0%, rgba(246,196,0,.10) 0%, rgba(0,0,0,0) 45%),
    #07080b;
}

/* wrapper */
.page-reset .wrap{
  width:100%;
  max-width:520px;
  padding:20px;
}

/* card */
.page-reset .card{
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid var(--ps-card-line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.45);
}

/* brand header */
.page-reset .brand{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin-bottom:10px;
}

.page-reset h1{
  font-size: 22px;
  margin: 0;
}

.page-reset p{
  margin: 8px 0 0;
  color: var(--ps-muted);
  line-height: 1.45;
}

/* hint row */
.page-reset .hint{
  display:flex;
  gap:10px;
  align-items:flex-start;
  margin-top:10px;
  color: var(--ps-muted);
  font-size:12px;
}

/* form */
.page-reset .grid{
  display:grid;
  gap:12px;
  margin-top:16px;
}

/* =========================
   Password reset – vertical form layout
   ========================= */

.page-reset .row{
  display:block; /* pakota pystysuunnaksi */
}

.page-reset label{
  display:block;
  font-size:13px;
  color: var(--ps-muted);
  margin-bottom:6px;
}

.page-reset .card input {
  background-color: rgba(0,0,0,0.20) !important;
  background-image: none !important;
  border: 1px solid #2a2e36 !important;
  color: #f3f4f6 !important;
}

.page-reset .card input:focus {
  border-color: rgba(255,213,74,0.6) !important;
  box-shadow: 0 0 0 4px rgba(255,213,74,0.12) !important;
}

.page-reset input:disabled{
  opacity:.7;
}

/* button (use your existing .btn if present) */
.page-reset .btn{
  width:100%;
  margin-top:14px;
  border:none;
  border-radius:14px;
  padding:12px 14px;
  font-weight:700;
  cursor:pointer;
  background: var(--ps-accent);
  color:#111;
}
.page-reset .btn:disabled{opacity:0.55; cursor:not-allowed;}

.page-reset .btn:hover {
  filter: brightness(1.05);
}

/* message box */
.page-reset .msg{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,0.25);
  color: var(--ps-muted);
  display:none;
}
.page-reset .msg.ok{border-color: rgba(74,222,128,0.35); color: #c9f7d7;}
.page-reset .msg.err{border-color: rgba(255,92,92,0.35); color: #ffd1d1;}

.page-reset .small{
  font-size:12px;
  color: var(--ps-muted);
  margin-top:10px;
}

/* Appin pehmeä sisäänajo kun loading poistuu */
#mainApp,
#saastoApp,
.app-container {
  transition: opacity .20s ease;
}

.app-is-entering {
  opacity: .92;
}

@media (max-width: 700px){
  .app-container{
    height: auto;
    max-height: calc(100vh - 36px);
  }
}
.ps-help-modal{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
}

.ps-help-modal.is-open{
  display: block;
}

.ps-help-backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
}

.ps-help-panel{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: min(720px, 90vw);
  max-height: 80vh;
  overflow-y: auto;

  background: var(--card);
  border-radius: 14px;
  padding: 24px;
}

.ps-help-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
}

.ps-help-close{
  background:none;
  border:none;
  font-size:20px;
  cursor:pointer;
}
.ps-appmenu-section-title{
  font-weight: 700;
  color: #facc15;
  margin: 2px 0 10px;
}

.ps-appmenu-section-title:not(:first-child){
  margin-top: 8px;
  padding-top: 2px;
}
.ps-help-tabs{
  display: flex;
  gap: 10px;
  margin: 0 0 18px;
  flex-wrap: wrap;
}

.ps-help-tab{
  appearance: none;
  border: 1px solid rgba(255,255,255,.10);
  background: var(--surface-3);
  color: #e5e7eb;
  border-radius: 999px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: .18s ease;
}

.ps-help-tab:hover{
  border-color: rgba(250,204,21,.45);
}

.ps-help-tab.is-active{
  background: #facc15;
  color: var(--ink);
  border-color: #facc15;
}

.ps-help-section h3{
  margin: 0 0 10px;
}

.ps-help-section p{
  margin: 0 0 12px;
}
/* ------------------------------------------------------
   3) Info-tip (yksi toteutus, ei tuplia)
   ------------------------------------------------------ */
.info-tip::before,
.info-tip::after,
.info-tip[aria-label]::after{
  content:none !important;
}

.info-tip{
  all: unset;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;
  height:18px;
  vertical-align:middle;
  cursor:help;
}

.info-tip svg{
  display:block;
  width:100%;
  height:100%;
}
.info-tip svg .ring{  stroke: rgba(255,255,255,.55); }
.info-tip svg .glyph{ stroke: #E5E7EB; fill: #E5E7EB; }

@media (max-width:640px){
  .info-tip{ width:16px; height:16px; }
}

.tip-bubble{
  position:fixed;
  z-index:99999;
  background:rgba(17,17,17,.96);
  color:#fff;
  padding:6px 8px;
  border:1px solid rgba(255,255,255,.2);
  border-radius:8px;
  font-size:12px;
  white-space:nowrap;
  pointer-events:none;
  display:none;
  transform:translate(-50%, -8px);
}
.report-balance-final{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:8px;
  white-space:nowrap;
  flex:0 0 auto;
}
.ps-help-content ul{
  padding-left: 22px;
  margin: 12px 0;
}

.ps-help-content li{
  margin-bottom: 22px;
  line-height: 1.55;
}

.ps-help-content li:last-child{
  margin-bottom: 0;
}
.ps-help-topic-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:12px;
  margin:16px 0 18px;
}

.ps-help-topic-card{
  appearance:none;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.03);
  color:#f4f4f5;
  border-radius:16px;
  padding:16px;
  text-align:left;
  cursor:pointer;
  transition: .16s ease;
  min-height: 110px;
}

.ps-help-topic-card:hover{
  border-color: rgba(250,204,21,.35);
  background: rgba(255,255,255,.05);
}

.ps-help-topic-card.is-active{
  border-color: rgba(250,204,21,.9);
  background: rgba(250,204,21,.08);
}

.ps-help-topic-title{
  display:block;
  font-weight:800;
  font-size:1rem;
  margin-bottom:8px;
  color: var(--accent);
}

.ps-help-topic-desc{
  display:block;
  font-size:.92rem;
  line-height:1.45;
  color: rgba(244,244,245,.88);
}

.ps-help-topic-content{
  margin-top: 8px;
}

.ps-help-cards{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:14px;
}

.ps-help-card{
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:14px 16px;
}

.ps-help-card--wide,
.ps-help-card--note{
  grid-column:1 / -1;
}

.ps-help-card--note{
  background: rgba(250,204,21,.06);
  border-color: rgba(250,204,21,.18);
}

.ps-help-card h5{
  margin:0 0 10px;
  color: var(--accent);
  font-size:.98rem;
  line-height:1.2;
}

.ps-help-card p{
  margin:0 0 10px;
  line-height:1.55;
  color: rgba(244,244,245,.94);
}

.ps-help-card p:last-child{
  margin-bottom:0;
}

.ps-help-formula{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:8px;
  max-width:100%;
  margin:14px 0;
  padding:14px 12px;
  overflow-wrap:anywhere;
  border:1px solid rgba(255,255,255,.1);
  border-radius:12px;
  background:rgba(120,113,108,.12);
  color:rgba(250,250,249,.98);
  font-size:clamp(.82rem, 2.8vw, 1rem);
  line-height:1.35;
  text-align:center;
}

.ps-help-formula__symbol,
.ps-help-formula__equals{
  flex:0 0 auto;
  font-weight:700;
}

.ps-help-formula sub{
  font-size:.72em;
}

.ps-help-fraction{
  display:inline-grid;
  grid-template-rows:auto auto;
  min-width:0;
  max-width:100%;
  vertical-align:middle;
}

.ps-help-fraction__top,
.ps-help-fraction__bottom{
  display:block;
  padding:2px 8px;
}

.ps-help-fraction__top{
  border-bottom:1px solid currentColor;
}

.ps-help-card__section{
  margin-top:24px;
  padding-top:24px;
  border-top:1px solid rgba(255,255,255,.12);
}

.ps-help-card h6{
  margin:18px 0 10px;
  color:var(--accent);
  font-size:.95rem;
  line-height:1.3;
}

.ps-help-table-wrap{
  max-width:100%;
  margin:12px 0 18px;
  overflow-x:auto;
}

.ps-help-forecast-table{
  width:100%;
  border-collapse:collapse;
  color:rgba(244,244,245,.94);
}

.ps-help-forecast-table th,
.ps-help-forecast-table td{
  padding:10px 12px;
  border-bottom:1px solid rgba(255,255,255,.1);
  text-align:left;
  vertical-align:top;
}

.ps-help-forecast-table th{
  color:var(--accent);
  font-weight:800;
}

.ps-help-forecast-table tbody tr:last-child td{
  border-bottom:0;
}

@media (max-width: 860px){
  .ps-help-topic-grid{
    grid-template-columns:1fr;
  }

  .ps-help-cards{
    grid-template-columns:1fr;
  }

  .ps-help-card--wide,
  .ps-help-card--note{
    grid-column:auto;
  }
}

@media (max-width: 520px){
  .ps-help-formula{
    gap:6px;
    padding:12px 8px;
  }

  .ps-help-fraction{
    flex-basis:100%;
  }

  .ps-help-table-wrap{
    overflow:visible;
  }

  .ps-help-forecast-table,
  .ps-help-forecast-table tbody,
  .ps-help-forecast-table tr,
  .ps-help-forecast-table td{
    display:block;
    width:100%;
  }

  .ps-help-forecast-table thead{
    position:absolute;
    width:1px;
    height:1px;
    padding:0;
    margin:-1px;
    overflow:hidden;
    clip:rect(0, 0, 0, 0);
    white-space:nowrap;
    border:0;
  }

  .ps-help-forecast-table tbody{
    display:grid;
    gap:10px;
  }

  .ps-help-forecast-table tr{
    box-sizing:border-box;
    padding:9px 10px;
    border:1px solid rgba(255,255,255,.1);
    border-radius:10px;
    background:rgba(255,255,255,.025);
  }

  .ps-help-forecast-table td,
  .ps-help-forecast-table tbody tr:last-child td{
    display:grid;
    grid-template-columns:minmax(0, 1.35fr) minmax(0, .65fr);
    gap:8px;
    padding:4px 0;
    border:0;
  }

  .ps-help-forecast-table td::before{
    content:attr(data-label);
    color:rgba(244,244,245,.72);
    font-weight:700;
  }
}


/* Puhelimen selainversio: sivu vierii viewportissa kortin sisäscrollin sijaan. */
@media (max-width: 600px){
  html,
  body{
    height:auto;
    min-height:100%;
  }

  body{
    min-height:100dvh;
    overflow-x:hidden;
    overflow-y:auto;
  }

  .app-shell{
    height:auto;
    min-height:100dvh;
    align-items:flex-start;
  }

  .app-container{
    height:auto;
    min-height:0;
    max-height:none;
    overflow:visible;
  }

  #plansApp.app-container{
    min-height:0;
  }
}
