/* Elrendezés: bal oldalt nézetek és listák, jobbra a feladatok; telefonon a nézetek vízszintesen görgethető sorba rendeződnek. */
:root {
  --bg: #f2f5fa; --surface: #ffffff; --surface2: #eaeff7; --ink: #16202f; --muted: #647087;
  --line: #dce2ec; --accent: #2e63f5; --accent-ink: #ffffff; --accent-soft: #e4ebff;
  --danger: #d92d20; --ok: #12a150; --p1: #f08a0c; --p2: #e5372b; --shadow: 0 1px 2px rgba(22,32,47,.06), 0 4px 14px rgba(22,32,47,.05);
  --c0: #2e63f5; --c1: #12a150; --c2: #f08a0c; --c3: #9a55e8; --c4: #e5489b; --c5: #0aa9bd;
  --font: Figtree, system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131b; --surface: #171e29; --surface2: #1f2735; --ink: #e8edf5; --muted: #95a2b6;
    --line: #2b3648; --accent: #6f96ff; --accent-ink: #0b1220; --accent-soft: #1f2c4e;
    --danger: #ff6b5e; --ok: #35c978; --p1: #ffa63d; --p2: #ff6b5e; --shadow: 0 1px 2px rgba(0,0,0,.4);
    --c0: #6f96ff; --c1: #35c978; --c2: #ffa63d; --c3: #b88aff; --c4: #ff7ab8; --c5: #3dd0e3; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131b; --surface: #171e29; --surface2: #1f2735; --ink: #e8edf5; --muted: #95a2b6;
  --line: #2b3648; --accent: #6f96ff; --accent-ink: #0b1220; --accent-soft: #1f2c4e;
  --danger: #ff6b5e; --ok: #35c978; --p1: #ffa63d; --p2: #ff6b5e; --shadow: 0 1px 2px rgba(0,0,0,.4);
  --c0: #6f96ff; --c1: #35c978; --c2: #ffa63d; --c3: #b88aff; --c4: #ff7ab8; --c5: #3dd0e3; color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app { max-width: 1040px; margin: 0 auto; padding-block: 18px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 28px; align-items: start; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: -.01em; margin: 4px 10px 14px; display: flex; align-items: center; gap: 8px; }
.brand i { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); display: inline-grid; place-items: center; }
.brand i svg { width: 14px; height: 14px; }
nav { position: sticky; top: 18px; }
.navgroup { display: flex; flex-direction: column; gap: 2px; }
.navlabel { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 10px 6px; display: flex; justify-content: space-between; align-items: center; }
.navitem { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 10px; color: var(--ink); }
.navitem:hover { background: var(--surface2); }
.navitem[aria-current="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.navitem .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lc, var(--muted)); flex: none; }
.navitem .cnt { margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.navitem[aria-current="true"] .cnt { color: var(--accent); }
.navitem .x { margin-left: auto; background: none; border: 0; color: var(--muted); padding: 0 4px; border-radius: 6px; }
.navitem .x:hover { color: var(--danger); }
.linkbtn { background: none; border: 0; color: var(--accent); padding: 2px 4px; border-radius: 6px; font-size: 13px; }
.newlist { display: flex; gap: 6px; margin: 6px 4px 0; }
.newlist input { flex: 1; min-width: 0; }
main { min-width: 0; }
.head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.head h1 { margin: 0; font-size: 28px; letter-spacing: -.02em; line-height: 1.1; }
.head .sub { color: var(--muted); margin-top: 4px; }
.search { position: relative; }
.search input[type=search] { width: 200px; max-width: 100%; padding: 8px 12px 8px 34px; }
.search svg { position: absolute; left: 11px; top: 50%; translate: 0 -50%; width: 15px; height: 15px; color: var(--muted); }
input[type=text], input[type=search], input[type=date], input[type=time], select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
textarea { width: 100%; resize: vertical; min-height: 64px; }
.progress { height: 6px; background: var(--surface2); border-radius: 99px; overflow: hidden; margin: 0 0 16px; }
.progress b { display: block; height: 100%; background: var(--ok); border-radius: 99px; transition: width .25s; }
.add { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 6px 6px 14px; display: flex; gap: 8px; align-items: center; box-shadow: var(--shadow); }
.add:focus-within { border-color: var(--accent); }
.add input { flex: 1; min-width: 0; border: 0; background: none; padding: 10px 0; outline: 0; font-size: 16px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 9px 16px; font-weight: 600; }
.btn.ghost { background: var(--surface2); color: var(--ink); font-weight: 500; }
.btn.danger { background: none; color: var(--danger); border: 1px solid var(--line); font-weight: 500; }
.aibar { margin-top: 10px; }
.aibar[hidden] { display: none; }
.add.ai { padding-left: 14px; }
.ai-ic { color: var(--accent); flex: none; display: inline-flex; }
.mic { flex: none; width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--surface2); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.mic[hidden] { display: none; }
.mic.on { background: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.grip { flex: none; width: 30px; height: 30px; margin: -3px -8px 0 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: grab; touch-action: none; display: grid; place-items: center; opacity: .55; }
.grip:hover, .grip:focus-visible { opacity: 1; background: var(--surface2); }
.task { position: relative; }
.task.shift { transition: transform .15s ease; }
.task.dragging { z-index: 5; border-color: var(--accent); box-shadow: 0 10px 28px rgba(22,32,47,.22); transition: none; }
body.dragging-body { user-select: none; cursor: grabbing; }
.thumb { display: block; max-width: 160px; max-height: 110px; border-radius: 8px; margin: 2px 0 6px; border: 1px solid var(--line); }
.fsize, .fstat { color: var(--muted); font-size: 13px; }
.sub a { color: var(--accent); word-break: break-all; }
.aimsg { color: var(--muted); font-size: 13px; margin: 8px 4px 0; min-height: 18px; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 4px 0; min-height: 20px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; padding: 2px 9px; border-radius: 99px; background: var(--surface2); color: var(--muted); white-space: nowrap; }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.chip.late { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lc); }
.group { margin-top: 22px; }
.group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 4px 8px; display: flex; gap: 8px; }
.group h2.late { color: var(--danger); }
.group h2 span { font-weight: 400; }
ul.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.task.open { border-color: var(--accent); }
.row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 14px; }
.check { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line); background: none; display: grid; place-items: center; padding: 0; color: var(--accent-ink); }
.check:hover { border-color: var(--accent); }
.check svg { width: 13px; height: 13px; opacity: 0; }
.task.done .check { background: var(--ok); border-color: var(--ok); }
.task.done .check svg { opacity: 1; }
.body { flex: 1; min-width: 0; cursor: pointer; }
.title { overflow-wrap: anywhere; }
.task.done .title { color: var(--muted); text-decoration: line-through; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.meta:empty { display: none; }
.flag { flex: none; width: 4px; align-self: stretch; border-radius: 4px; background: var(--p1); margin: -2px 0; }
.flag.p2 { background: var(--p2); }
.detail { border-top: 1px solid var(--line); padding: 12px 14px 14px; display: grid; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field input, .field select { width: 100%; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { background: var(--surface2); border: 1px solid transparent; border-radius: 99px; padding: 5px 12px; font-size: 13.5px; }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.subs { display: grid; gap: 6px; }
.sub { display: flex; align-items: center; gap: 8px; }
.sub input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.sub span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sub.d span { color: var(--muted); text-decoration: line-through; }
.sub .x, .iconx { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 0 6px; border-radius: 6px; }
.sub .x:hover { color: var(--danger); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.empty { text-align: center; color: var(--muted); padding: 44px 16px; border: 1px dashed var(--line); border-radius: 14px; margin-top: 22px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }
.skeleton { height: 52px; border-radius: 14px; background: linear-gradient(90deg, var(--surface2), var(--surface), var(--surface2)); background-size: 200% 100%; animation: sh 1.4s infinite linear; margin-top: 8px; }
@keyframes sh { to { background-position: -200% 0; } }
.cal { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.calhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.calhead strong { font-size: 17px; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wd { text-align: center; font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px 0; }
.day { aspect-ratio: 1.15; min-height: 46px; background: none; border: 1px solid transparent; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 5px 2px; gap: 3px; font-variant-numeric: tabular-nums; }
.day:hover { background: var(--surface2); }
.day.out { color: var(--muted); opacity: .55; }
.day.today .n { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 7px; font-weight: 700; }
.day.sel { border-color: var(--accent); background: var(--accent-soft); }
.dots { display: flex; gap: 3px; height: 6px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--lc); }
.timeline .time { width: 54px; flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; padding-top: 12px; text-align: right; }
.tl { display: flex; gap: 10px; align-items: flex-start; }
.tl > .task { flex: 1; min-width: 0; }
#toasts { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; justify-items: center; pointer-events: none; z-index: 20; }
.toast { pointer-events: auto; background: var(--ink); color: var(--bg); border-radius: 12px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 100%; }
.toast button { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 0; }
:root[data-theme="light"] .toast button, .toast button { filter: brightness(1.35) saturate(.9); }
.foot { margin-top: 28px; color: var(--muted); font-size: 12.5px; text-align: center; }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); gap: 10px; padding-top: 12px; }
  nav { position: static; }
  .brand { margin: 0 2px 8px; }
  .navbar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .navgroup { flex-direction: row; gap: 6px; }
  .navlabel { display: none; }
  .navitem { width: auto; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; }
  .navitem .cnt, .navitem .x { margin-left: 4px; }
  .head h1 { font-size: 24px; }
  .search { flex: 1 1 100%; } .search input[type=search] { width: 100%; }
  .timeline .time { width: 42px; }
}
@media (prefers-reduced-motion: reduce) { .skeleton, .progress b { animation: none; transition: none; } }

/* ---------- 1. csomag: bejelentkezés, profil ---------- */
[hidden] { display: none !important; }
.boot { min-height: 60vh; display: grid; place-items: center; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
code { background: var(--surface2); border-radius: 6px; padding: 1px 6px; font-size: .92em; }
.btn.wide { width: 100%; padding: 12px 16px; }
.btn[disabled] { opacity: .6; cursor: default; }
.authwrap { min-height: 100vh; display: grid; place-items: center; padding: 20px max(16px, env(safe-area-inset-left, 0px)); }
.authcard { width: min(100%, 400px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 24px 22px 20px; display: grid; gap: 14px; }
.authcard .brand { margin: 0 0 4px; }
.authcard h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.authcard form { display: grid; gap: 12px; }
.authtabs { display: grid; grid-template-columns: 1fr 1fr; }
.authtabs button { padding: 8px 10px; }
.authmsg { margin: 0; min-height: 20px; font-size: 14px; color: var(--muted); }
.authmsg.err { color: var(--danger); }
.authmsg.ok { color: var(--ok); }
.field input:disabled { opacity: .7; }
.usernav { margin-top: 18px; }
.avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.uname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.modal { position: fixed; inset: 0; background: rgba(10, 16, 28, .5); display: grid; place-items: center; padding: 16px; z-index: 30; }
.modalcard { width: min(100%, 420px); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.3); display: grid; gap: 12px; max-height: 92vh; overflow: auto; }
.modalcard h2 { margin: 0; font-size: 19px; }
.modalcard form { display: grid; gap: 12px; }
@media (max-width: 760px) {
  .usernav { margin-top: 0; }
  .navbar { align-items: center; }
}
input[type=email], input[type=password] { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; width: 100%; font-size: 16px; }
input[type=email]:focus, input[type=password]:focus, input[type=text]:focus { border-color: var(--accent); }
.authcard input[type=text] { width: 100%; font-size: 16px; padding: 10px 12px; }
.modalcard input[type=text], .modalcard input[type=email] { width: 100%; font-size: 16px; padding: 10px 12px; }
