/* Munkanapló Mobil – telefonra (egy kézzel, hüvelykujjal): nagy érintési felületek, alul a fontos gombok. */
:root {
  --bg: #11141b;
  --bg2: #171b24;
  --card: #1a1f29;
  --line: #2a3140;
  --fg: #e8ecf3;
  --muted: #8b93a7;
  --accent: #4f7cff;
  --green: #2fb67c;
  --red: #e5484d;
  --amber: #e8a33a;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --nav-h: 62px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fa;
    --bg2: #eaeef5;
    --card: #ffffff;
    --line: #dde3ec;
    --fg: #1c2331;
    --muted: #6b7385;
    color-scheme: light;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.4 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; overscroll-behavior-y: contain; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 10px 14px; min-height: 44px; }
button:disabled { opacity: .45; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.danger { background: transparent; border-color: var(--red); color: var(--red); }
button.big { min-height: 52px; font-size: 17px; }
button.sm { min-height: 34px; padding: 6px 10px; font-size: 14px; }
button.icon { border: 0; background: transparent; min-width: 44px; font-size: 20px; padding: 6px; }
button.icon.sm { min-width: 30px; min-height: 30px; font-size: 14px; margin-left: auto; }
button.link { border: 0; background: none; color: var(--accent); padding: 6px 4px; min-height: 36px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; padding: 11px 12px; min-height: 46px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.muted { color: var(--muted); }
.small, small { font-size: 13px; }
small { display: block; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; }
.row.gap, .gap { gap: 8px; }
.row.end { justify-content: flex-end; margin-top: 10px; }
.pad { padding: 0 14px; }
.late, .late b { color: var(--red); }
.plus { color: var(--green); }

/* ---- Keret ---- */
.app { min-height: 100dvh; }
.view { padding: 64px 0 calc(var(--nav-h) + var(--safe-b) + 84px); }
.page { padding: 8px 12px; display: flex; flex-direction: column; gap: 12px; max-width: 640px; margin: 0 auto; }
header.top { position: fixed; inset: 0 0 auto 0; z-index: 20; height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 12px; padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.lvl { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; flex: 1; min-width: 0; }
.lvl-n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; flex: none; }
.lvl-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; max-width: 140px; }
.lvl-bar i, .xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #8e6cf0); border-radius: 4px; transition: width .4s; }
.stats { display: flex; gap: 10px; font-weight: 600; font-size: 15px; align-items: center; }
.pendxp { color: var(--amber); font-size: 13px; }
.sync { border: 0; background: none; min-width: 36px; min-height: 36px; padding: 0; display: grid; place-items: center; }
.sync i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.sync.pend i { background: var(--amber); }
.sync.off i { background: var(--muted); }
.sync.err i { background: var(--red); }
.sync.run i { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

nav.bottom { position: fixed; inset: auto 0 0 0; z-index: 20; display: flex; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
nav.bottom a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-decoration: none; color: var(--muted); gap: 2px; }
nav.bottom a span { font-size: 22px; filter: grayscale(1); opacity: .7; }
nav.bottom a.on { color: var(--fg); }
nav.bottom a.on span { filter: none; opacity: 1; }
nav.bottom small { font-size: 11px; }
.fab { position: fixed; z-index: 21; right: 16px; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); width: 62px; height: 62px; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff; font-size: 32px; box-shadow: 0 6px 20px rgba(0,0,0,.35); padding: 0; }
.fab:active { transform: scale(.94); }

/* ---- Kártyák ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.card.flush { padding: 10px 0 4px; gap: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.card.flush .card-head { margin-bottom: 4px; }
.pill { background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.pill.ok { background: color-mix(in srgb, var(--green) 20%, transparent); border-color: var(--green); }
.hello h2 { margin: 6px 0 0; font-size: 22px; }
.hint { font-size: 12px; color: var(--muted); }
.empty { text-align: center; padding: 18px 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; align-items: center; }
.empty .ei { font-size: 34px; }
.empty .et { color: var(--fg); font-weight: 600; }
.banner { text-align: left; background: color-mix(in srgb, var(--amber) 15%, var(--card)); border-color: var(--amber); }
.evening-link { text-align: center; color: var(--muted); text-decoration: none; padding: 12px; }

/* Szokás-gombok */
.habits { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.habit { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; min-height: 0; user-select: none; -webkit-user-select: none; }
.habit .hb { width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--c); display: grid; place-items: center; font-size: 26px; font-weight: 700; transition: transform .15s, background .2s; }
.habit.done .hb { background: var(--c); color: #fff; }
.habit.mini .hb { background: color-mix(in srgb, var(--c) 30%, transparent); }
.habit:active .hb { transform: scale(.9); }
.habit .hn { font-size: 13px; text-align: center; line-height: 1.2; }

/* Rutin lépései, ellenőrzőlista */
.steps, .checklist, .agenda, .wins { list-style: none; margin: 0; padding: 0; }
.steps li, .checklist li { display: flex; align-items: center; gap: 12px; min-height: 46px; border-top: 1px solid var(--line); cursor: pointer; }
.steps li:first-child, .checklist li:first-child { border-top: 0; }
.chk { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; font-weight: 700; }
.done > .chk, li.done .chk { background: var(--green); border-color: var(--green); color: #fff; }
li.done { color: var(--muted); text-decoration: line-through; }
.agenda li { display: flex; align-items: center; gap: 8px; min-height: 40px; border-top: 1px solid var(--line); }
.agenda li:first-child { border-top: 0; }
.agenda .at { width: 92px; flex: none; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.dotc { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; flex: none; }

/* Feladatsor + húzás */
.swipe { position: relative; overflow: hidden; }
.swipe-bg { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 20px; font-weight: 700; color: #fff; }
.swipe-bg.right { background: color-mix(in srgb, var(--green) 55%, var(--card)); }
.swipe-bg.left { background: color-mix(in srgb, var(--amber) 55%, var(--card)); justify-content: flex-end; }
.swipe-bg.armed.right { background: var(--green); }
.swipe-bg.armed.left { background: var(--amber); }
.swipe-fg { position: relative; background: var(--card); touch-action: pan-y; }
.task { display: flex; align-items: center; gap: 10px; padding: 8px 14px; min-height: 58px; border-top: 1px solid var(--line); }
.task.done .tt { color: var(--muted); text-decoration: line-through; }
.tchk { width: 30px; height: 30px; min-height: 30px; border-radius: 50%; border: 2px solid var(--muted); background: none; padding: 0; flex: none; font-weight: 700; }
.task.done .tchk, .tchk.on { background: var(--green); border-color: var(--green); color: #fff; }
.tchk.big { width: 40px; height: 40px; }
.tmain { flex: 1; min-width: 0; }
.tt { font-size: 16px; overflow-wrap: anywhere; }
.tm { font-size: 13px; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.imp { color: var(--amber); font-weight: 800; }
.committed .task { box-shadow: inset 4px 0 0 var(--accent); }
.done-sep { padding: 10px 14px 4px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* Chipek, szegmens */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chips.sticky { position: sticky; top: 56px; z-index: 5; background: var(--bg); padding: 6px 0; }
.chips button { border-radius: 999px; white-space: nowrap; min-height: 38px; padding: 6px 14px; }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips input[type=date], .chips select { width: auto; min-height: 38px; padding: 4px 10px; border-radius: 999px; }
.seg { display: flex; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; border: 0; background: none; min-height: 42px; }
.seg button.on { background: var(--card); box-shadow: 0 1px 4px rgba(0,0,0,.25); font-weight: 600; }
.seg.small button { min-height: 34px; font-size: 14px; }
.catchips { display: flex; flex-wrap: wrap; gap: 8px; }
.catchips button { border-radius: 999px; min-height: 40px; padding: 6px 12px; border-color: color-mix(in srgb, var(--c) 50%, var(--line)); }
.catchips button.on, .catchips button.sug { background: var(--c); border-color: var(--c); color: #fff; }
.catchips.big button { min-height: 50px; font-size: 16px; }

/* Űrlapok */
.form, .tsheet, .quick { display: flex; flex-direction: column; gap: 10px; }
.lbl { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 600; }
.addline { display: flex; gap: 8px; }
.addline input { flex: 1; }
.addline button { min-width: 50px; }
.ttitle { font-size: 18px; font-weight: 600; min-height: 50px; }
.amount { display: flex; align-items: baseline; gap: 8px; justify-content: center; }
.amount input { font-size: 40px; font-weight: 700; text-align: center; border: 0; background: none; max-width: 240px; min-height: 64px; }
.amount span { font-size: 22px; color: var(--muted); }
.qinput { font-size: 19px; min-height: 56px; }
.preview { background: var(--bg2); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
details summary { padding: 6px 0; }
.toggle { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.toggle input { width: 22px; height: 22px; min-height: 0; }
.btnlink { color: var(--accent); text-decoration: none; padding: 8px 0; }

/* Alsó lap */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; animation: fade .15s; }
.sheet { background: var(--card); width: 100%; max-width: 640px; margin: 0 auto; border-radius: 18px 18px 0 0; max-height: 88dvh; display: flex; flex-direction: column;
  padding-bottom: calc(var(--safe-b) + 10px); animation: up .2s ease-out; }
.sheet.tall { height: 88dvh; }
.grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 2px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 16px; }
.sheet-head h3 { margin: 0; font-size: 17px; }
.sheet-body { overflow-y: auto; padding: 6px 16px 10px; }
@keyframes up { from { transform: translateY(40%); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

/* Felvillanó üzenet */
.toast { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(64px + env(safe-area-inset-top, 0px)); max-width: calc(100% - 24px);
  background: var(--fg); color: var(--bg); border-radius: 999px; padding: 10px 16px; display: flex; gap: 8px; align-items: center; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0,0,0,.3); animation: pop .25s ease-out; }
.toast.xp { background: linear-gradient(90deg, var(--accent), #8e6cf0); color: #fff; }
.toast.warn { background: var(--amber); color: #1c1c1c; }
.toast .link { color: inherit; text-decoration: underline; min-height: 0; padding: 0 0 0 8px; }
@keyframes pop { from { transform: translate(-50%, -10px) scale(.9); opacity: 0; } }

/* Naptár */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 64px; border-radius: 12px; }
.wd b { font-size: 18px; }
.wd small { color: var(--muted); font-size: 12px; text-transform: capitalize; }
.wd.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.wd.on small { color: #fff; }
.wd.today:not(.on) { border-color: var(--accent); }
.dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); margin: 0 auto; }
.wd i:not(.dot) { height: 6px; }
.month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mh { text-align: center; color: var(--muted); }
.md { min-height: 44px; padding: 4px 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 10px; }
.md.out { opacity: .35; }
.md.on { background: var(--accent); color: #fff; }
.md.today:not(.on) { border-color: var(--accent); }
.agenda li.tap { cursor: pointer; }

/* Pénz */
.sumgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sum { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.sum b { font-size: 18px; }
.sum.in b { color: var(--green); }
.tx { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); min-height: 56px; cursor: pointer; }
.txi { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; font-size: 18px; }
.tx .grow b { font-weight: 500; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sortmode { display: flex; flex-direction: column; gap: 14px; }
.sortcard { background: var(--bg2); border-radius: 14px; padding: 18px; text-align: center; }
.sortcard b { font-size: 28px; display: block; }
.wish { flex-direction: row; align-items: center; }

/* Én */
.hero { flex-direction: row; align-items: center; gap: 14px; }
.lvl-big { width: 64px; height: 64px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), #8e6cf0); color: #fff; font-size: 28px; font-weight: 800; display: grid; place-items: center; flex: none; }
.xpbar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin: 6px 0; }
.pendnote { color: var(--amber); }
.statgrid { flex-direction: row; justify-content: space-around; text-align: center; }
.statgrid span { font-size: 22px; display: block; }
.led, .shop { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--line); }
.led.pend { background: color-mix(in srgb, var(--amber) 8%, transparent); }
.led b { white-space: nowrap; font-size: 14px; }
.shop .si { font-size: 26px; }

/* Belépés */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.login form { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 360px; }
.login .logo { font-size: 56px; }
.login h1 { margin: 0; }
.err { color: var(--red); }
.spin { animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Nyugták jóváhagyása */
.btnbig { display: grid; place-items: center; min-width: 56px; min-height: 52px; border: 1px solid var(--line); background: var(--bg2); border-radius: 10px; font-size: 22px; text-decoration: none; }
a.banner { display: block; text-decoration: none; color: var(--fg); border: 1px solid var(--amber); border-radius: 10px; padding: 10px 14px; }
.rq.need { border-color: var(--amber); }
.rq-row { display: flex; gap: 12px; align-items: flex-start; }
.rq-thumb { width: 86px; max-height: 150px; object-fit: cover; object-position: top; border-radius: 8px; border: 1px solid var(--line); background: #fff; flex: none; }
.rq-thumb.wait { height: 86px; display: grid; place-items: center; font-size: 30px; background: var(--bg2); }
.rq-fields { display: flex; flex-direction: column; gap: 6px; }
.amount.sm { justify-content: flex-start; }
.amount.sm input { font-size: 26px; min-height: 48px; text-align: left; max-width: 170px; padding: 4px 8px; border: 1px solid var(--line); background: var(--bg2); }
.amount.sm span { font-size: 16px; }
.warnline { color: var(--amber); }
.rq-full img { width: 100%; height: auto; border-radius: 8px; background: #fff; }
