/* Today — app.css. Light theme only, pastel palette per WebApp_House_Style.md. */

@font-face {
  font-family: "Lexend";
  src: url("./fonts/lexend-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Lexend";
  src: url("./fonts/lexend-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --accent: #EFB3C1;
  --on-accent: #8A4257;
  --accent-tint: #FBE4EA;
  --bg: #FDF7F8;
  --card: #FFFFFF;
  --text: #4A3A40;
  --text-2: #8A7780;
  --text-3: #B0A0A7;
  --line: #EDE3E6;
  --mint: #8ECFB4;
  --coral: #DE8580;
  --peach: #F0C193;

  --f: 12px; /* base body font size, 6 steps */
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; background: var(--bg); }

body {
  font-family: "Lexend", Verdana, "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  line-height: 1.35;
  overscroll-behavior-y: none;
}

button, input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--on-accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---------- App shell ---------- */
#app-root {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  font-size: var(--f);
}

.app { display: flex; flex-direction: column; height: 100%; min-height: 0; font-size: var(--f); }

/* ---------- Header ---------- */
.hdr {
  padding-top: env(safe-area-inset-top);
  height: calc(48px + env(safe-area-inset-top));
  flex: 0 0 calc(48px + env(safe-area-inset-top));
  display: flex; align-items: center; gap: 8px; padding-inline: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.hdr h1 { font-size: calc(var(--f) * 1.85); font-weight: 700; flex: 1; min-width: 0; }
.hdr .ico {
  width: 44px; height: 44px; flex: 0 0 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 10px; font-size: calc(var(--f) * 1.3); cursor: pointer; color: var(--text-2);
}
.hdr .ico:active { background: var(--accent-tint); }

/* ---------- Scroll body ---------- */
.body-scroll {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 12px 12px calc(24px + env(safe-area-inset-bottom));
}

.section { margin-bottom: 20px; }
.section-title {
  font-size: calc(var(--f) * 1.15); font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px; min-height: 28px;
}
.section-title .count { font-size: calc(var(--f) * 0.85); color: var(--text-3); font-weight: 400; }

/* ---------- Today 3 slots ---------- */
.today-slots { display: flex; flex-direction: column; gap: 8px; }
.slot {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 6px 12px;
}
.slot.empty {
  display: flex; align-items: center; justify-content: center; color: var(--text-3);
  font-size: calc(var(--f) * 0.95); border-style: dashed; min-height: 56px;
}
.overflow-section {
  padding: 10px 12px 12px; border: 1px solid var(--peach); border-radius: 14px;
  background: color-mix(in srgb, var(--peach) 14%, var(--card));
}
.overflow-section .section-title { margin-bottom: 2px; }
.review-hint { color: var(--text-2); font-size: calc(var(--f) * 0.88); line-height: 1.5; margin-bottom: 8px; }
.overflow-section .group-list { display: flex; flex-direction: column; gap: 6px; }
.overflow-row { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }

.task-row { display: flex; align-items: flex-start; gap: 8px; }
.task-row .check {
  width: 26px; height: 26px; min-width: 44px; min-height: 44px; margin: -11px -11px -11px 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer; flex: 0 0 44px;
}
.task-row .check .dot {
  width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--text-3); display: block;
}
.task-row.done .check .dot { background: var(--mint); border-color: var(--mint); position: relative; }
.task-row.done .check .dot::after {
  content: ""; position: absolute; left: 5px; top: 2px; width: 6px; height: 11px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(40deg);
}
.task-row .main { flex: 1; min-width: 0; }
/* Soon badge floats before the title so ordinary text wrapping flows the
   title around it on the same line — only a long title wraps to its own
   next line, the badge itself never stacks above the content.
   display:flow-root keeps the float's height inside .main-line1 instead of
   bleeding into .sub-progress underneath. */
.task-row .main-line1 { display: flow-root; }
.task-row .title { font-size: calc(var(--f) * 1.05); word-break: break-word; }
.task-row.done .title { color: var(--text-3); text-decoration: line-through; }
.task-row .sub-progress { font-size: calc(var(--f) * 0.82); color: var(--text-3); margin-top: 2px; }
.task-row .soon-badge {
  float: left; margin: 2px 6px 2px 0; padding: 1px 7px; border-radius: 999px;
  font-size: calc(var(--f) * 0.78); font-weight: 700; line-height: 1.6;
  color: var(--text); background: color-mix(in srgb, var(--peach) 32%, var(--card));
  border: 1px solid var(--peach);
}
.task-row.soon .title { font-style: italic; }
.task-row .actions { display: flex; gap: 2px; flex: 0 0 auto; }
.task-row .actions button {
  /* Same 44px-touch-target-but-visually-smaller trick as .check above: the
     44px box (accessibility floor) is pulled in with a negative margin so it
     doesn't force every row to be 44px tall regardless of how little text
     is in it — this button was the one place that trick was missing, so a
     single-line row with no subtasks still came out 44px tall. */
  width: 44px; height: 44px; margin: -11px -11px -11px 0; background: none; border: 0; border-radius: 8px; cursor: pointer;
  color: var(--text-2); font-size: calc(var(--f) * 1.1); display: flex; align-items: center; justify-content: center;
}
.task-row .actions button:active { background: var(--accent-tint); }

/* ---------- Row kind markers (Note dash / Event time badge) ---------- */
.task-row .kind-mark {
  width: 26px; min-width: 44px; min-height: 44px; margin: -11px -11px -11px 0;
  display: flex; align-items: center; justify-content: center; flex: 0 0 44px;
  color: var(--text-3); font-size: calc(var(--f) * 1.05); font-weight: 700;
}
.task-row.type-event .kind-mark.time-badge {
  font-size: calc(var(--f) * 0.82); font-weight: 700; color: var(--on-accent);
  background: var(--accent-tint); border-radius: 8px; width: auto; min-width: 0;
  padding: 0 6px; height: 26px; min-height: 0; margin: 0; align-self: center;
  white-space: nowrap;
}

/* ---------- Today 3-tier divider (plan §3-2) ---------- */

/* ---------- Row "⋯" menu (plan §3-6) ---------- */
.menu-list { display: flex; flex-direction: column; gap: 2px; }
.menu-item {
  display: flex; align-items: center;
  width: 100%; min-height: 44px; text-align: left; padding: 0 6px; border-radius: 8px;
  border: 0; background: none; color: var(--text); font: inherit; font-size: calc(var(--f) * 1);
  cursor: pointer;
}
.menu-item:active { background: var(--accent-tint); }
.menu-item.danger { color: var(--coral); }

.done-note { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }

.subtasks { margin: 6px 0 0 32px; display: flex; flex-direction: column; gap: 4px; }
.subtask-row { display: flex; align-items: center; gap: 6px; }
.subtask-row .check {
  width: 20px; height: 20px; min-width: 44px; min-height: 44px; margin: -12px;
  display: flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; flex: 0 0 44px;
}
.subtask-row .check .dot { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--text-3); display: block; }
.subtask-row.done .check .dot { background: var(--accent); border-color: var(--accent); }
.subtask-row .title { font-size: calc(var(--f) * 0.95); flex: 1; }
.subtask-row.done .title { color: var(--text-3); text-decoration: line-through; }

/* ---------- Candidates strip ---------- */
.candidate-row {
  display: flex; align-items: center; gap: 8px; background: var(--accent-tint);
  border-radius: 12px; padding: 8px 10px; margin-bottom: 6px;
}
.candidate-row .title { flex: 1; font-size: calc(var(--f) * 0.98); min-width: 0; word-break: break-word; }
.candidate-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.candidate-row button {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 30px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--card); color: var(--on-accent); font-weight: 700; font-size: calc(var(--f) * 0.9); cursor: pointer;
}
.candidate-row button::after { content: ""; position: absolute; inset: -7px -3px; }
.candidate-row button.ghost {
  border-color: var(--line); color: var(--text-2); font-weight: 400;
}

/* ---------- Someday / Done collapsibles ---------- */
.collapsible summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px;
  font-size: calc(var(--f) * 1.05); font-weight: 700; min-height: 44px; padding: 4px 0;
}
.collapsible summary::-webkit-details-marker { display: none; }
.collapsible summary .chevron { transition: transform .15s ease; color: var(--text-2); }
.collapsible[open] summary .chevron { transform: rotate(90deg); }
.collapsible .group-list { display: flex; flex-direction: column; gap: 6px; padding-top: 4px; }
.done-date-group { margin-bottom: 10px; }
.done-date-group h3 { font-size: calc(var(--f) * 0.92); color: var(--text-2); margin-bottom: 4px; }

.someday-row {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px;
}
.someday-row .task-row .actions { gap: 0; }

/* Note cards in Someday clamp to 4 lines by default (plan §3-4); tapping
   toggles .expanded to lift the clamp. textContent-only, no innerHTML. */
.someday-row.type-note .note-clamp {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
  white-space: pre-wrap; word-break: break-word; cursor: pointer;
}
.someday-row.type-note .note-clamp.expanded {
  -webkit-line-clamp: unset; display: block;
}

.empty-hint { color: var(--text-3); font-size: calc(var(--f) * 0.95); padding: 8px 2px; }

/* ---------- Someday filter chips ---------- */
#someday-filter-chips { margin: 4px 0 6px; }

/* ---------- Add bar ---------- */
.add-wrap { flex: 0 0 auto; border-top: 1px solid var(--line); background: var(--card); }
#add-kind-chips { padding: 8px 10px 0; }
.add-bar {
  flex: 0 0 auto; display: flex; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 0; background: var(--card); align-items: flex-end;
}
.add-bar input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px;
  min-height: 44px; font-size: 16px; background: var(--bg);
}
.add-bar textarea {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font: inherit; font-size: 16px; background: var(--bg); resize: none; min-height: 66px;
}
.add-bar button {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; border: 0; background: var(--accent);
  color: var(--on-accent); font-weight: 700; font-size: calc(var(--f) * 1.3); cursor: pointer;
}
.add-bar button:disabled { opacity: .5; }
.add-hint { font-size: calc(var(--f) * 0.8); color: var(--text-3); padding: 0 12px 4px; }

/* ---------- Overlay / sheet (settings, confirm, previews) ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(74,58,64,0.35); display: flex; align-items: flex-end;
  justify-content: center; z-index: 50;
}
.frame { width: 100%; max-width: 640px; }
.sheet {
  background: var(--card); border-radius: 18px 18px 0 0; max-height: 88dvh; display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet-hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.sheet-hdr h2 { font-size: calc(var(--f) * 1.3); font-weight: 700; }
.sheet-hdr .ico {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; background: none; border: 0; border-radius: 10px; cursor: pointer; color: var(--text-2); font-size: calc(var(--f) * 1.2);
}
.sheet-body { overflow-y: auto; padding: 4px 16px 20px; flex: 1; min-height: 0; }
.sheet-foot { display: flex; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }

.settings-section { margin-bottom: 18px; }
.settings-section h3 { font-size: calc(var(--f) * 1.05); margin-bottom: 8px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.settings-row .lbl { font-size: calc(var(--f) * 0.98); }
.hint { font-size: calc(var(--f) * 0.84); color: var(--text-3); margin-top: 4px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: calc(var(--f) * .92); color: var(--text-2); margin-bottom: 5px; }
input[type="text"], input[type="password"], input[type="date"], input[type="time"], textarea {
  width: 100%; min-height: 44px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px;
  padding: 0 12px; background: var(--card); color: var(--text);
}

.chiprow { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  /* A pill with a visible fill can't use the .check-style negative-margin
     trick — margin repositions the box, it doesn't shrink the painted
     background/border, so the pill still looked 44px tall either way. The
     44px touch target (house style floor) instead comes from an invisible
     ::after that extends the hit area beyond the visibly smaller pill. */
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: calc(var(--f) * .95); min-height: 30px; min-width: 30px; padding: 6px 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
}
/* Vertical extension is generous (rows have room above/below); horizontal
   is kept small since chips sit only 8px apart in a row — a wide inset
   there would make neighboring chips' hit areas overlap. */
.chip::after { content: ""; position: absolute; inset: -7px -3px; }
.chip[aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }

.btn {
  /* Same visible-pill-vs-hit-area split as .chip above. */
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: calc(var(--f) * 1); min-height: 32px; padding: 7px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
}
.btn::after { content: ""; position: absolute; inset: -6px -3px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.ghost { background: none; }
.btn.danger { color: var(--coral); border-color: var(--coral); }

.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line); border: 0; cursor: pointer; flex: 0 0 44px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s ease; }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }

/* ---------- Toasts / aria-live ---------- */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(70px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 60; pointer-events: none; }
.toast {
  pointer-events: auto; background: var(--text); color: #fff; border-radius: 999px; padding: 8px 14px;
  font-size: calc(var(--f) * .95); display: flex; align-items: center; gap: 10px; max-width: 90vw;
}
.toast button { position: relative; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--accent-tint); font: inherit; font-weight: 700; cursor: pointer; min-height: 30px; padding: 0 4px; }
.toast button::after { content: ""; position: absolute; inset: -7px; }

/* ---------- Preview (snapshot-style read-only view) ---------- */
.preview-body { white-space: pre-wrap; word-break: break-word; font-size: calc(var(--f) * 1); padding: 8px 0; }

/* ---------- Empty state ---------- */
.start-hint { text-align: center; color: var(--text-3); font-size: calc(var(--f) * 0.95); padding: 24px 12px; }

.task-row.type-note .title { color: var(--text-2); }

/* Timeline shares Today's existing palette, typography and controls. */
[hidden] { display: none !important; }
.today-tabs { display: flex; gap: 4px; padding: 4px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
/* Visible pill kept close to the label; a transparent ::after keeps the 44px tap area. */
.today-tab { position: relative; min-height: 34px; flex: 1; padding: 6px 16px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; font-size: calc(var(--f) * 1.1); }
.today-tab::after { content: ""; position: absolute; inset: -6px 0; }
.today-tab[aria-current="page"] { background: var(--accent-tint); color: var(--on-accent); font-weight: 700; }
.tasks-panel, .timeline-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.timeline-panel { overflow: hidden; }
.timeline-toolbar { display: flex; align-items: center; gap: 4px; padding: 5px 10px; flex-shrink: 0; }
.timeline-toolbar .ico { position: relative; border: 0; background: transparent; min-width: 40px; min-height: 40px; font-size: 20px; }
.timeline-toolbar .ico::after { content: ""; position: absolute; inset: -2px; }
.timeline-date { flex: 1; min-width: 0; max-width: 190px; border: 0; background: transparent; padding: 6px 0; font-weight: 700; font-size: 16px; min-height: 36px; }
.timeline-toolbar .ghost { margin-left: auto; }
.timeline-viewbar { display: flex; align-items: center; padding: 0 12px 6px; gap: 5px; flex-shrink: 0; }
.timeline-viewbar > :last-child { margin-left: auto; }
.timeline-viewbar .chip { min-height: 34px; padding: 6px 12px; border-radius: 8px; }
.timeline-viewbar [aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent); color: var(--on-accent); }
.timeline-status { padding: 0 12px; margin: 0; flex-shrink: 0; }
.timeline-status:empty { display: none; }
.timeline-content { overflow-y: auto; flex: 1; min-height: 90px; padding: 8px 12px 16px; overscroll-behavior: contain; }
.timeline-current { margin: 0 12px 8px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-tint); flex-shrink: 0; max-height: 25vh; overflow-y: auto; }
.timeline-eyebrow { font-size: var(--f); font-weight: 700; color: var(--text-2); margin: 0 0 6px; }
.timeline-current-line { display: flex; gap: 6px; align-items: center; }
.timeline-current-line > div { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.timeline-current-line .hint { display: block; }
.timeline-current-line .btn { flex-shrink: 0; }
.timeline-composer { border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--bg); flex-shrink: 0; }
.timeline-composer > label { font-weight: 700; display: block; margin-bottom: 5px; }
.timeline-composer > input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); padding: 10px; font-size: 16px; }
.timeline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.timeline-composer .hint { margin-top: 5px; font-size: max(9px, calc(var(--f) * .85)); }
.timeline-error { color: var(--on-accent); font-weight: 700; margin-top: 8px; white-space: normal; overflow-wrap: anywhere; }
.timeline-error:empty { display: none; }
.timeline-empty { min-height: 180px; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 8px; color: var(--text-2); padding: 20px; }
.timeline-empty h2 { font-size: calc(var(--f) * 1.3); color: var(--text); }
.timeline-empty-clock { font-size: 38px; color: var(--on-accent); }
.timeline-list { display: grid; gap: 6px; }
.timeline-record { border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px 4px; background: var(--card); min-width: 0; }
.timeline-record.is-current { border-color: var(--accent); }
.timeline-record-main { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 40px; border: 0; text-align: left; background: transparent; cursor: pointer; padding: 3px 0; font-size: var(--f); }
.timeline-time { font-size: max(9px, calc(var(--f) * .88)); font-variant-numeric: tabular-nums; color: var(--text-2); overflow-wrap: anywhere; }
.timeline-title { font-size: calc(var(--f) * 1.08); overflow-wrap: anywhere; text-align: left; }
.timeline-title.muted { color: var(--text-3); font-style: italic; }
.timeline-badge { font-size: max(9px, calc(var(--f) * .85)); color: var(--on-accent); }
.timeline-add-end { display: inline-flex; width: auto; min-height: 26px; margin-top: 3px; padding: 3px 10px; text-align: left; font-size: max(10px, calc(var(--f) * .95)); }
.timeline-add-end::after { inset: -9px -6px; }
.timeline-grid { position: relative; min-height: 1500px; }
.timeline-hour { position: absolute; left: 0; right: 0; height: 1px; border-top: 1px solid var(--line); pointer-events: none; }
.timeline-hour > span { position: absolute; left: 0; top: 3px; width: 72px; font-size: max(9px, calc(var(--f) * .78)); color: var(--text-2); font-variant-numeric: tabular-nums; }
.timeline-mark { position: absolute; width: 6px; border-radius: 50%; background: var(--on-accent); pointer-events: none; }
.timeline-mark.interval { border: 1px solid var(--accent); border-radius: 3px; background: var(--accent-tint); }
.timeline-mark.running { border-color: var(--on-accent); border-style: dashed; }
.timeline-grid > .timeline-record { position: absolute; left: 116px; right: 0; }
.timeline-dialog { margin: auto; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--bg); font-size: var(--f); }
.timeline-dialog[open] { display: flex; flex-direction: column; }
.timeline-dialog::backdrop { background: rgb(68 37 49 / 25%); }
.timeline-dialog h2 { padding: 16px 16px 10px; font-size: max(16px, calc(var(--f) * 1.4)); }
.timeline-dialog-body { overflow-y: auto; padding: 4px 16px 16px; min-height: 0; }
.timeline-dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line); flex-shrink: 0; }
.timeline-field { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 5px; margin: 8px 0; font-size: max(10px, var(--f)); }
.timeline-field input, .timeline-field select { width: 100%; min-width: 0; min-height: 40px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); font-size: 16px; }
.timeline-fields { display: flex; gap: 10px; }
.timeline-check { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 8px 0; }
.timeline-check input { width: 24px; height: 24px; }
.timeline-markdown { display: block; width: 100%; min-height: 230px; margin-top: 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: var(--card); white-space: pre; overflow: auto; }
.timeline-conflict { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.timeline-conflict .btn { margin: 5px 0; }
@media (max-height: 540px) {
  .timeline-composer { padding-top: 5px; padding-bottom: calc(5px + env(safe-area-inset-bottom)); }
  .timeline-composer .hint, .timeline-composer > label { display: none; }
  .timeline-composer { display: grid; grid-template-columns: 1fr auto; gap: 5px; }
  .timeline-composer .timeline-actions { margin: 0; }
  .timeline-composer .timeline-error { grid-column: 1 / -1; }
  .timeline-current { max-height: 90px; }
}
@media (max-width: 360px) { .timeline-fields { flex-direction: column; gap: 0; } .timeline-toolbar { gap: 0; } }

@media(max-height:540px) and (max-width:430px){.timeline-composer{display:block}.timeline-composer .timeline-actions{margin-top:5px}.timeline-current{max-height:64px}}
