  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
  button, a, select, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  :root {
    --bg: #f6f1eb; --bg-warm: #efe8df; --surface: #fffcf8;
    --border: #e0d6c8; --text: #3a322a; --text-soft: #7d7167;
    --text-faint: #b0a698; --accent: #c4704b; --accent-soft: #d4946f;
    --accent-hover: #b3623f; --green: #6b8f71; --red: #b85c5c;
    --cat-deep: #5a8a65; --cat-meetings: #d4864b; --cat-admin: #c4a04b;
    --cat-personal: #9b8e82; --cat-sleep: #5b82b5; --cat-waste: #b85c5c;
    --shadow: rgba(58,50,42,0.1); --shadow-strong: rgba(58,50,42,0.12);
    --overlay-dim: rgba(58,50,42,0.18); --overlay-alert: rgba(196,112,75,0.08);
    --pulse-highlight: #f0ddd0; --pie-label-bg: rgba(255,252,248,0.92);
    --ring-blue: #3a6b8c;
  }
  [data-theme="dark"] {
    --bg: #1e1a17; --bg-warm: #2a2420; --surface: #332c26;
    --border: #4d443a; --text: #e8ddd0; --text-soft: #b5a898;
    --text-faint: #7d7168; --accent: #d4864b; --accent-soft: #c4704b;
    --accent-hover: #e0955a; --green: #7da882; --red: #d47070;
    --cat-deep: #6da878; --cat-meetings: #e09458; --cat-admin: #d4b05a;
    --cat-personal: #b0a090; --cat-sleep: #6d96c8; --cat-waste: #d47070;
    --shadow: rgba(0,0,0,0.25); --shadow-strong: rgba(0,0,0,0.3);
    --overlay-dim: rgba(0,0,0,0.4); --overlay-alert: rgba(196,112,75,0.12);
    --pulse-highlight: #2e2218; --pie-label-bg: rgba(51,44,38,0.94);
    --ring-blue: #5a9bc0;
  }
  html, body { height: 100%; }
  html { font-size: 16px; }
  body { font-family: 'Source Sans 3', sans-serif; background: var(--bg); color: var(--text); height: 100%; transition: background-color 0.4s ease, color 0.4s ease; line-height: 1.6; overflow: hidden; position: relative; }
  body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.20; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.227  0 0 0 0 0.196  0 0 0 0 0.165  0.55 0 0 0 -0.22'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"); }
  body > * { position: relative; z-index: 1; }
  .no-transition, .no-transition *, .no-transition *::before, .no-transition *::after { transition: none !important; }
  @supports (height: 100dvh) { body { height: 100dvh; } }
  body.alerting { animation: pulse-bg 1.8s ease-in-out infinite; }
  @keyframes pulse-bg { 0%,100% { background-color: var(--bg); } 50% { background-color: var(--pulse-highlight); } }

  .container { max-width: 640px; margin: 0 auto; padding: 1rem 1.25rem 0.75rem; height: 100%; display: flex; flex-direction: column; overflow: hidden; }
  .container-scroll { max-width: 640px; margin: 0 auto; padding: 1.5rem 1.5rem 4rem; }

  .view-scroll { overflow-y: auto !important; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
  .view-scroll::-webkit-scrollbar { width: 5px; }
  .view-scroll::-webkit-scrollbar-track { background: transparent; }
  .view-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .view-scroll::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

  header { display: flex; align-items: center; justify-content: center; position: relative; margin-bottom: 0.5rem; flex-shrink: 0; }
  .header-center { text-align: center; }
  h1 { font-family: 'Cinzel', serif; font-weight: 500; font-size: 1.7rem; letter-spacing: -0.02em; margin-bottom: 0.1rem; }
  .subtitle { font-size: 0.85rem; color: var(--text-soft); font-weight: 300; }

  .menu-btn { position: absolute; right: 0; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 0.4rem; color: var(--text-soft); transition: color 0.2s; border-radius: 6px; }
  .menu-btn:hover { color: var(--text); }
  .menu-btn svg { width: 22px; height: 22px; display: block; }
  .menu-dropdown { display: none; position: absolute; top: calc(100% + 0.5rem); right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 6px 24px var(--shadow); min-width: 220px; z-index: 50; padding: 0.5rem 0; }
  .menu-dropdown.open { display: block; }
  .menu-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.6rem 1rem; background: none; border: none; font-family: 'Source Sans 3', sans-serif; font-size: 0.88rem; color: var(--text); cursor: pointer; transition: background 0.15s; text-align: left; }
  .menu-item:hover { background: var(--bg-warm); }
  .menu-item svg { width: 16px; height: 16px; color: var(--text-faint); flex-shrink: 0; }
  .menu-item.danger { color: var(--red); }
  .menu-item.danger svg { color: var(--red); }
  .menu-divider { height: 1px; background: var(--border); margin: 0.35rem 0; }
  .menu-tz-section { padding: 0.5rem 1rem 0.6rem; }
  .menu-tz-label { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); margin-bottom: 0.35rem; }
  .tz-select { width: 100%; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; font-family: 'Source Sans 3', sans-serif; font-size: 0.82rem; color: var(--text); background: var(--bg); outline: none; cursor: pointer; }
  .tz-select:focus { border-color: var(--accent); }

  /* Timer area: ring + controls */
  .timer-area { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-bottom: 0.75rem; flex-shrink: 0; }

  .timer-ring { width: 140px; height: 140px; position: relative; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .timer-ring svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform: rotate(-90deg) scaleY(-1); }
  .timer-ring .outer-track { fill: none; stroke: var(--border); stroke-width: 2; opacity: 0.3; transition: stroke-width 0.3s, opacity 0.3s; }
  .timer-ring .outer-progress { fill: none; stroke: var(--ring-blue); stroke-width: 2; stroke-linecap: round; transition: stroke 0.5s, stroke-width 0.3s; }
  .timer-ring .outer-progress.animated { transition: stroke-dashoffset 60s linear, stroke 0.5s, stroke-width 0.3s; }
  .timer-ring.ring-hover .outer-track { stroke-width: 4; opacity: 0.4; }
  .timer-ring.ring-hover .outer-progress { stroke-width: 4; }
  .timer-ring .track { fill: none; stroke: var(--border); stroke-width: 3; }
  .timer-ring .progress { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
  .timer-display { font-family: 'Cinzel', serif; font-size: 1.9rem; font-weight: 400; z-index: 1; }
  .timer-ring-info { display: none; font-size: 0.85rem; position: absolute; text-align: center; line-height: 1.3; padding: 0 1.5rem; }

  /* Control buttons column */
  .timer-controls { display: flex; flex-direction: column; gap: 0.5rem; width: 140px; }

  .ctrl-btn {
    font-family: 'Source Sans 3', sans-serif; font-size: 0.82rem; font-weight: 500;
    background: var(--surface); color: var(--text-soft);
    border: 1.5px solid var(--border); border-radius: 8px;
    padding: 0.45rem 0.9rem; cursor: pointer; transition: all 0.2s; width: 100%; box-sizing: border-box;
    display: flex; align-items: center; justify-content: center; gap: 0.4rem; white-space: nowrap;
    position: relative; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  }
  .ctrl-btn:hover { border-color: var(--accent-soft); color: var(--text); }
  .ctrl-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

  .ctrl-btn.stop:hover { border-color: var(--red); color: var(--red); }
  .ctrl-btn.distracted.active { background: var(--red); color: #fff; border-color: var(--red); }
  .ctrl-btn.distracted.active:hover { background: #a04e4e; }
  .ctrl-btn.focus-on { background: var(--cat-deep); color: #fff; border-color: var(--cat-deep); }
  .ctrl-btn.focus-on:hover { background: #4d7a58; }

  /* Focus dropdown */
  .focus-dropdown {
    display: none; position: absolute; top: calc(100% + 4px); left: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 4px 16px var(--shadow);
    z-index: 10; padding: 0.3rem 0; min-width: 120px;
  }
  .focus-dropdown.open { display: block; }
  .focus-opt {
    display: block; width: 100%; padding: 0.4rem 0.8rem; background: none; border: none;
    font-family: 'Source Sans 3', sans-serif; font-size: 0.82rem; color: var(--text);
    cursor: pointer; text-align: left; transition: background 0.15s;
  }
  .focus-opt:hover { background: var(--bg-warm); }

  .start-area { display: flex; flex-direction: column; align-items: stretch; gap: 0.4rem; width: 140px; }
  .btn-start { font-family: 'Source Sans 3', sans-serif; font-size: 0.82rem; font-weight: 500; background: var(--accent); color: #fff; border: 1.5px solid var(--accent); border-radius: 8px; padding: 0.45rem 0.9rem; cursor: pointer; transition: all 0.2s; width: 100%; box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 0.4rem; white-space: nowrap; }
  .btn-start svg { width: 14px; height: 14px; flex-shrink: 0; }
  .btn-start:hover { background: #b3623f; }
  .start-hint { font-size: 0.8rem; color: var(--text-faint); margin: 0; }

  .hidden { display: none !important; }

  .overlay { display: none; position: fixed; inset: 0; z-index: 100; align-items: center; justify-content: center; animation: fade-in 0.15s ease; overflow-y: auto; padding: 1rem 0; }
  .overlay.active { display: flex; }
  .overlay-alert { background: var(--overlay-alert); backdrop-filter: blur(2px); }
  .overlay-dim { background: var(--overlay-dim); backdrop-filter: blur(2px); }
  @keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

  .card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 2rem 2rem 1.5rem; width: 90%; max-width: 440px; box-shadow: 0 8px 40px var(--shadow-strong); animation: slide-up 0.35s ease; }
  @keyframes slide-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
  .card h2 { font-family: 'Cinzel', serif; font-weight: 500; font-size: 1.3rem; margin-bottom: 0.25rem; }
  .card-sub { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 1.25rem; }

  .alert-input { width: 100%; padding: 0.75rem 1rem; border: 1.5px solid var(--border); border-radius: 8px; font-family: 'Source Sans 3', sans-serif; font-size: 1rem; color: var(--text); background: var(--bg); outline: none; transition: border-color 0.2s; }
  .alert-input:focus { border-color: var(--accent); }
  .alert-input::placeholder { color: var(--text-faint); }
  .alert-actions { display: flex; gap: 0.75rem; margin-top: 1rem; flex-wrap: wrap; }

  .btn { font-family: 'Source Sans 3', sans-serif; font-size: 0.9rem; font-weight: 500; border: none; border-radius: 8px; padding: 0.6rem 1.25rem; cursor: pointer; transition: all 0.2s; }
  .btn-primary { background: var(--accent); color: #fff; flex: 1; }
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-primary:disabled { opacity: 0.4; cursor: default; }
  .btn-skip { background: var(--bg-warm); color: var(--text-soft); }
  .btn-skip:hover { background: var(--border); }

  .snooze-row { display: flex; gap: 0.5rem; margin-top: 0.75rem; align-items: center; }
  .snooze-label { font-size: 0.78rem; color: var(--text-faint); white-space: nowrap; }
  .btn-snooze { font-family: 'Source Sans 3', sans-serif; font-size: 0.78rem; font-weight: 500; background: none; color: var(--text-soft); border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.65rem; cursor: pointer; transition: all 0.2s; }
  .btn-snooze:hover { border-color: var(--accent-soft); color: var(--text); }

  .btn-repeat {
    font-family: 'Source Sans 3', sans-serif; font-size: 0.82rem; font-weight: 500;
    background: var(--bg-warm); color: var(--text-soft);
    border: 1px solid var(--border); border-radius: 6px;
    padding: 0.35rem 0.7rem; cursor: pointer; transition: all 0.2s;
    margin-top: 0.5rem; display: inline-flex; align-items: center; gap: 0.35rem;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .btn-repeat:hover { border-color: var(--accent-soft); color: var(--text); }

  .split-block { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem 0.75rem; margin-bottom: 0.5rem; background: var(--bg); }
  .split-block-time { font-size: 0.78rem; color: var(--text-faint); margin-bottom: 0.35rem; }
  .split-block input { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; font-family: 'Source Sans 3', sans-serif; font-size: 0.92rem; color: var(--text); background: var(--surface); outline: none; }
  .split-block input:focus { border-color: var(--accent); }
  .split-block input::placeholder { color: var(--text-faint); }
  .btn-remove-split { font-size: 0.78rem; color: var(--text-faint); background: none; border: none; cursor: pointer; padding: 0; margin-bottom: 0.75rem; transition: color 0.15s; }
  .btn-remove-split:hover { color: var(--text); }

  .quick-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.75rem; }
  .chip { font-family: 'Source Sans 3', sans-serif; font-size: 0.78rem; font-weight: 500; background: var(--bg-warm); color: var(--text-soft); border: 1px solid transparent; border-radius: 20px; padding: 0.25rem 0.7rem; cursor: pointer; transition: all 0.15s; }
  .chip:hover { border-color: var(--accent-soft); color: var(--text); }

  .section-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; flex-shrink: 0; }
  .section-title { font-family: 'Cinzel', serif; font-weight: 500; font-size: 1.1rem; }
  .btn-icon { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.45rem 0.7rem; cursor: pointer; display: flex; align-items: center; gap: 0.35rem; font-family: 'Source Sans 3', sans-serif; font-size: 0.8rem; color: var(--text-soft); transition: all 0.2s; }
  .btn-icon:hover { border-color: var(--accent-soft); color: var(--text); }
  .btn-icon svg { width: 15px; height: 15px; }

  .day-group { margin-bottom: 1.5rem; }
  .day-group:last-child { margin-bottom: 0; }
  #timeline { flex: 1; min-height: 200px; overflow-y: auto; padding-right: 0.25rem; }
  .timeline-footer { flex-shrink: 0; }
  #timeline::-webkit-scrollbar { width: 5px; }
  #timeline::-webkit-scrollbar-track { background: transparent; }
  #timeline::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .day-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 0.6rem; padding-left: 0.25rem; }

  .entry { display: flex; align-items: flex-start; gap: 1rem; padding: 0.7rem 0.9rem; border-radius: 8px; transition: background 0.15s; cursor: pointer; }
  .entry:hover { background: var(--bg-warm); }
  .entry-time { font-size: 0.82rem; color: var(--text-faint); white-space: nowrap; min-width: 100px; padding-top: 1px; font-variant-numeric: tabular-nums; }
  .entry-time.overlap { color: var(--accent); font-weight: 600; }
  .entry-text { font-size: 0.95rem; flex: 1; }
  .entry-text.skipped { color: var(--accent); font-style: italic; }

  .gap-row { display: flex; align-items: center; gap: 1rem; padding: 0.35rem 0.9rem; cursor: pointer; border-radius: 8px; transition: background 0.15s; }
  .gap-row:hover { background: var(--bg-warm); }
  .gap-time { font-size: 0.78rem; color: var(--text-faint); white-space: nowrap; min-width: 100px; font-variant-numeric: tabular-nums; }
  .gap-label { font-size: 0.82rem; color: var(--border); font-style: italic; }

  .empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-faint); font-size: 0.92rem; line-height: 1.7; }
  .empty-state .icon { font-size: 2rem; margin-bottom: 0.5rem; opacity: 0.4; }

  .prelog-bar { display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 0.5rem 0; }
  .prelog-input { flex: 1; font-family: 'Source Sans 3', sans-serif; font-size: 0.92rem; padding: 0.55rem 0.75rem; border: 1.5px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); outline: none; transition: border-color 0.2s; }
  .prelog-input:focus { border-color: var(--accent); }
  .prelog-input::placeholder { color: var(--text-faint); }
  .prelog-clear { font-size: 1.2rem; background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 0.25rem 0.4rem; border-radius: 6px; line-height: 1; }
  .prelog-clear:hover { color: var(--text); background: var(--bg-warm); }
  .prelog-clear.hidden { display: none; }

  .analyze-bar { text-align: center; margin-top: 0.5rem; padding-top: 0.5rem; }

  .tracked-summary {
    text-align: center; font-size: 0.82rem; color: var(--text-faint);
    padding-top: 1rem; margin-top: 0.75rem;
    border-top: 1px solid var(--border);
  }
  .btn-analyze { font-family: 'Source Sans 3', sans-serif; font-size: 0.88rem; font-weight: 500; background: var(--surface); color: var(--accent); border: 1.5px solid var(--accent); border-radius: 10px; padding: 0.6rem 1.5rem; cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; gap: 0.5rem; }
  .btn-analyze:hover { background: var(--accent); color: #fff; }
  .btn-analyze:disabled, .btn-analyze.disabled { opacity: 0.4; cursor: default; }
  .btn-analyze svg { width: 16px; height: 16px; }

  .edit-split-row { display: flex; gap: 0.5rem; margin-top: 0.75rem; align-items: center; }
  .btn-split-open { font-family: 'Source Sans 3', sans-serif; font-size: 0.82rem; font-weight: 500; background: none; color: var(--accent); border: 1px solid var(--accent-soft); border-radius: 8px; padding: 0.4rem 0.8rem; cursor: pointer; transition: all 0.2s; }
  .btn-split-open:hover { background: var(--accent-soft); color: var(--text); }
  .merged-label { font-size: 0.82rem; font-weight: 500; color: var(--text-faint); border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.8rem; }
  .merged-entries { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.75rem; }
  .merged-entry-row { display: flex; align-items: center; justify-content: space-between; padding: 0.5rem 0.7rem; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: all 0.15s; font-size: 0.85rem; }
  .merged-entry-row:hover { border-color: var(--accent-soft); background: var(--bg-warm); }
  .merged-entry-row .merged-entry-time { color: var(--text-faint); font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .merged-entry-row .merged-entry-edit { color: var(--accent); font-size: 0.78rem; font-weight: 500; margin-left: 0.5rem; }

  .split-slider-area { margin: 1rem 0; }
  .split-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-faint); margin-top: 0.25rem; }
  .split-entries { display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
  .split-entry-block { width: 100%; }
  .split-entry-time { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 0.25rem; font-variant-numeric: tabular-nums; }
  .btn-swap { background: none; border: 1px solid var(--border); border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-soft); transition: all 0.2s; }
  .btn-swap:hover { border-color: var(--accent); color: var(--accent); }

  .field-row { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; }
  .field-group { flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }
  .field-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
  .field-input { width: 100%; padding: 0.55rem 0.75rem; border: 1.5px solid var(--border); border-radius: 8px; font-family: 'Source Sans 3', sans-serif; font-size: 0.92rem; color: var(--text); background: var(--bg); outline: none; transition: border-color 0.2s; }
  .field-input:focus { border-color: var(--accent); }
  .backfill-hint { font-size: 0.78rem; color: var(--text-faint); margin-bottom: 0.75rem; }

  .card-scroll { display: flex; flex-direction: column; max-height: 85vh; }
  .card-scroll > h2 { flex-shrink: 0; }
  .card-scroll-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; margin: 0 -2rem; padding: 0.25rem 2rem 0.5rem; }
  .card-scroll-footer { flex-shrink: 0; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
  .about-form-flex { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
  @media (max-width: 600px) { .card-scroll { max-height: calc(100vh - 4rem); } }

  .daily-quote { margin: 2rem auto 2rem; padding: 1rem; max-width: 640px; text-align: center; border-top: 1px solid var(--border); }
  .daily-quote blockquote { font-family: 'EB Garamond', serif; font-style: italic; font-size: 1.15rem; line-height: 1.55; color: var(--text); margin: 0 0 0.5rem; }
  .daily-quote figcaption { font-family: 'Cinzel', serif; font-size: 0.72rem; font-weight: 500; color: var(--text-faint); letter-spacing: 0.12em; text-transform: uppercase; }

  .about-logo { display: block; width: 84px; height: 84px; object-fit: contain; margin: 0 auto 0.75rem; }

  .about-content p { font-size: 0.92rem; line-height: 1.55; margin: 0 0 0.85rem; color: var(--text); }
  .about-content p:last-child { margin-bottom: 0; }
  .about-form .form-row { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
  .about-form .form-row label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint); }
  .about-form textarea.field-input { resize: vertical; min-height: 80px; font-family: inherit; }
  .contact-status { font-size: 0.85rem; color: var(--accent); margin: 0.5rem 0 0; }

  .confirm-backdrop { display: none; position: fixed; inset: 0; background: var(--overlay-dim); z-index: 200; align-items: center; justify-content: center; }
  .confirm-backdrop.active { display: flex; }
  .confirm-box { background: var(--surface); border-radius: 12px; padding: 1.5rem; width: 90%; max-width: 340px; box-shadow: 0 8px 40px var(--shadow-strong); text-align: center; }
  .confirm-box p { margin-bottom: 1.25rem; font-size: 0.95rem; }
  .confirm-box .alert-actions { justify-content: center; }
  .status-toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--bg); padding: 0.55rem 1.2rem; border-radius: 8px; font-size: 0.85rem; opacity: 0; transition: all 0.3s ease; z-index: 300; pointer-events: none; }
  .status-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* Wizard & Results (unchanged styles) */
  .view { display: none; height: 100%; overflow: hidden; } .view.active { display: block; }
  #viewMain.active { overflow-y: auto; }
  #viewMain > .container { height: 100vh; }
  .wizard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
  .wizard-header h2 { font-family: 'Cinzel', serif; font-weight: 500; font-size: 1.4rem; }
  .wizard-sub { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 1.25rem; }
  .wiz-entry { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 0.5rem; background: var(--surface); }
  .wiz-entry-time { font-size: 0.78rem; color: var(--text-faint); white-space: nowrap; min-width: 90px; font-variant-numeric: tabular-nums; }
  .wiz-entry-text { font-size: 0.88rem; flex: 1; min-width: 0; }
  .wiz-entry-text.skipped { color: var(--text-faint); font-style: italic; }
  .cat-select { font-family: 'Source Sans 3', sans-serif; font-size: 0.78rem; padding: 0.3rem 0.45rem; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); outline: none; cursor: pointer; flex-shrink: 0; }
  .cat-select:focus { border-color: var(--accent); }
  .cat-select.unset { border-color: var(--accent); border-width: 1.5px; }
  .wiz-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 0.25rem; margin-bottom: 1.25rem; }

  .wiz-group {
    border: 1px solid var(--border); border-radius: 8px;
    margin-bottom: 0.5rem; background: var(--surface); overflow: hidden;
  }
  .wiz-group-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.6rem 0.75rem;
  }
  .wiz-group-info { flex: 1; min-width: 0; }
  .wiz-group-text { font-size: 0.88rem; }
  .wiz-group-text.skipped { color: var(--text-faint); font-style: italic; }
  .wiz-day-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin: 1.25rem 0 0.5rem; padding-left: 0.25rem; border-top: 1px solid var(--border); padding-top: 0.75rem; }
  .wiz-group-meta { font-size: 0.75rem; color: var(--text-faint); margin-top: 0.1rem; }
  .wiz-group-times {
    padding: 0 0.75rem 0.5rem;
    font-size: 0.75rem; color: var(--text-faint);
    line-height: 1.5;
  }
  .wiz-scroll::-webkit-scrollbar { width: 5px; }
  .wiz-scroll::-webkit-scrollbar-track { background: transparent; }
  .wiz-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .wiz-actions { display: flex; gap: 0.75rem; }
  .results-container { padding-bottom: 0.75rem; }
  .results-header { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 0.5rem; position: relative; flex-shrink: 0; }
  .day-nav { background: none; border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-soft); transition: all 0.2s; }
  .day-nav:hover { border-color: var(--accent-soft); color: var(--text); }
  .day-nav:disabled { opacity: 0.3; cursor: default; }
  .day-nav svg { width: 16px; height: 16px; }
  .results-date { font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 500; min-width: 180px; text-align: center; }
  .results-hero { display: flex; align-items: center; gap: 1.5rem; margin-bottom: 1rem; flex-shrink: 0; }
  .pie-container { display: flex; justify-content: center; position: relative; flex-shrink: 0; }
  .focus-metrics { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; }
  .focus-metric { margin-bottom: 0; }
  .focus-metric-value { font-family: 'Cinzel', serif; font-size: 1.25rem; font-weight: 500; color: var(--text); line-height: 1.2; }
  .focus-metric-label { font-size: 0.75rem; color: var(--text-faint); line-height: 1.3; }
  .info-btn { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--text-faint); background: none; color: var(--text-faint); font-size: 0.6rem; font-style: italic; font-family: serif; cursor: pointer; padding: 0; vertical-align: middle; margin-left: 2px; transition: all 0.2s; }
  .info-btn:hover { border-color: var(--accent); color: var(--accent); }
  .info-tooltip { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--text); color: var(--bg); font-size: 0.75rem; padding: 8px 10px; border-radius: 8px; line-height: 1.4; z-index: 10; animation: fadeIn 0.2s; }
  @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
  @media (max-width: 480px) {
    .results-hero { flex-direction: column; gap: 0.75rem; }
    .focus-metrics { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 0.75rem; text-align: center; }
    .focus-metric { margin-bottom: 0; }
  }
  .pie-container svg { overflow: visible; }
  .pie-slice { transition: opacity 0.2s, transform 0.2s; transform-origin: 85px 85px; cursor: pointer; }
  .pie-container.has-hover .pie-slice { opacity: 0.3; }
  .pie-container.has-hover .pie-slice.active { opacity: 1; transform: scale(1.06); }
  .pie-slice:hover { opacity: 1 !important; transform: scale(1.06); }
  .pie-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; pointer-events: none; opacity: 0; transition: opacity 0.2s; background: var(--pie-label-bg); padding: 0.5rem 0.75rem; border-radius: 8px; box-shadow: 0 2px 8px var(--shadow-strong); }
  .pie-label.visible { opacity: 1; }
  .pie-label-cat { font-family: 'Cinzel', serif; font-size: 0.95rem; font-weight: 500; color: var(--text); margin-bottom: 0.1rem; }
  .pie-label-time { font-size: 0.82rem; color: var(--text); font-weight: 500; }
  .pie-label-pct { font-size: 0.78rem; color: var(--text-soft); margin-top: 0.1rem; }
  .results-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-right: 0.25rem; }
  .results-scroll::-webkit-scrollbar { width: 5px; }
  .results-scroll::-webkit-scrollbar-track { background: transparent; }
  .results-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .breakdown { margin-bottom: 0.75rem; }
  .breakdown-title { font-family: 'Cinzel', serif; font-weight: 500; font-size: 1.1rem; margin-bottom: 0.75rem; }
  .breakdown-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
  .breakdown-row:last-child { border-bottom: none; }
  .breakdown-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
  .breakdown-label { font-size: 0.9rem; flex: 1; }
  .breakdown-time { font-size: 0.88rem; color: var(--text-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .breakdown-pct { font-size: 0.82rem; color: var(--text-faint); min-width: 36px; text-align: right; }
  .waste-section { border-top: 1px solid var(--border); padding-top: 0.75rem; }
  .waste-title { font-family: 'Cinzel', serif; font-weight: 500; font-size: 1rem; color: var(--red); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
  .waste-item { padding: 0.5rem 0.75rem; border-left: 3px solid var(--red); margin-bottom: 0.5rem; font-size: 0.9rem; }
  .waste-item-time { font-size: 0.78rem; color: var(--text-faint); }
  .results-back { font-family: 'Source Sans 3', sans-serif; font-size: 0.88rem; background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; transition: color 0.2s; display: flex; align-items: center; gap: 0.3rem; position: absolute; left: 0; top: 50%; transform: translateY(-50%); }
  .results-back:hover { color: var(--accent-hover); }
  .results-back svg { width: 16px; height: 16px; }
  .results-export { font-family: 'Source Sans 3', sans-serif; font-size: 0.82rem; font-weight: 500; background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; transition: color 0.2s; display: flex; align-items: center; gap: 0.3rem; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
  .results-export:hover { color: var(--accent-hover); }
  .results-export svg { width: 15px; height: 15px; }

  .results-title {
    font-family: 'Cinzel', serif; font-weight: 500; font-size: 1.15rem;
    text-align: center; margin-bottom: 0.75rem; color: var(--text); flex-shrink: 0;
  }
  .no-waste { color: var(--green); font-size: 0.92rem; padding: 1rem 0; }

  .wiz-edit-btn { font-family: 'Source Sans 3', sans-serif; font-size: 0.82rem; font-weight: 500; background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; transition: color 0.2s; display: flex; align-items: center; gap: 0.3rem; }
  .wiz-edit-btn:hover { color: var(--accent-hover); }
  .wiz-edit-btn svg { width: 15px; height: 15px; }

  .cat-editor-list { list-style: none; padding: 0; margin: 0.75rem 0; max-height: 360px; overflow-y: auto; }
  .cat-editor-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--border); }
  .cat-editor-item:last-child { border-bottom: none; }
  .cat-editor-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
  .cat-editor-label { flex: 1; font-size: 0.9rem; min-width: 0; }
  .cat-editor-label input { width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 0.3rem 0.5rem; font-family: 'Source Sans 3', sans-serif; font-size: 0.85rem; color: var(--text); background: var(--bg); outline: none; }
  .cat-editor-label input:focus { border-color: var(--accent); }
  .cat-editor-arrows { display: flex; flex-direction: column; gap: 2px; }
  .cat-editor-arrows button { background: none; border: 1px solid var(--border); border-radius: 4px; width: 22px; height: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-soft); padding: 0; transition: all 0.15s; }
  .cat-editor-arrows button:hover { border-color: var(--accent-soft); color: var(--text); }
  .cat-editor-arrows button:disabled { opacity: 0.2; cursor: default; }
  .cat-editor-remove { background: none; border: none; color: var(--text-faint); cursor: pointer; padding: 0.2rem; transition: color 0.15s; }
  .cat-editor-remove:hover { color: var(--red); }
  .cat-mode-toggle { font-size: 0.7rem; color: var(--text-faint); cursor: pointer; display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
  .cat-mode-toggle input { width: 14px; height: 14px; margin: 0; }
  .cat-mode-toggle input:disabled { opacity: 0.4; }

  .settings-list { margin: 1rem 0 0; }
  .settings-row { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0; gap: 0.75rem; }
  .settings-row-with-hint { align-items: flex-start; }
  .settings-label-group { display: flex; flex-direction: column; gap: 0.15rem; flex: 1; min-width: 0; }
  .settings-hint { font-size: 0.72rem; color: var(--text-faint); line-height: 1.35; }
  .settings-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; color: var(--text); }
  .settings-divider { height: 1px; background: var(--border); margin: 0.25rem 0; }
  .toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
  .toggle-switch input { opacity: 0; width: 0; height: 0; }
  .toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 24px; transition: 0.2s; }
  .toggle-slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
  .toggle-switch input:checked + .toggle-slider { background: var(--accent); }
  .toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }
  .mode-toggle { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
  .mode-btn { padding: 0.35rem 0.75rem; font-size: 0.82rem; border: none; background: none; cursor: pointer; color: var(--text-soft); font-family: inherit; transition: all 0.2s; }
  .mode-btn.active { background: var(--accent); color: #fff; }
  .cat-editor-remove svg { width: 14px; height: 14px; display: block; }
  .cat-editor-locked { font-size: 0.7rem; color: var(--text-faint); font-style: italic; white-space: nowrap; }
  .cat-editor-count { font-size: 0.78rem; color: var(--text-faint); margin-top: 0.25rem; }
  .cat-editor-footer { display: flex; gap: 0.5rem; align-items: center; }

  .cat-timeline-section { border-top: 1px solid var(--border); padding-top: 0.75rem; margin-top: 0.5rem; }
  .cat-timeline-title { font-family: 'Cinzel', serif; font-weight: 500; font-size: 1rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
  .cat-timeline-entry { padding: 0.35rem 0.75rem; border-left: 3px solid var(--border); margin-bottom: 0.35rem; font-size: 0.88rem; }
  .cat-timeline-entry-time { font-size: 0.78rem; color: var(--text-faint); }

  .howto-content { margin-top: 1rem; }
  .howto-step { font-size: 0.9rem; margin-bottom: 0.75rem; line-height: 1.55; }
  .howto-step strong { color: var(--accent); }
  .howto-note { font-size: 0.82rem; color: var(--text-faint); margin-top: 1rem; font-style: italic; }

  @media (max-width: 480px) {
    .container { padding: 0.75rem 0.75rem 0.5rem; }
    h1 { font-size: 1.4rem; }
    .subtitle { font-size: 0.78rem; }
    .timer-area { gap: 0.75rem; }
    .timer-ring { width: 110px; height: 110px; }
    .timer-display { font-size: 1.4rem; }
    .timer-ring-info { font-size: 0.7rem; padding: 0 1.2rem; }
    .ctrl-btn { font-size: 0.75rem; padding: 0.35rem 0.6rem; }
    .ctrl-btn svg { width: 12px; height: 12px; }
    .btn-start { font-size: 0.88rem; padding: 0.6rem 1.5rem; }
    .start-hint { font-size: 0.75rem; }
    .entry { padding: 0.5rem 0.6rem; gap: 0.6rem; }
    .entry-time { min-width: 80px; font-size: 0.75rem; }
    .entry-text { font-size: 0.88rem; }
    .gap-row { padding: 0.25rem 0.6rem; }
    .wiz-entry { flex-wrap: wrap; }
    .wiz-group-header { flex-wrap: wrap; }
    .results-date { min-width: 130px; font-size: 0.95rem; }
    .card { padding: 1.25rem 1.25rem 1rem; }
    .overlay { align-items: flex-start; padding-top: 2rem; }
  }

  @media (max-width: 380px) {
    .timer-area { flex-direction: column; gap: 0.5rem; }
    .timer-controls { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .start-area { align-items: center; }
    .timer-ring { width: 100px; height: 100px; }
    .timer-display { font-size: 1.2rem; }
    .timer-ring-info { font-size: 0.65rem; padding: 0 1rem; }
    h1 { font-size: 1.25rem; }
  }
