:root {
  --bg: #f5f2ea;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --border: #e4ddcf;
  --text: #2a2620;
  --muted: #7a7166;
  --primary: #2f5d3a;
  --primary-2: #3f7a4d;
  --primary-soft: #e3eee4;
  --accent: #8b5a2b;
  --danger: #b3261e;
  --danger-soft: #fbe5e3;
  --warn: #9a6400;
  --warn-soft: #fdf1d8;
  --info: #2b5c8b;
  --info-soft: #e3edf7;
  --ok: #2f7a3d;
  --ok-soft: #e1f2e3;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 4px 14px rgba(40, 30, 10, .05);
  --on-primary: #ffffff;
  --radius: 14px;
  --nav-h: 64px;
  color-scheme: light;
}
/* sötét mód: automatikusan a rendszer szerint, vagy kézzel (Beállítások → Megjelenés) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151713; --surface: #1e211c; --surface-2: #252922; --border: #343a30; --text: #ece8df; --muted: #a29b8f;
    --primary: #6fb47f; --primary-2: #82c792; --primary-soft: #23352a; --accent: #d39b62;
    --danger: #f08b82; --danger-soft: #3d2220; --warn: #e8b552; --warn-soft: #3a3020; --info: #8ab8e8; --info-soft: #1f2e3d;
    --ok: #7ccf8b; --ok-soft: #1f3524; --shadow: 0 1px 2px rgba(0,0,0,.3); --on-primary: #10200f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #151713; --surface: #1e211c; --surface-2: #252922; --border: #343a30; --text: #ece8df; --muted: #a29b8f;
    --primary: #6fb47f; --primary-2: #82c792; --primary-soft: #23352a; --accent: #d39b62;
    --danger: #f08b82; --danger-soft: #3d2220; --warn: #e8b552; --warn-soft: #3a3020; --info: #8ab8e8; --info-soft: #1f2e3d;
    --ok: #7ccf8b; --ok-soft: #1f3524; --shadow: 0 1px 2px rgba(0,0,0,.3); --on-primary: #10200f;
    color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* színpaletták (az alap az „Erdő” zöld) */
:root[data-palette="nyereg"] { --primary: #7a4a22; --primary-2: #925a2b; --primary-soft: #f3e7da; --on-primary: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-palette="nyereg"]:not([data-theme="light"]) { --primary: #d39b62; --primary-2: #e0ae7a; --primary-soft: #3a2a1c; --on-primary: #1f1206; } }
:root[data-palette="nyereg"][data-theme="dark"] { --primary: #d39b62; --primary-2: #e0ae7a; --primary-soft: #3a2a1c; --on-primary: #1f1206; }
:root[data-palette="ejkek"] { --primary: #24497a; --primary-2: #2f5d96; --primary-soft: #e2eaf5; --on-primary: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-palette="ejkek"]:not([data-theme="light"]) { --primary: #7fa9e0; --primary-2: #96bbea; --primary-soft: #1d2a3d; --on-primary: #0c1726; } }
:root[data-palette="ejkek"][data-theme="dark"] { --primary: #7fa9e0; --primary-2: #96bbea; --primary-soft: #1d2a3d; --on-primary: #0c1726; }
:root[data-palette="bordo"] { --primary: #7d2333; --primary-2: #962d40; --primary-soft: #f6e3e6; --on-primary: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-palette="bordo"]:not([data-theme="light"]) { --primary: #e08a99; --primary-2: #eaa1ae; --primary-soft: #3a1d23; --on-primary: #24070d; } }
:root[data-palette="bordo"][data-theme="dark"] { --primary: #e08a99; --primary-2: #eaa1ae; --primary-soft: #3a1d23; --on-primary: #24070d; }
:root[data-palette="mez"] { --primary: #8a6100; --primary-2: #a37400; --primary-soft: #f8edd2; --on-primary: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-palette="mez"]:not([data-theme="light"]) { --primary: #e3b54f; --primary-2: #edc670; --primary-soft: #392d14; --on-primary: #221800; } }
:root[data-palette="mez"][data-theme="dark"] { --primary: #e3b54f; --primary-2: #edc670; --primary-soft: #392d14; --on-primary: #221800; }
:root[data-palette="pala"] { --primary: #3d4a52; --primary-2: #51606a; --primary-soft: #e6eaec; --on-primary: #ffffff; }
@media (prefers-color-scheme: dark) { :root[data-palette="pala"]:not([data-theme="light"]) { --primary: #a9b8c2; --primary-2: #bcc8d0; --primary-soft: #283035; --on-primary: #12181c; } }
:root[data-palette="pala"][data-theme="dark"] { --primary: #a9b8c2; --primary-2: #bcc8d0; --primary-soft: #283035; --on-primary: #12181c; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- elrendezés */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 16px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 16px; font-weight: 700; font-size: 18px; color: var(--primary); }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); font-weight: 500;
}
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }
.nav .ico { width: 22px; text-align: center; }
.nav-sep { height: 1px; background: var(--border); margin: 10px 8px; }

.main { flex: 1; min-width: 0; padding: 22px 28px 40px; max-width: 1280px; }
.topbar { display: none; }
.bottomnav { display: none; }

@media (max-width: 899px) {
  .sidebar { display: none; }
  .main { padding: 14px 14px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  }
  .topbar .title { font-weight: 700; font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topbar .back { font-size: 22px; padding: 0 6px; color: var(--primary); }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  }
  .bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; }
  .bottomnav a .ico { font-size: 22px; line-height: 1; }
  .bottomnav a.active { color: var(--primary); }
  .bottomnav a:hover { text-decoration: none; }
  .page-head h1 { display: none; }
}

/* ---------- oldal fejléc, tabok */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { flex: 1; min-width: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -2px 14px; padding: 2px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex-shrink: 0; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 500;
}
.tabs a.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tabs a:hover { text-decoration: none; }

/* ---------- gombok, űrlap */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; min-height: 40px;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--danger); }
.btn.small { padding: 5px 10px; min-height: 32px; font-size: 13px; border-radius: 8px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn:disabled { opacity: .5; cursor: default; }

.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form { grid-template-columns: 1fr; } }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.field .req { color: var(--danger); }
.field .help { font-size: 12px; color: var(--muted); margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font: inherit; font-size: 16px; min-height: 42px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 40%, transparent); border-color: var(--primary); }
textarea { min-height: 84px; resize: vertical; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; padding: 0; flex-shrink: 0; accent-color: var(--primary); vertical-align: middle; }
.check { display: flex; align-items: center; gap: 10px; padding: 9px 0; font-weight: 500; color: var(--text) !important; font-size: 15px !important; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .form-actions.sticky { position: sticky; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); background: var(--surface); padding: 10px 0; margin-top: 10px; }
  .toolbar select, .toolbar input[type=date] { flex: 1 1 140px; }
  .form-actions .btn { flex: 1; }
}

/* ---------- kártyák */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-head h2 { flex: 1; }
.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 899px) { .grid.cols-2, .grid.cols-3 { grid-template-columns: 1fr; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .value { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .value.pos { color: var(--ok); }
.stat .value.neg { color: var(--danger); }
@media (max-width: 500px) { .stats { grid-template-columns: repeat(2, 1fr); } .stat .value { font-size: 19px; } }

.quick { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick .btn { flex-shrink: 0; }

/* ---------- lista / táblázat → mobilon kártyák */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input[type=search] { flex: 1 1 220px; }
.toolbar select, .toolbar input[type=date] { flex: 0 1 180px; width: auto; }
.tbl-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 700; padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr[data-href] { cursor: pointer; }
.tbl tbody tr[data-href]:hover { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.row-danger td:first-child { box-shadow: inset 3px 0 var(--danger); }
.tbl tr.row-warn td:first-child { box-shadow: inset 3px 0 var(--warn); }
.tbl tr.row-muted { opacity: .55; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); }
@media (max-width: 700px) {
  .tbl-wrap.cards { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .cards table.tbl, .cards .tbl tbody, .cards .tbl tr, .cards .tbl td { display: block; }
  .cards .tbl thead { display: none; }
  .cards .tbl tr { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; padding: 10px 12px; box-shadow: var(--shadow); position: relative; }
  .cards .tbl td { border: 0; padding: 2px 0; display: flex; gap: 8px; font-size: 14px; }
  .cards .tbl td::before { content: attr(data-label); color: var(--muted); font-size: 12px; min-width: 110px; flex-shrink: 0; padding-top: 1px; }
  .cards .tbl td:first-child { font-weight: 700; font-size: 16px; padding-bottom: 4px; }
  .cards .tbl td:first-child::before { display: none; }
  .cards .tbl td.num { text-align: left; }
  .cards .tbl td:empty, .cards .tbl td.empty { display: none; }
  .cards .tbl tr td:first-child { box-shadow: none !important; }
  .cards .tbl tr.row-danger { border-left: 4px solid var(--danger); }
  .cards .tbl tr.row-warn { border-left: 4px solid var(--warn); }
  .cards .tbl td.actions-cell { padding-top: 6px; }
  .cards .tbl td.actions-cell::before { display: none; }
  .cards .tbl tfoot { display: block; }
  .cards .tbl tfoot tr { background: var(--surface-2); }
}
.empty-state { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty-state .big { font-size: 38px; margin-bottom: 6px; }
.count { color: var(--muted); font-size: 13px; margin: 8px 2px; }

/* ---------- jelvények */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }

/* ---------- részletek */
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px 20px; }
.kv .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv .v { font-size: 15px; white-space: pre-wrap; word-break: break-word; }
.kv .wide { grid-column: 1 / -1; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.section-title h2 { flex: 1; }

/* ---------- figyelmeztetések */
.alerts { display: flex; flex-direction: column; gap: 6px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.alert:hover { text-decoration: none; filter: brightness(.98); }
.alert.danger { background: var(--danger-soft); border-color: transparent; }
.alert.warn { background: var(--warn-soft); border-color: transparent; }
.alert.info { background: var(--info-soft); border-color: transparent; }
.alert .ico { font-size: 17px; }

.list-item { display: flex; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--border); color: var(--text); }
.list-item:last-child { border-bottom: 0; }
.list-item:hover { text-decoration: none; }
.list-item .time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 48px; color: var(--primary); }
.list-item .body { flex: 1; min-width: 0; }
.list-item .sub { font-size: 13px; color: var(--muted); }
.focus-note { margin-top: 4px; font-size: 13px; background: var(--warn-soft); color: var(--text); padding: 5px 8px; border-radius: 8px; }

/* ---------- naptár */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-head h2 { flex: 1; text-transform: capitalize; min-width: 140px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-grid .dow { background: var(--surface-2); padding: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; }
.cal-day { background: var(--surface); min-height: 108px; padding: 5px; cursor: pointer; overflow: hidden; }
.cal-day.other { background: var(--surface-2); opacity: .6; }
.cal-day.today .num { background: var(--primary); color: var(--on-primary); border-radius: 999px; }
.cal-day.sel { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal-day .num { display: inline-block; min-width: 24px; height: 24px; line-height: 24px; text-align: center; font-size: 13px; font-weight: 700; }
.cal-ev { font-size: 11.5px; padding: 1px 5px; border-radius: 5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--primary-soft); color: var(--text); }
.cal-ev.task { background: var(--info-soft); }
.cal-ev.deadline { background: var(--warn-soft); }
.cal-ev.done { text-decoration: line-through; opacity: .6; }
.cal-more { font-size: 11px; color: var(--muted); margin-top: 2px; }
.dots { display: none; gap: 3px; justify-content: center; margin-top: 2px; }
.dots i { width: 6px; height: 6px; border-radius: 99px; background: var(--primary); display: block; }
.dots i.task { background: var(--info); }
.dots i.deadline { background: var(--warn); }
@media (max-width: 700px) {
  .cal-day { min-height: 54px; text-align: center; padding: 4px 2px; }
  .cal-day .cal-ev, .cal-day .cal-more { display: none; }
  .dots { display: flex; }
}

/* ---------- egyéb */
.toast-wrap { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 20px + env(safe-area-inset-bottom)); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 900px) { .toast-wrap { bottom: 24px; } }
.toast { background: #2a2620; color: #fff; padding: 10px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); font-weight: 500; animation: pop .2s ease; max-width: 90vw; }
.toast.error { background: var(--danger); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.modal-bg { position: fixed; inset: 0; background: rgba(20, 15, 5, .45); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; max-width: 640px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 18px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal h2 { margin-bottom: 12px; }
@media (max-width: 640px) {
  .modal-bg { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}

.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.menu-grid a { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 12px; text-align: center; color: var(--text); font-weight: 600; box-shadow: var(--shadow); }
.menu-grid a .ico { font-size: 28px; display: block; margin-bottom: 4px; }
.menu-grid a:hover { text-decoration: none; background: var(--surface-2); }

.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth .card { width: 100%; max-width: 380px; padding: 26px; }
.auth .logo { text-align: center; margin-bottom: 16px; }
.auth .logo img { width: 72px; height: 72px; border-radius: 18px; }
.auth h1 { text-align: center; margin-bottom: 4px; }
.auth form { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.err { color: var(--danger); font-weight: 600; font-size: 14px; }

.bar-chart { width: 100%; height: auto; }
.bar-chart text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; word-break: break-all; }
.steps { padding-left: 20px; margin: 8px 0; }
.steps li { margin-bottom: 4px; }
.inline-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.qty-btns { display: inline-flex; gap: 4px; }
.loading { padding: 40px; text-align: center; color: var(--muted); }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.check-list label { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--border); }

/* ---------- naptár rendezés */
.cleanup-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cleanup-row:last-child { border-bottom: 0; }
.cleanup-row .who { flex: 1 1 200px; min-width: 0; word-break: break-word; }
.cleanup-row .who .sub { font-size: 13px; color: var(--muted); }
.cleanup-row .acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cleanup-row .acts select { width: auto; max-width: 220px; min-height: 34px; padding: 5px 8px; font-size: 14px; }
@media (max-width: 640px) {
  .cleanup-row .acts { flex: 1 1 100%; }
  .cleanup-row .acts select { flex: 1 1 100%; max-width: none; }
}

/* ---------- AI asszisztens */
.ai-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 56px; height: 56px; border-radius: 50%;
  border: 0; background: var(--primary); color: var(--on-primary); font-size: 26px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
@media (max-width: 899px) { .ai-fab { bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); right: 14px; width: 52px; height: 52px; } }
.ai-panel {
  position: fixed; z-index: 95; right: 20px; bottom: 88px; width: 420px; height: min(640px, calc(100vh - 120px));
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
  display: none; flex-direction: column; overflow: hidden;
}
.ai-panel.open { display: flex; }
@media (max-width: 899px) {
  .ai-panel { inset: 0; width: auto; height: auto; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); }
}
.ai-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.ai-msgs { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.ai-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 15px; line-height: 1.45; word-wrap: break-word; }
.ai-msg p { margin: 0 0 6px; } .ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul { margin: 4px 0; padding-left: 20px; }
.ai-msg.user { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.ai-msg.error { background: var(--danger-soft); border-color: transparent; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.ai-chip { font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--primary-soft); color: var(--text); }
.ai-chip.undone { text-decoration: line-through; opacity: .6; }
.ai-chip:hover { text-decoration: none; filter: brightness(.97); }
.ai-empty { margin: auto; text-align: center; color: var(--muted); padding: 10px; }
.ai-empty .big { font-size: 40px; }
.ai-examples { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.ai-ex { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.ai-ex:hover { background: var(--surface-2); }
.ai-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
.ai-input textarea { min-height: 42px; max-height: 140px; resize: none; }
.ai-input .btn { align-self: flex-end; min-width: 46px; }
.typing { display: flex; gap: 4px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- gyors választó gombok (etetés) */
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick {
  border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 8px 14px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center;
}
.pick:hover { background: var(--surface-2); text-decoration: none; }
.pick.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pick.add { border-style: dashed; color: var(--muted); font-weight: 500; }
.card .field + .field { margin-top: 14px; }

/* ---------- megjelenés választó */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 10px 0; }
.swatch { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.swatch.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.swatch i { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; box-shadow: inset 0 0 0 2px rgba(255,255,255,.35); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--text); padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--primary); color: var(--on-primary); }

/* ---------- egyszerű nézet („fater mód”) */
.simple { font-size: 20px; line-height: 1.35; max-width: 720px; margin: 0 auto; padding: calc(12px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); min-height: 100vh; background: var(--bg); color: var(--text); }
.simple button { font: inherit; cursor: pointer; }
.s-preview { position: fixed; inset: 0; z-index: 85; overflow-y: auto; background: var(--bg); }
.s-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.s-head > div { flex: 1; }
.s-hello { font-size: 28px; font-weight: 800; }
.s-date { color: var(--muted); font-size: 19px; }
.s-small { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 12px; padding: 8px 12px; font-size: 16px !important; font-weight: 600; }
.s-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.s-tabs button { min-height: 60px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; font-size: 20px; }
.s-tabs button.on { border-color: var(--primary); background: var(--primary-soft); }
.s-add { width: 100%; min-height: 72px; border-radius: 18px; border: 0; background: var(--primary); color: var(--on-primary); font-size: 24px !important; font-weight: 800; margin-bottom: 18px; box-shadow: var(--shadow); }
.s-daynav { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 8px; text-align: center; margin-bottom: 14px; }
.s-daynav button { height: 64px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font-size: 34px !important; font-weight: 700; }
.s-dayname { font-size: 30px; font-weight: 800; }
.s-sub { color: var(--muted); font-size: 18px; }
.s-card { display: flex; width: 100%; align-items: center; gap: 16px; text-align: left; padding: 16px; margin-bottom: 10px; border-radius: 18px; border: 2px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.s-card.off { opacity: .55; }
.s-card.off b { text-decoration: line-through; }
.s-time { font-size: 30px; font-weight: 800; color: var(--primary); min-width: 88px; font-variant-numeric: tabular-nums; }
.s-who { display: flex; flex-direction: column; gap: 2px; font-size: 22px; }
.s-who span { font-size: 18px; color: var(--muted); }
.s-tag { display: inline-block; font-size: 15px !important; font-weight: 700; color: var(--danger) !important; }
.s-empty, .s-loading { text-align: center; padding: 30px 10px; color: var(--muted); font-size: 22px; }
.s-sum { text-align: center; color: var(--muted); margin: 6px 0 14px; }
.s-h2 { font-size: 24px; margin: 18px 0 10px; }
.s-note { padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); margin-bottom: 8px; }
.s-weekday { margin-bottom: 12px; border-radius: 18px; border: 2px solid var(--border); background: var(--surface); overflow: hidden; }
.s-wtitle { display: flex; width: 100%; align-items: baseline; gap: 10px; padding: 12px 14px; border: 0; background: var(--surface-2); color: var(--text); text-align: left; font-size: 22px !important; }
.s-wtitle span { color: var(--muted); font-size: 17px; }
.s-wtitle .s-count { margin-left: auto; background: var(--primary); color: var(--on-primary); border-radius: 999px; padding: 0 10px; font-weight: 800; }
.s-wtitle .s-count:empty { display: none; }
.s-wrow { padding: 10px 14px; border-top: 1px solid var(--border); font-size: 21px; }
.s-muted { color: var(--muted); }
.s-overlay { position: fixed; inset: 0; z-index: 90; overflow-y: auto; max-width: none; }
.s-overlay > * { max-width: 720px; margin: 0 auto; }
.s-sheet { padding-top: 30px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
.s-wizhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.s-step { color: var(--muted); font-size: 17px; }
.s-q { font-size: 34px; margin: 10px 0 14px; }
.s-input { width: 100%; font-size: 24px !important; min-height: 64px; border-radius: 16px; border: 2px solid var(--border); padding: 10px 16px; margin-bottom: 12px; }
.s-list { display: flex; flex-direction: column; gap: 10px; }
.s-hint { color: var(--muted); font-size: 18px; margin: 6px 0; display: block; }
.s-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; width: 100%; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font-size: 22px !important; font-weight: 700; }
.s-btn span { font-size: 16px; font-weight: 500; color: var(--muted); }
.s-btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.s-btn.primary span { color: var(--on-primary); opacity: .85; }
.s-btn.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.s-btn:disabled { opacity: .5; }
.s-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.s-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.s-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.s-grid4 .s-btn { font-size: 19px !important; }
.s-who-chip { display: inline-block; padding: 6px 14px; border-radius: 999px; background: var(--primary-soft); font-weight: 700; margin-bottom: 14px; }
.s-summary { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; border: 2px solid var(--border); background: var(--surface); font-size: 24px; margin-bottom: 16px; }
.s-go { min-height: 76px; font-size: 26px !important; }
.s-done { text-align: center; padding-top: 40px; }
.s-big { font-size: 80px; color: var(--ok); line-height: 1; }
.s-done .s-go { margin-top: 30px; }
@media (max-width: 380px) { .s-grid3 { grid-template-columns: repeat(2, 1fr); } }
