:root {
  --bg-primary:     #1a1a2e;
  --bg-section:     #16213e;
  --bg-input:       #0f3460;
  --bg-active:      #e94560;
  --bg-frank:       #1a2e1a;
  --bg-frank-active:#2e7d32;

  --text-primary:   #f0f0f0;
  --text-secondary: #a0a0b0;
  --text-on-active: #ffffff;

  --migraine-0:     #2e7d32;
  --migraine-1:     #558b2f;
  --migraine-2:     #f9a825;
  --migraine-3:     #ef6c00;
  --migraine-4:     #c62828;
  --migraine-5:     #7b1fa2;

  --stress-1:       #2e7d32;
  --stress-2:       #7cb342;
  --stress-3:       #f9a825;
  --stress-4:       #ef6c00;
  --stress-5:       #c62828;

  --med-accent:     #00838f;
  --milestone:      #4fc3f7;  /* light blue — milestone callouts */
  --med-accent-bg:  #002b2e;
  --med-accent-dim: rgba(0,131,143,0.18);

  --tap-min:        56px;
  --tap-min-wide:   72px;
  --font-base:      18px;
  --font-large:     24px;
  --font-xlarge:    36px;
  --radius:         12px;
  --section-gap:    16px;
  --bottombar-height: 80px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: var(--font-base);
  line-height: 1.4;
  color: var(--text-primary);
  background: var(--bg-primary);
}

/* ── HEADER ─────────────────────────────────── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: 56px;
  background: var(--bg-section);
  padding: 0 4px 0 16px;
}

.header-title {
  flex: 1;
  font-size: var(--font-large);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-icon-btn {
  min-width: 48px;
  height: 48px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 24px;
  color: var(--text-primary);
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.header-icon-btn:active {
  background: var(--bg-input);
}

/* ── MAIN CONTENT ───────────────────────────── */
#app-content {
  height: calc(100vh - 56px - var(--bottombar-height));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-panel {
  display: none;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--section-gap);
  padding-bottom: calc(var(--section-gap) * 2);
}

.tab-panel.active {
  display: block;
}

/* ── SECTION COMPONENT ──────────────────────── */
.tracker-section {
  background: var(--bg-section);
  border-radius: var(--radius);
  margin-bottom: var(--section-gap);
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--tap-min);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.section-arrow {
  font-size: 14px;
  color: var(--text-secondary);
  display: inline-block;
  width: 16px;
}

.section-arrow.collapsed {
  transform: rotate(-90deg);
}

.section-title {
  flex: 1;
  font-size: var(--font-large);
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.section-check {
  color: #2e7d32;
  font-size: var(--font-large);
  font-weight: 700;
}

.section-check.hidden { display: none; }

.section-body {
  padding: 12px 16px 16px;
}

.section-body.hidden { display: none; }

/* ── BUTTON GROUP ───────────────────────────── */
.btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.btn-group label {
  display: block;
  font-size: var(--font-base);
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.btn-group-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.btn {
  flex: 1;
  min-height: var(--tap-min);
  min-width: 44px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 8px;
}

.btn:hover {
  filter: brightness(1.1);
}

.btn.active {
  border-color: var(--text-primary);
  background: var(--bg-active);
  color: var(--text-on-active);
}

/* ── SCHEDULE SLOT STATES (shared) ───────────── */
/* Four variants per REQ_2: none / needed / done / late */

/* Interactive slot button on the DANI schedule list */
.slot-btn {
  flex: 1;
  min-height: var(--tap-min);
  min-width: 44px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--bg-input);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.slot-btn:disabled { cursor: default; }

/* Readonly indicator icon in the section header */
.slot-ind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  font-size: 16px;
  line-height: 1;
}

/* variant 1 — not needed / not available */
.slot-btn.state-none,
.slot-ind.state-none {
  background: rgba(255, 255, 255, 0.05);
  opacity: 0.3;
  filter: grayscale(1);
}

/* variant 2 — needed / selected / active (action required) */
.slot-btn.state-needed,
.slot-ind.state-needed {
  background: rgba(249, 168, 37, 0.14);
  border-color: var(--migraine-2);
}

/* variant 3 — done / executed */
.slot-btn.state-done,
.slot-ind.state-done {
  background: var(--bg-frank-active);
  border-color: var(--bg-frank-active);
}

/* variant 4 — late / missed */
.slot-btn.state-late,
.slot-ind.state-late {
  background: var(--migraine-4);
  border-color: var(--migraine-4);
}

/* Inline hint next to a field label */
.field-hint {
  font-weight: 400;
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0;
}

/* Slot picker buttons (schedule editor: time-of-day / start / when) */
.slot-btn-row {
  display: flex;
  gap: 6px;
  width: 100%;
  margin-bottom: 4px;
  border-radius: var(--radius);
}

/* Flash to draw attention to a required row on validation failure */
.slot-btn-row.attention {
  animation: slot-attn 0.5s ease 0s 3;
}
@keyframes slot-attn {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 69, 96, 0); }
  50%      { box-shadow: 0 0 0 3px var(--bg-active); }
}
.slot-pick {
  flex: 1;
  min-height: var(--tap-min);
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: var(--font-base);
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  line-height: 1.1;
}
.slot-pick.active {
  background: var(--med-accent);
  border-color: var(--med-accent);
  color: #fff;
}
.slot-pick:disabled {
  opacity: 0.35;
  cursor: default;
}

/* ── ICONS (thin-line inline SVG, stroke = currentColor) ── */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  flex: none;
}
.header-icon-btn .icon { width: 26px; height: 26px; }
.slot-ind { color: var(--text-primary); }
.slot-ind .icon { width: 18px; height: 18px; }
.slot-btn .icon { width: 24px; height: 24px; }
.slot-pick .icon { width: 1.3em; height: 1.3em; }
.stats-toggle .icon,
.med-ov-title .icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
}

/* Two fixed-color exceptions (everything else inherits via currentColor) */
.icon-migraine { color: var(--migraine-5); } /* purple — intensity 5 */
.icon-flame    { color: var(--stress-4);   } /* orange — stress 4 */
.icon-moonRed  { color: var(--migraine-4); } /* red — total lunar eclipse */

/* Medicine type icon in lists, liquid icons, inline label icons */
.med-icon .icon,
.med-list-name .icon,
.sched-name .icon,
.sched-item-name .icon,
.liquid-label .icon,
.frank-med-btn .icon,
.date-adj-btn .icon { width: 1.1em; height: 1.1em; vertical-align: -0.18em; }

/* Icons inside generic buttons (medicine type, hot-flash intensity) */
.btn .icon { width: 1.1em; height: 1.1em; vertical-align: -0.18em; }

/* Migraine / hot-flash icons inside the LOG week-view segment cells */
.log-seg-line .icon  { width: 15px; height: 15px; vertical-align: -2px; }
.log-seg-label .icon { width: 13px; height: 13px; vertical-align: -2px; }

/* ── BOTTOM BAR ─────────────────────────────── */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  min-height: var(--bottombar-height);
  background: var(--bg-section);
  border-top: 1px solid var(--bg-input);
  display: flex;
  align-items: flex-end;
  padding: 0 16px 12px;
  gap: 12px;
  z-index: 200;
}

#event-time-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.time-display {
  font-size: var(--font-xlarge);
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.time-display.frozen {
  border-bottom: 2px solid var(--bg-active);
}

.time-adjust-row {
  display: flex;
  gap: 6px;
}

.time-adj-btn {
  flex: 1;
  min-height: 44px;
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--font-base);
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.time-adj-btn:active {
  background: var(--bg-active);
  color: var(--text-on-active);
}

.date-display {
  font-size: var(--font-base);
  color: var(--text-secondary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.date-adjust-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-adj-btn {
  min-height: 44px;
  padding: 0 16px;
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--font-base);
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.date-adj-btn:active {
  background: var(--bg-active);
  color: var(--text-on-active);
}

.reset-link {
  font-size: 14px;
  color: var(--bg-active);
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

.reset-link.hidden { display: none; }

.bottom-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

/* Refresh — centered in the bar between the time block and SAVE */
#refresh-btn {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
#refresh-btn:active { background: var(--bg-active); }
#refresh-btn .icon { width: 26px; height: 26px; }
#refresh-btn.spinning .icon { animation: refresh-spin 0.6s linear; }
@keyframes refresh-spin { to { transform: rotate(360deg); } }

#log-btn {
  min-width: 64px;
  min-height: 56px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: var(--font-large);
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 14px;
}

#log-btn.active {
  background: #2e7d32;
  color: var(--text-on-active);
  border-color: transparent;
}

#save-btn {
  min-width: 72px;
  min-height: 56px;
  background: var(--bg-active);
  color: var(--text-on-active);
  border: none;
  border-radius: var(--radius);
  font-size: var(--font-large);
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0 16px;
}

#save-btn.inactive {
  background: var(--bg-input);
  color: var(--text-secondary);
  cursor: default;
}

#save-btn.success {
  background: #2e7d32;
}

#save-btn.error {
  background: var(--migraine-4);
}

.date-cal-btn {
  flex: 1;
}

/* ── CALENDAR OVERLAY ───────────────────────── */
.date-cal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.date-cal-overlay.hidden { display: none; }

.date-cal {
  background: var(--bg-section);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 480px;
  padding: 20px 16px calc(var(--bottombar-height) + 24px);
}

.date-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.date-cal-nav button {
  background: var(--bg-input);
  border: none;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--font-large);
  font-weight: 700;
  width: 56px;
  height: 56px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

#cal-month-year {
  font-size: var(--font-large);
  font-weight: 700;
  color: var(--text-primary);
}

.date-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 8px;
  text-align: center;
}

.date-cal-weekdays span {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 4px 0;
}

.date-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day, .cal-empty {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-large);
  font-weight: 600;
}

.cal-day {
  background: var(--bg-input);
  border: 2px solid transparent;
  color: var(--text-primary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.cal-empty { background: none; }

.cal-day.today { border-color: var(--text-secondary); }

.cal-day.selected {
  background: var(--bg-active);
  color: var(--text-on-active);
  border-color: var(--text-primary);
}

/* ── TOAST ──────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 480px;
  width: calc(100% - 32px);
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: var(--font-base);
  font-weight: 600;
  color: #fff;
  text-align: center;
}

.toast.success { background: #2e7d32; }
.toast.error   { background: var(--migraine-4); }
.toast.info    { background: var(--bg-input); color: var(--text-primary); }

/* ── ERROR SCREEN ───────────────────────────── */
#error-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 32px;
}

#error-screen.visible {
  display: flex;
}

#error-screen h1 {
  font-size: var(--font-xlarge);
  color: var(--migraine-4);
  margin-bottom: 16px;
}

#error-screen p {
  font-size: var(--font-large);
  color: var(--text-secondary);
}

/* ── MODAL ──────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 400;
  justify-content: center;
  align-items: flex-start;
  padding-top: 60px;
}

.modal-overlay.visible {
  display: flex;
}

.modal {
  background: var(--bg-section);
  border-radius: var(--radius);
  width: calc(100% - 32px);
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-title {
  font-size: var(--font-large);
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-large);
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── LOG OVERLAY (uses the .med-overlay fullscreen shell) ─────────── */
/* Its own accent so the header/footer borders match the app's pink. */
#log-overlay {
  --med-accent:    var(--bg-active);
  --med-accent-bg: var(--bg-primary);
}

.log-overlay.hidden { display: none; }

/* Date navigation strip below the header */
.log-subbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bg-input);
  flex-shrink: 0;
  background: rgba(0,0,0,0.2);
}
.log-subbar .log-nav-btn { min-height: 44px; min-width: 52px; }

.log-date-heading {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-align: center;
}

.log-entries {
  flex: 1;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  padding: 8px 0;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.log-entry {
  display: flex;
  gap: 14px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--bg-section);
}

.log-time {
  font-size: var(--font-base);
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 38px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.log-items {
  flex: 1;
  font-size: var(--font-base);
  color: var(--text-primary);
  line-height: 1.5;
}

.log-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.35);
  padding: 0 2px;
  flex-shrink: 0;
  align-self: center;
  transition: color 0.15s;
}
.log-delete-btn:hover { color: rgba(255, 255, 255, 0.9); }

.log-empty,
.log-loading {
  padding: 32px 16px;
  color: var(--text-secondary);
  font-size: var(--font-base);
  text-align: center;
}

.log-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--bg-input);
  flex-shrink: 0;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.log-nav-btn {
  min-width: 64px;
  min-height: 52px;
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--font-large);
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.log-nav-btn:disabled {
  color: var(--text-secondary);
  opacity: 0.4;
  cursor: default;
}

/* ── LOG TOPBAR (view toggle + heading) ─────── */
.log-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bg-input);
  flex-shrink: 0;
  background: var(--bg-section);
}

.log-view-toggle {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.log-close-btn {
  flex-shrink: 0;
  height: 36px;
  padding: 0 16px;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 2px solid var(--text-secondary);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.log-view-btn {
  height: 36px;
  padding: 0 14px;
  background: var(--bg-input);
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.log-view-btn.active {
  background: var(--bg-active);
  color: var(--text-on-active);
}

/* ── LOG DAY VIEW ───────────────────────────── */
.log-day-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── LOG WEEK VIEW ──────────────────────────── */
.log-week-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.log-week-header {
  display: grid;
  grid-template-columns: 62px repeat(7, 1fr);
  flex-shrink: 0;
  background: var(--bg-section);
  border-bottom: 2px solid var(--bg-input);
}

.wh-gutter { /* empty top-left corner */ }

.wh-day {
  text-align: center;
  padding: 4px 2px;
  border-left: 1px solid var(--bg-input);
  line-height: 1.3;
}

.wh-date {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.wh-name {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
}

.wh-today .wh-date {
  color: var(--bg-active);
}

/* Three segment rows fill the available height — no vertical scrollbar. */
.log-week-scroll {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.log-week-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.log-week-row {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 62px repeat(7, 1fr);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.log-seg-label {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding-top: 3px;
  padding-left: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.log-week-cell {
  border-left: 1px solid rgba(255,255,255,0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px 1px;
}

.log-week-cell.has-events {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.log-seg-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  line-height: 1;
}

/* ── LOG DETAIL POPUP ───────────────────────── */
.log-detail-popup {
  position: fixed;
  bottom: calc(var(--bottombar-height) + 12px);
  left: 12px;
  right: 12px;
  background: var(--bg-section);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 12px 44px 14px 14px;
  z-index: 400;
  line-height: 1.5;
}

.log-detail-popup.hidden { display: none; }

.log-detail-close {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--font-large);
  cursor: pointer;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.log-detail-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.log-detail-text {
  font-size: var(--font-base);
  color: var(--text-primary);
  word-break: break-word;
  white-space: pre-line;
}

/* ── INPUTS ─────────────────────────────────── */
.text-input,
.search-input,
textarea {
  width: 100%;
  min-height: var(--tap-min);
  background: var(--bg-input);
  border: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: var(--font-base);
  padding: 8px 12px;
  font-family: inherit;
}

.text-input:focus,
.search-input:focus,
textarea:focus {
  outline: none;
  border-color: var(--bg-active);
}

textarea {
  min-height: 90px;
  resize: vertical;
}

.text-input::placeholder,
.search-input::placeholder,
textarea::placeholder {
  color: var(--text-secondary);
}

/* ── LABEL ──────────────────────────────────── */
.field-label {
  display: block;
  font-size: var(--font-base);
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  margin-top: 12px;
}

.field-label:first-child { margin-top: 0; }

/* ── UTILITY ────────────────────────────────── */
.hidden { display: none !important; }

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-input);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: var(--font-base);
  min-height: 40px;
}

.chip-remove {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  line-height: 1;
  min-width: 24px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.nova-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
}

.nova-1 { background: #2e7d32; color: #fff; }
.nova-2 { background: #7cb342; color: #fff; }
.nova-3 { background: #ef6c00; color: #fff; }
.nova-4 { background: #c62828; color: #fff; }
