    :root {
      --bg: #0f0f12;
      --surface: #18181c;
      --surface-elevated: #1e1e24;
      --border: #2a2a30;
      --text: #e8e8ec;
      --muted: #8888a0;
      --radius: 0.5rem;
      --radius-sm: 0.4rem;
      --safe-top: env(safe-area-inset-top, 0);
      --safe-bottom: env(safe-area-inset-bottom, 0);
      --rainbow-0: #ef4444;
      --rainbow-1: #f43f5e;
      --rainbow-2: #ec4899;
      --rainbow-3: #f97316;
      --rainbow-4: #eab308;
      --rainbow-5: #84cc16;
      --rainbow-6: #22c55e;
      --rainbow-7: #14b8a6;
      --rainbow-8: #06b6d4;
    }

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

    html {
      overflow-x: hidden;
      max-width: 100vw;
    }
    html, body {
      height: 100%;
      min-height: 100dvh;
      max-width: 100%;
      background: var(--bg);
      color: var(--text);
      font-family: 'Outfit', system-ui, sans-serif;
      -webkit-font-smoothing: antialiased;
      padding-top: var(--safe-top);
      padding-bottom: var(--safe-bottom);
      overflow-x: hidden;
      position: relative;
    }
    body::before {
      content: '';
      position: fixed;
      inset: 0;
      z-index: -1;
      background:
        radial-gradient(ellipse 120% 80% at 10% 10%, rgba(55,55,60,0.4) 0%, transparent 45%),
        radial-gradient(ellipse 100% 60% at 90% 90%, rgba(40,40,45,0.35) 0%, transparent 45%),
        radial-gradient(ellipse 80% 50% at 50% 50%, rgba(70,70,75,0.15) 0%, transparent 50%);
      pointer-events: none;
    }

    .app {
      min-height: 100%;
      max-width: 100%;
      min-width: 0;
      display: flex;
      flex-direction: column;
      padding: 0 1.25rem 1.5rem;
      overflow-x: hidden;
    }
    @supports (height: 100dvh) {
      @media (max-width: 600px) {
        .app {
          height: 100dvh;
          max-height: 100dvh;
          overflow-y: auto;
          -webkit-overflow-scrolling: touch;
          box-sizing: border-box;
        }
      }
    }

    .header { padding: 1.25rem 0 0.5rem; flex-shrink: 0; min-width: 0; max-width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
    .logo-jump-btn {
      border: none;
      background: transparent;
      padding: 0;
      margin: 0;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      border-radius: 8px;
    }
    .logo-jump-btn:focus-visible {
      outline: 2px solid var(--muted);
      outline-offset: 3px;
    }
    .header-logo { height: 48px; width: auto; display: block; object-fit: contain; }
    .view-toolbar {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0.65rem;
      padding: 0.5rem 0 0.75rem;
      flex-shrink: 0;
      min-width: 0;
      max-width: 100%;
    }
    .view-toolbar-tabs-row {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      width: 100%;
      min-width: 0;
      flex-wrap: wrap;
      gap: 0.5rem;
    }
    .view-toolbar .pomodoro-wrap {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.5rem;
      flex: none;
      min-width: 0;
      width: 100%;
    }
    .view-toolbar-filters {
      display: flex;
      align-items: flex-start;
      flex-direction: column;
      gap: 0.45rem;
      flex-wrap: wrap;
      width: 100%;
    }
    .view-filter-label {
      font-size: 0.72rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .view-filter-select {
      background: var(--surface);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.35rem 0.45rem;
      font-size: 0.8rem;
      font-family: 'Outfit', system-ui, sans-serif;
    }
    .view-filter-priorities {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      flex-wrap: wrap;
    }
    .view-filter-priorities label {
      display: inline-flex;
      align-items: center;
      gap: 0.2rem;
      padding: 0.18rem 0.35rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--surface);
      color: var(--text);
      font-size: 0.75rem;
    }
    .view-filter-colors {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      flex-wrap: wrap;
      width: 100%;
    }
    .view-filter-color {
      width: 24px;
      height: 24px;
      border-radius: 0.55rem;
      border: 2px solid var(--border);
      background: transparent;
      padding: 0;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      transition: box-shadow 0.12s ease, opacity 0.12s ease;
    }
    .view-filter-color.is-selected {
      box-shadow: 0 0 0 2px rgba(255,255,255,0.12);
      opacity: 1;
    }
    .view-filter-color:not(.is-selected) {
      background: transparent !important;
      opacity: 0.85;
    }
    .view-filter-colors-reset {
      margin-left: 0.15rem;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--muted);
      border-radius: 999px;
      padding: 0.18rem 0.5rem;
      font-size: 0.72rem;
      cursor: pointer;
      font-family: 'Outfit', system-ui, sans-serif;
    }
    .view-toolbar-right { display: flex; align-items: center; justify-content: flex-end; margin-left: auto; gap: 0.5rem; flex-shrink: 0; flex-wrap: wrap; width: 100%; }
    .sort-panel {
      display: none;
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 0.35rem;
      padding: 0.85rem;
      background: var(--surface-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      min-width: 15rem;
      max-width: min(24rem, calc(100vw - 2rem));
      z-index: 100;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }
    .sort-panel.is-open { display: block; }
    .sort-panel .view-filter-priorities { width: 100%; }
    .sort-panel .view-filter-colors { width: 100%; }
    .view-toolbar .header-timer-bar-row { flex: 1 1 100%; min-width: 8rem; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; order: 10; }
    .header-timer-bar-row .pomodoro-bar-fill { height: 100%; border-radius: 3px; background: #00FFF2; transition: width 0.15s linear; }
    .pomodoro-btn {
      font-family: 'Outfit', system-ui, sans-serif;
      font-size: 0.85rem;
      font-weight: 600;
      padding: 0.5rem 0.75rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface-elevated);
      color: var(--text);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      white-space: nowrap;
    }
    .pomodoro-btn:hover { border-color: var(--muted); }
    .pomodoro-btn.primary { background: var(--surface-elevated); color: var(--text); border-color: var(--border); }
    .header-right { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; flex-shrink: 0; }
    .notify-wrap { flex-shrink: 0; }
    .notify-wrap .pomodoro-btn { border: 1px solid var(--border); color: #ec4899; }
    .notify-wrap .pomodoro-btn:hover { border-color: var(--muted); color: #f472b6; }
    .notify-wrap .pomodoro-btn.notifications-on { border-color: transparent; color: #7dd3fc; }
    .notify-wrap .pomodoro-btn.notifications-on:hover { color: #bae6fd; }
    .sync-wrap { position: relative; flex-shrink: 0; display: flex; align-items: center; gap: 0.45rem; }
    .reward-score-chip {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 2.6rem;
      padding: 0.5rem 0.75rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface-elevated);
      font-size: 0.85rem;
      font-weight: 800;
      letter-spacing: 0.01em;
      line-height: 1;
      white-space: nowrap;
      font-family: 'JetBrains Mono', monospace;
      background-image: linear-gradient(120deg, #ef4444, #eab308, #22c55e, #06b6d4, #a855f7);
      background-size: 200% 200%;
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      -webkit-text-fill-color: transparent;
      animation: goal-gradient-shift 8s ease infinite;
    }
    .app-version { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.03em; color: #6b7280; -webkit-user-select: none; user-select: none; white-space: nowrap; line-height: 1; }
    .sync-wrap .pomodoro-btn.sync-when-notify-on { color: #3b82f6; }
    .sync-wrap .pomodoro-btn.sync-synched {
      color: #22c55e;
      border-color: rgba(34, 197, 94, 0.5);
      background: color-mix(in srgb, #22c55e 12%, var(--surface-elevated) 88%);
    }
    .sync-wrap .pomodoro-btn.sync-synched:hover {
      color: #4ade80;
      border-color: rgba(74, 222, 128, 0.65);
    }
    .import-export-wrap { display: flex; align-items: center; gap: 0.35rem; flex-shrink: 0; }
    .sync-panel {
      display: none;
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 0.35rem;
      padding: 0.75rem;
      background: var(--surface-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      min-width: 12rem;
      z-index: 100;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }
    .sync-panel.is-open { display: block; }
    .sync-wrap .pomodoro-btn:focus + .sync-panel.is-open,
    .sync-panel.is-open:focus-within { display: block; }
    .sync-hint { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }
    .sync-hint-signed-in { margin-top: 0.25rem; margin-bottom: 0.5rem; }
    .sync-panel .sync-input {
      display: block;
      width: 100%;
      margin-bottom: 0.5rem;
      padding: 0.4rem 0.5rem;
      font-size: 0.9rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
    }
    .sync-btns { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
    .sync-forgot-link {
      display: block; width: 100%; margin-top: 0.35rem; padding: 0; border: none; background: none;
      color: var(--muted); font-size: 0.78rem; cursor: pointer; text-align: left; text-decoration: underline; font-family: inherit;
    }
    .sync-forgot-link:hover { color: var(--text); }
    .sync-error { font-size: 0.8rem; color: #ef4444; margin-top: 0.25rem; }
    .contact-panel {
      display: none;
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 0.35rem;
      padding: 1rem;
      background: var(--surface-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      min-width: 18rem;
      max-width: 22rem;
      z-index: 100;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }
    .contact-panel.is-open { display: block; }
    .contact-wrap .view-btn:focus + .contact-panel.is-open,
    .footer-contact-wrap .app-footer-btn:focus + .contact-panel.is-open,
    .contact-panel.is-open:focus-within { display: block; }
    .footer-contact-wrap .contact-panel {
      top: auto;
      bottom: 100%;
      margin-top: 0;
      margin-bottom: 0.35rem;
    }
    .notes-panel {
      display: none;
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 0.35rem;
      padding: 1rem;
      background: var(--surface-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      min-width: 20rem;
      width: min(30rem, 90vw);
      z-index: 100;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }
    .notes-panel.is-open { display: block; }
    .notes-wrap .view-btn:focus + .notes-panel.is-open,
    .notes-panel.is-open:focus-within { display: block; }
    .notes-panel-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
    .notes-panel-desc { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; }
    .notes-docs-controls {
      display: grid;
      grid-template-columns: 1fr auto auto;
      gap: 0.4rem;
      margin-bottom: 0.45rem;
      align-items: center;
    }
    .notes-doc-select,
    .notes-title-input {
      width: 100%;
      min-width: 0;
      background: var(--surface);
      color: var(--text);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.35rem 0.45rem;
      font-size: 0.8rem;
      font-family: 'Outfit', system-ui, sans-serif;
      box-sizing: border-box;
    }
    .notes-title-input { margin-bottom: 0.55rem; }
    .notes-mini-btn {
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      border-radius: var(--radius-sm);
      padding: 0.33rem 0.45rem;
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
    }
    .notes-mini-btn:hover { border-color: var(--muted); }
    .notes-toolbar { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
    .notes-tool-btn {
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      border-radius: var(--radius-sm);
      padding: 0.25rem 0.45rem;
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
    }
    .notes-tool-btn:hover { border-color: var(--muted); }
    .notes-md-help {
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--surface);
      padding: 0.45rem 0.55rem;
      margin-bottom: 0.6rem;
    }
    .notes-md-help summary {
      cursor: pointer;
      font-size: 0.78rem;
      font-weight: 700;
      color: var(--muted);
      list-style: none;
    }
    .notes-md-help summary::-webkit-details-marker { display: none; }
    .notes-md-help summary::before { content: '▸ '; color: var(--muted); }
    .notes-md-help[open] summary::before { content: '▾ '; }
    .notes-md-help-list {
      margin: 0.45rem 0 0;
      padding-left: 1rem;
      display: grid;
      gap: 0.3rem;
      color: var(--text);
      font-size: 0.78rem;
      line-height: 1.35;
    }
    .notes-md-help-list code {
      font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 0.74rem;
      background: rgba(125, 211, 252, 0.12);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 0.04rem 0.25rem;
    }
    .notes-editor {
      width: 100%;
      min-height: 8rem;
      resize: vertical;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
      font-size: 0.86rem;
      line-height: 1.35;
      padding: 0.5rem;
      box-sizing: border-box;
      margin-bottom: 0.55rem;
    }
    .notes-preview-title {
      font-size: 0.75rem;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: var(--muted);
      margin-bottom: 0.35rem;
    }
    .notes-preview {
      border: 1px solid var(--border);
      background: var(--surface);
      border-radius: var(--radius-sm);
      padding: 0.5rem;
      font-size: 0.86rem;
      line-height: 1.35;
      color: var(--text);
      min-height: 4rem;
      max-height: 12rem;
      overflow-y: auto;
      margin-bottom: 0.6rem;
    }
    .notes-preview p { margin: 0 0 0.45rem; }
    .notes-preview p:last-child { margin-bottom: 0; }
    .notes-preview h1,
    .notes-preview h2,
    .notes-preview h3 {
      margin: 0.1rem 0 0.45rem;
      line-height: 1.2;
      color: var(--text);
    }
    .notes-preview h1 { font-size: 1.05rem; font-weight: 800; }
    .notes-preview h2 { font-size: 0.96rem; font-weight: 750; }
    .notes-preview h3 { font-size: 0.9rem; font-weight: 700; }
    .notes-preview ul { margin: 0.3rem 0 0.55rem 1.1rem; padding: 0; }
    .notes-preview ul.checklist { list-style: none; margin-left: 0.1rem; }
    .notes-preview ul.checklist li { display: flex; align-items: center; gap: 0.4rem; }
    .notes-preview .checkmark-box {
      width: 1.1rem;
      text-align: center;
      color: var(--muted);
      font-weight: 700;
      flex-shrink: 0;
    }
    .notes-preview .checklist li.done { color: var(--muted); }
    .notes-preview .checklist li.done .checkmark-text { text-decoration: line-through; }
    .notes-preview a { color: #7dd3fc; text-decoration: underline; }
    .notes-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
    .notes-save-msg { font-size: 0.76rem; color: var(--muted); min-height: 1em; }
    .contact-panel-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.25rem; }
    .contact-panel-desc { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.75rem; }
    .contact-form .input-wrap { margin-bottom: 0.5rem; }
    .contact-form .input-wrap label { font-size: 0.75rem; color: var(--muted); }
    .contact-form input,
    .contact-form textarea {
      width: 100%;
      padding: 0.4rem 0.5rem;
      font-size: 0.9rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      font-family: 'Outfit', system-ui, sans-serif;
      box-sizing: border-box;
    }
    .contact-form textarea { resize: vertical; min-height: 4rem; }
    .contact-form-error { font-size: 0.8rem; color: #ef4444; margin-top: 0.25rem; }
    .contact-form-success { font-size: 0.8rem; color: var(--rainbow-6); margin-top: 0.25rem; }
    .contact-form-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
    .contact-me { margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
    .contact-me-heading { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.5rem; }
    .contact-me-links { display: flex; flex-direction: column; gap: 0.4rem; }
    .contact-me-links a { font-size: 0.9rem; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 0.35rem; }
    .contact-me-links a:hover { color: var(--muted); text-decoration: underline; }
    .contact-me-links a .contact-me-label { color: var(--muted); font-size: 0.8rem; min-width: 4.5rem; }
    .settings-panel {
      display: none;
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 0.35rem;
      padding: 1rem;
      background: var(--surface-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      min-width: 18rem;
      max-width: 24rem;
      max-height: 85vh;
      overflow-y: auto;
      z-index: 100;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }
    .settings-panel.is-open { display: block; }
    .footer-settings-wrap .app-footer-btn:focus + .settings-panel.is-open,
    .settings-panel.is-open:focus-within { display: block; }
    .tools-panel {
      display: none;
      position: absolute;
      top: 100%;
      right: 0;
      margin-top: 0.35rem;
      padding: 1rem;
      background: var(--surface-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      min-width: 18rem;
      max-width: 24rem;
      max-height: 85vh;
      overflow-y: auto;
      z-index: 100;
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    }
    .tools-panel.is-open { display: block; }
    .footer-tools-wrap .app-footer-btn:focus + .tools-panel.is-open,
    .tools-panel.is-open:focus-within { display: block; }
    .footer-tools-wrap .tools-panel {
      top: auto;
      bottom: 100%;
      margin-top: 0;
      margin-bottom: 0.35rem;
    }
    .footer-settings-wrap .settings-panel {
      top: auto;
      bottom: 100%;
      margin-top: 0;
      margin-bottom: 0.35rem;
    }
    .tools-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.65rem; }
    .tools-panel .tools-panel-actions { margin-bottom: 0; }
    .settings-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
    .settings-section { margin-bottom: 1.25rem; }
    .settings-section:last-child { margin-bottom: 0; }
    .settings-section-title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 0.5rem; }
    .settings-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
    .settings-row:last-child { margin-bottom: 0; }
    .settings-label { font-size: 0.9rem; flex: 1; min-width: 0; }
    .settings-toggle {
      flex-shrink: 0;
      width: 2.5rem;
      height: 1.35rem;
      border-radius: 999px;
      background: var(--border);
      border: none;
      cursor: pointer;
      position: relative;
      transition: background 0.2s;
    }
    .settings-toggle[aria-pressed="true"] { background: var(--rainbow-6); }
    .settings-toggle::after {
      content: '';
      position: absolute;
      width: 1rem;
      height: 1rem;
      border-radius: 50%;
      background: var(--text);
      top: 50%;
      transform: translateY(-50%);
      left: 0.2rem;
      transition: left 0.2s;
    }
    .settings-toggle[aria-pressed="true"]::after { left: 1.25rem; }
    .settings-theme-btns { display: flex; gap: 0.35rem; flex-wrap: wrap; }
    .settings-theme-btn {
      padding: 0.4rem 0.65rem;
      font-size: 0.8rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      cursor: pointer;
      font-weight: 600;
    }
    .settings-theme-btn:hover { border-color: var(--muted); }
    .settings-theme-btn.active { background: var(--surface-elevated); border-color: var(--muted); }
    .settings-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
    .settings-actions .pomodoro-btn { font-size: 0.85rem; padding: 0.4rem 0.6rem; }
    .settings-actions .notify-wrap { display: inline-flex; align-items: center; }
    .settings-actions .import-export-wrap { display: inline-flex; align-items: center; gap: 0.5rem; }
    .settings-language-btns { display: inline-flex; align-items: center; gap: 0.35rem; }
    .app-footer {
      margin: 1rem 1.25rem 0.5rem;
      padding: 0.65rem 0.75rem;
      border: 1px solid var(--border);
      border-radius: var(--radius);
      background: var(--surface-elevated);
      display: flex;
      align-items: center;
      gap: 0.75rem;
      flex-wrap: wrap;
    }
    .app-footer-meta { font-size: 0.78rem; color: #7b8193; white-space: nowrap; }
    .app-footer-status { font-size: 0.8rem; color: #939aac; flex: 1; min-width: 10rem; }
    .app-footer-actions { display: inline-flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; margin-left: auto; }
    .app-footer-btn {
      padding: 0.35rem 0.55rem;
      font-size: 0.78rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      color: #9aa1b4;
      cursor: pointer;
      font-weight: 600;
    }
    .app-footer-btn:hover { border-color: var(--muted); color: #b1b8ca; }
    .settings-privacy { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }
    .settings-privacy p { margin-bottom: 0.5rem; }
    .settings-privacy p:last-child { margin-bottom: 0; }
    html.theme-bright { --bg: #f4f4f6; --surface: #fff; --surface-elevated: #fff; --border: #e0e0e6; --text: #1a1a1e; --muted: #5c5c6e; }
    html.theme-bright body::before { background: none; }
    html.theme-colorful { --bg: #1a1625; --surface: #251f35; --surface-elevated: #2d2640; --border: #3d3550; --text: #e8e4f0; --muted: #9a8fb8; }
    html.theme-colorful body::before {
      background:
        radial-gradient(ellipse 100% 70% at 20% 20%, rgba(59, 130, 246, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 100% 70% at 80% 80%, rgba(236, 72, 153, 0.25) 0%, transparent 50%);
    }
    .sync-email { font-size: 0.85rem; color: var(--muted); margin-right: 0.5rem; }
    .sync-history-block { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid rgba(255,255,255,0.08); }
    .sync-history-row { margin-bottom: 0.5rem; }
    .sync-history-controls { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
    .sync-history-select { flex: 1; min-width: 10rem; max-width: 100%; }
    .sync-history-btn { flex-shrink: 0; font-size: 0.75rem; padding: 0.35rem 0.6rem; }
    .sync-latest-btn { width: 100%; }
    .sync-history-details { margin-top: 0.4rem; }
    .sync-history-summary { font-size: 0.8rem; color: var(--muted); cursor: pointer; user-select: none; padding: 0.25rem 0; }
    .sync-history-summary:hover { color: var(--text); }
    .sync-history-details[open] .sync-history-summary { margin-bottom: 0.4rem; }
    #syncHistoryRefresh { margin-top: 0.35rem; font-size: 0.8rem; }
    .sync-history-select option.sync-snapshot-latest { font-weight: bold; }
    .snooze-panel {
      position: fixed;
      z-index: 200;
      padding: 0.6rem 0.7rem;
      background: var(--surface-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      box-shadow: 0 4px 12px rgba(0,0,0,0.4);
      min-width: 13rem;
      font-family: 'Outfit', system-ui, sans-serif;
    }
    .snooze-panel-main {
      display: flex;
      align-items: stretch;
      gap: 0.75rem;
    }
    .snooze-panel-units {
      display: grid;
      grid-template-columns: repeat(4, auto);
      gap: 0.4rem 0.5rem;
    }
    .snooze-unit {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0.2rem;
    }
    .snooze-unit-label {
      padding: 0.25rem 0.45rem;
      font-size: 0.7rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      cursor: pointer;
      text-align: center;
      white-space: nowrap;
    }
    .snooze-unit-row {
      display: flex;
      justify-content: center;
      gap: 0.2rem;
    }
    .snooze-unit-step {
      width: 1.5rem;
      height: 1.2rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      font-size: 0.8rem;
      cursor: pointer;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    .snooze-unit-label:hover,
    .snooze-unit-step:hover { border-color: var(--muted); }
    .snooze-panel-total {
      min-width: 4.5rem;
      font-family: 'JetBrains Mono', monospace;
      font-size: 1.2rem;
      font-weight: 700;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      text-align: right;
      padding-left: 0.25rem;
    }
    .snooze-panel-custom { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--border); display: none; }
    .snooze-panel-custom.is-open { display: block; }
    .snooze-panel-custom .snooze-custom-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
    .snooze-panel-custom input[type="number"] { width: 4rem; padding: 0.35rem 0.4rem; font-size: 0.85rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
    .snooze-panel-custom select { padding: 0.35rem 0.5rem; font-size: 0.85rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); cursor: pointer; }
    .pomodoro-unit { display: flex; align-items: center; gap: 0.35rem; }
    .pomodoro-unit input { width: 3.5em; min-width: 3.5em; padding: 0.35rem 0.4rem; font-size: 0.85rem; text-align: center; background: var(--surface-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: 'JetBrains Mono', monospace; }
    .pomodoro-unit label { font-size: 0.7rem; color: var(--muted); }
    .pomodoro-display {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      gap: 0.2rem;
    }
    .pomodoro-time { font-family: 'JetBrains Mono', monospace; font-size: 1rem; font-weight: 700; }
    .pomodoro-bar-wrap { width: 80px; height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
    .pomodoro-bar-fill { height: 100%; border-radius: 3px; background: #00FFF2; transition: width 0.5s ease-out; }
    .timer-sep { width: 1px; height: 28px; background: var(--border); flex-shrink: 0; }

    .next-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 0.5rem; }
    .next-box {
      background: var(--surface-elevated);
      border: 2px solid var(--border);
      border-radius: var(--radius);
      padding: 1.25rem 1rem;
      margin-bottom: 1.25rem;
    }
    .next-box .progress-wrap { margin-bottom: 0.75rem; }
    .next-box .card-label { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
    .next-box .card-datetime { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }
    .next-box .card-display {
      font-family: 'JetBrains Mono', monospace;
      font-size: clamp(2rem, 10vw, 2.75rem);
      font-weight: 700;
      letter-spacing: -0.02em;
    }
    .next-placeholder { text-align: center; color: var(--muted); font-size: 0.95rem; padding: 1rem; }
    .all-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 0.6rem; }

    .view-btn {
      font-family: 'Outfit', system-ui, sans-serif;
      font-size: 0.9rem;
      font-weight: 600;
      padding: 0.5rem 1rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface-elevated);
      color: var(--muted);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .view-btn:hover { color: var(--text); border-color: var(--muted); }
    .view-btn.active { background: var(--surface-elevated); color: var(--text); border-color: var(--muted); }
    .view-btn-sort {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
    }
    .sort-funnel-icon {
      width: 0.9rem;
      height: 0.9rem;
      display: inline-block;
      fill: currentColor;
      opacity: 0.95;
    }
    .view-btn-link { text-decoration: none; display: inline-flex; align-items: center; }
    .vibeminder-intro { padding: 0.5rem 0 0.75rem; font-size: 0.9rem; color: var(--muted); line-height: 1.5; max-width: 100%; }
    .vibeminder-quote {
      margin: 0 0 0.85rem;
      padding: 0;
      font-size: 0.88rem;
      font-style: italic;
      color: var(--muted);
      line-height: 1.45;
      max-width: 100%;
      border-left: 3px solid var(--border);
      padding-left: 0.75rem;
    }
    .view-container { flex: 1; min-height: 0; min-width: 0; max-width: 100%; display: flex; flex-direction: column; overflow: hidden; }
    .list-wrap { flex: 1; min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
    .list-wrap.hidden { display: none; }
    .calendar-view-wrap {
      flex: 1;
      min-height: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .calendar-view-wrap.hidden { display: none; }
    .grid-view-wrap {
      flex: 1;
      min-height: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .grid-view-wrap.hidden { display: none; }
    .grid-view-grid {
      flex: 1;
      min-height: 0;
      min-width: 0;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
      grid-auto-rows: auto;
      align-items: start;
      gap: 0.5rem;
      padding: 0.25rem 0;
      overflow: auto;
    }
    .grid-view-wrap .grid-cell {
      min-height: 0;
      min-width: 0;
      display: flex;
    }
    .grid-view-wrap .grid-cell .card {
      width: 100%;
      min-height: 0;
      display: flex;
      flex-direction: column;
      box-sizing: border-box;
    }
    .grid-view-wrap .grid-cell .card { position: relative; }
    .grid-view-wrap .grid-cell .card-head { display: contents; }
    .grid-view-wrap .grid-cell .card-label {
      font-size: clamp(0.8rem, 2.8vmin, 1.5rem);
      line-height: 1.15;
      order: -2;
      flex: 0 0 auto;
      margin-bottom: 0;
      padding-bottom: 0;
    }
    .grid-view-wrap .grid-cell .progress-wrap { order: -1; margin-top: 0; padding-top: 0; margin-bottom: 0.35rem; flex-shrink: 0; }
    .grid-view-wrap .grid-cell .card-right {
      order: 0;
      align-items: flex-start;
      flex-shrink: 0;
      text-align: left;
    }
    .grid-view-wrap .grid-cell .card-details { order: 1; }
    .grid-view-wrap .grid-cell .card-actions { order: 2; }
    .grid-view-wrap .grid-cell .card-display { font-size: clamp(0.55rem, 2vmin, 0.95rem); text-align: left; }
    .grid-view-wrap .grid-cell .card-datetime { font-size: 0.55rem; margin-top: 0.15rem; text-align: left; }
    .grid-view-wrap .grid-cell .card-color-label {
      position: absolute;
      bottom: 0.5rem;
      left: 0.5rem;
      right: auto;
      margin: 0;
      font-size: 0.6rem;
    }
    .grid-view-wrap .grid-cell .card-details { font-size: 0.7rem; margin-top: 0.2rem; }
    .grid-view-wrap .grid-cell .card-actions { margin-top: 0.35rem; gap: 0.25rem; }
    .grid-view-wrap .grid-cell .card-actions button { min-width: 1.75rem; height: 1.75rem; font-size: 0.7rem; }
    .grid-view-wrap .grid-cell .card-edit-form .input-wrap { margin-bottom: 0.35rem; }
    .grid-view-wrap .grid-cell .card-edit-form input[type="text"],
    .grid-view-wrap .grid-cell .card-edit-form .input-datetime { padding: 0.35rem 0.45rem; font-size: 0.75rem; }
    .grid-view-wrap .grid-cell .card-edit-form .edit-actions { margin-top: 0.4rem; gap: 0.35rem; }
    .grid-view-wrap .grid-cell .card-edit-form .edit-actions button { padding: 0.3rem 0.5rem; font-size: 0.75rem; }
    .gantt-view-wrap {
      flex: 1;
      min-height: 0;
      min-width: 0;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }
    .gantt-view-wrap.hidden { display: none; }
    .gantt-scroll {
      flex: 1;
      min-height: 0;
      min-width: 0;
      overflow: auto;
      -webkit-overflow-scrolling: touch;
      padding-left: 1.25rem;
      padding-right: 1.25rem;
    }
    .gantt-chart {
      display: flex;
      align-items: stretch;
      min-height: min-content;
    }
    .gantt-timeline-wrap {
      flex: 1;
      min-width: 0;
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
    }
    .gantt-timeline {
      position: relative;
      min-width: 100%;
      height: 100%;
    }
    .gantt-axis {
      height: 2rem;
      border-bottom: 1px solid var(--border);
      position: relative;
      background: var(--surface);
    }
    .gantt-axis-tick {
      position: absolute;
      top: 0;
      bottom: 0;
      font-size: 0.65rem;
      color: var(--muted);
      font-family: 'JetBrains Mono', monospace;
      padding-top: 0.25rem;
      padding-left: 2px;
      border-left: 1px solid var(--border);
      white-space: nowrap;
    }
    .gantt-rows {
      position: relative;
    }
    .gantt-row {
      height: 2.5rem;
      position: relative;
      border-bottom: 1px solid var(--border);
    }
    .gantt-bar {
      position: absolute;
      top: 50%;
      left: 0;
      width: 1.15rem;
      height: 1.15rem;
      margin-top: -0.575rem;
      border-radius: 50%;
      background: var(--surface);
      border: 2px solid var(--border);
      box-sizing: border-box;
    }
    .gantt-bar.past { opacity: 0.7; }
    .gantt-bar-group {
      position: absolute;
      top: 50%;
      transform: translate(-50%, -50%);
      display: flex;
      align-items: center;
      gap: 0.6rem;
      flex-wrap: nowrap;
      max-width: min(28rem, 75vw);
    }
    .gantt-bar-label {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text);
      padding: 0.15rem 0.45rem;
      border-radius: 999px;
      background: rgba(0,0,0,0.25);
      border: 1px solid var(--border);
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      pointer-events: none;
      flex: 1 1 auto;
      min-width: 0;
      text-align: left;
    }
    .gantt-bar-time {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--muted);
      font-family: 'JetBrains Mono', monospace;
      flex-shrink: 0;
      white-space: nowrap;
    }
    .gantt-now-line {
      position: absolute;
      top: 0;
      bottom: 0;
      width: 2px;
      background: #ec4899;
      z-index: 2;
      pointer-events: none;
    }
    .calendar-scroll {
      flex: 1;
      min-width: 0;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 1.5rem;
      padding-right: 0.55rem;
    }
    .calendar-scroll::-webkit-scrollbar { width: 10px; }
    .calendar-scroll::-webkit-scrollbar-track {
      background: transparent;
      margin: 4px 0;
    }
    .calendar-scroll::-webkit-scrollbar-thumb {
      background: linear-gradient(180deg, color-mix(in srgb, var(--muted) 70%, var(--surface-elevated) 30%), color-mix(in srgb, var(--border) 80%, var(--surface) 20%));
      border-radius: 999px;
      border: 2px solid transparent;
      background-clip: content-box;
    }
    .calendar-scroll::-webkit-scrollbar-thumb:hover {
      background: linear-gradient(180deg, color-mix(in srgb, var(--text) 35%, var(--muted) 65%), color-mix(in srgb, var(--muted) 75%, var(--surface) 25%));
      border-radius: 999px;
      border: 2px solid transparent;
      background-clip: content-box;
    }
    .calendar-month {
      margin-bottom: 2rem;
      break-inside: avoid;
      display: flex;
      flex-direction: row;
      align-items: stretch;
      gap: 0.5rem;
      min-width: 0;
    }
    .calendar-month-title {
      font-family: 'JetBrains Mono', monospace;
      font-size: 1rem;
      font-weight: 700;
      color: var(--text);
      writing-mode: vertical-rl;
      transform: rotate(180deg);
      text-transform: uppercase;
      letter-spacing: 0.05em;
      min-width: 2rem;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0.5rem 0;
    }
    .calendar-month-year { color: #5a5a5e; }
    .calendar-month-inner { flex: 1; min-width: 0; margin-left: 0.75rem; }
    .calendar-weekdays {
      display: grid;
      grid-template-columns: 1.5rem repeat(7, minmax(0, 1fr));
      gap: 2px;
      margin-bottom: 0.25rem;
      font-size: 0.7rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }
    .calendar-weekdays span { text-align: center; }
    .calendar-weeknum-header {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.6rem;
      font-weight: 600;
      color: #4a4a50;
      writing-mode: vertical-rl;
      transform: rotate(180deg);
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .calendar-grid {
      display: grid;
      grid-template-columns: 1.5rem repeat(7, minmax(0, 1fr));
      gap: 2px;
    }
    .calendar-weeknum-cell {
      background: transparent !important;
      border: none !important;
      border-color: transparent !important;
      min-height: 0;
      padding: 0.2rem 0;
      box-shadow: none;
    }
    .calendar-weeknum {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.7rem;
      font-weight: 600;
      color: #4a4a50;
      writing-mode: vertical-rl;
      transform: rotate(180deg);
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 100%;
    }
    .calendar-day {
      min-height: 4rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.35rem;
      font-size: 0.85rem;
      display: flex;
      flex-direction: column;
    }
    .calendar-day--empty { background: transparent; border-color: transparent; }
    .calendar-day--today { border-color: #ec4899; box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.25); }
    .calendar-day--expanded {
      border-color: color-mix(in srgb, var(--text) 50%, var(--border) 50%);
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 20%, transparent 80%);
    }
    .calendar-day-num {
      font-weight: 600;
      color: var(--muted);
      margin-bottom: 0.35rem;
      flex-shrink: 0;
    }
    .calendar-day--today .calendar-day-num { color: var(--text); }
    .calendar-day-items {
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      flex: 1;
      min-width: 0;
    }
    .calendar-day-item {
      position: relative;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: 0.5rem;
      min-width: 0;
      border-left: 3px solid var(--cal-event-color, var(--border));
      padding-left: 0.75rem;
      border-radius: 0 3px 3px 0;
      background: rgba(0, 0, 0, 0.15);
    }
    .calendar-day-item::before {
      content: '';
      position: absolute;
      left: 0.28rem;
      top: 50%;
      width: 0.35rem;
      height: 0.35rem;
      border-radius: 50%;
      transform: translateY(-50%);
      background: var(--cal-event-color, var(--border));
      box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
      pointer-events: none;
    }
    .calendar-day-item-title {
      font-size: clamp(0.78rem, 2vmin, 1.05rem);
      font-weight: 700;
      line-height: 1.15;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 3;
      -webkit-box-orient: vertical;
      word-break: break-word;
      color: var(--text);
      flex: 1;
      min-width: 0;
    }
    .calendar-day-item-time {
      font-size: 0.72rem;
      font-weight: 600;
      line-height: 1.1;
      color: var(--muted);
      white-space: nowrap;
      flex-shrink: 0;
      align-self: center;
    }
    .calendar-day-item-time.window { color: #f59e0b; font-weight: 700; }
    .calendar-day-item--window { border-left-style: dashed; }
    .calendar-day-expanded {
      margin-top: 0.35rem;
      padding-top: 0.35rem;
      border-top: 1px dashed var(--border);
      display: flex;
      flex-direction: column;
      gap: 0.35rem;
    }
    .calendar-day-expanded-empty {
      font-size: 0.72rem;
      color: var(--muted);
      line-height: 1.25;
    }
    .calendar-day-expanded-item {
      background: color-mix(in srgb, var(--surface-elevated) 90%, var(--bg) 10%);
      border: 1px solid var(--border);
      border-radius: 0.35rem;
      padding: 0.3rem 0.35rem;
      min-width: 0;
    }
    .calendar-day-expanded-title {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 0.2rem;
      line-height: 1.2;
      word-break: break-word;
    }
    .calendar-day-expanded-meta {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
      gap: 0.18rem 0.45rem;
      font-size: 0.68rem;
      color: var(--muted);
      line-height: 1.25;
    }
    .calendar-day-expanded-meta .window-mark { color: #f59e0b; font-weight: 700; }
    .calendar-day-expanded-details {
      margin-top: 0.2rem;
      font-size: 0.7rem;
      color: var(--text);
      line-height: 1.28;
      white-space: pre-wrap;
      word-break: break-word;
    }

    .list {
      flex: 1;
      min-width: 0;
      overflow-y: auto;
      overflow-x: hidden;
      -webkit-overflow-scrolling: touch;
      padding-bottom: 0.35rem;
      display: flex;
      flex-direction: column;
      gap: 0.25rem;
    }

    .card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.4rem 0.5rem 0.35rem;
      flex-shrink: 0;
      min-width: 0;
      max-width: 100%;
      overflow-x: hidden;
      cursor: pointer;
    }

    .progress-wrap {
      position: relative;
      height: 4px;
      background: var(--border);
      border-radius: 2px;
      margin-bottom: 0.2rem;
      overflow: visible;
    }
    .progress-fill {
      height: 100%;
      border-radius: 2px;
      transition: width 0.5s ease-out;
    }
    .progress-markers {
      position: absolute;
      inset: 0;
      pointer-events: none;
    }
    .progress-markers span {
      position: absolute;
      top: -1px;
      width: 2px;
      height: 6px;
      background: var(--surface-elevated);
      border-radius: 1px;
      opacity: 0.9;
    }
    .progress-markers span:nth-child(1) { left: 25%; }
    .progress-markers span:nth-child(2) { left: 50%; }
    .progress-markers span:nth-child(3) { left: 75%; }

    .card-head {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      column-gap: 0.4rem;
      row-gap: 0.05rem;
      align-items: start;
      margin-bottom: 0;
      min-width: 0;
    }
    .card-label {
      font-size: 0.95rem;
      font-weight: 700;
      min-width: 0;
      line-height: 1.15;
      margin-bottom: 0;
      overflow-wrap: anywhere;
    }
    .card-left {
      min-width: 0;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 0.08rem;
    }
    .card-title-row {
      width: 100%;
      min-width: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: start;
      column-gap: 0.45rem;
    }
    .card-right {
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      justify-content: flex-start;
      min-width: max-content;
    }
    .card-display { font-family: 'JetBrains Mono', monospace; font-size: 0.85rem; font-weight: 700; letter-spacing: -0.02em; }
    .card.expired .card-display { color: var(--muted); }
    @keyframes expired-pulse-glow {
      0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0.12), inset 0 0 0 1px transparent; }
      50% { box-shadow: 0 0 20px 6px rgba(255,255,255,0.28), inset 0 0 0 1px rgba(255,255,255,0.08); }
    }
    @keyframes expired-scale-breathe {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(0.99); }
    }
    @keyframes expired-opacity-pulse {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.88; }
    }
    @keyframes expired-pattern-move {
      from { background-position: 0 0; }
      to { background-position: 20px 20px; }
    }
    .card.card-expired-anim-1 { animation: expired-pulse-glow 2.2s ease-in-out infinite; }
    .card.card-expired-anim-2 { animation: expired-scale-breathe 2.5s ease-in-out infinite; }
    .card.card-expired-anim-3 { animation: expired-opacity-pulse 2.2s ease-in-out infinite; }
    .card.card-expired-anim-4 {
      position: relative;
      overflow: hidden;
    }
    .card.card-expired-anim-4::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: inherit;
      pointer-events: none;
      z-index: 0;
      background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 8px,
        rgba(255,255,255,0.06) 8px,
        rgba(255,255,255,0.06) 12px
      );
      background-size: 20px 20px;
      animation: expired-pattern-move 2.5s linear infinite;
    }
    .card.card-expired-anim-4 > * { position: relative; z-index: 1; }
    .card-datetime { font-size: 0.6rem; color: var(--muted); margin-top: 0.05rem; text-align: right; }
    .card-actions {
      margin-top: 0.3rem;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 0.25rem;
      flex-wrap: wrap;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
    }
    .card.actions-visible .card-actions {
      opacity: 1;
      pointer-events: auto;
    }
    .card-actions button {
      font-size: 0.75rem;
      min-width: 1.75rem;
      height: 1.75rem;
      padding: 0 0.35rem;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: var(--radius-sm);
      font-weight: 600;
      border: none;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      font-family: 'Outfit', system-ui, sans-serif;
    }
    .card-actions button:active { transform: scale(0.97); }
    .card-actions button {
      background: var(--surface-elevated);
      color: var(--muted);
      border: 1px solid var(--border);
    }
    .card-actions button:hover { color: var(--text); border-color: var(--muted); }
    .done-comment {
      width: min(30vw, 22rem);
      min-width: 12rem;
      max-width: 100%;
      min-height: 4.6rem;
      max-height: 12rem;
      flex: 0 1 auto;
      padding: 0.45rem 0.5rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface-elevated);
      color: var(--text);
      font-size: 0.8rem;
      line-height: 1.25;
      font-family: 'Outfit', system-ui, sans-serif;
      resize: vertical;
      box-sizing: border-box;
    }
    .done-comment:focus { outline: none; border-color: var(--muted); }
    .card-actions .done-comment.remove-comment { flex: 0 1 auto; min-width: 12rem; }
    .card-details {
      font-size: 0.75rem;
      color: var(--muted);
      margin-top: 0;
      margin-bottom: 0;
      line-height: 1.3;
      column-width: min(20em, 100%);
      column-gap: 0.75rem;
      column-fill: auto;
      min-width: 0;
      overflow-wrap: break-word;
    }
    .card-head + .card-actions { margin-top: 0.12rem; }
    .card-recurrence {
      font-size: 0.6rem;
      color: var(--muted);
      margin-top: 0.08rem;
      white-space: nowrap;
      text-align: right;
    }
    .card-color-label { font-size: 0.6rem; color: var(--muted); margin-top: 0.08rem; }
    .card-edit .card-edit-form { margin-top: 0.35rem; min-width: 0; }
    .card-edit-form .input-wrap { margin-bottom: 0.35rem; min-width: 0; }
    .card-edit-color-row { position: relative; }
    .edit-color-popover { position: relative; display: inline-block; }
    .edit-color-toggle {
      width: 1.7rem;
      height: 1.7rem;
      border-radius: 0.55rem;
      border: 2px solid var(--border);
      background: linear-gradient(135deg, #8b5cf6, #3b82f6, #06b6d4, #22c55e, #84cc16, #eab308, #f97316, #ec4899);
      cursor: pointer;
      padding: 0;
    }
    .edit-color-swatch-list {
      position: absolute;
      top: calc(100% + 0.35rem);
      left: 0;
      z-index: 3;
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 0.35rem;
      padding: 0.45rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface-elevated);
      width: min(20rem, 92vw);
      box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    }
    .edit-color-swatch-list[hidden] { display: none; }
    .edit-recurring-wrap { margin-bottom: 0.35rem; display: block; }
    .card-edit-form input[type="text"],
    .card-edit-form textarea,
    .card-edit-form .input-datetime { width: 100%; max-width: 100%; min-width: 0; padding: 0.35rem 0.45rem; font-size: 0.8rem; background: var(--surface-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); box-sizing: border-box; }
    .card-edit-form textarea {
      min-height: 4.6rem;
      line-height: 1.35;
      resize: vertical;
      overflow-y: auto;
    }
    .card-edit-form input:focus { outline: none; border-color: var(--edit-accent, var(--border)); }
    .card-edit-form .edit-actions { display: flex; gap: 0.35rem; margin-top: 0.4rem; justify-content: center; }
    .card-edit-form .edit-actions button { padding: 0.3rem 0.6rem; font-size: 0.75rem; border-radius: var(--radius-sm); cursor: pointer; border: none; font-family: inherit; }
    .card-edit-save { background: var(--edit-accent, var(--rainbow-0)); color: var(--bg); }
    .card-edit-cancel { background: var(--surface-elevated); color: var(--muted); border: 1px solid var(--border); }
    .card-edit { border-color: var(--edit-accent, var(--border)); }

    .add-section { flex-shrink: 0; min-width: 0; max-width: 100%; padding: 1rem 0; border-top: 1px solid var(--border); }
    .add-section-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
    .add-section h2 { font-size: 0.75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 0; }
    .add-time-left-label {
      font-size: 1rem;
      font-weight: 700;
      color: var(--text);
      text-transform: none;
      letter-spacing: 0.02em;
      background: var(--surface);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.6rem 0.8rem;
      white-space: normal;
      min-width: 10.5rem;
      text-align: left;
      font-family: 'JetBrains Mono', monospace;
      line-height: 1.2;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
    }
    .add-time-left-row {
      display: flex;
      justify-content: flex-start;
      margin-top: 0.45rem;
    }
    .time-adjust-row .add-time-left-row {
      margin-top: 0.15rem;
    }
    .add-form { --add-form-field-width: 50%; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; max-width: 100%; }
    .add-form > .input-wrap,
    .add-form > .buttons-add,
    .add-form > .form-error,
    .goal-reward-form.add-form > .input-wrap,
    .goal-reward-form.add-form > .goal-reward-form-actions {
      width: var(--add-form-field-width);
      max-width: 100%;
      min-width: 0;
    }
    .goal-reward-card .goal-reward-form.add-form { --add-form-field-width: 100%; }
    .add-form label,
    .goal-reward-form.add-form label { font-size: 0.8rem; color: var(--muted); }
    .add-form input[type="text"],
    .add-form textarea,
    .goal-reward-form.add-form input[type="text"],
    .goal-reward-form.add-form input[type="number"],
    .goal-reward-form.add-form textarea {
      width: 100%;
      max-width: 100%;
      min-width: 0;
      padding: 0.7rem 0.85rem;
      font-family: 'Outfit', system-ui, sans-serif;
      font-size: 1rem;
      background: var(--surface);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      color: var(--text);
      box-sizing: border-box;
    }
    .add-form textarea,
    .goal-reward-form.add-form textarea {
      min-height: 5.2rem;
      line-height: 1.35;
      resize: vertical;
      overflow-y: auto;
    }
    .add-form input:focus,
    .add-form textarea:focus,
    .goal-reward-form.add-form input:focus,
    .goal-reward-form.add-form textarea:focus { outline: none; border-color: var(--accent-color, var(--rainbow-0)); }
    .mode-toggle {
      display: inline-flex;
      gap: 0.35rem;
      padding: 0.25rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--surface);
      margin-bottom: 0.4rem;
    }
    .time-adjust-row .mode-toggle { margin-bottom: 0; }
    .mode-toggle-btn {
      border: 1px solid var(--border);
      border-radius: calc(var(--radius-sm) - 2px);
      background: transparent;
      color: var(--muted);
      font-family: 'Outfit', system-ui, sans-serif;
      font-size: 0.78rem;
      padding: 0.35rem 0.65rem;
      cursor: pointer;
    }
    .mode-toggle-btn.active {
      background: var(--accent-color, var(--rainbow-0));
      color: var(--bg);
      border-color: transparent;
    }

    .duration-row {
      display: flex;
      align-items: center;
      gap: 0.5rem;
      flex-wrap: wrap;
    }
    .duration-unit {
      display: flex;
      align-items: center;
      gap: 0.25rem;
      min-width: 5rem;
      background: var(--surface);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
      padding: 0.25rem 0.35rem;
    }
    .duration-unit .duration-unit-label { font-size: 0.65rem; text-transform: lowercase; letter-spacing: 0.02em; color: var(--muted); margin-right: 0.2rem; }
    .duration-unit .val { font-family: 'JetBrains Mono', monospace; font-size: 1rem; font-weight: 600; min-width: 1.5rem; text-align: center; }
    .duration-unit button {
      width: 28px;
      height: 28px;
      border: none;
      border-radius: 6px;
      background: var(--surface-elevated);
      color: var(--text);
      font-size: 1.1rem;
      line-height: 1;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      transition: transform 0.12s ease, background 0.12s ease;
      font-family: 'Outfit', system-ui, sans-serif;
    }
    .duration-unit button:hover { background: var(--border); }
    .duration-unit button:active { transform: scale(0.92); }
    .duration-unit button.bump { animation: bump 0.3s ease; }
    @keyframes bump {
      0% { transform: scale(1); }
      50% { transform: scale(1.2); }
      100% { transform: scale(1); }
    }

    .duration-summary { font-size: 0.8rem; color: var(--muted); margin-top: -0.25rem; }
    .buttons-add { align-items: center; gap: 1rem; }
    .recurring-label { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; color: var(--muted); cursor: pointer; -webkit-user-select: none; user-select: none; }
    .recurring-label input { width: 1.1em; height: 1.1em; accent-color: var(--accent-color, var(--rainbow-0)); }
    .recurring-advanced {
      margin-top: -0.25rem;
      padding: 0.75rem;
      border: 1px solid var(--border);
      border-radius: var(--radius-sm);
      background: var(--surface-elevated);
    }
    .recurring-advanced-row {
      display: grid;
      grid-template-columns: 7rem 1fr;
      gap: 0.5rem;
      align-items: center;
      margin-bottom: 0.45rem;
    }
    .recurring-advanced-row:last-child { margin-bottom: 0; }
    .recurring-advanced-row > label {
      font-size: 0.75rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .weekday-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 0.35rem;
    }
    .weekday-grid label {
      display: inline-flex;
      align-items: center;
      gap: 0.3rem;
      font-size: 0.76rem;
      color: var(--text);
    }
    .count-control {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
    }
    .count-control button {
      width: 1.65rem;
      height: 1.65rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      cursor: pointer;
      font-size: 1rem;
      line-height: 1;
    }
    .count-control span {
      min-width: 2.4rem;
      text-align: center;
      font-family: 'JetBrains Mono', monospace;
      color: var(--text);
      font-size: 0.85rem;
    }
    .color-picker { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
    .color-swatch {
      width: 26px;
      height: 26px;
      border-radius: 0.55rem;
      border: 2px solid var(--border);
      background: var(--surface-elevated);
      padding: 0;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px rgba(255,255,255,0.12); }
    .color-swatch.auto {
      background: linear-gradient(135deg, #8b5cf6, #3b82f6, #06b6d4, #22c55e, #84cc16, #eab308, #f97316, #ec4899);
    }
    #colorPickerAdd {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      align-items: stretch;
      padding-top: 0.2rem;
      padding-bottom: 0.45rem;
      column-gap: 0.55rem;
      row-gap: 0.35rem;
      min-height: 0;
    }
    #colorPickerAdd .color-swatch {
      position: relative;
      overflow: hidden;
      width: 100%;
      max-width: none;
      min-height: 1.55rem;
      height: auto;
      justify-self: stretch;
      display: inline-flex;
      align-items: center;
      justify-content: flex-start;
      gap: 0.45rem;
      border: 1px solid var(--border);
      border-radius: 0.45rem;
      background: var(--surface);
      color: var(--text);
      text-align: left;
      padding: 0.22rem 0.4rem;
      font-size: 0.95rem;
      font-weight: 500;
      line-height: 1.15;
      font-family: 'Outfit', system-ui, sans-serif;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
    #colorPickerAdd .color-swatch::before {
      content: '';
      flex: 0 0 0.8rem;
      width: 0.8rem;
      height: 0.8rem;
      border-radius: 0.22rem;
      border: 1px solid rgba(255,255,255,0.35);
      background: var(--swatch-color, #888);
      box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15);
      pointer-events: none;
    }
    #colorPickerAdd .color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 35%, transparent 65%); }
    #colorPickerAdd .color-swatch.editing {
      cursor: text;
      border-color: var(--text);
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 35%, transparent 65%);
    }
    #colorPickerAdd .color-swatch .color-swatch-inline-input {
      flex: 1 1 auto;
      min-width: 0;
      width: 100%;
      border: none;
      background: transparent;
      color: inherit;
      font: inherit;
      line-height: inherit;
      padding: 0;
      margin: 0;
      outline: none;
    }
    #colorPickerAdd .color-swatch .color-swatch-inline-input::placeholder {
      color: var(--muted);
      opacity: 0.8;
    }
    .color-label-wrap { margin-top: 0.4rem; }
    .color-note { font-size: 0.75rem; color: var(--muted); margin-top: 0.25rem; }
    .priority-picker {
      display: flex;
      align-items: center;
      justify-content: flex-start;
      flex-wrap: nowrap;
      padding-top: 0.2rem;
      gap: 0.35rem;
      min-height: 0;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
    }
    .priority-scale-label {
      font-size: 0.72rem;
      color: var(--muted);
      font-weight: 600;
      letter-spacing: 0.01em;
      flex: 0 0 auto;
      white-space: nowrap;
      text-transform: lowercase;
    }
    .priority-swatch {
      position: relative;
      overflow: hidden;
      width: 1.85rem;
      height: 1.85rem;
      min-height: 1.85rem;
      flex: 0 0 auto;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--border);
      border-radius: 0.45rem;
      background: var(--swatch-color, var(--surface));
      color: #0a0a0c;
      text-align: center;
      padding: 0;
      font-size: 0.82rem;
      font-weight: 700;
      line-height: 1;
      font-family: 'JetBrains Mono', monospace;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .priority-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 35%, transparent 65%); }
    .priority-label-wrap { margin-top: 0.4rem; }
    .datetime-wrap { margin-top: 0.85rem; }
    .time-adjust-row { margin-top: 0.4rem; display: flex; flex-direction: column; align-items: stretch; gap: 0.45rem; }
    .time-adjust-label { font-size: 0.8rem; color: var(--muted); }
    .event-timing-row,
    .event-window-row {
      display: grid;
      grid-template-columns: 12rem minmax(0, 1fr);
      gap: 0.5rem;
      align-items: center;
    }
    .event-timing-row > label,
    .event-window-row > label {
      font-size: 0.72rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .datetime-picker-shell {
      margin-top: 0.35rem;
      padding: 0.85rem 0.9rem;
      border-radius: calc(var(--radius-sm) + 2px);
      border: 2px solid var(--border);
      background: var(--surface-elevated);
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      width: 100%;
      min-width: 0;
      max-width: 100%;
    }
    .input-datetime {
      width: 100%;
      padding: 0.7rem 0.85rem;
      font-family: 'Outfit', system-ui, sans-serif;
      font-size: 0.95rem;
      color: var(--text);
      background: var(--surface-elevated);
      border: 2px solid var(--border);
      border-radius: var(--radius-sm);
    }
    .input-datetime.hidden-picker {
      position: absolute;
      width: 1px;
      height: 1px;
      opacity: 0;
      pointer-events: none;
      border: 0;
      padding: 0;
    }
    .segmented-datetime {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 0.45rem;
    }
    .seg-input-wrap {
      display: flex;
      flex-direction: column;
      gap: 0.2rem;
    }
    .seg-input-label {
      font-size: 0.65rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .seg-input {
      width: 100%;
      min-width: 0;
      padding: 0.45rem 0.35rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      text-align: center;
      font-size: 0.9rem;
      font-family: 'JetBrains Mono', monospace;
      box-sizing: border-box;
    }
    .seg-input:focus { outline: none; border-color: var(--accent-color, var(--rainbow-0)); }
    .seg-step-top {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0.2rem;
      margin-bottom: 0.22rem;
    }
    .seg-step-btn {
      width: 100%;
      height: 1.1rem;
      border-radius: 0.35rem;
      border: 1px solid var(--border);
      background: var(--surface);
      color: var(--text);
      font-size: 0.75rem;
      line-height: 1;
      padding: 0;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .seg-step-btn:hover { background: var(--border); }
    .datetime-wrap.is-locked .seg-input,
    .datetime-wrap.is-locked .seg-step-btn {
      opacity: 0.65;
      cursor: not-allowed;
    }
    .input-datetime:focus { outline: none; border-color: var(--accent-color, var(--rainbow-0)); }
    .buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
    .btn {
      font-family: 'Outfit', system-ui, sans-serif;
      font-size: 0.95rem;
      font-weight: 600;
      padding: 0.75rem 1.25rem;
      border: none;
      border-radius: var(--radius-sm);
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      transition: transform 0.15s ease, box-shadow 0.15s ease;
    }
    .btn:active { transform: scale(0.97); }
    .btn-add { background: var(--accent-color, var(--rainbow-0)); color: var(--bg); }
    .btn-add:hover, .btn-add:active, .btn-add:focus-visible { box-shadow: 0 0 20px var(--accent-glow, rgba(34, 197, 94, 0.4)); }
    /* Dark + colorful themes: neon UI — solid black CTA reads clearer than accent fill */
    html:not(.theme-bright) .btn-add {
      background: #0a0a0c;
      color: #f4f4f8;
      border: 1px solid rgba(255, 255, 255, 0.14);
    }
    html:not(.theme-bright) .btn-add:hover,
    html:not(.theme-bright) .btn-add:active,
    html:not(.theme-bright) .btn-add:focus-visible {
      box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 0 18px rgba(255, 255, 255, 0.12);
    }
    .goal-reward-form-actions .goal-reward-set-btn.btn-add {
      background: var(--surface);
      color: #0a0a0c;
      border: 2px solid var(--accent-color, var(--rainbow-0));
    }
    .goal-reward-form-actions .goal-reward-set-btn.btn-add:hover,
    .goal-reward-form-actions .goal-reward-set-btn.btn-add:active,
    .goal-reward-form-actions .goal-reward-set-btn.btn-add:focus-visible {
      box-shadow: 0 0 16px var(--accent-glow, rgba(34, 197, 94, 0.35));
    }
    .form-error { font-size: 0.8rem; color: var(--rainbow-6); margin-top: -0.25rem; }
    .empty-list { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 2rem 1rem; }

    .goal-reward-section {
      flex-shrink: 0;
      min-width: 0;
      max-width: 100%;
      padding: 1rem 0;
      border-top: 1px solid var(--border);
    }
    .goal-reward-heading {
      font-size: 0.75rem;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin: 0 0 0.65rem;
    }
    .goal-reward-card {
      background: var(--surface-elevated);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 0.85rem 0.9rem;
    }
    .goal-reward-goals-list {
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
      margin-bottom: 0.85rem;
    }
    .goal-reward-goals-list:empty {
      display: none;
      margin-bottom: 0;
    }
    .goal-reward-goal-block {
      padding-bottom: 0.85rem;
      border-bottom: 1px solid var(--border);
    }
    .goal-reward-goal-block:last-child {
      border-bottom: none;
      padding-bottom: 0;
    }
    .goal-reward-goal-block.goal-reward-reached .goal-reward-bar-fill {
      animation: goal-bar-pulse 1.2s ease-in-out infinite;
    }
    .goal-reward-goal-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
      align-items: center;
      margin-top: 0.5rem;
    }
    .goal-reward-title-display {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--text);
      margin: 0 0 0.25rem;
      line-height: 1.25;
    }
    .goal-reward-reward-display {
      font-size: 0.8rem;
      color: var(--muted);
      margin: 0 0 0.5rem;
      line-height: 1.3;
    }
    .goal-reward-counter {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      justify-content: center;
      gap: 0.15rem 0.35rem;
      margin: 0.35rem 0 0.5rem;
      font-family: 'JetBrains Mono', monospace;
    }
    .goal-reward-counter-inner {
      font-size: clamp(2.5rem, 10vw, 3.75rem);
      font-weight: 800;
      line-height: 1;
      background: linear-gradient(120deg, #ef4444, #eab308, #22c55e, #06b6d4, #a855f7);
      background-size: 200% 200%;
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      -webkit-text-fill-color: transparent;
      animation: goal-gradient-shift 8s ease infinite;
    }
    .goal-reward-counter-inner.goal-counter-bump {
      animation: goal-gradient-shift 8s ease infinite, goal-counter-bump 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .goal-reward-counter-slash {
      font-size: clamp(1.25rem, 5vw, 1.85rem);
      font-weight: 600;
      color: var(--muted);
      opacity: 0.85;
    }
    .goal-reward-counter-target {
      font-size: clamp(1.25rem, 5vw, 1.85rem);
      font-weight: 700;
      color: var(--text);
    }
    @keyframes goal-gradient-shift {
      0%, 100% { background-position: 0% 50%; }
      50% { background-position: 100% 50%; }
    }
    @keyframes goal-counter-bump {
      0% { transform: scale(1); filter: brightness(1); }
      40% { transform: scale(1.12); filter: brightness(1.15); }
      100% { transform: scale(1); filter: brightness(1); }
    }
    @keyframes goal-bar-pulse {
      0%, 100% { filter: brightness(1) saturate(1); }
      50% { filter: brightness(1.12) saturate(1.2); }
    }
    .goal-reward-bar {
      height: 10px;
      border-radius: 999px;
      background: var(--surface);
      border: 1px solid var(--border);
      overflow: hidden;
    }
    .goal-reward-bar-fill {
      height: 100%;
      width: 0%;
      border-radius: inherit;
      background: linear-gradient(90deg, #22c55e, #06b6d4, #a855f7, #eab308);
      background-size: 200% 100%;
      transition: width 0.35s ease;
      animation: goal-bar-shimmer 3s linear infinite;
    }
    @keyframes goal-bar-shimmer {
      0% { background-position: 0% 50%; }
      100% { background-position: 200% 50%; }
    }
    .goal-reward-form.add-form { gap: 0.75rem; }
    .goal-reward-form-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
      align-items: center;
      margin-top: 0.15rem;
    }
    .goal-reward-form-actions .goal-reward-set-btn.btn-add { font-size: 0.85rem; padding: 0.45rem 0.75rem; }
    .footer-goal-compact {
      display: inline-flex;
      align-items: center;
      gap: 0.4rem;
      flex-wrap: wrap;
      max-width: 100%;
      padding: 0.25rem 0.5rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: linear-gradient(135deg, rgba(34, 197, 94, 0.12), rgba(6, 182, 212, 0.1));
      color: var(--text);
      font-size: 0.72rem;
      font-weight: 600;
      cursor: pointer;
      font-family: 'Outfit', system-ui, sans-serif;
      -webkit-tap-highlight-color: transparent;
    }
    .footer-goal-compact:hover { border-color: var(--muted); }
    .footer-goal-compact-label { color: var(--muted); max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
    .footer-goal-compact-nums {
      font-family: 'JetBrains Mono', monospace;
      font-weight: 700;
      font-size: 0.78rem;
      background: linear-gradient(90deg, #22c55e, #06b6d4);
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      -webkit-text-fill-color: transparent;
    }

    .completed-section { flex-shrink: 0; min-width: 0; max-width: 100%; padding: 1rem 0; border-top: 1px solid var(--border); }
    .completed-toggle {
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.65rem 0;
      background: none;
      border: none;
      color: var(--muted);
      font-size: 0.8rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      cursor: pointer;
      font-family: 'Outfit', system-ui, sans-serif;
      -webkit-tap-highlight-color: transparent;
    }
    .completed-toggle:hover { color: var(--text); }
    .completed-count { background: var(--surface); padding: 0.2rem 0.5rem; border-radius: var(--radius-sm); font-size: 0.75rem; }

    .completed-overlay {
      position: fixed;
      inset: 0;
      z-index: 100;
      background: rgba(15, 15, 18, 0.9);
      display: flex;
      flex-direction: column;
      align-items: stretch;
      padding: var(--safe-top) 1.25rem calc(1.5rem + var(--safe-bottom));
      overflow: hidden;
      min-height: 0;
      box-sizing: border-box;
    }
    .completed-overlay[hidden] { display: none; }
    .completed-overlay-header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 0.5rem;
      flex-wrap: wrap;
      padding: 1rem 0;
      flex-shrink: 0;
      min-height: 0;
    }
    .completed-overlay-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; order: 1; flex: 0 0 auto; margin-left: auto; }
    .completed-overlay-title { font-size: 1.1rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; order: 0; flex: 0 1 auto; min-width: 0; }
    .completed-reflection-summary {
      flex: 1 0 100%;
      width: 100%;
      order: 2;
      margin: 0.35rem 0 0;
      font-size: 0.8rem;
      line-height: 1.35;
      color: var(--muted);
      min-width: 0;
    }
    .completed-score-line {
      display: flex;
      flex-wrap: wrap;
      align-items: baseline;
      gap: 0.35rem 0.55rem;
      width: 100%;
    }
    .completed-score-word,
    .completed-score-tail {
      font-size: 1em;
      font-weight: 600;
      color: var(--muted);
    }
    .completed-score-num {
      font-size: clamp(2.25rem, 6vw + 1.25rem, 4.5rem);
      line-height: 1.08;
      font-weight: 800;
      color: var(--text);
      font-variant-numeric: tabular-nums;
    }
    .completed-summary-sep { color: var(--muted); font-weight: 400; font-size: 1em; }
    .completed-reflection-summary[hidden] { display: none !important; }
    .completed-overlay-close {
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text);
      font-size: 0.9rem;
      padding: 0.4rem 0.75rem;
      border-radius: var(--radius-sm);
      cursor: pointer;
      font-family: 'Outfit', system-ui, sans-serif;
      -webkit-tap-highlight-color: transparent;
    }
    .completed-overlay-list {
      flex: 1 1 auto;
      min-height: 0;
      overflow-x: hidden;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
      padding-bottom: 0.65rem;
    }
    .completed-popup-item {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      padding: 0.32rem 0.45rem;
      background: var(--surface);
      border-radius: var(--radius-sm);
      border-left: 3px solid var(--border);
      font-size: 0.8rem;
      color: var(--text);
      min-height: 0;
      flex-shrink: 0;
      line-height: 1.25;
    }
    .completed-popup-item .completed-popup-label { font-weight: 600; flex: 1; min-width: 0; line-height: 1.2; }
    .completed-popup-comment { font-size: 0.72rem; color: var(--muted); margin-top: 0.06rem; line-height: 1.2; white-space: pre-wrap; }
    .completed-popup-type { font-size: 0.82rem; font-weight: 700; color: var(--muted); flex-shrink: 0; line-height: 1; }
    .completed-popup-actions { display: inline-flex; align-items: center; gap: 0.15rem; flex-shrink: 0; }
    .completed-popup-item .completed-popup-delete,
    .completed-popup-item .completed-popup-restore {
      flex-shrink: 0;
      width: 1.65rem;
      height: 1.65rem;
      padding: 0;
      border: none;
      border-radius: 4px;
      background: var(--surface-elevated);
      color: var(--muted);
      font-size: 0.95rem;
      line-height: 1;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      -webkit-tap-highlight-color: transparent;
    }
    .completed-popup-item .completed-popup-restore { color: var(--rainbow-6); }
    .completed-popup-item .completed-popup-restore:hover { color: var(--text); background: var(--border); }
    .completed-popup-item .completed-popup-restore-now { font-size: 0.62rem; }
    .completed-popup-item .completed-popup-delete:hover { color: var(--text); background: var(--border); }
    .completed-popup-line1 {
      display: flex;
      align-items: flex-start;
      flex-wrap: wrap;
      gap: 0.3rem 0.4rem;
      width: 100%;
      min-width: 0;
      row-gap: 0.25rem;
    }
    .completed-popup-reflection {
      width: 100%;
      margin-top: 0.22rem;
      padding-top: 0.28rem;
      border-top: 1px solid var(--border);
    }
    .completed-popup-reflection-horizontal {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 0.22rem 0.45rem;
      row-gap: 0.2rem;
    }
    .completed-reflection-chip {
      display: inline-flex;
      align-items: baseline;
      flex-wrap: wrap;
      gap: 0.15rem 0.28rem;
      max-width: 100%;
      min-width: 0;
    }
    .completed-reflection-chip-label {
      font-size: 0.6rem;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      color: var(--muted);
      white-space: normal;
      line-height: 1.15;
      max-width: 100%;
    }
    .completed-reflection-chip-value {
      font-size: 0.74rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      white-space: nowrap;
      line-height: 1.2;
    }
    .completed-reflection-line {
      display: flex;
      align-items: center;
      min-height: 1.45rem;
      gap: 0.5rem;
    }
    .completed-reflection-label {
      display: inline-block;
      font-size: 0.7rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--muted);
      margin-bottom: 0;
    }
    .completed-reflection-value {
      margin-left: auto;
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      min-width: 3.2rem;
      text-align: right;
    }
    .completed-reflection-value.is-empty { opacity: 0; }
    .completed-reflection-value.tone-neg-strong,
    .completed-reflection-chip-value.tone-neg-strong { color: #ef4444; }
    .completed-reflection-value.tone-neg,
    .completed-reflection-chip-value.tone-neg { color: #f59e0b; }
    .completed-reflection-value.tone-neutral,
    .completed-reflection-chip-value.tone-neutral { color: #9ca3af; }
    .completed-reflection-value.tone-pos,
    .completed-reflection-chip-value.tone-pos { color: #84cc16; }
    .completed-reflection-value.tone-pos-strong,
    .completed-reflection-chip-value.tone-pos-strong { color: #22c55e; }
    .completed-reflection-btns {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
      align-items: flex-start;
      flex-direction: column;
      width: 100%;
    }
    .reflection-row {
      display: flex;
      align-items: flex-start;
      flex-wrap: wrap;
      gap: 0.45rem;
      width: 100%;
    }
    .reflection-row-label {
      min-width: 0;
      width: 100%;
      font-size: 0.7rem;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-bottom: 0.1rem;
    }
    .completed-reflection-btn {
      width: 2rem;
      height: 2rem;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.9rem;
      line-height: 1;
      border-radius: 0.55rem;
      border: 1px solid color-mix(in srgb, var(--border) 85%, #ffffff 15%);
      background: linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 92%, #ffffff 8%), color-mix(in srgb, var(--surface) 94%, #000000 6%));
      color: var(--muted);
      cursor: pointer;
      font-family: inherit;
      font-weight: 700;
      transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
    }
    .completed-reflection-btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--text) 80%, var(--border) 20%); }
    .completed-reflection-btn.active {
      border-color: color-mix(in srgb, var(--text) 78%, var(--border) 22%);
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent 82%), 0 0 0.45rem color-mix(in srgb, var(--text) 14%, transparent 86%);
    }
    .completed-reflection-clear {
      margin-left: 0.35rem;
      font-size: 0.68rem;
      padding: 0.2rem 0.4rem;
      border: none;
      background: none;
      color: var(--muted);
      cursor: pointer;
      text-decoration: underline;
      font-family: inherit;
    }
    .completed-reflection-clear:hover { color: var(--text); }
    .reflection-rating {
      flex: 1 1 100%;
      width: 100%;
      margin-bottom: 0.35rem;
    }
    .reflection-rating-hint {
      display: block;
      font-size: 0.72rem;
      color: var(--muted);
      margin-bottom: 0.3rem;
      line-height: 1.35;
    }
    .reflection-rating-btns {
      display: flex;
      flex-wrap: wrap;
      gap: 0.25rem;
      align-items: center;
    }
    .reflection-btn {
      width: 2rem;
      height: 2rem;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 0.95rem;
      line-height: 1;
      border-radius: 0.55rem;
      border: 1px solid color-mix(in srgb, var(--border) 85%, #ffffff 15%);
      background: linear-gradient(180deg, color-mix(in srgb, var(--surface-elevated) 92%, #ffffff 8%), color-mix(in srgb, var(--surface) 94%, #000000 6%));
      color: var(--muted);
      cursor: pointer;
      font-family: inherit;
      font-weight: 700;
      transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
    }
    .reflection-btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--text) 80%, var(--border) 20%); }
    .reflection-btn.selected {
      border-color: color-mix(in srgb, var(--text) 78%, var(--border) 22%);
      box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 18%, transparent 82%), 0 0 0.45rem color-mix(in srgb, var(--text) 14%, transparent 86%);
    }
    .reflection-btn[data-star-tone="neg-strong"],
    .completed-reflection-btn[data-star-tone="neg-strong"] { color: #ef4444; }
    .reflection-btn[data-star-tone="neg"],
    .completed-reflection-btn[data-star-tone="neg"] { color: #f59e0b; }
    .reflection-btn[data-star-tone="neutral"],
    .completed-reflection-btn[data-star-tone="neutral"] { color: #9ca3af; }
    .reflection-btn[data-star-tone="pos"],
    .completed-reflection-btn[data-star-tone="pos"] { color: #84cc16; }
    .reflection-btn[data-star-tone="pos-strong"],
    .completed-reflection-btn[data-star-tone="pos-strong"] { color: #22c55e; }
    .reflection-btn.selected[data-star-tone="neg-strong"],
    .completed-reflection-btn.active[data-star-tone="neg-strong"] { background: color-mix(in srgb, #ef4444 28%, var(--surface-elevated) 72%); }
    .reflection-btn.selected[data-star-tone="neg"],
    .completed-reflection-btn.active[data-star-tone="neg"] { background: color-mix(in srgb, #f59e0b 28%, var(--surface-elevated) 72%); }
    .reflection-btn.selected[data-star-tone="neutral"],
    .completed-reflection-btn.active[data-star-tone="neutral"] { background: color-mix(in srgb, #9ca3af 28%, var(--surface-elevated) 72%); }
    .reflection-btn.selected[data-star-tone="pos"],
    .completed-reflection-btn.active[data-star-tone="pos"] { background: color-mix(in srgb, #84cc16 28%, var(--surface-elevated) 72%); }
    .reflection-btn.selected[data-star-tone="pos-strong"],
    .completed-reflection-btn.active[data-star-tone="pos-strong"] { background: color-mix(in srgb, #22c55e 28%, var(--surface-elevated) 72%); }
    .reflection-clear-btn {
      display: block;
      margin-top: 0.3rem;
      font-size: 0.68rem;
      padding: 0;
      border: none;
      background: none;
      color: var(--muted);
      cursor: pointer;
      text-decoration: underline;
      font-family: inherit;
    }
    .reflection-clear-btn:hover { color: var(--text); }
    .completed-clear-all {
      font-size: 0.85rem;
      padding: 0.4rem 0.6rem;
      border-radius: var(--radius-sm);
      border: 1px solid var(--border);
      background: var(--surface-elevated);
      color: var(--muted);
      cursor: pointer;
      font-family: inherit;
    }
    .completed-clear-all:hover { color: var(--text); border-color: var(--muted); }
    @media (max-width: 900px) {
      .view-toolbar-tabs-row {
        justify-content: flex-start;
      }
      .add-form > .input-wrap,
      .add-form > .buttons-add,
      .add-form > .form-error,
      .goal-reward-form.add-form > .input-wrap,
      .goal-reward-form.add-form > .goal-reward-form-actions {
        width: 100%;
      }
      .datetime-picker-shell {
        width: 100%;
        min-width: 0;
        max-width: 100%;
      }
      .done-comment,
      .card-actions .done-comment.remove-comment {
        width: 100%;
        min-width: 0;
      }
      .app-footer {
        margin-left: 0;
        margin-right: 0;
      }
      .app-footer-status {
        min-width: 0;
        width: 100%;
      }
      .app-footer-actions {
        margin-left: 0;
        width: 100%;
      }
      .notes-panel {
        right: auto;
        left: 0;
        min-width: 0;
        width: min(30rem, calc(100vw - 2rem));
      }
      .footer-contact-wrap .contact-panel {
        right: auto;
        left: 0;
        max-width: min(22rem, calc(100vw - 2rem));
      }
      .footer-tools-wrap .tools-panel,
      .footer-settings-wrap .settings-panel {
        right: auto;
        left: 0;
        max-width: min(24rem, calc(100vw - 2rem));
      }
      #colorPickerAdd {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding-top: 0.35rem;
        min-height: 0;
        row-gap: 0.35rem;
      }
      .edit-color-swatch-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
    }
    @media (max-width: 420px) {
      .app { padding: 0 0.75rem 1rem; }
      .reflection-btn {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.8rem;
        border-radius: 0.4rem;
      }
      .completed-reflection-btn {
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.8rem;
        border-radius: 0.4rem;
      }
      .reflection-rating { margin-bottom: 0.2rem; }
      .reflection-rating-btns { gap: 0.15rem; }
      .reflection-row { gap: 0.25rem; }
      .reflection-row-label { font-size: 0.62rem; margin-bottom: 0; }
      .reflection-clear-btn { margin-top: 0.15rem; }
      .card-actions { gap: 0.2rem; flex-wrap: wrap; }
      .card-actions button { font-size: 0.7rem; min-width: 1.5rem; height: 1.5rem; padding: 0.2rem 0.4rem; }
      .done-comment, .card-actions .done-comment.remove-comment { font-size: 0.78rem; padding: 0.3rem 0.4rem; max-height: 3rem; }
      .completed-overlay { padding: var(--safe-top) 0.75rem calc(1rem + var(--safe-bottom)); }
      .completed-overlay-header { padding: 0.6rem 0; gap: 0.3rem; }
      .completed-overlay-title { font-size: 0.95rem; }
      .completed-score-num { font-size: clamp(1.75rem, 5vw + 1rem, 3rem); }
      .completed-overlay-close, .completed-clear-all { font-size: 0.8rem; padding: 0.3rem 0.55rem; }
      .completed-popup-item { padding: 0.25rem 0.35rem; }
      .completed-popup-item .completed-popup-delete,
      .completed-popup-item .completed-popup-restore { width: 1.4rem; height: 1.4rem; font-size: 0.8rem; }
      #colorPickerAdd { grid-template-columns: 1fr; }
    }
