/* JuniorSaver – a képernyőtervek (tervek/kepernyotervek.html) alapján.
   Színek: BudgetKite (meleg bézs, barna, bordó) + a három boríték színe. */
:root {
  --lap: #fbfbfb; --felulet: #ffffff; --szoveg: #372c26; --halvany: #7d6a5e; --vonal: #e8ddd2;
  --kiemelt: #8a2326; --gombszoveg: #ffffff;
  --zold: #2e8b57;  --zold-hatter: #e7f4ec;
  --sarga: #b07800; --sarga-hatter: #fdf3d8; --sarga-csik: #e0a800;
  --piros: #c4161c; --piros-hatter: #fbe9e9;
  --betu: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --also: 62px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --lap: #1f1916; --felulet: #2a221d; --szoveg: #f0e8e1; --halvany: #b9a89c; --vonal: #3a2f28;
    --kiemelt: #e08a8d; --gombszoveg: #1a1512;
    --zold: #6fcf97; --zold-hatter: #19301f;
    --sarga: #f0c14b; --sarga-hatter: #33290f; --sarga-csik: #f0c14b;
    --piros: #ff7b80; --piros-hatter: #3a1a1b;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--lap); color: var(--szoveg); font-family: var(--betu); font-size: 16px; line-height: 1.45; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
       padding-bottom: calc(var(--also) + env(safe-area-inset-bottom, 0px)); }

/* Fejléc */
.appfej { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; background: var(--lap);
          padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; }
.appfej .cim { margin: 0; font-size: 18px; font-weight: 700; flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.appfej .vissza { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 6px 4px 0; color: var(--halvany); cursor: pointer; }
.appfej .valto { text-decoration: none; font-size: 20px; color: var(--halvany); padding: 4px 8px; }
.appfej .szam { font-weight: 700; }
.fejjel { width: 26px; height: 26px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--av, var(--kiemelt)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }

.tartalom { flex: 1; padding: 4px 16px 20px; display: flex; flex-direction: column; gap: 12px; }

/* Alsó sáv */
.alsosav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: grid; grid-template-columns: repeat(4, 1fr);
           background: var(--felulet); border-top: 1px solid var(--vonal); padding: 6px 0 calc(8px + env(safe-area-inset-bottom, 0px)); }
.alsosav a { text-align: center; font-size: 11.5px; color: var(--halvany); text-decoration: none; display: grid; gap: 1px; }
.alsosav a i { font-style: normal; font-size: 19px; line-height: 1.2; }
.alsosav a.akt { color: var(--kiemelt); font-weight: 700; }
@media (min-width: 560px) { .alsosav { left: 50%; right: auto; width: 560px; transform: translateX(-50%); } }

/* Borítékok */
.bor { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; text-decoration: none;
       border-radius: 14px; border: 2px solid var(--szin); background: var(--hatter); padding: 28px 14px 12px; }
.bor::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22px; background: var(--szin); clip-path: polygon(0 0, 100% 0, 50% 100%); opacity: .9; }
.bor.z { --szin: var(--zold); --hatter: var(--zold-hatter); }
.bor.s { --szin: var(--sarga-csik); --hatter: var(--sarga-hatter); }
.bor.p { --szin: var(--piros); --hatter: var(--piros-hatter); }
.bor .nev { display: grid; }
.bor .nev b { font-size: 17px; }
.bor .nev span { font-size: 13px; color: var(--halvany); }
.bor .osszeg { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bor.nagy .osszeg { font-size: 30px; }
.lakat { font-size: 12.5px; }

/* Gombok */
.gombsor { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gomb { display: block; border: 0; border-radius: 12px; padding: 13px 10px; text-align: center; font-weight: 700; text-decoration: none; cursor: pointer;
        background: var(--kiemelt); color: var(--gombszoveg); font-size: 15.5px; }
.gomb.masod { background: var(--felulet); color: var(--szoveg); border: 1px solid var(--vonal); }
.gomb.teljes { grid-column: 1 / -1; }
.gomb.veszely { background: var(--piros); color: #fff; }
.kicsi-gombok .gomb { padding: 9px 8px; font-size: 14px; }
.gomb:focus-visible, .bor:focus-visible, .opcio:focus-within, input:focus-visible, select:focus-visible { outline: 3px solid var(--sarga-csik); outline-offset: 2px; }

/* Értesítések */
.ertesites { display: grid; gap: 2px; text-decoration: none; background: var(--felulet); border: 1px solid var(--vonal); border-left: 4px solid var(--kiemelt);
             border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.ertesites.p { border-left-color: var(--piros); }
.ertesites.z { border-left-color: var(--zold); }
.ertesites b { font-size: 15px; }
.uzenet { background: var(--zold-hatter); border: 1px solid var(--zold); border-radius: 12px; padding: 10px 12px; font-weight: 600; }
.hiba { margin: 0; color: var(--piros); font-weight: 600; }

/* Kártyák, mezők */
.kartya { background: var(--felulet); border: 1px solid var(--vonal); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.kartya > summary { cursor: pointer; font-weight: 700; }
.sor { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.szam { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.kicsi { font-size: 13px; color: var(--halvany); margin: 0; }
.kozep { text-align: center; }
p { margin: 0; }
.urlap { display: grid; gap: 12px; }
.mezo { display: grid; gap: 3px; }
.mezo input, .mezo select, .oszto input, .pin-mezo, .oszto-cel select {
  width: 100%; border: 1px solid var(--vonal); background: var(--felulet); border-radius: 10px; padding: 11px 12px; font-size: 17px; min-width: 0; }
.mezo .sugo { font-size: 12.5px; color: var(--halvany); }
.egyutt { display: flex; align-items: center; gap: 8px; }
.egyutt input { width: 90px; flex: none; }
details > summary { cursor: pointer; }

.oszto { display: grid; grid-template-columns: 14px 1fr 130px; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 12px; background: var(--felulet); border: 1px solid var(--vonal); }
.oszto input { text-align: right; padding: 8px 10px; }
.oszto-cel { margin-top: -6px; }
.osszeg-sor { text-align: right; }
.potty { display: inline-block; width: 13px; height: 13px; border-radius: 50%; background: var(--szin); flex: none; }
.potty.z { --szin: var(--zold); } .potty.s { --szin: var(--sarga-csik); } .potty.p { --szin: var(--piros); }

.valaszto { display: grid; gap: 8px; }
.link { color: var(--kiemelt); text-decoration: underline; cursor: pointer; }
.otletek { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.otlet { font: inherit; font-size: 13.5px; color: var(--szoveg); background: var(--sarga-hatter); border: 1px solid var(--sarga-csik);
  border-radius: 999px; padding: 4px 10px; cursor: pointer; }
.valaszto.ketoszlop { grid-template-columns: 1fr 1fr; }
.kerdes { display: grid; gap: 3px; }
.opcio { display: flex; gap: 10px; align-items: center; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--vonal); background: var(--felulet); cursor: pointer; }
.opcio:has(input:checked) { border: 2px solid var(--kiemelt); padding: 10px 11px; }
.opcio input { accent-color: var(--kiemelt); margin: 0; flex: none; }
.tilos { font-size: 13px; color: var(--halvany); text-align: center; }

.csik { height: 10px; border-radius: 5px; background: var(--vonal); overflow: hidden; }
.csik span { display: block; height: 100%; background: var(--sarga-csik); border-radius: 5px; }

.kod { font-size: 32px; font-weight: 800; letter-spacing: .12em; text-align: center; padding: 16px; border: 2px dashed var(--kiemelt); border-radius: 14px; background: var(--felulet); }
.pin-mezo { text-align: center; font-size: 28px; letter-spacing: .5em; max-width: 200px; justify-self: center; }
.nagyszam { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kartya.kozep { justify-items: center; text-align: center; }
.udv-logo { height: 120px; align-self: center; margin: 8px 0; }
.palanta-nagy { height: 120px; justify-self: center; }

/* Demó */
.demo-sav { background: var(--sarga-hatter); color: var(--szoveg); font-size: 12.5px; padding: 6px 16px; text-align: center; }
.demo-sav button { font: inherit; font-weight: 700; color: var(--kiemelt); background: none; border: 0; padding: 0 0 0 4px; text-decoration: underline; cursor: pointer; }

/* Ünneplés */
.unnep { display: grid; gap: 10px; justify-items: center; text-align: center; padding-top: 24px; position: relative; z-index: 1; }
.unnep h2 { margin: 0; font-size: 28px; }
.unnep .palanta-nagy { height: 160px; animation: no 0.9s ease-out both; }
.unnep .gomb { min-width: 200px; }
@keyframes no { from { transform: scale(0.4) translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.konfetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.konfetti i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; opacity: 0.85; animation: hull linear 2 both; }
@keyframes hull { from { transform: translateY(0) rotate(0); } to { transform: translateY(105vh) rotate(540deg); } }
@media (prefers-reduced-motion: reduce) { .konfetti { display: none; } .unnep .palanta-nagy { animation: none; } }

/* Vészkijárat, telepítés */
.kartya.vesz { border-left: 4px solid var(--sarga-csik); }
.lepesek { margin: 4px 0; padding-left: 22px; display: grid; gap: 6px; }
.figyelem { background: var(--sarga-hatter); border-radius: 10px; padding: 8px 10px; }
.plusz-cimke { font-size: 11px; font-weight: 800; color: var(--kiemelt); border: 1px solid var(--kiemelt); border-radius: 6px; padding: 0 6px; }
.koz { flex: 1; }

/* Profilok */
.profil { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--felulet); border: 1px solid var(--vonal); text-align: left; cursor: pointer; width: 100%; }
.profil .avatar { width: 44px; height: 44px; font-size: 18px; }
.profil-szoveg { flex: 1; min-width: 0; display: grid; }
.mini { display: flex; flex-direction: column; gap: 4px; }
.mini i { width: 24px; height: 6px; border-radius: 3px; background: var(--szin); }
.mini i.z { --szin: var(--zold); } .mini i.s { --szin: var(--sarga-csik); } .mini i.p { --szin: var(--piros); }

/* Napló */
.honap { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.honap a { text-decoration: none; font-size: 24px; padding: 0 12px; color: var(--halvany); }
.tabla-keret { overflow-x: auto; background: var(--felulet); border: 1px solid var(--vonal); border-radius: 12px; }
table.naplo { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.naplo th, .naplo td { padding: 6px 3px; border-bottom: 1px solid var(--vonal); text-align: left; vertical-align: top; }
.naplo th { font-size: 12px; color: var(--halvany); }
.naplo th.z { color: var(--zold); } .naplo th.s { color: var(--sarga); } .naplo th.p { color: var(--piros); }
.naplo td.o { text-align: right; font-weight: 700; white-space: nowrap; }
.naplo td.m { color: var(--halvany); max-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.naplo tr.nyito td { color: var(--halvany); font-weight: 700; }
.naplo tr.ossz td { font-weight: 800; border-top: 2px solid var(--szoveg); }
.naplo tr.zaro td { font-weight: 800; border-bottom: 0; }

/* Fektetve (telefon elforgatva) vagy tablet: oldalsáv, széles napló */
@media (orientation: landscape) and (max-height: 540px), (min-width: 900px) {
  .app { max-width: none; padding-bottom: 0; padding-left: calc(76px + env(safe-area-inset-left, 0px)); }
  .alsosav { top: 0; bottom: 0; left: 0; right: auto; width: calc(72px + env(safe-area-inset-left, 0px)); transform: none;
             grid-template-columns: 1fr; grid-auto-rows: min-content; align-content: center; gap: 18px;
             border-top: 0; border-right: 1px solid var(--vonal); padding: 0 0 0 env(safe-area-inset-left, 0px); }
  .tartalom, .appfej { max-width: 980px; width: 100%; margin: 0 auto; }
  .tartalom > :not(.tabla-keret):not(.honap) { max-width: 560px; width: 100%; align-self: center; }
  .honap { max-width: 560px; width: 100%; align-self: center; }
  table.naplo { font-size: 14px; }
  .naplo td.m { max-width: none; white-space: normal; font-size: 13px; }
  .naplo td.osz, .naplo th.osz { border-left: 1px solid var(--vonal); padding-left: 10px; }
  .csak-allo { display: none; }
}
@media (min-width: 900px) { .alsosav { width: 84px; } .app { padding-left: 88px; } }

/* Napló: a sorra koppintva javítás */
.naplo tr.katt { cursor: pointer; }
.naplo tr.katt td:first-child a { color: inherit; text-decoration: underline dotted; }
.naplo tr.torolt td { color: var(--halvany); }
.naplo sup.jav { font-size: 10px; margin-left: 1px; color: var(--halvany); }

/* Jelentések listája */
a.profil { text-decoration: none; color: inherit; }

/* Ki/be kapcsoló (beállítások) */
.kapcsolo-sor { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.kapcsolo { position: relative; flex: none; width: 50px; height: 30px; }
.kapcsolo input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.kapcsolo i { position: absolute; inset: 0; border-radius: 15px; background: var(--halvany); transition: background .15s; pointer-events: none; }
.kapcsolo i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.kapcsolo input:checked + i { background: var(--zold); }
.kapcsolo input:checked + i::after { transform: translateX(20px); }
.kapcsolo input:focus-visible + i { outline: 2px solid var(--piros); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .kapcsolo i, .kapcsolo i::after { transition: none; } }

/* Plusz: témák (csak a kiemelő szín és a háttér; a borítékok színe marad) */
:root[data-tema="tenger"]     { --kiemelt: #1f5f8b; --lap: #f6f9fb; }
:root[data-tema="erdo"]       { --kiemelt: #2f6b3a; --lap: #f7faf6; }
:root[data-tema="levendula"]  { --kiemelt: #6a3d9a; --lap: #faf8fc; }
:root[data-tema="naplemente"] { --kiemelt: #a8431a; --lap: #fcf8f5; }
@media (prefers-color-scheme: dark) {
  :root[data-tema="tenger"]     { --kiemelt: #7fb8e6; --lap: #1f1916; }
  :root[data-tema="erdo"]       { --kiemelt: #8fd19e; --lap: #1f1916; }
  :root[data-tema="levendula"]  { --kiemelt: #c3a6ec; --lap: #1f1916; }
  :root[data-tema="naplemente"] { --kiemelt: #f0a070; --lap: #1f1916; }
}
a.avatar { text-decoration: none; }
.temak { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tema-gomb { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid var(--vonal); background: var(--felulet); cursor: pointer; font-weight: 700; text-align: left; }
.tema-gomb i { width: 28px; height: 28px; border-radius: 50%; background: var(--t); flex: none; }
.tema-gomb.akt { border: 2px solid var(--t); padding: 11px; }
.tema-gomb:disabled { cursor: default; opacity: .55; }
.plusz-lista { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14.5px; }

/* Év végi összesítő */
.osszesito { display: grid; gap: 12px; }
.osszesito h2 { margin: 0; font-size: 20px; }
.osszesito h3 { margin: 6px 0 0; font-size: 16px; }
.osszesito ul { margin: 0; padding-left: 20px; display: grid; gap: 3px; }
.ossz-fej { display: flex; align-items: center; gap: 12px; }
.ossz-fej > div { display: grid; }
table.ossz-tabla { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.ossz-tabla th, .ossz-tabla td { padding: 6px 6px; border-bottom: 1px solid var(--vonal); text-align: left; white-space: nowrap; }
.ossz-tabla th { font-size: 12.5px; color: var(--halvany); }
.ossz-tabla .o { text-align: right; }
.ossz-tabla th.z { color: var(--zold); } .ossz-tabla th.s { color: var(--sarga); } .ossz-tabla th.p { color: var(--piros); }
.ossz-tabla tr.ossz td { font-weight: 800; border-top: 2px solid var(--szoveg); border-bottom: 0; }
.ossz-tabla.havi { font-size: 13px; }
.ossz-szamok { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ossz-szamok > div { display: grid; background: var(--felulet); border: 1px solid var(--vonal); border-radius: 12px; padding: 8px 12px; }
.ossz-szamok b { font-size: 18px; font-variant-numeric: tabular-nums; }

/* Nyomtatás / PDF: csak az összesítő, fehér lapon */
@media print {
  :root, :root[data-tema] { --lap: #fff; --felulet: #fff; --szoveg: #000; --halvany: #555; --vonal: #ccc;
          --zold: #2e8b57; --sarga: #8a6000; --sarga-csik: #e0a800; --piros: #c4161c; color-scheme: light; }
  body { background: #fff; }
  .app { padding: 0; max-width: none; }
  .appfej, .alsosav, .demo-sav, .uzenet, .nyomtat-nem { display: none !important; }
  .tartalom { padding: 0; }
  .tabla-keret { overflow: visible; border: 0; }
  .ossz-szamok > div, .ossz-tabla tr { break-inside: avoid; }
}
