/* Barack: rózsás-meleg szürke alap, padlizsán tinta, perzsimon kiemelés, körömvirág jelzőszín. Egy betűcsalád (Geist + Geist Mono). Csak világos téma. */
:root {
  --bg: #f5efeb;
  --paper: #fffaf7;
  --paper-2: #f8f0eb;
  --line: #ebdfd7;
  --line-soft: #f3e9e3;
  --rule: #dbc9be;
  --text: #2a1a22;
  --muted: #876f79;
  --accent: #e64b2e;
  --accent-hover: #cc3d22;
  --accent-ink: #fff6f2;
  --accent-soft: #fcdcd1;
  --pop: #ffc247;
  --now: #e64b2e;
  --danger: #c4302b;
  --shadow: 0 1px 2px rgba(60, 20, 30, .05), 0 8px 24px -16px rgba(60, 20, 30, .24);
}
:root {
  /* a napirend blokkjainak egyetlen színe (maroon) */
  --c: #861f2c;
  --c-amber: #c98a12;

  --f-display: "Geist", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-body: "Geist", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --hour: 72px;
  --r: 16px;
  color-scheme: light only;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button, a, label, select, input, textarea, .task, .block { touch-action: manipulation; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; margin: 0; text-wrap: balance; letter-spacing: -.025em; }
h2 { font-size: 1.05rem; }
.hint { color: var(--muted); font-size: .84rem; }
kbd { font-family: var(--f-mono); font-size: .75rem; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--paper-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

/* ---------- app shell ---------- */
.app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-block: 18px 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -.03em; }
/* óralap kitöltött negyeddel: egy időre bedobozolt sáv */
.logo { width: 28px; height: 28px; flex: none; display: block; }
.logo circle { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.logo path { fill: var(--accent); stroke: none; }

.datenav { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; min-width: 0; }
/* dátumcsempe a két nyíl között: a mai nap kitöltött, más nap halvány, a múlt szaggatott keretes.
   Fix szélességű, hogy napváltáskor a nyilak ne ugráljanak. */
.day-chip {
  display: inline-grid; justify-items: center; align-content: center; gap: 2px;
  width: 156px; height: 46px; padding: 0 8px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--paper); color: var(--text);
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.day-chip:hover { border-color: var(--rule); }
.day-chip.is-past { border-style: dashed; border-color: var(--rule); }
.day-chip.today { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); cursor: default; }
.day-date { font: 500 1.02rem/1.1 var(--f-mono); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-sub { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; line-height: 1.1; color: var(--muted); white-space: nowrap; }
.day-dot { width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid currentColor; opacity: .7; }
.day-rel { font-weight: 600; padding: 1px 4px; border-radius: 99px; background: var(--line-soft); color: var(--text); font-size: .66rem; }
.day-chip.today .day-sub { color: inherit; }
.day-chip.today .day-dot { border: 0; background: var(--pop); opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--pop) 35%, transparent); }
.day-chip.today .day-rel { background: color-mix(in srgb, var(--accent-ink) 22%, transparent); color: inherit; text-transform: uppercase; letter-spacing: .04em; }
.actions { display: flex; gap: 6px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--paper); color: var(--muted);
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--rule); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; border-color: transparent; background: transparent; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.icon-btn.sm:hover { background: var(--paper-2); border-color: var(--line); }

.pill {
  height: 38px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); font-weight: 600; font-size: .88rem;
  cursor: pointer;
}
.pill:hover { border-color: var(--rule); }
.pill.active { background: var(--text); border-color: var(--text); color: var(--paper); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); font-weight: 600; font-size: .9rem;
  cursor: pointer;
}
.btn:hover { border-color: var(--rule); background: var(--paper-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--paper-2); }
.btn.danger { color: var(--danger); background: transparent; border-color: transparent; }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); }

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 24px;
  min-height: 0;
  padding-bottom: 24px;
}
.side { display: flex; flex-direction: column; gap: 18px; min-height: 0; overflow-y: auto; padding: 2px; margin: -2px; }
.section {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow);
}
.section.grow { flex: 1 0 auto; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); }
.count { font-family: var(--f-mono); font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- now card ---------- */
.now-card {
  border-radius: var(--r);
  padding: 20px;
  background: var(--text);
  color: var(--accent-ink);
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--shadow);
}
.now-card.idle { background: var(--paper); color: var(--text); border: 1px solid var(--line); }
.now-eyebrow { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .8; display: flex; align-items: center; gap: 8px; }
.now-eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 2s ease-in-out infinite; }
.now-title { font-family: var(--f-display); font-size: 1.4rem; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; overflow-wrap: anywhere; }
.now-timer { font-family: var(--f-mono); font-size: 2.1rem; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.now-timer small { font-family: var(--f-body); font-size: .85rem; opacity: .75; margin-left: 6px; letter-spacing: 0; }
.bar { height: 5px; border-radius: 99px; background: color-mix(in srgb, currentColor 22%, transparent); overflow: hidden; }
.bar > i { display: block; height: 100%; background: currentColor; border-radius: inherit; transition: width .8s linear; }
.now-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .86rem; }
.now-next { opacity: .85; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-card.idle .now-next { color: var(--muted); opacity: 1; white-space: normal; }
.now-card .btn { height: 34px; font-size: .82rem; background: color-mix(in srgb, var(--accent-ink) 18%, transparent); border-color: transparent; color: inherit; flex: none; }
.now-card.idle .btn { background: var(--paper-2); border-color: var(--line); }
.now-btns { display: flex; gap: 6px; flex: none; }
@keyframes pulse { 50% { opacity: .35; } }


.tick {
  width: 22px; height: 22px; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--rule); border-radius: 50%;
  background: var(--paper); color: transparent; cursor: pointer; padding: 0;
}
.tick svg { width: 13px; height: 13px; stroke-width: 3; }
.tick:hover { border-color: var(--accent); }
.done > .tick, .tick.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- brain dump ---------- */
.add-form { display: flex; gap: 6px; }
.add-form input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2);
  font-size: 16px;
}
.add-form input::placeholder, .field ::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.add-form input:focus { background: var(--paper); border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.add-form select {
  height: 44px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  font-family: var(--f-mono); font-size: 16px;
}
.add-btn { width: 44px; height: 44px; padding: 0; }

.carry {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--muted); font-size: .86rem; cursor: pointer; text-align: left;
}
.carry:hover { color: var(--accent); border-color: var(--accent); }
.carry.confirm { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.carry svg { flex: none; }

.dump-list { list-style: none; margin: 0; padding: 0; display: grid; }
.task {
  display: flex; align-items: center; gap: 6px;
  min-height: 46px; padding: 4px 4px 4px 0;
  border-bottom: 1px solid var(--line-soft);
  transition: background .15s;
}
.task:last-child { border-bottom: 0; }
.task:hover { background: color-mix(in srgb, var(--paper-2) 70%, transparent); }
.task .handle {
  display: grid; place-items: center; width: 24px; height: 34px;
  color: var(--muted); opacity: .45; cursor: grab; touch-action: none; flex: none;
}
.task:hover .handle { opacity: 1; }
.task .handle svg { width: 14px; height: 14px; }
.task .t-title { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: pointer; padding: 4px 2px; }
.task.done .t-title { text-decoration: line-through; text-decoration-color: var(--accent); color: var(--muted); }
/* már a napirendben van: halványabb a késznél is, de nincs áthúzva */
.task.scheduled .t-title { color: var(--muted); opacity: .6; }
.chip {
  font-family: var(--f-mono); font-size: .72rem; font-variant-numeric: tabular-nums;
  padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; flex: none;
}
/* áthozás, időpont, időtartam egymás alatt, hogy a címnek maradjon hely */
.task .chips { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.chip.sched { border-color: transparent; background: var(--paper-2); }
.chip.pause { display: inline-flex; align-items: center; gap: 4px; border-color: transparent; background: var(--paper-2); }
.chip.pause svg { width: 12px; height: 12px; }
.chip.moved { display: inline-flex; align-items: center; gap: 3px; }
.chip.moved svg, .moved-mark svg { width: 12px; height: 12px; transform: scaleX(-1); }
.task.moved .t-title { color: var(--muted); }
.moved-mark { color: var(--muted); display: inline-flex; }
.star { color: var(--muted); opacity: .4; }
.star.on { color: var(--c-amber); opacity: 1; }
.star.on svg { fill: currentColor; }
.task:hover .star { opacity: 1; }
.empty { margin: 0; color: var(--muted); font-size: .9rem; padding: 6px 2px; }
.empty i { font-style: normal; font-family: var(--f-mono); font-size: .85em; color: var(--text); background: var(--paper-2); padding: 1px 5px; border-radius: 5px; }

/* ---------- gyors teendők ---------- */
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; }
.todo {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px; padding: 4px 0 4px 4px;
  border-bottom: 1px solid var(--line-soft);
}
.todo:last-child { border-bottom: 0; }
.todo .t-title { flex: 1; min-width: 0; overflow-wrap: anywhere; cursor: pointer; padding: 4px 2px; }
.todo.done .t-title { text-decoration: line-through; text-decoration-color: var(--accent); color: var(--muted); }
.todo.waiting .t-title { color: var(--muted); }
.todo .wait, .todo .del { opacity: .45; }
.todo:hover .wait, .todo:hover .del { opacity: 1; }
.todo .wait.on { color: var(--c-amber); opacity: 1; }
.todo .del:hover { color: var(--danger); }
.todo-edit {
  flex: 1; min-width: 0; height: 36px; padding: 0 10px;
  border: 1px solid var(--accent); border-radius: 8px; background: var(--paper);
  font-size: 16px; outline: none; box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- schedule ---------- */
.schedule {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  box-shadow: var(--shadow);
}
.schedule-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.schedule-head > div { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tl-scroll { flex: 1; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.timeline { position: relative; display: grid; grid-template-columns: 64px 1fr; margin: 16px 18px 20px 0; }
.hours { position: relative; }
.hours span {
  position: absolute; right: 12px; transform: translateY(-50%);
  font-family: var(--f-mono); font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums;
  transition: opacity .2s;
}
.hours span.near { opacity: 0; }
.grid {
  position: relative;
  border-left: 1px solid var(--rule);
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 100% var(--hour);
  border-bottom: 1px solid var(--line);
  cursor: copy;
}
/* félórás pontozott vonal */
.grid::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(to right, var(--line) 0 3px, transparent 3px 7px);
  background-size: 100% 1px;
  -webkit-mask: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) / 2), #000 calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour));
  mask: repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour) / 2), #000 calc(var(--hour) / 2) calc(var(--hour) / 2 + 1px), transparent calc(var(--hour) / 2 + 1px) var(--hour));
}
.past {
  position: absolute; left: 0; right: 0; top: 0;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  pointer-events: none;
}
.now-line { position: absolute; left: -5px; right: 0; height: 2px; background: var(--now); z-index: 6; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: 0; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--now); }
.now-line span {
  position: absolute; left: -62px; top: -9px; width: 52px; text-align: right;
  font-family: var(--f-mono); font-size: .72rem; color: var(--now); font-weight: 500; background: var(--paper);
}

.block {
  position: absolute;
  border-radius: 6px;
  padding: 6px 8px 6px 10px;
  background: color-mix(in srgb, var(--c) 6%, var(--paper));
  border: 1px solid var(--c);
  border-left: 3px solid var(--c);
  display: flex; gap: 8px; align-items: flex-start;
  overflow: hidden;
  cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  z-index: 2;
  transition: box-shadow .15s, transform .15s;
}
.block:hover { box-shadow: var(--shadow); z-index: 3; }
.block.dragging { cursor: grabbing; box-shadow: var(--shadow); z-index: 10; transition: none; }
.block.done { background: var(--paper); border-color: color-mix(in srgb, var(--c) 35%, var(--paper)); }
.block.done .b-title { text-decoration: line-through; color: var(--muted); }
.block.current { box-shadow: 0 0 0 2px var(--c); }
.block.lifted { box-shadow: 0 0 0 2px var(--c), var(--shadow); transform: scale(1.02); z-index: 10; }
.block .tick { width: 20px; height: 20px; border-color: color-mix(in srgb, var(--c) 50%, transparent); background: var(--paper); }
.block.done .tick { background: var(--c); border-color: var(--c); color: var(--paper); }
.b-body { min-width: 0; flex: 1; }
.b-title { font-weight: 600; font-size: .9rem; line-height: 1.25; overflow-wrap: anywhere; color: color-mix(in srgb, var(--c) 35%, var(--text)); }
.b-time { font-family: var(--f-mono); font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.b-note { font-size: .8rem; color: var(--muted); margin-top: 4px; white-space: pre-line; }
.block.short { padding-top: 3px; padding-bottom: 3px; align-items: center; }
.block.short .b-body { display: flex; gap: 8px; align-items: baseline; }
.block.short .b-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.block.short .b-time { margin: 0; }
.block.short .b-note, .block.tiny .b-note { display: none; }
.block.tiny { padding-top: 0; padding-bottom: 0; }
.block.tiny .tick { width: 16px; height: 16px; }
.block.tiny .tick svg { width: 10px; height: 10px; }
.block.tiny .b-title { font-size: .8rem; }
.b-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 10px; cursor: ns-resize; touch-action: none; }
.b-resize::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 26px; height: 3px; margin-left: -13px; border-radius: 2px; background: var(--c); opacity: 0; transition: opacity .15s; }
.block:hover .b-resize::after, .block.dragging .b-resize::after { opacity: .6; }
/* pihenő: halványabb, csíkos háttér, pipa helyett ikon */
.block.pause {
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 10%, var(--paper)) 0 6px, color-mix(in srgb, var(--c) 4%, var(--paper)) 6px 12px);
  border-left-style: dashed;
}
.block.pause .b-title { font-weight: 500; }
.b-icon { width: 20px; height: 20px; flex: none; display: grid; place-items: center; color: var(--c); }
.b-icon svg { width: 15px; height: 15px; }
.block.tiny .b-icon { width: 16px; height: 16px; }
.block.tiny .b-icon svg { width: 12px; height: 12px; }
.block.preview { opacity: .75; border-style: dashed; pointer-events: none; z-index: 9; }

.drag-ghost {
  position: fixed; z-index: 1000; pointer-events: none;
  padding: 8px 12px; border-radius: 8px;
  background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--c);
  box-shadow: var(--shadow); font-weight: 600; font-size: .9rem;
  transform: translate(-12px, -50%);
  max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }

/* ---------- picker ---------- */
.pick-sub { margin: 4px 0 0; }
#picker .dialog-actions { flex-wrap: nowrap; }
#picker .dialog-actions .btn { white-space: nowrap; }
.pick-list { list-style: none; margin: 0 -8px; padding: 0; display: grid; max-height: min(52vh, 420px); overflow-y: auto; }
.pick {
  width: 100%; display: flex; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px 8px; border: 0; border-radius: 10px;
  background: transparent; text-align: left; cursor: pointer;
}
.pick:hover, .pick:focus-visible { background: var(--paper-2); }
.pick .t-title { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.pick-star { color: var(--c-amber); display: grid; }
.pick-star svg { width: 14px; height: 14px; fill: currentColor; }
.pick-end { font-family: var(--f-mono); font-size: .72rem; color: var(--muted); width: 44px; text-align: right; flex: none; }
.pick-parts { display: block; font-weight: 400; font-size: .76rem; color: var(--muted); }
.pick-more { margin: 0 -8px; }
.pick-more > summary {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px; border-radius: 10px;
  color: var(--muted); font-size: .86rem; font-weight: 500; cursor: pointer; list-style: none;
}
.pick-more > summary::-webkit-details-marker { display: none; }
.pick-more > summary:hover { background: var(--paper-2); color: var(--text); }
.pick-more > summary svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .15s; }
.pick-more[open] > summary svg { transform: rotate(45deg); }
.pick-more > summary b { font-family: var(--f-mono); font-size: .72rem; font-weight: 500; }
.pick-more .pick-list { margin: 0; max-height: min(36vh, 300px); }

/* ---------- tab bar (csak mobilon) ---------- */
.tabbar { display: none; }

/* ---------- dialogs ---------- */
.dialog {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 0; background: var(--paper); color: var(--text);
  box-shadow: 0 30px 70px -24px color-mix(in srgb, var(--text) 35%, transparent);
}
.dialog::backdrop { background: color-mix(in srgb, var(--text) 30%, transparent); backdrop-filter: blur(2px); }
.dialog form { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.dialog h3 { font-size: 1.3rem; font-weight: 600; outline: none; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper-2);
  font-size: 16px;
}
.field textarea { resize: vertical; }
/* iOS Safari: a natív time input saját min. szélességgel kilóg a rácsoszlopból */
.field input[type="time"], .field input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 0; display: block; }
.field input[type="time"]::-webkit-date-and-time-value, .field input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); background: var(--paper); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .hint { margin: 0; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
#editForm[data-mode="task"] [data-only="block"], #editForm[data-mode="block"] [data-only="task"] { display: none; }
#editForm[data-pause="true"] .done-check { display: none; }
.check small { font-weight: 400; font-size: .8rem; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.dialog-actions { display: flex; align-items: center; gap: 8px; padding-top: 4px; }
.spacer { flex: 1; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.moved-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 2000; display: flex; align-items: center; gap: 14px;
  width: max-content; max-width: calc(100vw - 32px);
  padding: 10px 12px 10px 16px; border-radius: 12px;
  background: var(--text); color: var(--paper); font-size: .9rem; font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in .2s ease-out;
}
.toast-action { border: 0; background: transparent; color: var(--pop); font-weight: 600; cursor: pointer; padding: 4px 8px; border-radius: 8px; text-decoration: underline; text-underline-offset: 3px; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes slide-next { from { opacity: .3; transform: translateX(28px); } }
@keyframes slide-prev { from { opacity: .3; transform: translateX(-28px); } }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  html, body { height: auto; }
  .app { height: auto; padding: 0 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
  /* kompakt, odatapadó fejléc: görgetés közben is látszik, melyik napon vagy */
  .topbar {
    position: sticky; top: 0; z-index: 50;
    margin: 0 -16px; padding: 10px 16px; gap: 8px; flex-wrap: nowrap;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid transparent;
  }
  .brand-name { display: none; }
  .brand { gap: 0; }
  .icon-btn, .pill { height: 36px; }
  .icon-btn { width: 36px; }
  .pill { padding: 0 13px; }
  .datenav { gap: 4px; }
  .task .handle { display: none; }
  .task { padding-left: 4px; }

  /* két nézet: Lista és Napirend, alsó fülsávval */
  body[data-tab="list"] .schedule, body[data-tab="plan"] .side { display: none; }
  .app { padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .tabbar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    position: fixed; z-index: 60; left: 12px; right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    max-width: 420px; margin: 0 auto; padding: 5px;
    background: var(--text); border-radius: 18px;
    box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--text) 45%, transparent);
  }
  .tabbar button {
    position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 48px; border: 0; border-radius: 14px;
    background: transparent; color: color-mix(in srgb, var(--paper) 62%, transparent);
    font-weight: 600; font-size: .95rem; cursor: pointer;
    transition: background .2s, color .2s;
  }
  .tabbar button[aria-pressed="true"] { background: var(--paper); color: var(--text); }
  .tab-badge {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
    display: inline-grid; place-items: center;
    background: var(--pop); color: var(--text);
    font: 600 .7rem/1 var(--f-mono);
  }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .layout { touch-action: pan-y pinch-zoom; }
  .layout.slide-next { animation: slide-next .28s ease-out; }
  .layout.slide-prev { animation: slide-prev .28s ease-out; }

  .schedule-head { position: sticky; top: 57px; z-index: 8; background: var(--paper); border-radius: var(--r) var(--r) 0 0; }
  .layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .side { overflow: visible; padding: 0; margin: 0; gap: 16px; }
  .section { padding: 16px; }
  .tl-scroll { overflow: visible; flex: none; }
  .timeline { grid-template-columns: 54px 1fr; margin-right: 10px; }
  .hours span { right: 8px; }
  .now-line span { left: -52px; width: 44px; }
  .day-chip { width: 130px; height: 42px; padding: 0 4px; border-radius: 12px; }
  .day-date { font-size: .95rem; }
  .dialog-actions { flex-wrap: wrap; }
}
@media (hover: none) {
  .task .handle, .star, .todo .wait, .todo .del { opacity: 1; }
  .kbd-hint { display: none; }
  .b-resize { height: 16px; }
  .b-resize::after { opacity: .45; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
