  /* ══════════════════════════════════════════════════════════ */
  /* Opgaver-side — live version                               */
  /* ══════════════════════════════════════════════════════════ */

  :root {
    --opgaver-muted: #6B5E55;
    --opgaver-subtle: #7A6B60;
    --opgaver-action: #4A7A68;
    --opgaver-action-dark: #3D6B57;
    --opgaver-rose-text: #7A4F3F;
    --opgaver-sage-text: #3D6B57;
    --opgaver-slate-text: #4E5370;
    --opgaver-time: #746A5C;
    --priority-dot: #D4956A;
    --priority-dot-dark: #C8885E;
    --opgaver-done-bg: #F5F3F0;
  }

  [data-theme="dark"] {
    --cream: #171512;
    --white: #211D19;
    --sidebar-bg: #1A1714;
    --sidebar-border: rgba(232, 224, 216, 0.12);
    --pill-bg: rgba(255, 252, 247, 0.06);
    --divider: rgba(232, 224, 216, 0.10);
    --warm-text: #F2E9DF;
    --warm-text-light: #C8BDB2;
    --muted: #AFA39A;
    --muted-light: #7C736A;
    --icon-active: #F2E9DF;
    --icon-inactive: #9F948A;
    --rose-light: rgba(212, 168, 154, 0.14);
    --rose-bg: rgba(212, 168, 154, 0.12);
    --sage-light: rgba(168, 197, 184, 0.14);
    --sage-bg: rgba(168, 197, 184, 0.10);
    --slate-light: rgba(168, 176, 196, 0.14);
    --slate-bg: rgba(168, 176, 196, 0.10);
    --shadow-card: 0 2px 18px rgba(0, 0, 0, 0.26);
    --shadow-input: 0 1px 4px rgba(0, 0, 0, 0.22);
    --shadow-input-focus: 0 0 0 2px rgba(192, 128, 112, 0.35), 0 2px 14px rgba(0, 0, 0, 0.32);
    --opgaver-muted: #A09890;
    --opgaver-subtle: #9A8E85;
    --opgaver-action: #5A8E7A;
    --opgaver-action-dark: #4A7A68;
    --opgaver-rose-text: #D4A89A;
    --opgaver-sage-text: #A8C5B8;
    --opgaver-slate-text: #A8B0C4;
    --opgaver-time: #9CA3AF;
    --opgaver-done-bg: #211D19;
  }
  [data-theme="dark"] body,
  [data-theme="dark"] .app {
    background: var(--app-dark-canvas); /* #3225 shared app dark canvas */
    color: var(--warm-text);
  }
  [data-theme="dark"] .task-card,
  [data-theme="dark"] .task-input-card,
  [data-theme="dark"] .sofia-suggestion,
  [data-theme="dark"] .sofia-sidebar-shell,
  [data-theme="dark"] .sofia-reminder,
  [data-theme="dark"] .sofia-quick-actions-card,
  [data-theme="dark"] .sofia-tips-card,
  [data-theme="dark"] .parse-chip {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  [data-theme="dark"] .main {
    background: linear-gradient(180deg, #171512 0%, #201B18 55%, #181613 100%);
  }
  [data-theme="dark"] .main::before,
  [data-theme="dark"] .main::after {
    border-color: rgba(212, 168, 154, 0.08);
  }
  [data-theme="dark"] .decorative-arcs,
  [data-theme="dark"] .decorative-arcs-2 {
    border-color: rgba(212, 168, 154, 0.07);
    opacity: 0.38;
  }
  [data-theme="dark"] .decorative-arcs-bl {
    border-color: rgba(168, 197, 184, 0.07);
    opacity: 0.35;
  }
  [data-theme="dark"] .task-card,
  [data-theme="dark"] .task-input-card {
    background: #241F1B;
    border: 1px solid rgba(232, 224, 216, 0.08);
  }
  [data-theme="dark"] .task-item {
    border-bottom-color: rgba(232, 225, 215, 0.06);
  }
  [data-theme="dark"] .task-item:hover {
    background: rgba(212, 168, 154, 0.06);
  }
  [data-theme="dark"] .done-section .task-card { background: var(--opgaver-done-bg); border-color: rgba(255, 255, 255, 0.08); }
  [data-theme="dark"] .task-section--later .task-card { background: rgba(168, 176, 196, 0.04); }
  [data-theme="dark"] .task-section--later { border-top-color: rgba(255, 255, 255, 0.06); }
  [data-theme="dark"] .done-section { border-top-color: rgba(255, 255, 255, 0.06); }
  [data-theme="dark"] .done-toggle { background: rgba(168, 176, 196, 0.08); }
  [data-theme="dark"] .done-toggle:hover { background: rgba(168, 176, 196, 0.15); }
  [data-theme="dark"] .task-input-field { color: var(--warm-text); }
  [data-theme="dark"] .task-input-field::placeholder { color: var(--muted); }
  [data-theme="dark"] .task-text,
  [data-theme="dark"] .task-section-title,
  [data-theme="dark"] .stat-number,
  [data-theme="dark"] .task-edit-panel h2 {
    color: var(--warm-text);
  }
  [data-theme="dark"] .task-tag--rose { background: rgba(212, 168, 154, 0.14); color: var(--opgaver-rose-text); }
  [data-theme="dark"] .task-tag--sage { background: rgba(168, 197, 184, 0.14); color: var(--opgaver-sage-text); }
  [data-theme="dark"] .task-tag--slate { background: rgba(168, 176, 196, 0.14); color: var(--opgaver-slate-text); }
  [data-theme="dark"] .task-action-btn:hover {
    background: rgba(255, 252, 247, 0.08);
    color: #E8DDD4;
  }
  [data-theme="dark"] .task-delete-btn:hover {
    color: #D4706C;
    background: rgba(212, 112, 108, 0.08);
  }
  [data-theme="dark"] .task-star {
    filter: drop-shadow(0 0 4px rgba(212, 160, 96, 0.4));
  }
  [data-theme="dark"] .task-add-btn:hover { box-shadow: 0 3px 10px rgba(92, 77, 67, 0.18), 0 1px 0 0 rgba(255, 255, 255, 0.10) inset; }
  [data-theme="dark"] .task-add-btn:disabled { box-shadow: none; }
  [data-theme="dark"] .stat-divider { background: rgba(255, 255, 255, 0.08); }

  [aria-disabled="true"] {
    pointer-events: none;
    opacity: 0.45;
    cursor: not-allowed;
  }

  #bb-sidebar .sidebar-mic[aria-disabled="true"] {
    pointer-events: auto;
  }

  @media (prefers-reduced-motion: reduce) {
    .content *, .content *::before, .content *::after {
      /* transition:none (not 0.01ms) so visibility flips synchronously and a
         just-opened popover/panel is keyboard-focusable immediately. A 0.01ms
         visibility transition leaves the element visibility:hidden at the
         synchronous focus() call, trapping keyboard users. */
      transition: none !important;
      animation-duration: 0.01ms !important;
    }
    #task-feedback.task-feedback {
      transition: opacity 200ms ease !important;
      transform: translate(-50%, 0) !important;
    }
    #task-feedback.task-feedback:not(:empty) {
      transform: translate(-50%, 0) !important;
    }
  }


  .skip-link {
    position: absolute; top: -60px; left: 0;
    background: var(--warm-text); color: var(--white);
    padding: 12px 24px; z-index: 9000; /* --z-skip */
    font-family: var(--font-family); font-size: var(--font-size-sm);
    border-radius: 0 0 8px 0; text-decoration: none;
    transition: top 0.15s ease;
  }
  .skip-link:focus-visible { top: 0; }

  .content { max-width: 780px; padding-top: 48px; }

  /* ── Task input ── */
  .task-input-form {
    display: flex; align-items: center; gap: 12px;
    max-width: 720px; margin: 0 auto 32px;
  }
  .task-input-card {
    flex: 1 1 auto; position: relative; background: var(--white);
    border-radius: var(--radius-card); padding: 10px 16px 10px 20px;
    box-shadow: var(--shadow-input); transition: box-shadow 0.2s ease;
    display: flex; align-items: center; gap: 12px;
    height: 48px; min-height: 48px; box-sizing: border-box;
    align-self: center; min-width: 0;
  }
  .task-input-card:focus-within { box-shadow: none; }

  .task-input-field {
    flex: 1; border: none; outline: none;
    font-family: var(--font-family); font-size: var(--font-size-base);
    color: var(--warm-text); background: transparent;
    min-width: 0;
  }
  .task-input-field::placeholder {
    color: var(--opgaver-subtle); opacity: 1;
    font-family: var(--font-family); font-style: normal;
  }

  .task-add-btn {
    height: 44px; padding: 0 22px;
    border-radius: 14px;
    background-color: var(--opgaver-action);
    background-image: linear-gradient(135deg, var(--opgaver-action) 0%, var(--opgaver-action-dark) 100%);
    color: #fffdfa;
    font-family: var(--font-family); font-size: var(--font-size-base); font-weight: var(--font-weight-bold);
    cursor: pointer; transition: box-shadow 0.2s ease;
    flex-shrink: 0; display: flex; align-items: center; gap: 6px;
    border: none; align-self: center;
    box-shadow: 0 2px 6px rgba(92, 77, 67, 0.08), 0 1px 0 0 rgba(255, 255, 255, 0.15) inset;
  }
  .task-add-btn:hover {
    box-shadow: 0 3px 10px rgba(92, 77, 67, 0.12), 0 1px 0 0 rgba(255, 255, 255, 0.18) inset;
  }
  .task-add-btn:disabled {
    opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none;
  }
  .task-add-btn svg { width: 16px; height: 16px; }

  /* ── Smart parse chips ── */
  .parse-chips {
    display: flex; flex-wrap: wrap; gap: 6px;
    max-width: 720px; margin: -20px auto 24px;
    padding: 0 4px;
    min-height: 0;
    transition: min-height 0.2s ease, opacity 0.2s ease;
  }
  .parse-chips:empty { min-height: 0; margin-bottom: 0; }
  .parse-chip {
    display: inline-flex; align-items: center; gap: 5px;
    max-width: 100%;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    font-family: var(--font-family); font-size: var(--font-size-xs); font-weight: var(--font-weight-medium);
    line-height: 1.2;
    animation: chipIn 0.15s ease;
  }
  @keyframes chipIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
  }
  .parse-chip svg { width: 12px; height: 12px; flex-shrink: 0; }
  .parse-chip-dismiss {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0.5; transition: opacity 0.15s;
    margin: -8px -8px -8px 0; background: none; border: none; padding: 0;
    color: inherit;
  }
  .parse-chip-dismiss:hover { opacity: 1; }
  .parse-chip-dismiss svg { width: 10px; height: 10px; }
  .parse-chip--date {
    background: var(--slate-light); color: var(--slate);
  }
  [data-theme="dark"] .parse-chip--date {
    background: rgba(168, 176, 196, 0.15) !important; color: var(--opgaver-slate-text) !important;
  }
  .parse-chip--time {
    background: var(--sage-light); color: var(--opgaver-sage-text);
  }
  [data-theme="dark"] .parse-chip--time {
    background: rgba(168, 197, 184, 0.15) !important; color: var(--opgaver-sage-text) !important;
  }
  .parse-chip--priority {
    background: var(--rose-light); color: var(--opgaver-rose-text);
  }
  [data-theme="dark"] .parse-chip--priority {
    background: rgba(212, 168, 154, 0.15) !important; color: var(--opgaver-rose-text) !important;
  }
  .parse-chip--category {
    background: var(--pill-bg); color: var(--opgaver-muted);
  }
  [data-theme="dark"] .parse-chip--category {
    background: rgba(255, 255, 255, 0.08) !important; color: var(--opgaver-muted);
  }

  /* ── Auto-detected chip indicator ── */
  .parse-chip--auto {
    animation: chipIn 0.15s ease, chipAutoPulse 1.5s ease-out 0.15s;
    box-shadow: 0 0 0 1px rgba(168, 197, 184, 0.16);
    position: relative;
  }
  [data-theme="dark"] .parse-chip--auto {
    box-shadow: 0 0 0 1px rgba(168, 197, 184, 0.18) !important;
  }
  .parse-chip--auto::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 currentColor;
    animation: chipAutoRing 1s ease-out 0.15s;
    pointer-events: none;
  }
  @keyframes chipAutoPulse {
    0% { transform: scale(1); }
    15% { transform: scale(1.04); }
    30% { transform: scale(1); }
  }
  @keyframes chipAutoRing {
    0% { box-shadow: 0 0 0 0 rgba(168, 197, 184, 0.4); }
    100% { box-shadow: 0 0 0 6px rgba(168, 197, 184, 0); }
  }
  [data-theme="dark"] .parse-chip--auto::before {
    animation: chipAutoRingDark 1s ease-out 0.15s !important;
  }
  @keyframes chipAutoRingDark {
    0% { box-shadow: 0 0 0 0 rgba(168, 197, 184, 0.3); }
    100% { box-shadow: 0 0 0 6px rgba(168, 197, 184, 0); }
  }
  .parse-chip-auto {
    font-size: var(--font-size-xs);
    opacity: 0.55;
    margin-left: 1px;
    animation: chipAutoStarIn 0.4s ease-out 0.2s both;
  }
  @keyframes chipAutoStarIn {
    from { opacity: 0; transform: scale(0.5) rotate(-30deg); }
    to { opacity: 0.55; transform: scale(1) rotate(0deg); }
  }
  [data-theme="dark"] .parse-chip-auto {
    opacity: 0.45 !important;
  }

  @keyframes sofiaIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .sofia-link {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 12px; border-radius: 20px;
    background: rgba(168, 197, 184, 0.12); color: var(--opgaver-sage-text);
    font-size: var(--font-size-xs); font-weight: var(--font-weight-medium); text-decoration: none;
    transition: background 0.15s, transform 0.15s;
    border: none; cursor: pointer;
  }
  .sofia-link:hover { background: rgba(168, 197, 184, 0.25); transform: scale(1.02); }
  .sofia-link svg { width: 13px; height: 13px; }

  .task-sofia-details {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(168, 197, 184, 0.08);
    border: 1px solid rgba(168, 197, 184, 0.16);
    font-family: var(--font-family);
  }
  .task-sofia-details summary {
    cursor: pointer;
    color: var(--opgaver-sage-text);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
  }
  .task-sofia-body { padding-top: 8px; font-size: var(--font-size-xs); color: var(--warm-text); line-height: 1.45; }
  .task-sofia-body ul { margin: 6px 0 0; padding-left: 18px; }
  .task-sofia-body li { margin: 4px 0; }
  .task-sofia-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

  [data-theme="dark"] .task-sofia-details {
    background: rgba(168, 197, 184, 0.06);
    border-color: rgba(168, 197, 184, 0.12);
  }

  /* ── Task sections ── */
  .task-section { margin-bottom: 32px; }
  .task-section--later {
    margin-top: 40px; padding-top: 32px;
    border-top: 1px solid rgba(168, 176, 196, 0.3);
  }
  .task-section-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  }
  .task-section-dot {
    width: 10px; height: 10px; border-radius: 50%;
  }
  .task-section--later .task-section-dot { width: 12px; height: 12px; }
  .task-section-dot--rose { background: var(--rose); }
  .task-section-dot--sage { background: var(--sage); }
  .task-section-dot--slate { background: var(--slate); }
  .task-section-title {
    font-family: var(--font-family); font-weight: var(--font-weight-medium);
    font-size: var(--font-size-lg); color: var(--warm-text);
  }
  .task-section-count {
    font-size: var(--font-size-xs); color: var(--opgaver-subtle); margin-left: auto;
  }

  /* ── Task cards ── */
  .task-section--later .task-card {
    background: rgba(168, 176, 196, 0.07);
  }
  .task-item {
    position: relative;
    display: flex; align-items: flex-start; gap: 14px;
    padding: 18px 24px; border-bottom: 1px solid var(--divider);
    transition: background 0.15s ease, opacity 0.2s ease;
    cursor: default;
  }
  .task-item:last-child { border-bottom: none; }
  .task-item:hover { background: rgba(212, 168, 154, 0.04); }
  .task-item.completing {
    opacity: 0.4; transform: scale(0.98);
    transition: all 0.2s ease;
  }

  .task-checkbox-wrapper {
    min-width: 44px; min-height: 44px;
    display: flex; align-items: center; justify-content: center;
    margin: -12px; cursor: pointer; flex-shrink: 0;
  }
  .task-checkbox {
    width: 20px; height: 20px; min-width: 20px;
    border-radius: 50%; border: 2px solid var(--rose);
    cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease;
    display: flex; align-items: center; justify-content: center;
    background: transparent;
  }
  .task-checkbox-wrapper:hover .task-checkbox { background: var(--rose-light); }
  .task-checkbox.done { background: var(--rose); border-color: var(--rose); }
  .task-checkbox.done svg { display: block; }
  .task-checkbox svg { width: 12px; height: 12px; color: var(--white); display: none; }

  .task-content { flex: 1; min-width: 0; }
  .task-text {
    font-size: var(--font-size-sm); color: var(--warm-text); line-height: 1.5; margin-bottom: 6px;
    overflow-wrap: break-word; word-break: break-word;
  }
  .task-item.done .task-text { text-decoration: line-through; color: var(--opgaver-muted); }
  .task-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

  .task-tag {
    font-size: var(--font-size-xs); padding: 3px 10px; border-radius: 10px;
    font-family: var(--font-family);
  }
  .task-tag--rose { background: var(--rose-bg); color: var(--opgaver-rose-text); }
  .task-tag--sage { background: var(--sage-bg); color: var(--opgaver-sage-text); }
  .task-tag--slate { background: var(--slate-bg); color: var(--opgaver-slate-text); }
  .task-tag--sofia {
    background: rgba(168, 197, 184, 0.3); color: var(--opgaver-sage-text);
    border-radius: 10px; padding: 3px 10px;
    font-size: var(--font-size-xs); font-family: var(--font-family);
  }

  .task-time { font-size: var(--font-size-xs); color: var(--opgaver-time); margin-left: auto; }

  .task-priority {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0; margin-top: 8px; margin-left: auto;
  }
  .task-priority--high { background: var(--rose); }
  .task-priority--medium { background: var(--slate); }

  .task-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-self: center;
  }
  .task-action-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    background: none; border: none; cursor: pointer;
    padding: 0; color: var(--opgaver-subtle);
    border-radius: 8px; transition: color 0.15s ease, background 0.15s ease;
  }
  .task-action-btn:hover { color: var(--warm-text); background: rgba(168, 176, 196, 0.12); }
  .task-action-btn svg { width: 15px; height: 15px; }
  .task-delete-btn:hover { color: #9B6050; background: rgba(155, 96, 80, 0.08); }

  /* ── Done section ── */
  .done-section {
    margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--divider);
  }
  .done-toggle {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: var(--font-size-sm); color: var(--warm-text-light);
    font-family: var(--font-family); margin-bottom: 12px;
    padding: 10px 16px; min-height: 44px;
    background: rgba(168, 176, 196, 0.15);
    border-radius: var(--radius-pill); border: none;
    transition: background 0.15s ease;
  }
  .done-toggle:hover { background: rgba(168, 176, 196, 0.25); }
  .done-toggle svg {
    width: 16px; height: 16px; transition: transform 0.2s ease; flex-shrink: 0;
  }
  .done-toggle.open svg { transform: rotate(90deg); }
  .done-section .task-card {
    background: var(--opgaver-done-bg); box-shadow: none; border: 1px solid var(--divider);
  }
  #done-list-container { display: none; }
  #done-list-container.open { display: block; }

  /* ── Loading / empty states ── */
  .loading-state, .empty-state, .error-state {
    text-align: center; padding: 48px 24px;
    font-family: var(--font-family); color: var(--opgaver-subtle); font-size: var(--font-size-sm);
  }
  .error-state { color: #9B6050; }
  #task-feedback.task-feedback {
    position: fixed;
    left: 50%;
    bottom: 32px;
    top: auto;
    right: auto;
    width: auto;
    max-width: min(420px, calc(100vw - 48px));
    margin: 0;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(100% + 32px));
    transition: transform 380ms cubic-bezier(.2, .8, .2, 1), opacity 220ms ease;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    border-radius: 999px;
    background: #3A2F26;
    color: #FBF8F2;
    box-shadow: 0 4px 16px rgba(58, 47, 38, 0.18), inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
  }
  #task-feedback.task-feedback:not(:empty) {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
  }
  .task-feedback--success:not(:empty)::before,
  .task-feedback--error:not(:empty)::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .task-feedback--success:not(:empty)::before {
    background: #6E8A7E;
  }
  .task-feedback--error:not(:empty)::before {
    background: #A6594B;
  }

  /* ── Calm next-step suggestion (#3460) ── */
  .calm-next-step[hidden] { display: none; }
  .calm-next-step-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-top: 8px;
    border-radius: 12px;
    background: var(--card-bg, #FFFFFF);
    border: 1px solid var(--border-light, rgba(58, 47, 38, 0.08));
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--warm-text);
    max-width: 480px;
  }
  .calm-next-step-label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: var(--font-weight-medium);
  }
  .calm-next-step-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .calm-next-step-action {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 8px;
    /* --sage is a pastel (#A8C5B8) — too low contrast for light text (WCAG AA) */
    background: var(--sage-dark, #4A7A68);
    color: #FBF8F2;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background 200ms ease, opacity 200ms ease;
  }
  .calm-next-step-action:hover,
  .calm-next-step-action:focus-visible {
    background: #3D6B57;
    outline: none;
  }
  .calm-next-step-action[disabled] {
    opacity: 0.65;
    cursor: default;
    pointer-events: none;
  }
  .calm-next-step-dismiss[disabled] {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
  }
  .calm-next-step-action--quiet {
    background: transparent;
    color: var(--sage-dark, #4A7A68);
    border: 1px solid var(--sage-dark, #4A7A68);
  }
  .calm-next-step-action--quiet:hover,
  .calm-next-step-action--quiet:focus-visible {
    background: var(--sage-bg, rgba(90, 154, 122, 0.1));
    color: #3D6B57;
  }
  .calm-next-step-bar.is-done {
    border-color: var(--sage, #A8C5B8);
  }
  .calm-next-step-bar.is-done .calm-next-step-label {
    color: var(--sage-dark, #4A7A68);
  }
  .calm-next-step-check {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    vertical-align: -2px;
    color: var(--sage-dark, #4A7A68);
  }
  .calm-next-step-bar.is-error .calm-next-step-label {
    color: var(--opgaver-subtle, #9B8F85);
  }
  .calm-next-step-dismiss {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 8px;
    background: transparent;
    color: var(--opgaver-subtle, #9B8F85);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border: 1px solid var(--border-light, rgba(58, 47, 38, 0.08));
    cursor: pointer;
    white-space: nowrap;
    transition: background 200ms ease, border-color 200ms ease;
  }
  .calm-next-step-dismiss:hover,
  .calm-next-step-dismiss:focus-visible {
    background: var(--hover-bg, rgba(58, 47, 38, 0.04));
    border-color: var(--border-medium, rgba(58, 47, 38, 0.14));
    outline: none;
  }
  [data-theme="dark"] .calm-next-step-bar {
    background: var(--card-bg, #2A2420);
    border-color: var(--border-light, rgba(251, 248, 242, 0.08));
  }
  [data-theme="dark"] .calm-next-step-dismiss {
    border-color: var(--border-light, rgba(251, 248, 242, 0.08));
  }
  [data-theme="dark"] .calm-next-step-dismiss:hover,
  [data-theme="dark"] .calm-next-step-dismiss:focus-visible {
    background: var(--hover-bg, rgba(251, 248, 242, 0.06));
    border-color: var(--border-medium, rgba(251, 248, 242, 0.14));
  }
  /* Dark --sage-dark is a light green (#7CB8A4) — needs dark text for AA */
  [data-theme="dark"] .calm-next-step-action {
    background: var(--sage-dark, #7CB8A4);
    color: #21302A;
  }
  [data-theme="dark"] .calm-next-step-action:hover,
  [data-theme="dark"] .calm-next-step-action:focus-visible {
    background: #8FC4B1;
  }
  [data-theme="dark"] .calm-next-step-action--quiet {
    background: transparent;
    color: var(--sage-dark, #7CB8A4);
    border-color: var(--sage-dark, #7CB8A4);
  }
  [data-theme="dark"] .calm-next-step-action--quiet:hover,
  [data-theme="dark"] .calm-next-step-action--quiet:focus-visible {
    background: rgba(124, 184, 164, 0.12);
    color: #8FC4B1;
  }
  [data-theme="dark"] .calm-next-step-bar.is-done .calm-next-step-label {
    color: var(--sage-dark, #7CB8A4);
  }
  [data-theme="dark"] .calm-next-step-check {
    color: var(--sage-dark, #7CB8A4);
  }

  /* ── Mobile nav collision guard (#1641) ── */
  body.has-mn-bar #task-feedback.task-feedback {
    display: none !important;
  }
  body.has-mn-bar .task-undo-toast {
    display: none !important;
  }

  /* ── Mobile ── */
  @media (max-width: 640px) {
    .app { flex-direction: column; }
    .main {
      height: calc(100vh - 56px);
      height: calc(100dvh - 56px);
      flex: 0 0 calc(100dvh - 56px);
      max-height: calc(100dvh - 56px);
      padding-bottom: 0;
    }
    .content {
      padding: 20px 20px 80px;
      padding-left: max(20px, env(safe-area-inset-left));
      padding-right: max(20px, env(safe-area-inset-right));
      padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    }
    .task-input-form { flex-direction: column; align-items: stretch; }
    .task-add-btn { align-self: flex-end; }
    .task-item { padding: 14px 16px; }
  }

  .task-edit-modal[hidden] { display: none; }
  .task-edit-modal {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(35, 29, 24, 0.52);
  }
  .task-edit-panel {
    width: min(520px, 100%);
    background: var(--white);
    border-radius: var(--radius-card);
    box-shadow: 0 18px 60px rgba(35, 29, 24, 0.22);
    padding: 22px;
    font-family: var(--font-family);
  }
  [data-theme="dark"] .task-edit-panel {
    background: #241F1B;
    border: 1px solid rgba(232, 224, 216, 0.10);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  }
  .task-edit-panel h2 {
    margin: 0 0 14px;
    font-family: var(--font-family);
    font-size: var(--font-size-2xl);
    color: var(--warm-text);
  }
  .task-edit-grid { display: grid; gap: 12px; }
  .task-edit-grid label {
    display: grid; gap: 6px;
    font-size: var(--font-size-xs); color: var(--opgaver-subtle);
    font-weight: var(--font-weight-semibold);
  }
  .task-edit-grid input,
  .task-edit-grid select {
    min-height: 44px;
    border: 1px solid var(--divider);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    color: var(--warm-text);
    background: transparent;
  }
  .task-edit-grid .sk-dropdown-trigger {
    border-radius: 10px;
  }
  [data-theme="dark"] .task-edit-grid input,
  [data-theme="dark"] .task-edit-grid select {
    background: #1B1815;
    border-color: rgba(232, 224, 216, 0.14);
  }
  .task-edit-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .task-edit-error { min-height: 18px; color: #9B6050; font-size: var(--font-size-sm); }
  .task-edit-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
  .task-secondary-btn,
  .task-save-btn {
    min-height: 44px;
    padding: 0 16px;
    border-radius: 14px;
    font: inherit;
    cursor: pointer;
  }
  .task-secondary-btn {
    border: 1px solid var(--divider);
    background: transparent;
    color: var(--warm-text);
  }
  .task-save-btn {
    border: none;
    background-color: var(--opgaver-action);
    background-image: linear-gradient(135deg, var(--opgaver-action) 0%, var(--opgaver-action-dark) 100%);
    color: #fffdfa;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-family);
  }
  @media (max-width: 640px) {
    .task-edit-row { grid-template-columns: 1fr; }
    .task-actions { align-self: flex-start; }
  }

  /* ── Premium Blød Bølge upgrade ── */
  .main {
    position: relative;
    background:
      radial-gradient(ellipse at 70% 20%, rgba(212, 168, 154, 0.06) 0%, transparent 50%),
      radial-gradient(ellipse at 30% 80%, rgba(168, 197, 184, 0.05) 0%, transparent 50%),
      linear-gradient(180deg, #FAF7F3 0%, var(--pill-bg, #F0EAE4) 100%);
  }
  [data-theme="dark"] .main {
    background:
      radial-gradient(ellipse at 70% 20%, rgba(212, 168, 154, 0.05) 0%, transparent 50%),
      radial-gradient(ellipse at 30% 80%, rgba(168, 197, 184, 0.04) 0%, transparent 50%),
      linear-gradient(180deg, #171512 0%, #201B18 55%, #181613 100%);
  }
  .content {
    position: relative;
    z-index: 1;
  }
  .greeting { margin-bottom: 24px; }
  .greeting h1 {
    font-family: var(--font-family);
    font-weight: var(--font-weight-normal);
    font-size: var(--font-size-6xl);
    color: var(--warm-text);
    letter-spacing: -0.01em;
    margin-bottom: 0;
  }

  .sofia-suggestion {
    max-width: 720px;
    margin: 0 auto 32px;
    padding: 16px 20px;
    border-radius: var(--radius-card);
    background: var(--white);
    border: 1px solid rgba(168, 197, 184, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
      0 1px 2px rgba(92, 77, 67, 0.06),
      0 4px 16px rgba(92, 77, 67, 0.05),
      0 12px 40px rgba(92, 77, 67, 0.03),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    animation: sofiaIn 0.25s ease;
  }
  .sofia-suggestion-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background: var(--sage);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
  }
  .sofia-suggestion-icon svg { width: 16px; height: 16px; }
  .sofia-suggestion-body { flex: 1; min-width: 0; }
  .sofia-suggestion-label {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--opgaver-sage-text);
    margin-bottom: 3px;
  }
  .sofia-suggestion-text {
    font-family: var(--font-family);
    font-style: italic;
    font-size: var(--font-size-sm);
    color: var(--warm-text);
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .sofia-suggestion-actions { display: flex; gap: 8px; flex-shrink: 0; }
  .sofia-suggestion-accept,
  .sofia-suggestion-dismiss {
    padding: 8px 16px;
    border-radius: 14px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
  }
  .sofia-suggestion-accept {
    background-color: var(--opgaver-action);
    background-image: linear-gradient(135deg, var(--opgaver-action) 0%, var(--opgaver-action-dark) 100%);
    color: #fffdfa;
    border: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 12px 28px rgba(74, 122, 104, 0.22), 0 4px 12px rgba(74, 122, 104, 0.18);
  }
  .sofia-suggestion-accept:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 32px rgba(74, 122, 104, 0.28), 0 6px 18px rgba(74, 122, 104, 0.22);
  }
  .sofia-suggestion-accept:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
  }
  .sofia-suggestion-dismiss {
    background: transparent;
    color: var(--opgaver-subtle);
    border: 1px solid var(--divider);
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .sofia-suggestion-dismiss:hover {
    border-color: var(--rose);
    color: var(--warm-text);
  }
  [data-theme="dark"] .sofia-suggestion {
    background: #241F1B;
    border-color: rgba(168, 197, 184, 0.15);
  }

  .task-input-card {
    flex: 1 1 auto;
    position: relative;
    background: rgba(255, 254, 251, 0.9);
    border-radius: var(--radius-card);
    padding: 10px 16px 10px 20px;
    border: 1px solid rgba(228, 220, 212, 0.6);
    backdrop-filter: blur(20px) saturate(1.6);
    -webkit-backdrop-filter: blur(20px) saturate(1.6);
    box-shadow:
      0 2px 8px rgba(92, 77, 67, 0.06),
      0 8px 32px rgba(92, 77, 67, 0.04),
      inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 48px;
    min-height: 48px;
    box-sizing: border-box;
    align-self: center;
    min-width: 0;
  }
  .task-input-card:focus-within {
    border-color: rgba(212, 168, 154, 0.5);
    box-shadow: none;
  }
  [data-theme="dark"] .task-input-card {
    background: #241F1B;
    border: 1px solid rgba(232, 224, 216, 0.08);
    backdrop-filter: none;
  }
  .task-input-field::placeholder {
    color: var(--opgaver-subtle);
    opacity: 1;
    font-family: var(--font-family);
    font-style: normal;
  }
  .task-add-btn {
    height: 44px;
    padding: 0 22px;
    border-radius: 14px;
    background-color: var(--opgaver-action);
    background-image: linear-gradient(135deg, var(--opgaver-action) 0%, var(--opgaver-action-dark) 100%);
    color: #fffdfa;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: box-shadow 0.2s ease, background 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    border: none;
    align-self: center;
    box-shadow: 0 2px 6px rgba(92, 77, 67, 0.08), 0 1px 0 0 rgba(255, 255, 255, 0.15) inset;
  }
  .task-add-btn:hover {
    box-shadow: 0 3px 10px rgba(92, 77, 67, 0.12), 0 1px 0 0 rgba(255, 255, 255, 0.18) inset;
  }
  .task-add-btn:active {
    box-shadow: 0 1px 3px rgba(92, 77, 67, 0.10), 0 1px 0 0 rgba(255, 255, 255, 0.12) inset;
    transition-duration: 0.08s;
  }
  .task-add-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
  }

  @keyframes claude-btn-spin {
    to { transform: rotate(360deg); }
  }
  #add-task-btn.is-loading > svg { display: none; }
  #add-task-btn.is-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    opacity: 0.85;
    flex-shrink: 0;
    margin: 0 1px;
    animation: claude-btn-spin 0.7s linear infinite;
  }
  #add-task-btn.is-loading:disabled {
    opacity: 1;
    cursor: wait;
  }

  .parse-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px 5px 10px;
    border-radius: 20px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    line-height: 1.2;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid transparent;
    animation: chipIn 0.15s ease;
  }
  .parse-chip--date {
    background: rgba(224, 228, 238, 0.7);
    border-color: rgba(168, 176, 196, 0.3);
    color: var(--opgaver-slate-text);
  }
  .parse-chip--time {
    background: rgba(224, 237, 230, 0.7);
    border-color: rgba(168, 197, 184, 0.3);
    color: var(--opgaver-sage-text);
  }
  .parse-chip--category,
  .parse-chip--priority {
    background: rgba(244, 232, 226, 0.7);
    border-color: rgba(212, 168, 154, 0.3);
    color: var(--opgaver-rose-text);
  }

  .task-section--today { margin-top: 0; }
  .task-section--week,
  .task-section--deferred {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(184, 168, 152, 0.3);
  }
  .task-section-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
  }
  .task-section-dot--rose {
    background: var(--rose);
    box-shadow: 0 0 6px rgba(212, 168, 154, 0.5);
  }
  .task-section-dot--sage {
    background: var(--sage);
    box-shadow: 0 0 6px rgba(168, 197, 184, 0.5);
  }
  .task-section-dot--slate {
    background: var(--slate);
    box-shadow: 0 0 6px rgba(168, 176, 196, 0.5);
  }
  .task-section-count {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--white);
    background: var(--opgaver-subtle);
    padding: 2px 10px;
    border-radius: 10px;
    margin-left: auto;
  }
  .task-section--today .task-section-count { background: var(--rose); }
  .task-section--week .task-section-count { background: var(--slate); }
  .task-section--deferred .task-section-count { background: var(--muted); }

  .task-card {
    background: var(--white, #FFFEFB);
    border-radius: var(--radius-card);
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.25s ease;
  }
  .task-card:hover,
  .task-card:focus-within {
    border-color: rgba(92, 77, 67, 0.20);
    box-shadow: none;
  }
  [data-theme="dark"] .task-card {
    background: #241F1B;
    border: 1px solid rgba(232, 224, 216, 0.08);
    box-shadow: var(--shadow-card);
  }
  [data-theme="dark"] .task-card:hover,
  [data-theme="dark"] .task-card:focus-within {
    border-color: rgba(232, 224, 216, 0.18);
  }
  .task-section--deferred .task-card {
    background: rgba(240, 234, 228, 0.5);
    border: 1px solid rgba(184, 168, 152, 0.2);
  }
  [data-theme="dark"] .task-section--deferred .task-card {
    background: rgba(168, 176, 196, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
  }
  .task-section--deferred .task-card:hover,
  .task-section--deferred .task-card:focus-within {
    border-color: rgba(184, 168, 152, 0.35);
  }
  [data-theme="dark"] .task-section--deferred .task-card:hover,
  [data-theme="dark"] .task-section--deferred .task-card:focus-within {
    border-color: rgba(255, 255, 255, 0.12);
  }

  /* ── Deferred row calm alignment (#3594) ── */
  .task-section--deferred .task-item {
    align-items: flex-start;
  }
  .task-section--deferred .task-checkbox-wrapper {
    align-self: flex-start;
    margin-top: -7px;
  }
  .task-section--deferred .task-content {
    gap: 5px;
    padding-top: 0;
  }
  .task-section--deferred .task-time:not(.task-time--overdue) {
    color: rgb(122, 110, 98);
    font-weight: var(--font-weight-medium);
  }
  [data-theme="dark"] .task-section--deferred .task-time:not(.task-time--overdue) {
    color: rgb(160, 148, 136);
  }

  .task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .task-estimate {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    color: var(--opgaver-time);
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .task-estimate svg { width: 12px; height: 12px; }
  .task-subtask-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    color: var(--opgaver-subtle);
    padding: 3px 10px;
    border-radius: 10px;
    background: rgba(168, 197, 184, 0.1);
    border: 1px solid rgba(168, 197, 184, 0.15);
    cursor: pointer;
    transition: background 0.15s ease;
  }
  .task-subtask-indicator:hover { background: rgba(168, 197, 184, 0.2); }
  .task-subtask-progress {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }
  .task-subtask-progress circle {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
  }
  .task-subtask-bg { stroke: var(--divider); }
  .task-subtask-fill { stroke: var(--sage); transition: stroke-dashoffset 0.3s ease; }
  .task-time {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    color: var(--opgaver-time);
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .task-done-date {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    color: var(--opgaver-subtle);
    font-style: italic;
  }
  .task-restore-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--sage);
    border-radius: 8px;
    transition: color 0.15s ease, background 0.15s ease;
  }
  .task-restore-btn:hover {
    background: rgba(168, 197, 184, 0.12);
    color: var(--opgaver-sage-text);
  }
  .task-restore-btn svg { width: 15px; height: 15px; }

  .done-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--divider);
  }
  .done-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--font-size-sm);
    color: var(--warm-text-light);
    font-family: var(--font-family);
    margin-bottom: 12px;
    padding: 10px 16px;
    min-height: 44px;
    background: rgba(168, 197, 184, 0.12);
    border-radius: var(--radius-pill);
    border: none;
    transition: background 0.15s ease;
  }
  .done-toggle:hover { background: rgba(168, 197, 184, 0.22); }
  .done-section .task-card {
    background: rgba(245, 243, 240, 0.7);
    box-shadow: none;
    border: 1px solid var(--divider);
    backdrop-filter: none;
  }
  /* #a11y: completed-task opacity intentionally NOT reduced. A prior opacity:0.55 here
     composited the muted task text down to ~2.3:1 (WCAG AA fail, worse on mobile). The
     "done" de-emphasis is carried by the line-through + muted colour
     (.task-item.done .task-text) and the lighter done-card background, which keep the
     completed task title at >= 4.5:1. */
  .done-section .task-checkbox.done {
    background: var(--sage);
    border-color: var(--sage);
  }

  .botanical-leaf {
    position: absolute;
    bottom: 40px;
    left: 20px;
    width: 60px;
    height: 90px;
    opacity: 0.08;
    pointer-events: none;
    z-index: 0;
  }
  .botanical-leaf svg {
    width: 100%;
    height: 100%;
  }
  [data-theme="dark"] .botanical-leaf { opacity: 0.04; }

  @media (max-width: 640px) {
    .sofia-suggestion {
      align-items: flex-start;
      flex-wrap: wrap;
    }
    .sofia-suggestion-actions {
      width: 100%;
      justify-content: flex-end;
    }
    .task-time { margin-left: 0; }
    .task-item.done {
      display: grid;
      grid-template-columns: 34px minmax(0, 1fr) auto;
      align-items: start;
      column-gap: 12px;
      row-gap: 6px;
    }
    .task-item.done .task-checkbox-wrapper { grid-column: 1; }
    .task-item.done .task-content { grid-column: 2 / -1; }
    .task-item.done .task-done-date {
      grid-column: 2;
      align-self: center;
    }
    .task-item.done .task-actions {
      grid-column: 3;
      align-self: center;
    }
  }

  /* ── Premium v3: right Sofia panel + pixel layout ── */
  .app {
    display: flex;
    width: 100%;
    min-height: 100vh;
  }
  .main {
    flex: 1;
    min-width: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .main::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  .content {
    max-width: 960px;
    padding-top: 42px;
  }
  .sofia-right-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: rgba(255, 254, 251, 0.94);
    border-left: 1px solid var(--divider);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    padding: 24px 20px;
    gap: 20px;
    box-shadow: -12px 0 36px rgba(92, 77, 67, 0.04);
    z-index: 4;
  }
  .sofia-sidebar-topbar {
    display: none;
  }
  .sofia-sidebar-avatar-mini,
  .sofia-sidebar-title,
  .sofia-sidebar-close-btn {
    display: none;
  }
  .sofia-fold-toggle {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid transparent;
    cursor: pointer;
    color: #9A8E82;
    padding: 0;
    z-index: 2;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
    -webkit-tap-highlight-color: transparent;
  }
  .sofia-fold-toggle:hover,
  .sofia-fold-toggle:focus-visible:hover {
    background: #FBF8F2;
    border-color: rgba(92, 77, 67, 0.10);
    color: #5C4D43;
  }
  .sofia-fold-icon {
    width: 14px;
    height: 14px;
    transition: transform 160ms ease;
  }
  .sofia-sidebar-folded .sofia-fold-icon {
    transform: rotate(180deg);
  }

  .sofia-reminder {
    padding: 20px;
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, rgba(212, 168, 154, 0.08) 0%, rgba(168, 197, 184, 0.06) 100%);
    border: 1px solid rgba(212, 168, 154, 0.15);
  }
  .sofia-reminder-text {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--warm-text);
    line-height: 1.55;
    margin-bottom: 16px;
  }
  .sofia-reminder-meta {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--opgaver-subtle);
    margin: -8px 0 14px;
  }
  .sofia-reminder-actions { display: flex; flex-wrap: wrap; gap: 10px; }
  .sofia-reminder-accept {
    padding: 10px 18px;
    border-radius: 14px;
    background-color: var(--opgaver-action);
    background-image: linear-gradient(135deg, var(--opgaver-action) 0%, var(--opgaver-action-dark) 100%);
    color: #fffdfa;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    border: none;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(74, 122, 104, 0.22), 0 4px 12px rgba(74, 122, 104, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .sofia-reminder-accept:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 32px rgba(74, 122, 104, 0.28), 0 6px 18px rgba(74, 122, 104, 0.22);
  }
  .sofia-reminder-accept:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
  }
  .sofia-reminder-secondary {
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: var(--white);
    color: var(--warm-text);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border: 1px solid var(--divider);
    cursor: pointer;
    transition: border-color 0.15s ease;
  }
  .sofia-reminder-secondary:hover { border-color: var(--opgaver-action); }
  .sofia-reminder-dismiss {
    padding: 10px 14px;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--opgaver-muted);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
  }
  .sofia-reminder-dismiss:hover { color: var(--warm-text); }
  .sofia-reminder-secondary[hidden],
  .sofia-reminder-dismiss[hidden] { display: none !important; }
  /* Sofia rail - section title typography + spacing
     Refined to read as a quiet section label above its card. */
  .sofia-section-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: #8a7a6e;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.3;
    margin: 4px 4px 20px;
    padding: 0;
  }
  .sofia-quick-action {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid var(--divider);
    cursor: pointer;
    transition: border-color 0.15s ease, transform 0.15s ease;
    margin-bottom: 8px;
    text-decoration: none;
  }
  .sofia-quick-action:hover {
    border-color: var(--opgaver-action);
    transform: translateX(2px);
  }
  .sofia-quick-action-icon {
    width: 20px;
    height: 20px;
    color: var(--opgaver-subtle);
    flex-shrink: 0;
  }
  .sofia-quick-action-label {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--warm-text);
    flex: 1;
    text-align: left;
  }
  .sofia-quick-action-chevron {
    width: 16px;
    height: 16px;
    color: var(--muted);
  }
  .sofia-tips-card {
    padding: 18px;
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, rgba(168, 197, 184, 0.06) 0%, rgba(212, 168, 154, 0.04) 100%);
    border: 1px solid rgba(168, 197, 184, 0.15);
  }
  .sofia-tips-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
  }
  .sofia-tips-title {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--warm-text);
  }
  .sofia-tips-text {
    font-family: var(--font-family);
    font-style: italic;
    font-size: var(--font-size-sm);
    color: var(--opgaver-sage-text);
    line-height: 1.55;
    margin-top: 12px;
  }
  .sofia-tips-text {
    color: var(--warm-text);
    margin-top: 0;
  }
  .sofia-tips-sparkle {
    color: var(--sage);
    width: 20px;
    height: 20px;
    opacity: 0.5;
  }

  .stats-bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 960px;
    margin: 0 auto 24px;
    padding: 18px 22px;
    background: var(--white);
    border-radius: var(--radius-card);
    border: 1px solid rgba(228, 220, 212, 0.5);
    box-shadow: 0 1px 4px rgba(92, 77, 67, 0.04);
  }
  .stat-arcs {
    display: none;
  }
  .stat-item {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex: 1 1 0;
    min-width: 80px;
    min-height: 44px;
    padding: 6px 8px 14px;
    border-radius: 8px;
    overflow: visible;
    transition: transform 0.2s ease;
  }
  .stat-item:hover .stat-ring-number,
  .stat-item:hover .stat-label-row {
    color: var(--text-strong, #5c4d43);
  }
  .stat-item:active {
    transform: scale(0.98);
    transition-duration: 0.08s;
  }
  .stat-item[aria-pressed="true"] .stat-ring-number,
  .stat-item[aria-pressed="true"] .stat-label-row {
    font-weight: var(--font-weight-semibold);
    color: var(--text-strong, #5c4d43);
  }
  .stat-item[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background: #c98f7c;
    animation: statBarIn .25s ease-out;
  }
  @keyframes statBarIn {
    from { width: 0; opacity: 0; }
    to { width: 28px; opacity: 1; }
  }
  .stat-ring-wrap {
    width: 64px;
    height: 64px;
    position: relative;
  }
  .stat-ring {
    width: 100%;
    height: 100%;
  }
  .stat-ring-bg {
    fill: none;
    stroke: var(--divider);
    stroke-width: 3.5;
    stroke-linecap: round;
  }
  .stat-ring-fill {
    fill: none;
    stroke-width: 3.5;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.6s ease;
  }
  .stat-ring-fill--rose { stroke: var(--rose); }
  .stat-ring-fill--slate { stroke: var(--slate); }
  .stat-ring-fill--sage { stroke: var(--sage); }
  .stat-ring-number {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-xl);
    color: var(--warm-text);
  }
  .stat-ring-number[data-value="0"] {
    opacity: 0.5;
  }
  .stat-label-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--opgaver-subtle);
  }
  .stat-subtitle-row {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .stat-subtitle-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
  }
  .stat-subtitle-dot--rose { background: var(--rose); }
  .stat-subtitle-dot--slate { background: var(--slate); }
  .stat-subtitle-dot--sage { background: var(--sage); }
  .stat-subtitle {
    font-family: var(--font-family);
    font-style: normal;
    font-size: var(--font-size-xs);
    color: var(--warm-text-light);
    text-align: center;
    margin-top: -2px;
  }
  .stat-calendar {
    width: 100%;
    min-width: 0;
    flex-shrink: 1;
  }
  .stat-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
  }
  .stat-cal-day {
    appearance: none;
    border: 2px solid transparent;
    background: rgba(240, 234, 228, 0.4);
    color: inherit;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-height: 76px;
    padding: 9px 4px 8px;
    border-radius: 14px;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .stat-cal-day:hover {
    background: rgba(240, 234, 228, 0.8);
  }
  .stat-cal-day:active {
    transform: scale(0.98);
    transition-duration: 0.08s;
  }
  .stat-cal-day--today {
    background: rgba(110, 138, 126, 0.10);
    border-color: transparent;
    box-shadow: inset 0 0 0 1px rgba(110, 138, 126, 0.22);
  }
  .stat-cal-day--today:hover {
    background: rgba(110, 138, 126, 0.18);
  }
  .stat-cal-day[aria-pressed="true"] {
    background: rgb(110, 138, 126);
    border-color: rgb(110, 138, 126);
    box-shadow: none;
  }
  .stat-cal-day[aria-pressed="true"]:hover {
    background: rgb(100, 128, 116);
  }
  .stat-cal-name {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.02em;
    color: var(--opgaver-subtle);
  }
  .stat-cal-day--today .stat-cal-name {
    color: rgb(74, 122, 104);
  }
  .stat-cal-day[aria-pressed="true"] .stat-cal-name {
    color: rgb(255, 254, 251);
  }
  .stat-cal-num {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    color: rgb(58, 47, 38);
    line-height: 1.2;
  }
  .stat-cal-day--today .stat-cal-num {
    color: rgb(56, 94, 78);
  }
  .stat-cal-day[aria-pressed="true"] .stat-cal-num {
    color: rgb(255, 254, 251);
  }
  .stat-cal-dots {
    display: none;
  }
  .cf-count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    border-radius: 999px;
    background: rgb(110, 138, 126);
    color: rgb(255, 254, 251);
  }
  .cf-count--empty {
    background: transparent;
    color: transparent;
    font-size: 0;
    font-weight: var(--font-weight-medium);
  }
  .cf-count--empty::after {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #cfc6ba;
  }
  .stat-cal-day[aria-pressed="true"] .cf-count {
    background: rgb(255, 254, 251);
    color: rgb(56, 94, 78);
  }
  .stat-cal-day[aria-pressed="true"] .cf-count--empty {
    background: transparent;
    color: rgba(255, 254, 251, 0.6);
  }

  .stat-item:focus-visible,
  .stat-cal-day:focus-visible {
    outline: none;
  }
  .stat-item:focus-visible::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background: #c98f7c;
    pointer-events: none;
  }
  .stat-cal-day:focus-visible {
    border-color: rgb(110, 138, 126);
    box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.18);
  }
  @media (prefers-reduced-motion: reduce) {
    .stat-cal-day,
    .stat-item {
      transition: none !important;
      transform: none !important;
    }
  }

  /* ── Drag-to-schedule DnD states ── */
  .task-item[draggable="true"] {
    cursor: grab;
  }
  .task-item[draggable="true"]:active {
    cursor: grabbing;
  }
  .task-item.is-dragging {
    opacity: 0.45;
    pointer-events: none;
  }
  .stat-cal-day.dnd-over {
    background: rgba(110, 138, 126, 0.28);
    border-color: rgba(110, 138, 126, 0.7);
    transform: scale(1.04);
  }
  .stat-cal-day.dnd-dropped {
    background: rgba(110, 138, 126, 0.35);
    border-color: rgb(110, 138, 126);
  }
  @media (prefers-reduced-motion: no-preference) {
    .stat-cal-day.dnd-dropped {
      animation: dnd-pulse 0.65s ease-out;
    }
  }
  @keyframes dnd-pulse {
    0% { transform: scale(1.06); box-shadow: 0 0 0 4px rgba(110, 138, 126, 0.35); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(110, 138, 126, 0); }
  }
  .task-drag-ghost {
    position: fixed;
    top: -100px;
    left: -100px;
    max-width: 200px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    background: rgba(110, 138, 126, 0.92);
    color: #fff;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    z-index: 9999;
  }
  .task-drag-ghost-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.8;
  }
  .task-drag-ghost-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body.task-dnd-active .stat-cal-day {
    border-color: rgba(110, 138, 126, 0.35);
    transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
  }

  /* ── Six-dot drag grip affordance (#3642) ── */
  .task-item[draggable="true"],
  .task-item.is-dragging {
    padding-left: 38px;
  }
  .task-item[draggable="true"]::before,
  .task-item.is-dragging::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' fill='%235C4D43'%3E%3Ccircle cx='3' cy='2' r='1.5'/%3E%3Ccircle cx='7' cy='2' r='1.5'/%3E%3Ccircle cx='3' cy='8' r='1.5'/%3E%3Ccircle cx='7' cy='8' r='1.5'/%3E%3Ccircle cx='3' cy='14' r='1.5'/%3E%3Ccircle cx='7' cy='14' r='1.5'/%3E%3C/svg%3E") no-repeat center / 10px 16px;
    opacity: 0.22;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }
  .task-item[draggable="true"]:hover::before {
    opacity: 0.5;
  }
  body .task-item.is-dragging::before {
    opacity: 0.6;
  }
  @media (prefers-reduced-motion: reduce) {
    .task-item[draggable="true"]::before,
    .task-item.is-dragging::before {
      transition: none !important;
    }
  }
  @media (pointer: coarse) and (min-width: 641px) {
    .task-item[draggable="true"] {
      touch-action: none;
    }
  }
  body.task-dnd-active .task-item {
    touch-action: none;
  }

  /* ── Section drop targets: drag between today / week / unscheduled ── */
  body.task-dnd-active .task-section--today,
  body.task-dnd-active .task-section--week,
  body.task-dnd-active .task-section--unscheduled {
    border-radius: 18px;
    outline: 1px dashed rgba(110, 138, 126, 0.35);
    outline-offset: 8px;
    transition: outline-color 0.12s ease, background 0.12s ease;
  }
  body.task-dnd-active .task-section.dnd-over {
    outline: 2px dashed rgba(110, 138, 126, 0.7);
    background: rgba(110, 138, 126, 0.07);
  }
  .task-section.dnd-dropped {
    outline: 2px dashed rgb(110, 138, 126);
    outline-offset: 8px;
    border-radius: 18px;
  }
  @media (prefers-reduced-motion: no-preference) {
    .task-section.dnd-dropped {
      animation: dnd-section-pulse 0.65s ease-out;
    }
  }
  @keyframes dnd-section-pulse {
    0% { box-shadow: 0 0 0 4px rgba(110, 138, 126, 0.3); }
    100% { box-shadow: 0 0 0 0 rgba(110, 138, 126, 0); }
  }
  @media (prefers-reduced-motion: reduce) {
    body.task-dnd-active .task-section--today,
    body.task-dnd-active .task-section--week,
    body.task-dnd-active .task-section--unscheduled {
      transition: none;
    }
  }
  /* Empty schedule buckets get a temporary shell injected while dragging;
     the shell carries .task-section--empty and renders a drop hint. */
  .task-section--empty .task-section-collapse,
  .task-section--empty .task-section-count {
    display: none;
  }
  .task-section-drop-hint {
    padding: 18px 16px;
    border: 1px dashed rgba(110, 138, 126, 0.45);
    border-radius: 14px;
    color: var(--opgaver-subtle, #8A7E72);
    font-size: var(--font-size-sm);
    text-align: center;
    pointer-events: none;
  }

  /* Move-to-day buttons in snooze menu */
  .task-snooze-move-days {
    padding: 8px 0 4px;
    border-top: 1px solid rgba(110, 138, 126, 0.12);
    margin-top: 4px;
  }
  .task-snooze-move-title {
    display: block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: rgba(60, 50, 40, 0.55);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 12px 6px;
  }
  .task-snooze-day-row {
    display: flex;
    gap: 4px;
    padding: 0 10px;
    overflow-x: auto;
  }
  .task-snooze-day-btn {
    appearance: none;
    border: 1.5px solid rgba(110, 138, 126, 0.25);
    background: rgba(240, 234, 228, 0.4);
    border-radius: 8px;
    padding: 4px 6px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
  }
  .task-snooze-day-btn:hover {
    background: rgba(110, 138, 126, 0.14);
    border-color: rgba(110, 138, 126, 0.5);
  }
  .task-snooze-day-btn--current {
    background: rgba(110, 138, 126, 0.18);
    border-color: rgba(110, 138, 126, 0.55);
  }
  .task-snooze-day-name {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    color: rgba(60, 50, 40, 0.6);
  }
  .task-snooze-day-num {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: inherit;
  }

  .stat-divider,
  .stat-chart,
  #sofia-suggestion-container { display: none; }

  .task-input-form {
    max-width: 960px;
    margin: 0 auto 10px;
  }
  .task-input-card {
    padding: 10px 16px 10px 20px;
    gap: 10px;
  }
  .task-input-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    flex-shrink: 0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--opgaver-subtle);
    transition: color 220ms ease, background 220ms ease;
    padding: 0;
    position: relative;
    overflow: visible;
  }
  .task-input-icon:hover {
    color: var(--warm-text);
    background: rgba(212, 168, 154, 0.10);
  }
  .task-input-icon svg { width: 16px; height: 16px; }

  @keyframes calmMicBreath {
    0%, 100% { background: rgba(166, 89, 75, 0.06); }
    50% { background: rgba(166, 89, 75, 0.14); }
  }
  @keyframes calmMicFade {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1.0; }
  }

  #task-input-mic[aria-pressed="true"] {
    color: #A6594B;
    animation: calmMicBreath 2400ms ease-in-out infinite;
  }
  #task-input-mic[aria-busy="true"]:not([aria-pressed="true"]) svg {
    animation: calmMicFade 1600ms ease-in-out infinite;
  }

  @media (prefers-reduced-motion: reduce) {
    #task-input-mic[aria-pressed="true"] {
      animation: none;
      background: rgba(166, 89, 75, 0.10);
      color: #A6594B;
    }
    #task-input-mic[aria-busy="true"]:not([aria-pressed="true"]) svg {
      animation: none;
      opacity: 0.5;
    }
  }

  #task-input-mic.ss-mic--error {
    color: #A6594B;
    animation: calmMicShake 0.3s ease;
  }
  @keyframes calmMicShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
  }
  @media (prefers-reduced-motion: reduce) {
    #task-input-mic.ss-mic--error { animation: none; }
  }

  #task-input-voice-status.mic-feedback-visible {
    position: absolute;
    width: auto;
    height: auto;
    padding: 6px 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
    top: 100%;
    left: 0;
    right: 0;
    color: #A6594B;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1.3;
  }
  [data-theme="dark"] #task-input-voice-status.mic-feedback-visible {
    color: #D4A89A;
  }

  .parse-chips {
    max-width: 960px;
    margin: 0 auto 8px;
  }
  .task-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    margin-bottom: 16px;
    cursor: pointer;
  }
  #tasks-container > .task-section:first-child > .task-section-header {
    margin-top: 20px;
  }
  .task-section-count {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--opgaver-subtle);
    background: transparent !important;
    padding: 0;
    margin-left: 0;
  }
  .task-section-collapse {
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--opgaver-subtle);
    transition: transform 0.2s ease, background 0.15s ease;
  }
  .task-section-collapse:hover { background: rgba(0, 0, 0, 0.04); }
  .task-section-collapse svg { width: 16px; height: 16px; }
  .task-section-collapse.collapsed { transform: rotate(180deg); }
  .task-section-body {
    transition: max-height 0.2s ease, opacity 0.2s ease;
    overflow: hidden;
  }
  .task-section-body.collapsed { max-height: 0; opacity: 0; }

  .task-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(228, 220, 212, 0.4);
    transition: background 0.2s ease;
    cursor: default;
    position: relative;
  }
  .task-item:last-child { border-bottom: none; }
  .task-item:hover {
    background: rgba(212, 168, 154, 0.05);
  }
  .task-checkbox-wrapper {
    position: relative;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -10px -6px -10px -4px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 12px;
    transition: background 0.15s ease;
  }
  .task-checkbox-wrapper:hover {
    background: rgba(212, 168, 154, 0.06);
  }
  .task-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .task-text {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--warm-text);
    line-height: 1.45;
    overflow-wrap: break-word;
    word-break: break-word;
    cursor: pointer;
  }
  .task-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .task-tag {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    padding: 2px 10px;
    border-radius: 10px;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: box-shadow 0.15s ease;
  }
  .task-time {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    color: var(--opgaver-time);
    font-variant-numeric: tabular-nums;
    margin-left: 0;
  }
  .task-star {
    color: var(--star-gold, #D4A060);
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-left: 4px;
    vertical-align: -2px;
    filter: drop-shadow(0 0 3px rgba(212, 160, 96, 0.3));
  }
  .task-priority-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--priority-dot);
    margin-left: 5px;
    vertical-align: 1px;
    opacity: 0.75;
  }
  [data-theme="dark"] .task-priority-dot {
    background: var(--priority-dot-dark);
    opacity: 0.7;
  }
  .task-time--overdue {
    color: #905847 !important;
    font-weight: var(--font-weight-semibold);
  }
  [data-theme="dark"] .task-time--overdue {
    color: #C4907E !important;
  }
  .task-tag:hover {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
  }
  .task-tag--active {
    box-shadow: 0 0 0 2px rgba(192, 128, 112, 0.4) !important;
  }
  [data-theme="dark"] .task-tag--active {
    box-shadow: 0 0 0 2px rgba(212, 168, 154, 0.4) !important;
  }
  .task-item--filtered-out {
    display: none !important;
  }
  .task-filter-clear {
    display: inline-block;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    padding: 3px 10px;
    margin: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(192, 128, 112, 0.3);
    background: rgba(192, 128, 112, 0.06);
    color: var(--opgaver-rose-text, #6B4C42);
    cursor: pointer;
    transition: background 0.15s ease;
  }
  .task-filter-clear:hover {
    background: rgba(192, 128, 112, 0.12);
  }
  [data-theme="dark"] .task-filter-clear {
    border-color: rgba(212, 168, 154, 0.3);
    background: rgba(212, 168, 154, 0.08);
    color: var(--opgaver-rose-text);
  }
  .task-delete--confirm {
    background: #9B6050 !important;
    color: #FFF7F2 !important;
    width: auto !important;
    min-width: max-content;
    border-radius: 12px;
    padding: 2px 8px !important;
    opacity: 1 !important;
    white-space: nowrap;
  }
  [data-theme="dark"] .task-delete--confirm {
    color: #E8DDD4 !important;
  }
  .task-delete--confirm .task-delete-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family);
  }
  .task-delete--loading {
    opacity: 1 !important;
  }
  .task-delete-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--opgaver-subtle);
    border-radius: 50%;
    animation: task-spin 0.6s linear infinite;
  }
  @keyframes task-spin {
    to { transform: rotate(360deg); }
  }
  .task-subtask-item {
    cursor: pointer;
    transition: opacity 0.15s ease;
  }
  .task-subtask-item.is-checked .task-subtask-text {
    text-decoration: line-through;
    color: var(--opgaver-subtle);
  }
  .task-subtask-item.is-checked .task-subtask-check {
    background: var(--sage);
    border-color: var(--sage);
  }
  .task-subtask-item.is-checked .task-subtask-check svg {
    display: block;
  }
  .task-estimate {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    color: var(--opgaver-time);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
  }
  .task-estimate svg {
    width: 13px;
    height: 13px;
  }
  .task-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    align-self: center;
    opacity: 0;
    transition: opacity 0.15s ease;
  }
  .task-item:hover .task-actions { opacity: 1; }
  .task-item:focus-within .task-actions { opacity: 1; }
  .task-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: var(--opgaver-subtle);
    border-radius: 10px;
    transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  }
  .task-action-btn:hover {
    color: var(--warm-text);
    background: rgba(212, 168, 154, 0.10);
  }
  .task-action-btn:active {
    transform: scale(0.92);
    transition-duration: 0.08s;
  }
  .task-action-btn svg { width: 14px; height: 14px; }
  .task-delete-btn:hover {
    color: #B85450;
    background: rgba(184, 84, 80, 0.08);
  }
  .task-item:focus-within {
    background: rgba(212, 168, 154, 0.04);
  }
  .task-action-btn::after {
    content: "";
    position: absolute;
    inset: -3px;
    border: 2px solid transparent;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
  }
  .task-action-btn:focus-visible {
    outline: none;
    outline-offset: 2px;
    border-radius: 10px;
  }
  .task-action-btn:focus-visible::after {
    border-color: var(--opgaver-action);
    opacity: 1;
  }
  .task-action-btn:focus:not(:focus-visible) {
    outline: none;
  }
  .task-item--snooze-open {
    z-index: 50;
  }
  .task-item--snooze-open .task-actions {
    opacity: 1;
  }
  .task-card:has(.task-item--snooze-open) {
    overflow: visible;
  }
  .task-section-body:not(.collapsed):has(.task-item--snooze-open) {
    overflow: visible;
  }
  .task-snooze-menu[hidden] {
    display: none !important;
  }
  .task-snooze-menu {
    position: absolute;
    top: 46px;
    right: 16px;
    min-width: 404px;
    width: min(404px, calc(100vw - 48px));
    z-index: 40;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 254, 251, 0.98);
    border: 1px solid rgba(228, 220, 212, 0.72);
    box-shadow:
      0 4px 18px rgba(92, 77, 67, 0.10),
      0 14px 38px rgba(92, 77, 67, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .task-snooze-menu-title {
    margin: 2px 4px 8px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--warm-text);
  }
  .task-snooze-option {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--warm-text);
    position: relative;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, transform 0.15s ease;
  }
  .task-snooze-option:hover {
    background: rgba(212, 168, 154, 0.10);
  }
  .task-snooze-option:active {
    transform: scale(0.98);
    transition-duration: 0.08s;
  }
  .task-snooze-option:focus-visible,
  .task-snooze-apply:focus-visible,
  .task-snooze-date:focus-visible,
  .task-snooze-time:focus-visible {
    outline: none;
    outline-offset: 2px;
  }
  .task-snooze-option::after,
  .task-snooze-apply::after,
  .task-snooze-undo-btn::after {
    content: "";
    position: absolute;
    inset: -2px;
    border: 2px solid transparent;
    border-radius: 12px;
    pointer-events: none;
    opacity: 0;
  }
  .task-snooze-option:focus-visible::after,
  .task-snooze-apply:focus-visible::after,
  .task-snooze-undo-btn:focus-visible::after {
    border-color: var(--opgaver-action);
    opacity: 1;
  }
  .task-snooze-date:focus-visible,
  .task-snooze-time:focus-visible {
    border-color: var(--opgaver-action);
  }
  .task-snooze-option-label {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--warm-text);
  }
  .task-snooze-option-meta {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--opgaver-subtle);
    white-space: nowrap;
  }
  .task-snooze-option--primary {
    background: rgba(212, 168, 154, 0.08);
  }
  .task-snooze-option--primary .task-snooze-option-label {
    font-weight: var(--font-weight-bold);
  }
  .task-snooze-custom {
    display: grid;
    grid-template-columns: 1fr 1.15fr auto;
    align-items: end;
    gap: 12px;
    padding: 14px 10px 4px;
    width: 100%;
    margin-top: 8px;
    border-top: 1px solid rgba(228, 220, 212, 0.62);
  }
  .task-snooze-custom .task-snooze-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 7px;
    font-family: var(--font-family);
  }
  .task-snooze-custom .task-snooze-field > span {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    letter-spacing: 0.01em;
    color: rgba(92, 77, 67, 0.72);
  }
  .task-snooze-custom .task-snooze-date,
  .task-snooze-custom .calm-time-wrap,
  .task-snooze-custom .calm-time-input {
    width: 100%;
    height: 40px;
    box-sizing: border-box;
  }
  .task-snooze-date,
  .task-snooze-time {
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(228, 220, 212, 0.72);
    border-radius: 10px;
    background: var(--white);
    color: var(--warm-text);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    padding: 6px 8px;
    color-scheme: light;
  }
  .task-snooze-custom .task-snooze-date {
    padding: 8px 10px;
  }
  .task-snooze-apply {
    height: 40px;
    padding: 0 20px;
    white-space: nowrap;
    align-self: end;
    border: 0;
    border-radius: 10px;
    background: var(--opgaver-action);
    color: var(--white);
    position: relative;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 4px 12px rgba(155, 96, 80, 0.22);
  }
  .task-snooze-apply:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(155, 96, 80, 0.28);
  }
  .task-snooze-apply:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
  }
  .task-snooze-undo {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    background: #FAF7F3;
    border: 1px solid rgba(228, 220, 212, 0.72);
    box-shadow:
      0 4px 18px rgba(92, 77, 67, 0.12),
      0 12px 32px rgba(92, 77, 67, 0.08);
    font-family: var(--font-family);
    color: #5C4D43;
    animation: task-snooze-undo-in 0.25s ease;
  }
  .task-snooze-undo-text {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    white-space: nowrap;
  }
  .task-snooze-undo-btn {
    border: 0;
    background: none;
    color: var(--opgaver-action);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    position: relative;
    transition: background 0.15s ease;
  }
  .task-snooze-undo-btn:hover {
    background: rgba(212, 168, 154, 0.12);
  }
  .task-snooze-undo-btn:focus-visible {
    outline: none;
    outline-offset: 2px;
    border-radius: 8px;
  }
  .task-snooze-undo-btn:focus:not(:focus-visible) {
    outline: none;
  }
  .task-snooze-undo-bar {
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 3px;
    border-radius: 0 0 12px 12px;
    background: var(--opgaver-action);
    transform-origin: left;
    animation: task-snooze-undo-countdown 5s linear forwards;
  }
  @keyframes task-snooze-undo-in {
    from { opacity: 0; transform: translateX(-50%) translateY(12px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
  }
  @keyframes task-snooze-undo-countdown {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
  }
  [data-theme="dark"] .task-snooze-menu {
    background: rgba(36, 31, 27, 0.96);
    border-color: rgba(232, 224, 216, 0.12);
    box-shadow:
      0 6px 22px rgba(18, 16, 14, 0.42),
      0 18px 44px rgba(18, 16, 14, 0.36),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  [data-theme="dark"] .task-snooze-menu-title,
  [data-theme="dark"] .task-snooze-option-label {
    color: #E8DDD4;
  }
  [data-theme="dark"] .task-snooze-option:hover {
    background: rgba(212, 168, 154, 0.08);
  }
  [data-theme="dark"] .task-snooze-custom {
    border-top-color: rgba(232, 224, 216, 0.10);
  }
  [data-theme="dark"] .task-snooze-date,
  [data-theme="dark"] .task-snooze-time {
    background: rgba(27, 24, 21, 0.92);
    border-color: rgba(232, 224, 216, 0.14);
    color: #E8DDD4;
    color-scheme: dark;
  }
  [data-theme="dark"] .task-snooze-option--primary {
    background: rgba(212, 168, 154, 0.06) !important;
  }
  [data-theme="dark"] .task-snooze-undo {
    background: rgba(36, 31, 27, 0.96) !important;
    border-color: rgba(232, 224, 216, 0.12) !important;
    color: #E8DDD4 !important;
    box-shadow:
      0 6px 22px rgba(18, 16, 14, 0.42),
      0 18px 44px rgba(18, 16, 14, 0.36) !important;
  }
  [data-theme="dark"] .task-snooze-undo-btn {
    color: #D4A89A !important;
  }
  [data-theme="dark"] .task-snooze-undo-btn:hover {
    background: rgba(212, 168, 154, 0.08) !important;
  }
  [data-theme="dark"] .task-snooze-undo-bar {
    background: #D4A89A !important;
  }
  .task-checkbox-wrapper:focus-visible {
    outline: none;
    outline-offset: 2px;
    border-radius: 12px;
  }
  .task-checkbox-wrapper::after {
    content: "";
    position: absolute;
    inset: -3px;
    border: 2px solid transparent;
    border-radius: 14px;
    pointer-events: none;
    opacity: 0;
  }
  .task-checkbox-wrapper:focus-visible::after {
    border-color: var(--opgaver-action);
    opacity: 1;
  }
  .task-subtasks {
    margin: 8px 0 0 0;
    padding: 0;
  }
  .task-subtask-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    color: var(--opgaver-subtle);
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 8px 4px 0;
    border-radius: 8px;
    transition: background 0.15s ease;
  }
  .task-subtask-toggle:hover { background: rgba(168, 197, 184, 0.08); }
  .task-subtask-toggle svg { width: 14px; height: 14px; }
  .task-subtask-toggle .task-subtask-progress {
    width: 26px;
    height: 16px;
  }
  .task-subtask-list {
    position: relative;
    margin-top: 6px;
    margin-left: 10px;
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 7px;
  }
  .task-subtask-list::before {
    content: '';
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(168, 197, 184, 0.26), rgba(228, 220, 212, 0.42));
  }
  .task-subtask-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--warm-text);
  }
  .task-subtask-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 50%;
    width: 14px;
    height: 1px;
    background: rgba(228, 220, 212, 0.7);
  }
  .task-subtask-check {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 50%;
    border: 1.5px solid var(--sage);
    background: rgba(255, 254, 251, 0.76);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }
  .task-subtask-check.done {
    background: var(--sage);
    border-color: var(--sage);
  }
  .task-subtask-check.done svg { display: block; }
  .task-subtask-check svg {
    width: 10px;
    height: 10px;
    color: white;
    display: none;
  }
  .task-subtask-text {
    line-height: 1.35;
  }
  .task-subtask-item.done .task-subtask-text {
    text-decoration: line-through;
    color: var(--opgaver-subtle);
  }
  .task-subtask-list[hidden] {
    display: none;
  }

  .task-subtask-item {
    cursor: pointer !important;
    min-height: 44px !important;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: 8px;
    transition: background 0.12s ease;
  }
  .task-subtask-item:hover {
    background: rgba(168, 197, 184, 0.08) !important;
  }
  .task-subtask-item:active {
    background: rgba(168, 197, 184, 0.14) !important;
  }
  .task-subtask-check {
    cursor: pointer !important;
    transition: background 0.15s ease, border-color 0.15s ease;
  }

  .sofia-completion-prompt {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(168, 197, 184, 0.10);
    border: 1px solid rgba(168, 197, 184, 0.22);
    border-radius: 10px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--opgaver-sage-text);
    animation: subtaskPromptIn 0.25s ease;
  }
  @keyframes subtaskPromptIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .sofia-completion-btn {
    padding: 6px 14px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: white;
    background: var(--sage, #A8C5B8);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    min-height: 34px;
    transition: background 0.15s ease, transform 0.1s ease;
  }
  .sofia-completion-btn:hover {
    filter: brightness(0.92);
  }
  .sofia-completion-btn:active {
    transform: scale(0.97);
  }

  [data-theme="dark"] .task-subtask-item:hover {
    background: rgba(168, 197, 184, 0.06) !important;
  }
  [data-theme="dark"] .task-subtask-item:active {
    background: rgba(168, 197, 184, 0.10) !important;
  }
  [data-theme="dark"] .task-subtask-check {
    background: rgba(255, 254, 251, 0.08) !important;
    border-color: var(--sage, #A8C5B8) !important;
  }
  [data-theme="dark"] .task-subtask-check.done {
    background: var(--sage, #A8C5B8) !important;
    border-color: var(--sage, #A8C5B8) !important;
  }
  [data-theme="dark"] .task-subtask-item.done .task-subtask-text {
    color: var(--muted-light, #7C736A) !important;
  }
  [data-theme="dark"] .sofia-completion-prompt {
    background: rgba(168, 197, 184, 0.08) !important;
    border-color: rgba(168, 197, 184, 0.16) !important;
    color: var(--opgaver-sage-text) !important;
  }
  [data-theme="dark"] .sofia-completion-btn {
    background: var(--sage, #A8C5B8) !important;
    color: #171512 !important;
  }
  [data-theme="dark"] .task-subtask-list::before {
    background: linear-gradient(180deg, rgba(168, 197, 184, 0.16), rgba(228, 220, 212, 0.08)) !important;
  }
  [data-theme="dark"] .task-subtask-item::before {
    background: rgba(228, 220, 212, 0.15) !important;
  }

  .greeting {
    text-align: center;
    margin-bottom: 24px;
  }
  .greeting h1 {
    font-size: var(--font-size-6xl);
    margin-bottom: 0;
  }
  [data-theme="dark"] .sofia-right-sidebar,
  [data-theme="dark"] .stats-bar,
  [data-theme="dark"] .sofia-quick-action,
  [data-theme="dark"] .sofia-reminder-secondary {
    background: #241F1B;
    border-color: rgba(232, 224, 216, 0.08);
  }
  [data-theme="dark"] .sofia-tips-card,
  [data-theme="dark"] .sofia-reminder {
    background: linear-gradient(135deg, rgba(168, 197, 184, 0.06) 0%, rgba(212, 168, 154, 0.04) 100%);
    border-color: rgba(168, 197, 184, 0.12);
  }

  [data-theme="dark"] .stat-item[aria-pressed="true"] {
    background: transparent !important;
    box-shadow: none !important;
  }
  [data-theme="dark"] .stat-item[aria-pressed="true"]::after {
    background: #d4a89a;
  }
  [data-theme="dark"] .stat-cal-day {
    background: rgba(255, 252, 247, 0.06);
    border-color: transparent;
  }
  [data-theme="dark"] .stat-cal-day:hover {
    background: rgba(255, 252, 247, 0.12);
  }
  [data-theme="dark"] .stat-cal-day--today {
    background: rgba(168, 197, 184, 0.10);
    border-color: transparent;
    box-shadow: inset 0 0 0 1px rgba(168, 197, 184, 0.20);
  }
  [data-theme="dark"] .stat-cal-day[aria-pressed="true"] {
    background: rgba(168, 197, 184, 0.25);
    border-color: rgba(168, 197, 184, 0.50);
    box-shadow: none;
  }
  [data-theme="dark"] .stat-cal-name {
    color: rgba(232, 221, 212, 0.6);
  }
  [data-theme="dark"] .stat-cal-day--today .stat-cal-name {
    color: #A8C5B8;
  }
  [data-theme="dark"] .stat-cal-day[aria-pressed="true"] .stat-cal-name {
    color: rgba(255, 254, 251, 0.9);
  }
  [data-theme="dark"] .stat-cal-num {
    color: rgba(232, 221, 212, 0.85);
  }
  [data-theme="dark"] .stat-cal-day--today .stat-cal-num {
    color: #A8C5B8;
  }
  [data-theme="dark"] .stat-cal-day[aria-pressed="true"] .stat-cal-num {
    color: rgb(255, 254, 251);
  }
  [data-theme="dark"] .cf-count {
    background: rgba(168, 197, 184, 0.35);
    color: rgba(232, 221, 212, 0.9);
  }
  [data-theme="dark"] .cf-count--empty {
    background: transparent;
    color: transparent;
  }
  [data-theme="dark"] .cf-count--empty::after {
    background: rgba(232, 221, 212, 0.25);
  }
  [data-theme="dark"] .stat-cal-day[aria-pressed="true"] .cf-count {
    background: rgba(255, 254, 251, 0.2);
    color: rgb(255, 254, 251);
  }
  [data-theme="dark"] .stat-cal-day:focus-visible {
    border-color: #A8C5B8;
    box-shadow: 0 0 0 3px rgba(168, 197, 184, 0.2);
  }
  [data-theme="dark"] .task-item.is-dragging {
    opacity: 0.35;
  }
  [data-theme="dark"] .stat-cal-day.dnd-over {
    background: rgba(168, 197, 184, 0.22);
    border-color: rgba(168, 197, 184, 0.7);
  }
  [data-theme="dark"] .stat-cal-day.dnd-dropped {
    background: rgba(168, 197, 184, 0.3);
    border-color: #A8C5B8;
  }
  [data-theme="dark"] body.task-dnd-active .stat-cal-day {
    border-color: rgba(168, 197, 184, 0.3);
  }
  [data-theme="dark"] body.task-dnd-active .task-section--today,
  [data-theme="dark"] body.task-dnd-active .task-section--week,
  [data-theme="dark"] body.task-dnd-active .task-section--unscheduled {
    outline-color: rgba(168, 197, 184, 0.3);
  }
  [data-theme="dark"] body.task-dnd-active .task-section.dnd-over {
    outline-color: rgba(168, 197, 184, 0.7);
    background: rgba(168, 197, 184, 0.08);
  }
  [data-theme="dark"] .task-section.dnd-dropped {
    outline-color: #A8C5B8;
  }
  [data-theme="dark"] .task-section-drop-hint {
    border-color: rgba(168, 197, 184, 0.35);
    color: rgba(232, 221, 212, 0.6);
  }
  [data-theme="dark"] .task-item[draggable="true"]::before,
  [data-theme="dark"] .task-item.is-dragging::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='16' fill='%23E8DDD4'%3E%3Ccircle cx='3' cy='2' r='1.5'/%3E%3Ccircle cx='7' cy='2' r='1.5'/%3E%3Ccircle cx='3' cy='8' r='1.5'/%3E%3Ccircle cx='7' cy='8' r='1.5'/%3E%3Ccircle cx='3' cy='14' r='1.5'/%3E%3Ccircle cx='7' cy='14' r='1.5'/%3E%3C/svg%3E");
  }
  [data-theme="dark"] .task-drag-ghost {
    background: rgba(168, 197, 184, 0.92);
    color: #1a1a1a;
  }
  [data-theme="dark"] .task-snooze-move-title {
    color: rgba(255, 252, 247, 0.5);
  }
  [data-theme="dark"] .task-snooze-day-btn {
    background: rgba(255, 254, 251, 0.06);
    border-color: rgba(168, 197, 184, 0.25);
  }
  [data-theme="dark"] .task-snooze-day-btn:hover {
    background: rgba(168, 197, 184, 0.14);
    border-color: rgba(168, 197, 184, 0.5);
  }
  [data-theme="dark"] .task-snooze-day-btn--current {
    background: rgba(168, 197, 184, 0.16);
    border-color: rgba(168, 197, 184, 0.5);
  }
  [data-theme="dark"] .task-snooze-day-name {
    color: rgba(255, 252, 247, 0.55);
  }
  [data-theme="dark"] .stat-ring-bg { stroke: rgba(255, 252, 247, 0.10) !important; }
  [data-theme="dark"] .stat-ring-number { color: var(--warm-text-light) !important; }
  [data-theme="dark"] .stat-subtitle { color: rgba(232, 221, 212, 0.6) !important; }
  [data-theme="dark"] .stat-label-row { color: rgba(232, 221, 212, 0.7) !important; }
  [data-theme="dark"] .stat-subtitle-dot--rose { background: #D4A89A !important; }
  [data-theme="dark"] .stat-subtitle-dot--sage { background: #A8C5B8 !important; }
  [data-theme="dark"] .stat-subtitle-dot--slate { background: #A8B0C4 !important; }
  [data-theme="dark"] .task-input-icon:hover,
  [data-theme="dark"] .task-section-collapse:hover {
    background: rgba(255, 252, 247, 0.08);
  }
  [data-theme="dark"] .task-edit-modal {
    background: rgba(10, 8, 6, 0.62) !important;
  }
  [data-theme="dark"] .stat-item:hover {
    background: transparent !important;
  }
  [data-theme="dark"] .stat-item:focus-visible::after {
    background: #d4a89a;
  }
  @media (max-width: 1024px) {
    .sofia-right-sidebar { display: none; }
    .content,
    .stats-bar,
    .task-input-form,
    .parse-chips {
      max-width: 720px;
    }
    .stats-bar {
      flex-direction: column;
      align-items: stretch;
      gap: 18px;
    }
    .stat-calendar {
      overflow-x: auto;
      scrollbar-width: none;
    }
    .stat-calendar::-webkit-scrollbar {
      display: none;
    }

  }
  @media (max-width: 640px) {
    .app {
      overflow-x: hidden;
    }
    .main {
      height: calc(100vh - 56px);
      height: calc(100dvh - 56px); /* iOS Safari dynamic viewport */
      flex: 0 0 calc(100dvh - 56px);
      max-height: calc(100dvh - 56px);
      padding-bottom: 0;
    }
    .content {
      padding: 20px 20px 80px;
      padding-left: max(20px, env(safe-area-inset-left));
      padding-right: max(20px, env(safe-area-inset-right));
      padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    }
    .task-input-form {
      gap: 10px;
      flex-direction: column;
      align-items: stretch;
    }
    .task-input-card {
      padding: 10px 12px 10px 16px;
      height: 48px;
      min-height: 48px;
      box-sizing: border-box;
      overflow: visible;
      width: 100%;
      min-width: 0;
    }
    .task-add-btn {
      align-self: flex-end;
    }
    .task-input-field {
      font-size: max(16px, var(--font-size-base));
      min-height: 48px;
      padding: 12px 14px;
    }
    .task-edit-grid input,
    .task-edit-grid select,
    .task-edit-grid .sk-dropdown-trigger {
      font-size: max(16px, var(--font-size-base));
      min-height: 44px;
    }
    .task-input-icon {
      width: 28px;
      height: 28px;
      flex: 0 0 28px;
      margin: 0;
      box-sizing: border-box;
    }
    .task-item {
      display: grid;
      grid-template-columns: 26px minmax(0, 1fr) auto;
      column-gap: 8px;
      row-gap: 6px;
      padding: 12px 16px;
    }
    .task-checkbox-wrapper { grid-column: 1; }
    .task-content {
      grid-column: 2 / -1;
      overflow-wrap: break-word;
      word-break: break-word;
    }
    .task-actions {
      grid-column: 3;
      opacity: 1;
    }
    .task-action-btn,
    .parse-chip-dismiss {
      min-width: 44px;
      min-height: 44px;
    }
    .parse-chip-dismiss {
      width: 44px;
      height: 44px;
      flex: 0 0 44px;
      margin: -14px -14px -14px 0;
    }
    .task-snooze-menu {
      position: static;
      grid-column: 1 / -1;
      min-width: 0;
      width: 100%;
      max-width: 100%;
      margin-top: 4px;
      margin-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
      box-sizing: border-box;
    }
    .task-snooze-option {
      min-height: 44px;
    }
    .task-snooze-custom {
      grid-template-columns: 1fr;
    }
    .task-snooze-date,
    .task-snooze-time {
      font-size: max(16px, var(--font-size-sm));
    }
    .task-snooze-apply {
      min-height: 44px;
      scroll-margin-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
    }
    .task-snooze-undo {
      left: 16px;
      right: 16px;
      transform: none;
      animation-name: task-snooze-undo-in-mobile;
      padding-left: max(16px, env(safe-area-inset-left));
      padding-right: max(16px, env(safe-area-inset-right));
      bottom: max(72px, calc(72px + env(safe-area-inset-bottom)));
    }
    @keyframes task-snooze-undo-in-mobile {
      from { opacity: 0; transform: translateY(12px); }
      to { opacity: 1; transform: translateY(0); }
    }
  }

  /* Standard mobile (641px-767px) - catches large phones */
  @media (min-width: 641px) and (max-width: 767px) {
    .content {
      padding: 24px 24px 80px;
    }

    .stats-bar {
      flex-wrap: wrap;
      gap: 12px;
    }

    .stat-arcs {
      width: 100%;
      justify-content: space-around;
    }

    .stat-calendar {
      width: 100%;
      border-left: none;
      border-top: 1px solid var(--divider);
      padding-top: 12px;
      margin-left: 0;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .stat-calendar::-webkit-scrollbar {
      display: none;
    }

    .sofia-suggestion {
      flex-wrap: wrap;
    }

    .sofia-suggestion-actions {
      width: 100%;
      justify-content: flex-end;
    }

    .task-input-form {
      flex-direction: column;
      align-items: stretch;
    }

    .task-add-btn {
      align-self: flex-end;
    }
  }

  /* ── Sidebar premium polish: match Sofia mockup card language ── */
  .sofia-right-sidebar {
    width: 356px;
    padding: 24px 24px 24px 12px;
    background:
      radial-gradient(ellipse at 20% 0%, rgba(212, 168, 154, 0.05) 0%, transparent 55%),
      transparent;
    border-left: none;
    box-shadow: none;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sofia-right-sidebar::-webkit-scrollbar,
  .sofia-sidebar-shell::-webkit-scrollbar {
    width: 0;
    height: 0;
  }
  .sofia-sidebar-shell {
    min-height: calc(100vh - 48px);
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 18px 20px 22px;
    border-radius: var(--radius-card);
    background: rgba(255, 254, 251, 0.92);
    border: 1px solid rgba(228, 220, 212, 0.55);
    box-shadow: 0 18px 60px rgba(92, 77, 67, 0.12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
  }

  .sofia-sidebar-folded .sofia-sidebar-shell {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    min-height: 0;
    height: auto;
    width: auto;
    overflow: visible;
  }
  .sofia-sidebar-folded .sofia-sidebar-shell > *:not(.sofia-fold-toggle) {
    display: none;
  }
  .sofia-sidebar-folded .sofia-fold-toggle {
    position: relative;
    top: auto;
    right: auto;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: #FBF8F2;
    color: #5C4D43;
    border: 1px solid rgba(92, 77, 67, 0.10);
    box-shadow: 0 1px 3px rgba(92, 77, 67, 0.06);
    pointer-events: auto;
    margin: 0;
  }
  .sofia-sidebar-folded .sofia-fold-toggle:focus-visible {
    outline: 2px solid #7C9A8B;
    outline-offset: 2px;
  }
  .sofia-sidebar-folded {
    top: 56px;
    right: 24px;
    bottom: auto;
    height: auto;
    width: auto !important;
    padding: 0 !important;
    pointer-events: none;
  }

  .sofia-reminder {
    position: relative;
    padding: 22px 22px 20px;
    border-radius: var(--radius-card);
    background:
      radial-gradient(circle at 4% 100%, rgba(168, 197, 184, 0.28) 0%, rgba(168, 197, 184, 0.08) 42%, transparent 68%),
      linear-gradient(135deg, rgba(168, 197, 184, 0.28) 0%, rgba(250, 247, 243, 0.82) 46%, rgba(212, 168, 154, 0.28) 100%);
    border: 1px solid rgba(212, 168, 154, 0.22);
    box-shadow:
      0 1px 2px rgba(92, 77, 67, 0.05),
      0 10px 26px rgba(92, 77, 67, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.56);
  }
  .sofia-reminder-title {
    position: relative;
    z-index: 1;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    line-height: 1.45;
    color: var(--warm-text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  .sofia-reminder-text {
    position: relative;
    z-index: 1;
    font-size: var(--font-size-sm);
    line-height: 1.58;
    color: var(--warm-text);
    margin-bottom: 6px;
  }
  .sofia-reminder-countdown {
    position: relative;
    z-index: 1;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--opgaver-sage-text);
    margin-bottom: 16px;
  }
  .sofia-reminder-meta {
    position: relative;
    z-index: 1;
    margin: -2px 0 14px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--opgaver-subtle);
  }
  .sofia-reminder-counter {
    position: relative;
    z-index: 1;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--opgaver-muted);
    margin-top: -8px;
    margin-bottom: 14px;
  }
  .sofia-reminder-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }
  .sofia-reminder-accept {
    padding: 9px 16px;
    background: var(--opgaver-action);
    border-radius: 9px;
    box-shadow: 0 5px 14px rgba(155, 96, 80, 0.22);
  }
  .sofia-reminder-secondary {
    padding: 9px 16px;
    border-radius: 9px;
    background: rgba(255, 254, 251, 0.92);
    color: var(--warm-text);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border: 1px solid var(--divider);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(92, 77, 67, 0.06);
    transition: border-color 0.15s ease, transform 0.15s ease;
  }
  .sofia-reminder-secondary:hover {
    border-color: var(--rose);
    transform: translateY(-1px);
  }
  .sofia-reminder-dismiss {
    padding: 9px 14px;
    border-radius: 9px;
    background: transparent;
    color: var(--opgaver-muted);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
  }
  .sofia-reminder-dismiss:hover {
    color: var(--warm-text);
  }
  .sofia-reminder-feedback {
    padding: 12px;
    font-family: var(--font-family);
    font-style: italic;
    font-size: var(--font-size-sm);
    line-height: 1.5;
    color: var(--opgaver-sage-text);
  }
  .sofia-reminder--due {
    border-color: rgba(155, 96, 80, 0.30);
  }
  .sofia-reminder--due .sofia-reminder-text {
    color: var(--opgaver-action);
  }
  .sofia-reminder-secondary[hidden],
  .sofia-reminder-dismiss[hidden] {
    display: none !important;
  }
  .sofia-reminder-leaf {
    position: absolute;
    right: 10px;
    top: 38px;
    width: 94px;
    height: 112px;
    opacity: 0.16;
    color: var(--opgaver-action);
    pointer-events: none;
  }
  .sofia-reminder-leaf svg {
    width: 100%;
    height: 100%;
  }

  .sofia-reminder--soon {
    background:
      radial-gradient(circle at 4% 100%, rgba(212, 168, 154, 0.18) 0%, rgba(212, 168, 154, 0.06) 42%, transparent 68%),
      linear-gradient(135deg, rgba(212, 168, 154, 0.22) 0%, rgba(250, 247, 243, 0.82) 46%, rgba(168, 197, 184, 0.14) 100%) !important;
    border-color: rgba(212, 168, 154, 0.28) !important;
  }
  .sofia-reminder--soon .sofia-reminder-countdown {
    color: var(--opgaver-action);
  }
  .sofia-reminder--imminent {
    background:
      radial-gradient(circle at 4% 100%, rgba(212, 168, 154, 0.28) 0%, rgba(212, 168, 154, 0.10) 42%, transparent 68%),
      linear-gradient(135deg, rgba(212, 168, 154, 0.32) 0%, rgba(250, 244, 240, 0.88) 46%, rgba(212, 168, 154, 0.18) 100%) !important;
    border-color: rgba(155, 96, 80, 0.30) !important;
  }
  .sofia-reminder--imminent .sofia-reminder-countdown {
    color: var(--opgaver-action);
    animation: sofiaCountdownPulse 2s ease-in-out infinite;
  }
  .sofia-reminder--urgent {
    background:
      radial-gradient(circle at 4% 100%, rgba(155, 96, 80, 0.22) 0%, rgba(212, 168, 154, 0.12) 42%, transparent 68%),
      linear-gradient(135deg, rgba(212, 168, 154, 0.38) 0%, rgba(250, 242, 238, 0.90) 46%, rgba(155, 96, 80, 0.16) 100%) !important;
    border-color: rgba(155, 96, 80, 0.38) !important;
    box-shadow:
      0 1px 2px rgba(92, 77, 67, 0.05),
      0 10px 26px rgba(155, 96, 80, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.56) !important;
  }
  .sofia-reminder--urgent .sofia-reminder-countdown {
    color: #8B4A3A;
    font-weight: var(--font-weight-bold);
    animation: sofiaCountdownPulse 1.5s ease-in-out infinite;
  }
  @keyframes sofiaCountdownPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
  }
  @media (prefers-reduced-motion: reduce) {
    .sofia-reminder--imminent .sofia-reminder-countdown,
    .sofia-reminder--urgent .sofia-reminder-countdown {
      animation: none;
    }
  }

  .sofia-quick-actions-card {
    overflow: hidden;
    border-radius: var(--radius-card);
    background: rgba(255, 254, 251, 0.9);
    border: 1px solid rgba(228, 220, 212, 0.6);
    box-shadow: 0 10px 28px rgba(92, 77, 67, 0.08);
  }
  .sofia-quick-action {
    min-height: 58px;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 15px 16px;
  }
  .sofia-quick-action + .sofia-quick-action {
    border-top: 1px solid rgba(228, 220, 212, 0.58);
  }
  .sofia-quick-action:hover {
    transform: none;
    background: rgba(168, 197, 184, 0.07);
  }
  .sofia-quick-action:active {
    transform: scale(0.98);
    transition-duration: 0.08s;
  }
  .sofia-quick-action-icon {
    width: 21px;
    height: 21px;
    color: var(--opgaver-muted);
  }
  .sofia-quick-action-label {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    color: var(--warm-text);
  }
  .sofia-quick-action[aria-busy="true"] {
    cursor: progress;
  }
  .sofia-quick-action[aria-busy="true"] .sofia-quick-action-chevron {
    border: 2px solid rgba(155, 96, 80, 0.22);
    border-top-color: var(--opgaver-action);
    border-radius: 999px;
    animation: sofiaQuickButtonSpin 0.8s linear infinite;
  }
  .sofia-quick-action[aria-busy="true"] .sofia-quick-action-chevron path {
    display: none;
  }
  .sofia-mobile-actions {
    display: none;
    max-width: 720px;
    width: 100%;
    margin: 0 auto 24px;
  }
  .sofia-mobile-actions .sofia-quick-actions-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sofia-mobile-actions .sofia-quick-action {
    min-width: 0;
    min-height: 54px;
  }
  .sofia-mobile-actions .sofia-quick-action + .sofia-quick-action {
    border-top: none;
    border-left: 1px solid rgba(228, 220, 212, 0.58);
  }
  @media (max-width: 1024px) {
    .sofia-mobile-actions {
      display: block;
    }
  }
  @media (max-width: 640px) {
    .sofia-mobile-actions {
      margin-bottom: 20px;
    }
    .sofia-mobile-actions .sofia-quick-actions-card {
      grid-template-columns: 1fr;
    }
    .sofia-mobile-actions .sofia-quick-action + .sofia-quick-action {
      border-left: none;
      border-top: 1px solid rgba(228, 220, 212, 0.58);
    }
  }
  @keyframes sofiaQuickButtonSpin {
    to { transform: rotate(360deg); }
  }
  .sofia-quick-results {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
  }
  .sofia-quick-result-card {
    padding: 16px;
    border-radius: var(--radius-card);
    border: 1px solid rgba(228, 220, 212, 0.56);
    background: rgba(255, 254, 251, 0.88);
    box-shadow: 0 10px 28px rgba(92, 77, 67, 0.07);
  }
  .sofia-quick-result-card--loading,
  .sofia-quick-result-card--error {
    background: rgba(255, 252, 247, 0.92);
  }
  .sofia-quick-result-kicker {
    margin-bottom: 6px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--opgaver-subtle);
  }
  .sofia-quick-result-title {
    margin: 0 0 6px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-bold);
    line-height: 1.25;
    color: var(--warm-text);
  }
  .sofia-quick-result-desc,
  .sofia-quick-empty-note {
    margin: 0;
    font-size: var(--font-size-xs);
    line-height: 1.55;
    color: var(--opgaver-muted);
  }
  .sofia-quick-empty-note {
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-card);
    background: rgba(212, 168, 154, 0.08);
  }
  .sofia-workload-hint {
    margin: 4px 0 12px;
    font-size: var(--font-size-sm);
    line-height: 1.4;
    color: var(--opgaver-muted);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 200ms ease;
  }
  .sofia-workload-hint.is-tight {
    color: var(--opgaver-action);
  }
  .sofia-workload-hint.is-over {
    color: var(--opgaver-rose-text);
  }
  .sofia-quick-evidence {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
  }
  .sofia-quick-evidence-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(228, 220, 212, 0.62);
    background: rgba(255, 252, 247, 0.78);
    color: var(--opgaver-muted);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    line-height: 1.2;
    appearance: none;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.15s ease, box-shadow 0.2s ease;
  }
  .sofia-quick-evidence-chip:hover {
    transform: translateY(-1px);
    border-color: rgba(212, 168, 154, 0.38);
    background: rgba(255, 252, 247, 0.96);
    box-shadow: 0 4px 12px rgba(92, 77, 67, 0.08);
  }
  .sofia-quick-evidence-chip:active {
    transform: scale(0.98);
    transition-duration: 0.08s;
  }
  .sofia-quick-evidence-chip:focus-visible {
    outline: none;
    outline-offset: 2px;
  }
  .sofia-quick-evidence-chip::after {
    content: "";
    position: absolute;
    inset: -3px;
    border: 2px solid transparent;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
  }
  .sofia-quick-evidence-chip:focus-visible::after {
    border-color: var(--opgaver-action);
    opacity: 1;
  }
  .sofia-quick-evidence-chip[aria-pressed="true"] {
    background: rgba(212, 168, 154, 0.18);
    border-color: rgba(155, 96, 80, 0.42);
    color: var(--warm-text);
    box-shadow: 0 3px 10px rgba(155, 96, 80, 0.12);
  }
  .sofia-quick-evidence-chip strong {
    color: var(--warm-text);
    font-weight: var(--font-weight-bold);
  }
  .sofia-quick-evidence-chip--suggestion {
    background: rgba(212, 168, 154, 0.11);
    border-color: rgba(212, 168, 154, 0.30);
  }
  .sofia-quick-evidence-chip--missing {
    background: rgba(168, 176, 196, 0.10);
    border-color: rgba(168, 176, 196, 0.22);
  }
  .sofia-quick-next-action {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-card);
    border: 1px solid rgba(212, 168, 154, 0.24);
    background: rgba(212, 168, 154, 0.08);
  }
  .sofia-quick-next-action strong {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1.3;
    color: var(--warm-text);
  }
  .sofia-quick-next-action span {
    font-size: var(--font-size-xs);
    line-height: 1.45;
    color: var(--opgaver-muted);
  }
  .sofia-quick-loading-dots {
    display: flex;
    gap: 5px;
    margin-top: 13px;
  }
  .sofia-quick-loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--opgaver-action);
    animation: sofiaQuickPulse 1.1s ease-in-out infinite;
  }
  .sofia-quick-loading-dots span:nth-child(2) { animation-delay: 0.14s; }
  .sofia-quick-loading-dots span:nth-child(3) { animation-delay: 0.28s; }
  @keyframes sofiaQuickPulse {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
  }
  .sofia-quick-result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 13px;
  }
  .sofia-quick-suggestion {
    padding: 13px;
    border-radius: var(--radius-card);
    border: 1px solid rgba(228, 220, 212, 0.62);
    background: rgba(255, 254, 251, 0.78);
  }
  .sofia-quick-suggestion.is-applied {
    border-color: rgba(168, 197, 184, 0.7);
    background: rgba(168, 197, 184, 0.10);
  }
  .sofia-quick-suggestion-head,
  .sofia-quick-result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .sofia-quick-source,
  .sofia-quick-due {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--opgaver-subtle);
  }
  .sofia-quick-source {
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: rgba(212, 168, 154, 0.11);
    color: var(--opgaver-action);
  }
  .sofia-quick-suggestion-title {
    margin: 9px 0 5px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1.35;
    font-weight: var(--font-weight-bold);
    color: var(--warm-text);
  }
  .sofia-quick-suggestion-desc {
    margin: 0;
    font-size: var(--font-size-xs);
    line-height: 1.5;
    color: var(--opgaver-muted);
  }
  .sofia-quick-suggestion-reason {
    margin: 0 0 4px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1.4;
    color: var(--opgaver-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sofia-quick-suggestion-meta {
    margin: 6px 0 0;
    font-size: var(--font-size-xs);
    line-height: 1.45;
    color: var(--opgaver-subtle);
  }
  .sofia-quick-result-actions {
    justify-content: flex-start;
    margin-top: 11px;
  }
  .sofia-quick-result-accept,
  .sofia-quick-result-dismiss {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.15s ease;
  }
  .sofia-quick-result-accept {
    background: var(--opgaver-action);
    color: var(--white);
    box-shadow: 0 6px 14px rgba(155, 96, 80, 0.18);
  }
  .sofia-quick-result-accept:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(155, 96, 80, 0.24);
  }
  .sofia-quick-result-accept:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
  }
  .sofia-quick-result-dismiss {
    background: rgba(255, 252, 247, 0.86);
    color: var(--opgaver-muted);
    border-color: rgba(228, 220, 212, 0.58);
  }
  .sofia-quick-result-dismiss:hover {
    background: rgba(212, 168, 154, 0.10);
    color: var(--warm-text);
  }
  .sofia-quick-result-accept:disabled,
  .sofia-quick-result-dismiss:disabled {
    cursor: default;
    opacity: 0.72;
  }
  .sofia-week-plan {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 13px;
  }
  .sofia-week-plan-day {
    padding: 10px;
    border-radius: var(--radius-card);
    background: rgba(255, 252, 247, 0.64);
    border: 1px solid rgba(228, 220, 212, 0.50);
  }
  .sofia-week-plan-label {
    margin-bottom: 6px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--opgaver-subtle);
  }
  .sofia-week-plan-empty {
    font-size: var(--font-size-xs);
    color: var(--opgaver-muted);
  }
  .sofia-week-plan-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .sofia-week-plan-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 7px;
    align-items: baseline;
    font-size: var(--font-size-xs);
    color: var(--opgaver-muted);
  }
  .sofia-week-plan-item strong {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--warm-text);
    font-weight: var(--font-weight-bold);
  }

  .sofia-tips-card {
    padding: 18px 18px 16px;
    border-radius: var(--radius-card);
    border: 1px solid rgba(228, 220, 212, 0.52);
    box-shadow:
      0 1px 2px rgba(92, 77, 67, 0.04),
      0 12px 30px rgba(92, 77, 67, 0.075);
  }
  .sofia-tips-title {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--warm-text);
  }
  .sofia-tips-card {
    background:
      radial-gradient(circle at 100% 0%, rgba(212, 168, 154, 0.08) 0%, transparent 46%),
      rgba(255, 254, 251, 0.9);
  }
  .sofia-tips-header {
    margin-bottom: 12px;
  }
  .sofia-tips-sparkle {
    color: var(--rose);
    opacity: 0.8;
  }
  .sofia-tips-text {
    font-family: var(--font-family);
    font-style: normal;
    font-size: var(--font-size-sm);
    line-height: 1.72;
    color: var(--warm-text);
  }

  [data-theme="dark"] .sofia-sidebar-shell {
    background: rgba(36, 31, 27, 0.94);
    border-color: rgba(232, 224, 216, 0.10);
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
  }
  [data-theme="dark"] .sofia-tips-title,
  [data-theme="dark"] .sofia-quick-action-label {
    color: var(--warm-text);
  }
  [data-theme="dark"] .sofia-reminder,
  [data-theme="dark"] .sofia-quick-actions-card,
  [data-theme="dark"] .sofia-quick-result-card,
  [data-theme="dark"] .sofia-quick-suggestion,
  [data-theme="dark"] .sofia-week-plan-day,
  [data-theme="dark"] .sofia-tips-card {
    background: rgba(36, 31, 27, 0.82);
    border-color: rgba(232, 224, 216, 0.10);
  }
  [data-theme="dark"] .sofia-quick-result-title,
  [data-theme="dark"] .sofia-quick-suggestion-title,
  [data-theme="dark"] .sofia-week-plan-item strong {
    color: var(--warm-text);
  }
  /* Dark mode for stats sk-dropdown handled by sk-dropdown.css */
  [data-theme="dark"] .sofia-workload-hint {
    color: var(--opgaver-muted) !important;
  }
  [data-theme="dark"] .sofia-workload-hint.is-tight {
    color: var(--opgaver-action) !important;
  }
  [data-theme="dark"] .sofia-workload-hint.is-over {
    color: var(--opgaver-rose-text) !important;
  }
  [data-theme="dark"] .sofia-quick-result-desc,
  [data-theme="dark"] .sofia-quick-suggestion-desc,
  [data-theme="dark"] .sofia-quick-suggestion-meta,
  [data-theme="dark"] .sofia-week-plan-empty,
  [data-theme="dark"] .sofia-week-plan-item {
    color: var(--opgaver-muted);
  }
  [data-theme="dark"] .sofia-quick-suggestion-reason {
    color: var(--opgaver-muted) !important;
  }
  [data-theme="dark"] .sofia-quick-empty-note,
  [data-theme="dark"] .sofia-quick-evidence-chip,
  [data-theme="dark"] .sofia-quick-next-action,
  [data-theme="dark"] .sofia-quick-result-dismiss {
    background: rgba(212, 168, 154, 0.10);
    border-color: rgba(232, 224, 216, 0.10);
  }
  [data-theme="dark"] .sofia-quick-evidence-chip strong,
  [data-theme="dark"] .sofia-quick-next-action strong {
    color: var(--warm-text);
  }
  [data-theme="dark"] .sofia-quick-evidence-chip,
  [data-theme="dark"] .sofia-quick-next-action span {
    color: var(--opgaver-muted);
  }
  [data-theme="dark"] .sofia-quick-evidence-chip:hover,
  [data-theme="dark"] .sofia-quick-evidence-chip[aria-pressed="true"] {
    background: rgba(212, 168, 154, 0.16);
    border-color: rgba(212, 168, 154, 0.30);
    color: var(--warm-text);
  }
  [data-theme="dark"] .sofia-quick-suggestion.is-applied {
    background: rgba(168, 197, 184, 0.12);
    border-color: rgba(168, 197, 184, 0.32);
  }
  [data-theme="dark"] .task-add-btn {
    background-image: linear-gradient(135deg, #5A9A82 0%, #4A8A72 100%);
    box-shadow: 0 2px 6px rgba(92, 77, 67, 0.12), 0 1px 0 0 rgba(255, 255, 255, 0.08) inset;
    color: #fff;
  }
  [data-theme="dark"] .task-section-count {
    color: rgba(232, 221, 212, 0.8);
  }
  [data-theme="dark"] .sofia-fold-toggle {
    color: rgba(232, 224, 216, 0.50);
  }
  [data-theme="dark"] .sofia-fold-toggle:hover {
    background: rgba(255, 252, 247, 0.08);
    border-color: rgba(232, 224, 216, 0.10);
    color: #E8DDD4;
  }
  [data-theme="dark"] .task-input-icon {
    color: rgba(232, 221, 212, 0.6);
  }
  [data-theme="dark"] .task-input-icon:hover {
    color: #E8DDD4;
  }
  [data-theme="dark"] .sofia-sidebar-folded .sofia-sidebar-shell {
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  [data-theme="dark"] .sofia-sidebar-folded .sofia-fold-toggle {
    background: rgba(42, 37, 33, 0.92);
    color: #E8DDD4;
    border-color: rgba(232, 224, 216, 0.10);
  }
  [data-theme="dark"] .sofia-loading-icon {
    color: var(--opgaver-sage-text);
  }
  [data-theme="dark"] .sofia-reminder-text,
  [data-theme="dark"] .sofia-tips-text {
    color: var(--warm-text);
  }
  [data-theme="dark"] .sofia-reminder-meta {
    color: var(--warm-text-light);
  }
  [data-theme="dark"] .sofia-reminder-title {
    color: var(--warm-text);
  }
  [data-theme="dark"] .sofia-reminder-countdown {
    color: var(--opgaver-sage-text);
  }
  [data-theme="dark"] .sofia-reminder-counter {
    color: var(--opgaver-muted);
  }
  [data-theme="dark"] .sofia-reminder-dismiss {
    color: var(--opgaver-muted);
  }
  [data-theme="dark"] .sofia-reminder-dismiss:hover {
    color: var(--warm-text);
  }
  [data-theme="dark"] .sofia-reminder--soon {
    background:
      linear-gradient(135deg, rgba(212, 168, 154, 0.10) 0%, rgba(36, 31, 27, 0.82) 46%, rgba(168, 197, 184, 0.06) 100%) !important;
    border-color: rgba(212, 168, 154, 0.18) !important;
  }
  [data-theme="dark"] .sofia-reminder--soon .sofia-reminder-countdown {
    color: rgba(212, 168, 154, 0.85);
  }
  [data-theme="dark"] .sofia-reminder--imminent {
    background:
      linear-gradient(135deg, rgba(212, 168, 154, 0.16) 0%, rgba(36, 31, 27, 0.82) 46%, rgba(212, 168, 154, 0.08) 100%) !important;
    border-color: rgba(212, 168, 154, 0.28) !important;
  }
  [data-theme="dark"] .sofia-reminder--imminent .sofia-reminder-countdown {
    color: rgba(212, 168, 154, 0.90);
  }
  [data-theme="dark"] .sofia-reminder--urgent {
    background:
      linear-gradient(135deg, rgba(155, 96, 80, 0.18) 0%, rgba(36, 31, 27, 0.82) 46%, rgba(155, 96, 80, 0.10) 100%) !important;
    border-color: rgba(155, 96, 80, 0.35) !important;
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.10),
      0 10px 26px rgba(155, 96, 80, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  }
  [data-theme="dark"] .sofia-reminder--urgent .sofia-reminder-countdown {
    color: #D4A89A;
    font-weight: var(--font-weight-bold);
  }
  @media (max-width: 1024px) {
    .sofia-right-sidebar { display: none; }
  }

  /* Sofia result modal overlay */
  .sofia-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(18, 16, 14, 0.46);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  .sofia-modal-backdrop[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
  }
  .sofia-modal-panel {
    position: relative;
    width: 720px;
    max-width: min(720px, calc(100vw - 32px));
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(255, 254, 251, 0.97);
    border-radius: 20px;
    border: 1px solid rgba(228, 220, 212, 0.56);
    box-shadow: 0 24px 64px rgba(92, 77, 67, 0.14), 0 4px 16px rgba(92, 77, 67, 0.06);
    padding: 28px 28px 24px;
    transform: translateY(8px) scale(0.98);
    transition: transform 0.2s ease;
  }
  .sofia-modal-backdrop[aria-hidden="false"] .sofia-modal-panel {
    transform: translateY(0) scale(1);
  }
  .sofia-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--opgaver-muted);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .sofia-modal-close:hover {
    background: rgba(212, 168, 154, 0.12);
    color: var(--warm-text);
  }
  .sofia-modal-close:focus-visible {
    outline: 2px solid #4A7A68;
    outline-offset: 2px;
  }
  .sofia-modal-close svg {
    width: 18px;
    height: 18px;
  }
  .sofia-modal-body .sofia-quick-result-card {
    border: none;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }
  [data-theme="dark"] .sofia-modal-backdrop {
    background: rgba(18, 16, 14, 0.46);
  }
  [data-theme="dark"] .sofia-modal-panel {
    background: rgba(36, 31, 27, 0.95);
    border-color: rgba(232, 224, 216, 0.10);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36), 0 4px 16px rgba(0, 0, 0, 0.18);
  }
  [data-theme="dark"] .sofia-modal-body .sofia-quick-result-title,
  [data-theme="dark"] .sofia-modal-body .sofia-quick-suggestion-title {
    color: #E8DDD4;
  }
  [data-theme="dark"] .sofia-modal-close {
    color: rgba(232, 224, 216, 0.50);
  }
  [data-theme="dark"] .sofia-modal-close:hover {
    background: rgba(212, 168, 154, 0.10);
    color: #E8DDD4;
  }
  @media (max-width: 640px) {
    .sofia-modal-backdrop {
      padding: env(safe-area-inset-top, 16px) env(safe-area-inset-right, 0)
               env(safe-area-inset-bottom, 16px) env(safe-area-inset-left, 0);
      box-sizing: border-box;
      overflow-y: auto;
    }
    .sofia-modal-panel {
      display: flex;
      flex-direction: column;
      width: 100%;
      max-width: 100%;
      max-height: calc(100dvh - 32px);
      overflow: hidden;
      padding: 56px 16px 18px;
      border-radius: 18px;
    }
    .sofia-modal-body {
      overflow-y: auto;
      overflow-x: hidden;
      flex: 1 1 auto;
      min-height: 0;
    }
    .sofia-modal-close {
      width: 44px;
      height: 44px;
      top: 10px;
      right: 10px;
      border-radius: 10px;
    }
    .sofia-modal-close:focus-visible {
      outline: 2px solid #4A7A68;
      outline-offset: 2px;
    }
    /* Inset (not bleed) on mobile: the body clips overflow-x, so the
       full-bleed sticky footer would be clipped. Sticks to the body bottom. (#2934) */
    .sofia-bulk-actions--primary {
      margin: 8px 0 0;
      padding: 13px 0 0;
      bottom: 0;
      border-bottom-left-radius: 0;
      border-bottom-right-radius: 0;
    }
  }

  /* ── Suggest modal IA (#1541) ──────────────────────────────────── */
  .sofia-suggest-title {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: #3A2F26;
    letter-spacing: -0.005em;
    line-height: 1.2;
    margin: 0 0 4px;
  }
  .sofia-suggest-subtitle {
    margin: 0 0 16px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-normal);
    color: #9A8E82;
    line-height: 1.4;
  }
  /* Anvend alle demoted to a quiet ghost shortcut — per-item review is the default (#2882). */
  .sofia-suggest-bulk {
    background: transparent;
    color: #4A7A68;
    border: 1px solid rgba(110, 138, 126, 0.34);
    border-radius: 14px;
    box-shadow: none;
  }
  .sofia-suggest-bulk:hover {
    background: rgba(110, 138, 126, 0.08);
    color: #3D6B57;
    border-color: rgba(110, 138, 126, 0.5);
  }
  .sofia-suggest-divider {
    border: none;
    border-top: 1px solid rgba(92, 77, 67, 0.08);
    margin: 24px 0;
  }
  .sofia-quick-section-title {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: #9A8E82;
    margin: 20px 0 12px;
  }
  /* suggest_tasks modal cards — calm review-first surface (#2882) */
  .sofia-modal-body .sofia-quick-suggestion {
    position: relative;
    padding: 16px 18px; /* symmetric — corner X is absolutely positioned (#2934) */
    background: #FFFEFB;
    border-radius: 14px;
    border: 1px solid rgba(228, 220, 212, 0.7);
    box-shadow: 0 1px 2px rgba(92, 77, 67, 0.04), 0 4px 12px rgba(92, 77, 67, 0.05);
    cursor: default;
  }
  .sofia-modal-body .sofia-quick-suggestion:hover {
    border-color: rgba(92, 77, 67, 0.16);
    box-shadow: 0 2px 4px rgba(92, 77, 67, 0.06), 0 8px 20px rgba(92, 77, 67, 0.08);
    transform: none;
  }
  .sofia-modal-body .sofia-quick-suggestion-title {
    margin: 0;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: #3A2F26;
    line-height: 1.4;
  }
  /* Source tag leads with a calm sage tint, not the old coral/warm chip (#2882). */
  .sofia-modal-body .sofia-quick-suggestion-head {
    margin: 8px 0;
  }
  .sofia-modal-body .sofia-quick-source {
    background: rgba(110, 138, 126, 0.12);
    color: #4A7A68;
  }
  /* Reason now reads as a quiet supportive helper line under the title (#2882). */
  .sofia-modal-body .sofia-quick-suggestion-reason {
    display: block;
    margin: 4px 0 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1.45;
    font-weight: var(--font-weight-normal);
    color: var(--opgaver-muted);
    white-space: normal;
  }
  /* The repeated scheduling-reason boilerplate is removed from the modal (#2934). */
  .sofia-modal-body .sofia-quick-suggestion-sched-reason {
    display: none;
  }
  /* No exact due/time on the calm review card; keep move-picker out of the modal. */
  .sofia-modal-body .sofia-quick-due,
  .sofia-modal-body .sofia-quick-move-picker {
    display: none;
  }
  .sofia-modal-body .sofia-quick-suggestion-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
  }
  /* Quiet corner ✕ dismiss — small glyph, 44px invisible hit area (#2882). */
  .calm-card-x {
    all: unset;
    position: absolute;
    top: 12px;
    right: 12px;
    box-sizing: border-box;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--opgaver-subtle);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }
  .calm-card-x::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 46px;
    height: 46px;
    transform: translate(-50%, -50%);
  }
  .calm-card-x:hover {
    color: var(--warm-text);
    background: rgba(92, 77, 67, 0.08);
  }
  .calm-card-x:focus-visible {
    outline: 2px solid #4A7A68;
    outline-offset: 2px;
  }
  /* Quiet secondary footer actions: Hør (TTS) + Allerede gjort (#2882). */
  .calm-tts-btn,
  .calm-done-btn {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    min-width: 46px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(92, 77, 67, 0.14);
    background: rgba(255, 252, 247, 0.6);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--opgaver-muted);
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  }
  /* Decorative speaker glyph before "Hør" — masked so it inherits currentColor
     and never enters the accessible name (#2934). */
  .calm-tts-btn::before {
    content: "";
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 2.5 4.6 5.3H2.2c-.4 0-.7.3-.7.7v4c0 .4.3.7.7.7h2.4L8 13.5c.5.4 1.2 0 1.2-.6V3.1c0-.6-.7-1-1.2-.6z'/><path d='M11.3 5.1c-.3-.2-.7-.1-.9.2-.2.3-.1.7.2.9.6.4 1 1.1 1 1.8s-.4 1.4-1 1.8c-.3.2-.4.6-.2.9.2.3.6.4.9.2 1-.6 1.6-1.7 1.6-2.9s-.6-2.3-1.6-2.9z'/></svg>") center / contain no-repeat;
    mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M8 2.5 4.6 5.3H2.2c-.4 0-.7.3-.7.7v4c0 .4.3.7.7.7h2.4L8 13.5c.5.4 1.2 0 1.2-.6V3.1c0-.6-.7-1-1.2-.6z'/><path d='M11.3 5.1c-.3-.2-.7-.1-.9.2-.2.3-.1.7.2.9.6.4 1 1.1 1 1.8s-.4 1.4-1 1.8c-.3.2-.4.6-.2.9.2.3.6.4.9.2 1-.6 1.6-1.7 1.6-2.9s-.6-2.3-1.6-2.9z'/></svg>") center / contain no-repeat;
  }
  .calm-tts-btn:hover,
  .calm-done-btn:hover {
    color: var(--warm-text);
    background: rgba(110, 138, 126, 0.08);
    border-color: rgba(110, 138, 126, 0.28);
  }
  .calm-tts-btn:focus-visible,
  .calm-done-btn:focus-visible {
    outline: 2px solid #4A7A68;
    outline-offset: 2px;
  }
  .calm-tts-btn.is-playing {
    color: #4A7A68;
    background: rgba(110, 138, 126, 0.12);
    border-color: rgba(110, 138, 126, 0.34);
  }
  /* Per-item review is the default; nudge Tilføj to the trailing edge (#2882). */
  .sofia-modal-body .sofia-quick-suggestion-footer .sofia-quick-accept-btn {
    margin-left: auto;
    box-sizing: border-box;
    justify-content: center;
    min-height: 46px;
    min-width: 46px;
    padding: 9px 18px;
  }
  /* Calm "already done" confirmation: retire the actions, keep the card readable. */
  .sofia-modal-body .sofia-quick-suggestion.calm-is-done {
    opacity: 0.7;
  }
  .sofia-modal-body .sofia-quick-suggestion.calm-is-done .sofia-quick-suggestion-footer {
    display: none;
  }
  .sofia-modal-body .sofia-quick-suggestion.calm-is-done .sofia-quick-suggestion-title {
    text-decoration: line-through;
    text-decoration-color: rgba(92, 77, 67, 0.4);
  }
  .sofia-quick-accept-btn {
    all: unset;
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 10px;
    background: #4A7A68;
    color: #FBF8F2;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(92, 77, 67, 0.08);
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  }
  .sofia-quick-accept-btn:hover {
    background: #3D6B57;
    box-shadow: 0 2px 6px rgba(92, 77, 67, 0.12);
  }
  .sofia-quick-accept-btn:active {
    transform: scale(0.96);
    transition-duration: 0.06s;
  }
  .sofia-quick-accept-btn:focus-visible {
    outline: 2px solid #4A7A68;
    outline-offset: 2px;
  }
  .sofia-quick-accept-btn:disabled,
  .sofia-quick-accept-btn[aria-busy="true"] {
    opacity: 0.65;
    pointer-events: none;
  }
  .sofia-suggest-list {
    gap: 12px;
    padding-bottom: 8px; /* final card clears the sticky bulk footer (#2934) */
  }
  .sofia-modal-panel {
    scrollbar-width: thin;
    scrollbar-color: rgba(92, 77, 67, 0.18) transparent;
  }
  .sofia-modal-panel::-webkit-scrollbar {
    width: 6px;
  }
  .sofia-modal-panel::-webkit-scrollbar-track {
    background: transparent;
    margin: 12px 0;
  }
  .sofia-modal-panel::-webkit-scrollbar-thumb {
    background: rgba(92, 77, 67, 0.14);
    border-radius: 3px;
  }
  .sofia-modal-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(92, 77, 67, 0.24);
  }
  .sofia-modal-panel::-webkit-scrollbar-button {
    display: none;
  }
  [data-theme="dark"] .sofia-suggest-title {
    color: #E8DDD4;
  }
  [data-theme="dark"] .sofia-suggest-subtitle {
    color: rgba(232, 224, 216, 0.50);
  }
  [data-theme="dark"] .sofia-suggest-bulk {
    background: transparent;
    color: #A8C5B8;
    border-color: rgba(168, 197, 184, 0.34);
  }
  [data-theme="dark"] .sofia-suggest-bulk:hover {
    background: rgba(168, 197, 184, 0.12);
    color: #C4DBD0;
    border-color: rgba(168, 197, 184, 0.5);
  }
  [data-theme="dark"] .sofia-suggest-divider {
    border-top-color: rgba(232, 224, 216, 0.08);
  }
  [data-theme="dark"] .sofia-quick-section-title {
    color: rgba(232, 224, 216, 0.50);
  }
  [data-theme="dark"] .sofia-modal-body .sofia-quick-suggestion {
    background: rgba(36, 31, 27, 0.82);
    border-color: rgba(232, 224, 216, 0.10);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  }
  [data-theme="dark"] .sofia-modal-body .sofia-quick-suggestion:hover {
    border-color: rgba(232, 224, 216, 0.18);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  }
  [data-theme="dark"] .sofia-modal-body .sofia-quick-suggestion-title {
    color: #E8DDD4;
  }
  [data-theme="dark"] .sofia-quick-accept-btn {
    background: #6E8A7E;
  }
  /* Calm review-card controls — dark mode (#2882) */
  [data-theme="dark"] .sofia-modal-body .sofia-quick-suggestion-reason,
  [data-theme="dark"] .sofia-modal-body .sofia-quick-suggestion-sched-reason {
    color: var(--opgaver-muted);
  }
  [data-theme="dark"] .sofia-modal-body .sofia-quick-source {
    background: rgba(168, 197, 184, 0.16);
    color: #A8C5B8;
  }
  [data-theme="dark"] .calm-card-x {
    color: rgba(232, 224, 216, 0.5);
  }
  [data-theme="dark"] .calm-card-x:hover {
    color: #E8DDD4;
    background: rgba(212, 168, 154, 0.10);
  }
  [data-theme="dark"] .calm-tts-btn,
  [data-theme="dark"] .calm-done-btn {
    background: rgba(36, 31, 27, 0.5);
    border-color: rgba(232, 224, 216, 0.14);
    color: var(--opgaver-muted);
  }
  [data-theme="dark"] .calm-tts-btn:hover,
  [data-theme="dark"] .calm-done-btn:hover {
    color: #E8DDD4;
    background: rgba(168, 197, 184, 0.12);
    border-color: rgba(168, 197, 184, 0.3);
  }
  [data-theme="dark"] .calm-tts-btn.is-playing {
    color: #A8C5B8;
    background: rgba(168, 197, 184, 0.16);
    border-color: rgba(168, 197, 184, 0.38);
  }
  [data-theme="dark"] .sofia-modal-body .sofia-quick-suggestion.calm-is-done .sofia-quick-suggestion-title {
    text-decoration-color: rgba(232, 224, 216, 0.4);
  }
  /* Calm controls honour reduced-motion (#2882). */
  @media (prefers-reduced-motion: reduce) {
    .calm-card-x,
    .calm-tts-btn,
    .calm-done-btn {
      transition: none;
    }
  }
  [data-theme="dark"] .sofia-modal-panel {
    scrollbar-color: rgba(232, 224, 216, 0.15) transparent;
  }
  [data-theme="dark"] .sofia-modal-panel::-webkit-scrollbar-thumb {
    background: rgba(232, 224, 216, 0.12);
  }
  [data-theme="dark"] .sofia-modal-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(232, 224, 216, 0.22);
  }

  /* ── Plan my week guided review (.cpw-*) (#2225) ──────────── */
  .cpw-root {
    padding: 0;
  }
  .cpw-header {
    margin-bottom: 16px;
  }
  .cpw-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: #3A2F26;
    letter-spacing: -0.005em;
    line-height: 1.2;
    margin: 0 0 2px;
  }
  .cpw-week {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    gap: 12px;
    padding: 4px 14px 16px;
  }
  .cpw-day-btn {
    all: unset;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 78px;
    border-radius: 14px;
    background: rgba(228, 220, 212, 0.32);
    color: #5C4D43;
    font-family: var(--font-family);
    cursor: pointer;
    padding: 8px 4px;
    text-align: center;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  }
  .cpw-day-btn:hover {
    background: rgba(228, 220, 212, 0.52);
  }
  .cpw-day-btn:active {
    transform: scale(0.97);
    transition-duration: 0.06s;
  }
  .cpw-day-btn--active {
    background: rgb(74, 122, 104);
    color: #fff;
    box-shadow: 0 2px 8px rgba(74, 122, 104, 0.25);
  }
  .cpw-day-btn--active:hover {
    background: rgb(74, 122, 104);
  }
  .cpw-day-btn--done:not(.cpw-day-btn--active) {
    background: rgba(74, 122, 104, 0.12);
    color: #4A7A68;
  }
  .cpw-day-btn--empty:not(.cpw-day-btn--active) {
    background: rgba(228, 220, 212, 0.18);
    color: #9A8E82;
  }
  .cpw-day-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.2;
  }
  .cpw-day-num {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin-top: 4px;
  }
  .cpw-day-cap {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    opacity: 0.65;
    line-height: 1.2;
    margin-top: 2px;
    letter-spacing: 0.02em;
  }
  .cpw-day {
    padding: 0 2px;
  }
  .cpw-empty-day {
    border: 1px dashed rgba(154, 142, 130, 0.32);
    border-radius: 16px;
    color: #9A8E82;
    font-size: var(--font-size-sm);
    line-height: 1.4;
    padding: 18px 14px;
    text-align: center;
  }
  .cpw-card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title time"
      "actions actions";
    align-items: start;
    column-gap: 12px;
    row-gap: 12px;
    background: rgb(255, 254, 251);
    border: 1px solid rgba(228, 220, 212, 0.9);
    border-radius: 16px;
    padding: 14px 14px 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 3px rgba(92, 77, 67, 0.05);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
  }
  .cpw-card:hover {
    box-shadow: 0 4px 12px rgba(92, 77, 67, 0.10);
    border-color: rgba(212, 199, 188, 0.95);
  }
  .cpw-card--done {
    display: block;
    opacity: 0.55;
    box-shadow: none;
  }
  .cpw-card--done .cpw-btn--ghost {
    margin-top: 8px;
  }
  .cpw-card-time {
    grid-area: time;
    justify-self: end;
    align-self: start;
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: #4A7A68;
    background: rgba(74, 122, 104, 0.08);
    border-radius: 8px;
    padding: 2px 8px;
    margin: 0;
    white-space: nowrap;
  }
  .cpw-card-title {
    grid-area: title;
    align-self: start;
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
    color: #3A2F26;
    line-height: 1.4;
    margin: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .cpw-card-title--decided {
    text-decoration: line-through;
  }
  .cpw-card-actions {
    grid-area: actions;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
  }
  .cpw-card-badge {
    display: inline-block;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1.3;
    margin-bottom: 4px;
  }
  .cpw-card-badge--added {
    color: #4A7A68;
  }
  .cpw-card-badge--skipped {
    color: #9A8E82;
  }
  .cpw-btn {
    all: unset;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
    box-sizing: border-box;
  }
  .cpw-btn--primary {
    background: #4A7A68;
    color: #fff;
    box-shadow: 0 1px 3px rgba(92, 77, 67, 0.08);
  }
  .cpw-btn--primary:hover {
    background: #3D6B57;
    box-shadow: 0 2px 6px rgba(92, 77, 67, 0.12);
  }
  .cpw-btn--primary:active {
    transform: scale(0.97);
    transition-duration: 0.06s;
  }
  .cpw-btn--ghost {
    background: transparent;
    color: #5C4D43;
  }
  .cpw-btn--ghost:hover {
    background: rgba(228, 220, 212, 0.4);
  }
  .cpw-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
  }
  .cpw-btn[aria-busy="true"] {
    opacity: 0.65;
    pointer-events: none;
  }
  .cpw-nav {
    position: sticky;
    bottom: -24px;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 8px -28px -24px;
    padding: 14px 28px;
    border-top: 1px solid rgba(92, 77, 67, 0.18);
    background: #ffffff;
  }
  .cpw-root button:focus-visible {
    outline: 2px solid #4A7A68;
    outline-offset: 2px;
  }
  @media (prefers-reduced-motion: reduce) {
    .cpw-day-btn,
    .cpw-btn,
    .cpw-card {
      transition: none;
    }
    .cpw-day-btn:active,
    .cpw-btn--primary:active {
      transform: none;
    }
  }
  @media (max-width: 640px) {
    .cpw-week {
      display: flex !important;
      overflow-x: auto;
      scroll-snap-type: x mandatory;
      -webkit-overflow-scrolling: touch;
      gap: 12px;
      padding: 4px 14px 16px;
      margin: 0 -16px;
      padding-left: 16px;
      padding-right: 16px;
      scrollbar-width: none;
    }
    .cpw-week::-webkit-scrollbar {
      display: none;
    }
    .cpw-week::before,
    .cpw-week::after {
      content: "";
      flex: 0 0 calc(50% - 51px);
    }
    .cpw-day-btn {
      flex: 0 0 78px;
      width: 78px;
      min-height: 86px;
      box-sizing: border-box;
      padding: 10px 6px;
      scroll-snap-align: center;
      gap: 2px;
    }
    .cpw-day-label {
      white-space: nowrap;
    }
    .cpw-day-num {
      white-space: nowrap;
    }
    .cpw-day-cap {
      white-space: nowrap;
    }
    .cpw-card {
      padding: 12px 12px 10px;
    }
    .cpw-nav {
      bottom: -18px;
      margin: 8px -16px -18px;
      padding: 14px 16px;
    }
  }
  @media (max-width: 360px) {
    .cpw-week::before,
    .cpw-week::after {
      flex-basis: calc(50% - 48px);
    }
    .cpw-day-btn {
      flex: 0 0 72px;
      width: 72px;
      min-height: 84px;
      padding: 8px 4px;
    }
  }
  [data-theme="dark"] .cpw-header h2 {
    color: #E8DDD4;
  }
  [data-theme="dark"] .cpw-day-btn {
    background: rgba(232, 224, 216, 0.08);
    color: rgba(232, 224, 216, 0.70);
  }
  [data-theme="dark"] .cpw-day-btn:hover {
    background: rgba(232, 224, 216, 0.14);
  }
  [data-theme="dark"] .cpw-day-btn--active {
    background: rgb(74, 122, 104);
    color: #fff;
  }
  [data-theme="dark"] .cpw-day-btn--active:hover {
    background: rgb(74, 122, 104);
  }
  [data-theme="dark"] .cpw-day-btn--done:not(.cpw-day-btn--active) {
    background: rgba(74, 122, 104, 0.18);
    color: #6E8A7E;
  }
  [data-theme="dark"] .cpw-day-btn--empty:not(.cpw-day-btn--active) {
    background: rgba(232, 224, 216, 0.05);
    color: rgba(232, 224, 216, 0.42);
  }
  [data-theme="dark"] .cpw-empty-day {
    border-color: rgba(232, 224, 216, 0.14);
    color: rgba(232, 224, 216, 0.50);
  }
  [data-theme="dark"] .cpw-card {
    background: rgba(36, 31, 27, 0.82);
    border-color: rgba(232, 224, 216, 0.10);
  }
  [data-theme="dark"] .cpw-card-title {
    color: #E8DDD4;
  }
  [data-theme="dark"] .cpw-card-time {
    color: #6E8A7E;
    background: rgba(74, 122, 104, 0.15);
  }
  [data-theme="dark"] .cpw-card-badge--added {
    color: #6E8A7E;
  }
  [data-theme="dark"] .cpw-card-badge--skipped {
    color: rgba(232, 224, 216, 0.50);
  }
  [data-theme="dark"] .cpw-btn--primary {
    background: #4A7A68;
  }
  [data-theme="dark"] .cpw-btn--ghost {
    color: rgba(232, 224, 216, 0.70);
  }
  [data-theme="dark"] .cpw-btn--ghost:hover {
    background: rgba(232, 224, 216, 0.08);
  }
  [data-theme="dark"] .cpw-nav {
    background: #241F1B;
    border-top-color: rgba(232, 224, 216, 0.12);
  }
  [data-theme="dark"] .cpw-root button:focus-visible {
    outline-color: #6E8A7E;
  }

  /* Chat-ny shell parity: exact left sidebar and background language */
  html, body {
    background: var(--cream);
  }

  .app {
    position: relative;
    background:
      radial-gradient(ellipse at 74% 18%, rgba(212, 168, 154, 0.055) 0%, transparent 48%),
      radial-gradient(ellipse at 22% 86%, rgba(168, 197, 184, 0.045) 0%, transparent 48%),
      linear-gradient(180deg, #FAF7F3 0%, var(--pill-bg, #F0EAE4) 100%);
    overflow: hidden;
  }

  .app::before {
    content: none;
    background-image: none;
    display: none;
  }

  .main {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: transparent;
    position: relative;
  }

  .main::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 154, 0.16);
    pointer-events: none;
  }

  .main::after {
    content: '';
    position: absolute;
    top: -160px;
    right: -120px;
    width: 580px;
    height: 580px;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 154, 0.10);
    pointer-events: none;
  }

  .decorative-arcs {
    position: absolute;
    top: -200px;
    right: -160px;
    width: 660px;
    height: 660px;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 154, 0.12) !important;
    pointer-events: none;
  }

  .decorative-arcs-2 {
    position: absolute;
    top: -80px;
    right: -40px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 154, 0.26) !important;
    pointer-events: none;
  }

  .decorative-arcs-bl {
    position: absolute;
    bottom: -190px;
    left: 38px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    border: 1px solid rgba(168, 197, 184, 0.09);
    pointer-events: none;
  }

  @media (max-width: 767px) {
    .decorative-arcs-bl {
      display: none;
    }
  }

  .botanical-leaf {
    display: none;
  }

  [data-theme="dark"] .app {
    background: #171512;
  }

  [data-theme="dark"] .app::before {
    content: none;
    display: none;
  }

  /* Smooth Sofia background: let the chat-ny app gradient continue behind the right rail */
  .sofia-right-sidebar {
    background: transparent !important;
  }

  .sofia-sidebar-shell {
    min-height: calc(100vh - 48px);
    background: var(--white);
    border-color: rgba(228, 220, 212, 0.38);
    box-shadow:
      0 16px 50px rgba(92, 77, 67, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.56);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow-y: auto;
  }

  .sofia-reminder,
  .sofia-quick-actions-card,
  .sofia-tips-card {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  [data-theme="dark"] .sofia-sidebar-shell {
    background: #241F1B;
    border-color: rgba(232, 224, 216, 0.10);
    box-shadow:
      0 16px 50px rgba(0, 0, 0, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
  }

  /* Unified page background: .main and Sofia are siblings, so the parent must own the canvas */
  :root {
    --opgaver-page-background:
      radial-gradient(ellipse at 70% 20%, rgba(212, 168, 154, 0.06) 0%, transparent 50%),
      radial-gradient(ellipse at 30% 80%, rgba(168, 197, 184, 0.05) 0%, transparent 50%),
      linear-gradient(180deg, #FAF7F3 0%, var(--pill-bg, #F0EAE4) 100%);
    /* #3225 — consume the shared app dark canvas (assets/css/blod-bolge-shell.css). */
    --opgaver-page-background-dark: var(--app-dark-canvas);
  }

  html,
  body,
  .app {
    background: var(--opgaver-page-background) !important;
  }

  .main,
  .sofia-right-sidebar {
    background: transparent !important;
  }

  [data-theme="dark"] html,
  [data-theme="dark"] body,
  [data-theme="dark"] .app {
    background: var(--opgaver-page-background-dark) !important;
  }

  [data-theme="dark"] .main,
  [data-theme="dark"] .sofia-right-sidebar {
    background: transparent !important;
  }

  /* Sofia overlay: the sidebar is not a page column, it floats on the shared app canvas */
  .app {
    isolation: isolate;
  }

  .main {
    width: 100%;
    padding-right: 356px;
  }

  .sofia-right-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 356px !important;
    height: 100vh;
    padding: 24px 24px 24px 12px !important;
    flex: none;
    z-index: 8;
    overflow: visible;
  }

  .sofia-right-sidebar.sofia-sidebar-folded {
    top: 56px;
    right: 24px;
    bottom: auto;
    height: auto;
    width: auto !important;
    padding: 0 !important;
    pointer-events: none;
  }

  .sofia-sidebar-shell {
    width: 320px;
  }

  @media (min-width: 1025px) {
    .sofia-right-sidebar:not(.sofia-sidebar-folded) .sofia-sidebar-shell {
      margin-top: 86px;
      min-height: calc(100vh - 48px - 86px);
    }
  }

  .main {
    transition: padding-right 300ms ease;
  }

  .app.sofia-sidebar-collapsed .main {
    padding-right: 24px;
  }

  .sofia-week-summary {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(212, 168, 154, 0.06);
    border: 1px solid rgba(212, 168, 154, 0.18);
  }

  .sofia-week-summary-stats {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    line-height: 1.45;
    color: var(--warm-text);
  }

  .sofia-week-summary-warning {
    margin-top: 4px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: 1.45;
    color: #D4A060;
  }

  .sofia-week-plan-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
  }

  .sofia-week-plan-day--today {
    border-color: rgba(212, 168, 154, 0.55);
    background: rgba(212, 168, 154, 0.06);
  }

  .sofia-week-plan-day--today .sofia-week-plan-label {
    color: var(--opgaver-action);
  }

  .sofia-week-plan-label {
    margin-bottom: 0;
    font-family: var(--font-family);
  }

  .sofia-week-plan-cap {
    flex: 0 0 auto;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(168, 197, 184, 0.15);
    color: var(--opgaver-sage-text);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    line-height: 1.5;
  }

  .sofia-cap--busy {
    background: rgba(212, 160, 96, 0.15);
    color: #D4A060;
  }

  .sofia-cap--full {
    background: rgba(184, 84, 80, 0.12);
    color: #B85450;
  }

  .sofia-cap--open {
    background: transparent;
    color: var(--opgaver-muted);
    font-weight: var(--font-weight-semibold);
  }

  .sofia-week-plan-item--suggestion {
    margin-left: -2px;
    padding-left: 8px;
    border-left: 2px solid rgba(212, 168, 154, 0.45);
  }

  .sofia-week-plan-time {
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    font-variant-numeric: tabular-nums;
    color: var(--opgaver-muted);
  }

  .sofia-week-plan-time--none {
    color: var(--opgaver-subtle);
  }

  .sofia-week-plan-title {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--warm-text);
    font-weight: var(--font-weight-bold);
  }

  .sofia-week-plan-item--suggestion .sofia-week-plan-title {
    color: var(--opgaver-action);
  }

  .sofia-week-plan-reason {
    grid-column: 1 / -1;
    padding-left: 49px;
    font-size: var(--font-size-xs);
    font-style: italic;
    line-height: 1.45;
    color: var(--opgaver-subtle);
  }

  .sofia-week-plan-more {
    padding-left: 49px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--opgaver-muted);
  }

  .sofia-quick-suggestion-sched-reason {
    margin: 4px 0 0;
    padding-left: 1px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-style: italic;
    line-height: 1.45;
    color: var(--opgaver-subtle);
  }

  .sofia-quick-result-move {
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid rgba(212, 168, 154, 0.35);
    background: transparent;
    color: var(--opgaver-action);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.15s ease, border-color 0.2s ease;
  }

  .sofia-quick-result-move:hover {
    background: rgba(212, 168, 154, 0.08);
    border-color: rgba(155, 96, 80, 0.35);
  }

  .sofia-quick-result-move:active {
    transform: scale(0.92);
    transition-duration: 0.08s;
  }

  .sofia-quick-result-move:focus-visible,
  .sofia-bulk-apply:focus-visible,
  .sofia-move-date:focus-visible,
  .sofia-move-time:focus-visible {
    outline: none;
    outline-offset: 2px;
  }

  .sofia-quick-move-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(228, 220, 212, 0.50);
    background: rgba(255, 252, 247, 0.92);
  }

  .sofia-quick-move-picker[hidden] {
    display: none !important;
  }

  .sofia-move-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--opgaver-muted);
  }

  .sofia-move-date,
  .sofia-move-time {
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(228, 220, 212, 0.60);
    background: var(--white);
    color: var(--warm-text);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
  }

  .sofia-move-date:focus-visible,
  .sofia-move-time:focus-visible {
    border-color: rgba(155, 96, 80, 0.40);
    box-shadow: none;
  }

  .sofia-move-confirm {
    min-height: 44px;
    padding: 6px 12px;
    font-size: var(--font-size-xs); /* token exception: tight layout */
  }

  .sofia-bulk-actions {
    margin: 10px 0 4px;
    text-align: center;
  }

  .sofia-bulk-apply {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--opgaver-action);
    color: var(--white);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(155, 96, 80, 0.18);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
  }

  .sofia-bulk-apply:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 18px rgba(155, 96, 80, 0.24);
  }

  .sofia-bulk-apply:active {
    transform: scale(0.97);
    transition-duration: 0.08s;
  }

  .sofia-bulk-apply:disabled,
  .sofia-quick-result-move:disabled {
    cursor: default;
    opacity: 0.72;
    transform: none;
  }

  /* "Anvend alle (N)" — full-width green sticky footer flush to the modal
     bottom; bleeds to the panel edges like the CPW nav footer (#2934). */
  .sofia-bulk-actions--primary {
    position: sticky;
    bottom: -24px;
    z-index: 2;
    margin: 8px -28px -24px;
    padding: 13px 28px 24px;
    background: #ffffff;
    border-top: 1px solid rgba(92, 77, 67, 0.18);
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
  }
  [data-theme="dark"] .sofia-bulk-actions--primary {
    background: rgba(36, 31, 27, 0.98);
    border-top-color: rgba(232, 224, 216, 0.12);
  }
  .sofia-bulk-apply--primary {
    width: 100%;
    min-height: 44px;
    padding: 11px 20px;
    border-radius: 12px;
    background: #4A7A68;
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    box-shadow: none;
  }
  .sofia-bulk-apply--primary:hover {
    background: #3F6B5B;
    transform: none;
    box-shadow: none;
  }
  /* Visible focus ring on the green bulk CTA (overrides the shared
     .sofia-bulk-apply:focus-visible outline:none) (#2934). */
  .sofia-bulk-apply--primary:focus-visible {
    outline: 2px solid #4A7A68;
    outline-offset: 2px;
  }

  .sofia-bulk-apply.sofia-suggest-bulk {
    background: transparent;
    color: #4A7A68;
    border: 1px solid rgba(110, 138, 126, 0.34);
    border-radius: 14px;
    box-shadow: none;
  }

  .sofia-bulk-apply.sofia-suggest-bulk:hover {
    background: rgba(110, 138, 126, 0.08);
    color: #3D6B57;
    border-color: rgba(110, 138, 126, 0.5);
    box-shadow: none;
  }

  .sofia-quick-result-list--compact {
    gap: 2px;
    margin-top: 0;
  }
  .sofia-compact-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-card);
    border: 1px solid rgba(228, 220, 212, 0.4);
    background: rgba(255, 254, 251, 0.6);
    transition: border-color 0.15s ease;
  }
  .sofia-compact-suggestion:hover {
    border-color: rgba(212, 168, 154, 0.5);
  }
  .sofia-compact-suggestion.is-applied {
    border-color: rgba(168, 197, 184, 0.7);
    background: rgba(168, 197, 184, 0.10);
  }
  .sofia-compact-time {
    flex-shrink: 0;
    min-width: 70px;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--opgaver-action);
    white-space: nowrap;
  }
  .sofia-compact-title {
    flex: 1;
    min-width: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--warm-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sofia-compact-reason {
    flex: 0 1 220px;
    min-width: 0;
    max-width: 220px;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: 1.35;
    color: var(--opgaver-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sofia-compact-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .sofia-compact-accept {
    padding: 5px 10px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--opgaver-action);
    color: var(--white);
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.1s ease;
  }
  .sofia-compact-accept:hover {
    transform: scale(1.05);
  }
  .sofia-compact-dismiss {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--opgaver-subtle);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: background 0.12s ease;
  }
  .sofia-compact-dismiss:hover {
    background: rgba(212, 168, 154, 0.12);
  }

  [data-theme="dark"] .sofia-compact-suggestion {
    border-color: rgba(212, 168, 154, 0.12);
    background: rgba(255, 254, 251, 0.03);
  }
  [data-theme="dark"] .sofia-compact-suggestion:hover {
    border-color: rgba(212, 168, 154, 0.25);
  }
  [data-theme="dark"] .sofia-compact-suggestion.is-applied {
    border-color: rgba(168, 197, 184, 0.32);
    background: rgba(168, 197, 184, 0.12);
  }
  [data-theme="dark"] .sofia-compact-accept {
    background: var(--opgaver-action);
  }
  [data-theme="dark"] .sofia-compact-reason {
    color: var(--opgaver-muted) !important;
  }
  [data-theme="dark"] .sofia-compact-dismiss:hover {
    background: rgba(212, 168, 154, 0.08);
  }

  [data-theme="dark"] .sofia-week-summary {
    background: rgba(212, 168, 154, 0.04);
    border-color: rgba(212, 168, 154, 0.12);
  }

  [data-theme="dark"] .sofia-week-summary-warning,
  [data-theme="dark"] .sofia-cap--busy {
    color: #D4A060;
  }

  [data-theme="dark"] .sofia-week-plan-day--today {
    border-color: rgba(212, 168, 154, 0.25);
    background: rgba(212, 168, 154, 0.04);
  }

  [data-theme="dark"] .sofia-week-plan-cap {
    background: rgba(168, 197, 184, 0.12);
    color: #8FBFAD;
  }

  [data-theme="dark"] .sofia-cap--full {
    background: rgba(184, 84, 80, 0.10);
    color: #D47B78;
  }

  [data-theme="dark"] .sofia-cap--open {
    background: transparent;
    color: var(--opgaver-muted);
  }

  [data-theme="dark"] .sofia-week-plan-item--suggestion {
    border-left-color: rgba(212, 168, 154, 0.30);
  }

  [data-theme="dark"] .sofia-week-plan-item--suggestion .sofia-week-plan-title {
    color: #D4A89A;
  }

  [data-theme="dark"] .sofia-week-plan-title,
  [data-theme="dark"] .sofia-week-summary-stats {
    color: var(--warm-text);
  }

  [data-theme="dark"] .sofia-quick-result-move {
    border-color: rgba(212, 168, 154, 0.22);
    color: #D4A89A;
  }

  [data-theme="dark"] .sofia-quick-result-move:hover {
    background: rgba(212, 168, 154, 0.06);
  }

  [data-theme="dark"] .sofia-quick-move-picker {
    background: rgba(42, 38, 34, 0.85);
    border-color: rgba(232, 224, 216, 0.08);
  }

  [data-theme="dark"] .sofia-move-date,
  [data-theme="dark"] .sofia-move-time {
    background: rgba(42, 38, 34, 0.60);
    border-color: rgba(232, 224, 216, 0.12);
    color: #E8DDD4;
  }

  [data-theme="dark"] .sofia-bulk-apply {
    background: var(--opgaver-action) !important;
  }

  [data-theme="dark"] .sofia-bulk-apply.sofia-suggest-bulk {
    background: transparent !important;
    color: #A8C5B8;
    border-color: rgba(168, 197, 184, 0.34);
    box-shadow: none;
  }

  [data-theme="dark"] .sofia-bulk-apply.sofia-suggest-bulk:hover {
    background: rgba(168, 197, 184, 0.12) !important;
    color: #C4DBD0;
    border-color: rgba(168, 197, 184, 0.5);
    box-shadow: none;
  }

  /* --- Issue #505: tappable cards, day sections, expand link --- */

  .sofia-quick-suggestion--tappable {
    cursor: pointer;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out, border-color 0.15s ease;
  }
  .sofia-quick-suggestion--tappable:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(92, 77, 67, 0.10);
    border-color: rgba(212, 168, 154, 0.45);
  }
  .sofia-quick-suggestion--tappable:active {
    transform: scale(0.98);
    transition-duration: 0.06s;
  }
  .sofia-quick-suggestion--tappable[aria-busy="true"] {
    opacity: 0.65;
    pointer-events: none;
  }
  .sofia-quick-suggestion--tappable.is-applied {
    pointer-events: none;
  }

  .sofia-quick-suggestion-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
  }
  .sofia-quick-skip-link {
    all: unset;
    font-family: var(--font-family);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--opgaver-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-pill);
    transition: color 0.15s ease, background 0.15s ease;
  }
  .sofia-quick-skip-link:hover {
    color: var(--warm-text);
    background: rgba(212, 168, 154, 0.08);
  }

  .sofia-day-section {
    margin-top: 8px;
  }
  .sofia-day-header {
    all: unset;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(250, 247, 243, 0.6);
    cursor: pointer;
    font-family: var(--font-family);
    transition: background 0.15s ease;
  }
  .sofia-day-header:hover {
    background: rgba(212, 168, 154, 0.08);
  }
  .sofia-day-header-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-bold);
    color: var(--warm-text);
  }
  .sofia-day-header-count {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--opgaver-muted);
  }
  .sofia-day-header-chevron {
    margin-left: auto;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease-out;
  }
  .sofia-day-header-chevron::before {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    margin: 3px auto;
    border-right: 2px solid var(--opgaver-muted);
    border-bottom: 2px solid var(--opgaver-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease-out;
  }
  .sofia-day-section--collapsed .sofia-day-header-chevron::before {
    transform: rotate(-45deg);
  }

  .sofia-day-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
  }
  .sofia-day-list--hidden {
    display: none;
  }
  .sofia-day-item--overflow {
    display: none;
  }

  .sofia-expand-link {
    all: unset;
    display: block;
    width: 100%;
    text-align: center;
    padding: 10px 0;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    color: var(--opgaver-action);
    cursor: pointer;
    transition: color 0.15s ease;
  }
  .sofia-expand-link:hover {
    color: var(--warm-text);
  }

  [data-theme="dark"] .sofia-quick-suggestion--tappable:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25) !important;
    border-color: rgba(212, 168, 154, 0.30) !important;
  }
  [data-theme="dark"] .sofia-quick-skip-link {
    color: var(--opgaver-muted) !important;
  }
  [data-theme="dark"] .sofia-quick-skip-link:hover {
    color: var(--warm-text) !important;
    background: rgba(212, 168, 154, 0.06) !important;
  }
  [data-theme="dark"] .sofia-day-header {
    background: rgba(36, 31, 27, 0.5) !important;
  }
  [data-theme="dark"] .sofia-day-header:hover {
    background: rgba(212, 168, 154, 0.06) !important;
  }
  [data-theme="dark"] .sofia-day-header-label {
    color: var(--warm-text) !important;
  }
  [data-theme="dark"] .sofia-day-header-count {
    color: var(--opgaver-muted) !important;
  }
  [data-theme="dark"] .sofia-day-header-chevron::before {
    border-color: var(--opgaver-muted) !important;
  }
  [data-theme="dark"] .sofia-expand-link {
    color: var(--opgaver-action) !important;
  }
  [data-theme="dark"] .sofia-expand-link:hover {
    color: var(--warm-text) !important;
  }

  /* Opgaver-local language picker bridge for bb-left-sidebar */
  #bb-sidebar .s-lang-list,
  .opgaver-lang-flyout.s-lang-list {
    display: none;
    grid-template-columns: 1fr;
    gap: 2px;
    margin: 2px 0 6px;
    padding: 6px;
    border: 1px solid rgba(228, 220, 212, 0.60);
    border-radius: 12px;
    background: rgba(255, 254, 251, 0.96);
    box-shadow: 0 8px 24px rgba(92, 77, 67, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .opgaver-lang-flyout.s-lang-list {
    position: fixed;
    z-index: 10720;
    min-width: 176px;
    max-width: min(220px, calc(100vw - 24px));
    margin: 0;
  }

  #bb-sidebar .s-lang-list.open,
  .opgaver-lang-flyout.s-lang-list.open {
    display: grid;
  }

  #bb-sidebar .s-lang-option,
  .opgaver-lang-flyout .s-lang-option {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--warm-text);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
  }

  #bb-sidebar .s-lang-option:hover,
  .opgaver-lang-flyout .s-lang-option:hover {
    background: rgba(212, 168, 154, 0.10);
  }

  #bb-sidebar .s-lang-option:active,
  .opgaver-lang-flyout .s-lang-option:active {
    transform: scale(0.98);
  }

  #bb-sidebar .s-lang-option:focus-visible,
  .opgaver-lang-flyout .s-lang-option:focus-visible {
    outline: none;
    outline-offset: 2px;
  }

  #bb-sidebar .s-lang-option.active,
  #bb-sidebar .s-lang-option[aria-checked="true"],
  .opgaver-lang-flyout .s-lang-option.active,
  .opgaver-lang-flyout .s-lang-option[aria-checked="true"] {
    color: var(--opgaver-action);
    font-weight: var(--font-weight-bold);
  }

  [data-theme="dark"] #bb-sidebar .s-lang-list,
  [data-theme="dark"] .opgaver-lang-flyout.s-lang-list {
    background: rgba(42, 38, 34, 0.96);
    border-color: rgba(232, 224, 216, 0.12);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  [data-theme="dark"] #bb-sidebar .s-lang-option,
  [data-theme="dark"] .opgaver-lang-flyout .s-lang-option {
    color: #E8DDD4;
  }

  [data-theme="dark"] #bb-sidebar .s-lang-option:hover,
  [data-theme="dark"] .opgaver-lang-flyout .s-lang-option:hover {
    background: rgba(212, 168, 154, 0.08);
  }

  [data-theme="dark"] #bb-sidebar .s-lang-option.active,
  [data-theme="dark"] #bb-sidebar .s-lang-option[aria-checked="true"],
  [data-theme="dark"] .opgaver-lang-flyout .s-lang-option.active,
  [data-theme="dark"] .opgaver-lang-flyout .s-lang-option[aria-checked="true"] {
    color: #D4A89A;
  }

  @media (max-width: 600px) {
    .sofia-compact-suggestion {
      flex-wrap: wrap;
      gap: 4px 8px;
    }
    .sofia-compact-reason {
      display: block;
      flex: 1 1 100%;
      max-width: 100%;
    }
    .sofia-compact-time {
      min-width: auto;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .sofia-compact-accept,
    .sofia-compact-suggestion,
    .sofia-bulk-apply,
    .sofia-quick-result-move,
    #bb-sidebar .s-lang-option,
    .opgaver-lang-flyout .s-lang-option {
      transition: none;
    }

    .sofia-bulk-apply:hover {
      transform: none;
    }

    .main {
      transition: none !important;
    }
    .sofia-fold-toggle,
    .sofia-fold-icon {
      transition: none !important;
    }
  }

  @media (max-width: 1024px) {
    .main {
      padding-right: 0;
    }
    .sofia-right-sidebar {
      display: none;
    }
  }

  @media (max-width: 640px) {
    .main {
      height: calc(100vh - 56px);
      height: calc(100dvh - 56px); /* iOS Safari dynamic viewport */
      flex: 0 0 calc(100dvh - 56px);
      max-height: calc(100dvh - 56px);
      padding-right: 0 !important;
      padding-bottom: 0;
    }
    .task-item[draggable="true"],
    .task-item.is-dragging {
      padding-left: 14px;
    }
    .task-item[draggable="true"]::before,
    .task-item.is-dragging::before {
      content: none;
    }
  }

  @media (max-width: 767px) {
    /* Mobile stat calendar: fit all 7 days inside the card */
    .stat-calendar {
      width: 100%;
      min-width: 0;
      max-width: 100%;
      box-sizing: border-box;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .stat-calendar::-webkit-scrollbar {
      display: none;
    }
    .stat-calendar-days {
      grid-template-columns: repeat(7, minmax(0, 1fr));
      gap: 4px;
      min-width: 0;
    }
    .stat-cal-day {
      min-width: 0;
      width: 100%;
      min-height: 56px;
      padding: 6px 2px 5px;
      border-radius: 10px;
      box-sizing: border-box;
    }
    .stat-cal-name {
      font-size: var(--font-size-xs);
    }
    .stat-cal-num {
      font-size: var(--font-size-sm);
    }
    .cf-count {
      height: 16px;
      min-width: 16px;
      font-size: var(--font-size-xs);
      padding: 0 4px;
    }

    /* Mobile hero ring: show only today, hide week/done */
    .stat-arcs {
      flex: 0 0 auto;
      flex-direction: column;
      align-items: center;
      gap: 6px;
      padding: 4px 16px;
      height: auto;
      min-height: 0;
    }
    .stat-item--week,
    .stat-item--done {
      display: none;
    }
    .stat-item--today {
      flex: 0 0 auto;
      flex-direction: column;
      align-items: center;
      width: 100%;
      min-width: 0;
      min-height: 0;
      height: auto;
      padding: 0;
      gap: 6px;
    }
    .stat-item--today .stat-ring-wrap {
      width: 88px;
      height: 88px;
    }
    .stat-item--today .stat-ring-number {
      font-size: var(--font-size-4xl);
      font-weight: var(--font-weight-bold);
      color: var(--text-strong, #5c4d43);
    }
    .stat-item--today .stat-ring-fill,
    .stat-item--today .stat-ring-bg {
      stroke-width: 3.2;
    }
    .stat-item--today .stat-label-row {
      position: static;
      width: auto;
      height: auto;
      padding: 0;
      margin: 0;
      overflow: visible;
      clip: auto;
      white-space: normal;
      border: 0;
      font-size: var(--font-size-xs);
      font-weight: var(--font-weight-semibold);
      text-transform: uppercase;
      letter-spacing: 0.7px;
      color: var(--warm-text-light);
      opacity: 0.85;
      order: -1;
      text-align: center;
      line-height: 1.2;
    }
    .stat-item--today .stat-subtitle-row {
      width: 100%;
      justify-content: center;
      gap: 6px;
      margin-top: 0;
    }
    .stat-item--today .stat-subtitle-dot {
      width: 6px;
      height: 6px;
    }
    .stat-item--today .stat-subtitle {
      font-size: var(--font-size-sm);
      line-height: 1.2;
      margin-top: 0;
      color: var(--warm-text-light);
      font-weight: var(--font-weight-medium);
    }

    /* All-done checkmark state (today value is 0) */
    .stat-item--today .stat-ring-number[data-value="0"] {
      color: transparent;
      opacity: 1;
    }
    .stat-item--today .stat-ring-number[data-value="0"]::after {
      content: "";
      position: absolute;
      inset: 0;
      margin: auto;
      width: 36px;
      height: 36px;
      background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23719a85' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/contain no-repeat;
    }
    .stat-item--today:has(.stat-ring-number[data-value="0"]) .stat-ring-fill {
      stroke: #719a85;
    }
    .stat-item--today:has(.stat-ring-number[data-value="0"]) .stat-ring-bg {
      stroke: rgba(113, 154, 133, 0.20);
    }
    .stat-item--today:has(.stat-ring-number[data-value="0"]) .stat-subtitle {
      color: #4f7562;
      font-weight: var(--font-weight-semibold);
    }
    .stat-item--today:has(.stat-ring-number[data-value="0"]) .stat-subtitle-dot {
      background: #719a85;
    }
    .stat-item--today.stat-item--complete .stat-ring-fill {
      stroke: #719a85;
    }
    .stat-item--today.stat-item--complete .stat-ring-bg {
      stroke: rgba(113, 154, 133, 0.20);
    }
    .stat-item--today.stat-item--complete .stat-subtitle {
      color: #4f7562;
      font-weight: var(--font-weight-semibold);
    }
    .stat-item--today.stat-item--complete .stat-subtitle-dot {
      background: #719a85;
    }

    /* Dark mode all-done state */
    [data-theme="dark"] .stat-item--today .stat-ring-number[data-value="0"] {
      color: transparent !important;
    }
    [data-theme="dark"] .stat-item--today .stat-ring-number[data-value="0"]::after {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8c5b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
    }
    [data-theme="dark"] .stat-item--today:has(.stat-ring-number[data-value="0"]) .stat-ring-fill,
    [data-theme="dark"] .stat-item--today.stat-item--complete .stat-ring-fill {
      stroke: #a8c5b8 !important;
    }
    [data-theme="dark"] .stat-item--today:has(.stat-ring-number[data-value="0"]) .stat-ring-bg,
    [data-theme="dark"] .stat-item--today.stat-item--complete .stat-ring-bg {
      stroke: rgba(168, 197, 184, 0.15) !important;
    }
    [data-theme="dark"] .stat-item--today:has(.stat-ring-number[data-value="0"]) .stat-subtitle,
    [data-theme="dark"] .stat-item--today.stat-item--complete .stat-subtitle {
      color: #a8c5b8 !important;
    }
    [data-theme="dark"] .stat-item--today:has(.stat-ring-number[data-value="0"]) .stat-subtitle-dot,
    [data-theme="dark"] .stat-item--today.stat-item--complete .stat-subtitle-dot {
      background: #a8c5b8 !important;
    }

    /* Focus ring for today hero button */
    .stat-item--today:focus-visible::after {
      bottom: -4px;
    }

    /* Reduced-motion: disable all-done transitions */
    @media (prefers-reduced-motion: reduce) {
      .stat-item--today .stat-ring-number[data-value="0"]::after,
      .stat-item--today .stat-ring-fill,
      .stat-item--today .stat-ring-bg,
      .stat-item--today .stat-subtitle,
      .stat-item--today .stat-subtitle-dot {
        transition: none;
      }
    }

    .task-input-form {
      flex-direction: column;
      align-items: stretch;
      gap: 10px;
    }
    .task-input-card {
      flex: 1 1 auto;
      width: 100%;
      min-width: 0;
      overflow: visible;
      gap: 4px;
      padding: 10px 12px 10px 16px;
      height: 48px;
      min-height: 48px;
      box-sizing: border-box;
    }
    .task-input-field {
      min-width: 0;
      padding: 10px 0;
    }
    .task-input-icon {
      width: 28px;
      height: 28px;
      flex: 0 0 28px;
      margin: 0;
      border-radius: 9px;
    }
    .task-input-icon svg {
      width: 16px;
      height: 16px;
      pointer-events: none;
    }
    .task-add-btn {
      align-self: flex-end;
      flex: 0 0 auto;
      min-width: 76px;
      height: 44px;
      padding: 0 14px;
      white-space: nowrap;
    }
    .task-add-btn svg {
      flex: 0 0 16px;
      color: currentColor;
      stroke: currentColor;
      opacity: 1;
    }
  }

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

  [hidden] {
    display: none !important;
  }

/* WU-3: body scroll lock when Sofia modal is open */
body.modal-open { overflow: hidden; }

/* WU-3: subtask chevron indicator */
.task-subtask-chevron {
  display: inline-block;
  width: 10px;
  height: 10px;
  transition: transform 0.2s ease;
  color: var(--opgaver-subtle);
  flex-shrink: 0;
}
.task-subtask-toggle[aria-expanded="true"] .task-subtask-chevron {
  transform: rotate(90deg);
}

/* WU-3: custom inline validation error (warm, readable) */
.task-edit-inline-error {
  display: none;
  color: #B85450;
  background: rgba(184, 84, 80, 0.07);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  padding: 6px 10px;
  border-radius: 8px;
  margin-top: 4px;
}
.task-edit-inline-error.visible { display: block; }
[data-theme="dark"] .task-edit-inline-error {
  color: #E8A098 !important;
  background: rgba(184, 84, 80, 0.14) !important;
}

/* WU-3: dark mode restore button */
[data-theme="dark"] .task-restore-btn {
  color: var(--opgaver-sage-text) !important;
}
[data-theme="dark"] .task-restore-btn:hover {
  background: rgba(168, 197, 184, 0.14) !important;
}

/* ── Quantity chip (issue #669) ── */
.parse-chip--quantity {
  background: #D4A89A;
  color: #5C4D43;
  font-weight: var(--font-weight-bold);
}
[data-theme="dark"] .parse-chip--quantity {
  background: #D4A89A;
  color: #2a2220;
}
.parse-chip-note {
  display: block;
  width: 100%;
  font-size: var(--font-size-xs);
  color: var(--text-muted, #8b7355);
  margin-top: 4px;
  line-height: 1.3;
}
[data-theme="dark"] .parse-chip-note {
  color: var(--text-muted, #b8a88a);
}

/* ── Undo toast (issue #669) ── */
.task-undo-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  background: #5C4D43;
  color: #FAF7F3;
  padding: 12px 20px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 12px rgba(92,77,67,0.15);
  transition: transform 0.3s ease;
  z-index: 9999;
  font-size: var(--font-size-sm);
}
.task-undo-toast--visible {
  transform: translateX(-50%) translateY(0);
}
.task-undo-toast__btn {
  background: #D4A89A;
  color: #5C4D43;
  border: none;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  white-space: nowrap;
}
[data-theme="dark"] .task-undo-toast {
  background: #3a2f2a;
  color: #FAF7F3;
}
[data-theme="dark"] .task-undo-toast__btn {
  background: #D4A89A;
  color: #2a2220;
}

/* ── Quantity confirmation modal (issue #669) ── */
.quantity-confirm {
  position: fixed;
  inset: 0;
  background: rgba(92,77,67,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}
.quantity-confirm[hidden] { display: none; }
.quantity-confirm__panel {
  background: #FAF7F3;
  border-radius: 16px;
  padding: 24px 28px;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(92,77,67,0.18);
}
.quantity-confirm__msg {
  margin: 0 0 16px;
  font-size: var(--font-size-base);
  color: #5C4D43;
}
.quantity-confirm__actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.quantity-confirm__yes,
.quantity-confirm__no {
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  font-size: var(--font-size-sm);
}
.quantity-confirm__yes {
  background: #D4A89A;
  color: #5C4D43;
}
.quantity-confirm__no {
  background: #e8ddd4;
  color: #5C4D43;
}
[data-theme="dark"] .quantity-confirm__panel {
  background: #3a2f2a;
}
[data-theme="dark"] .quantity-confirm__msg {
  color: #FAF7F3;
}
[data-theme="dark"] .quantity-confirm__yes {
  background: #D4A89A;
  color: #2a2220;
}
[data-theme="dark"] .quantity-confirm__no {
  background: #4a3f3a;
  color: #FAF7F3;
}

@media (max-width: 767px) {
  .task-edit-modal,
  .sofia-modal-backdrop,
  .ai-command-review-backdrop,
  .quantity-confirm { z-index: 9500 !important; }
  body.task-modal-open #bb-mobile-nav {
    opacity: 0.45;
    pointer-events: none;
    filter: saturate(0.4);
    transition: opacity 180ms ease, filter 180ms ease;
  }
}

/* ── Calm 24-hour time picker ── */
.calm-time-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
  gap: 0;
}
.calm-time-wrap .calm-time-input {
  flex: 1 1 100%;
  width: 100%;
  height: 44px;
  box-sizing: border-box;
  padding: 10px 76px 10px 14px;
  text-align: left;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  color: #3A2F26;
  background: #FFFEFB;
  border: 1px solid #E4DCD4;
  border-radius: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.calm-time-wrap .calm-time-input:hover {
  border-color: #CFC4B8;
}
.calm-time-wrap .calm-time-input:focus,
.calm-time-wrap .calm-time-input:focus-visible {
  outline: none;
  border-color: #6E8A7E;
  box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.18);
}
.calm-time-wrap .calm-time-input::placeholder {
  color: #9A8E82;
  font-weight: var(--font-weight-medium);
  opacity: 1;
}
.calm-time-clear,
.calm-time-toggle {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9A8E82;
  cursor: pointer;
  padding: 0;
  transform: translateY(-50%);
  transition: background 140ms ease, color 140ms ease;
}
.calm-time-toggle {
  right: 8px;
}
.calm-time-clear {
  right: 40px;
  font-size: 0;
  line-height: 0;
}
.calm-time-clear::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  transform: rotate(45deg);
}
.calm-time-wrap .calm-time-input:placeholder-shown ~ .calm-time-clear {
  opacity: 0;
  pointer-events: none;
}
.calm-time-clear:hover,
.calm-time-toggle:hover {
  background: rgba(110, 138, 126, 0.10);
  color: #4A7A68;
}
.calm-time-clear:focus-visible,
.calm-time-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.18);
}
.calm-time-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
}
.calm-time-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px;
  width: auto;
  min-width: 0;
  max-height: none;
  box-sizing: border-box;
  overflow: visible;
  padding: 8px;
  background: #FFFEFB;
  border: 1px solid rgba(228, 220, 212, 0.9);
  border-radius: 14px;
  box-shadow: 0 12px 32px -16px rgba(58, 47, 38, 0.22), 0 2px 6px -2px rgba(58, 47, 38, 0.08);
}
.task-snooze-menu .calm-time-popover {
  left: auto;
  right: 0;
  width: min(280px, calc(100vw - 48px));
  min-width: min(280px, calc(100vw - 48px));
}
.calm-time-popover[hidden] {
  display: none;
}
.calm-time-popover > [data-calm-time-option] {
  display: none;
}
.calm-time-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  max-width: 100%;
  width: auto;
  min-height: 52px;
  box-sizing: border-box;
  overflow: hidden;
  padding: 10px 10px;
  text-align: left;
  font-family: var(--font-family);
  background: #FBF8F2;
  border: 1px solid #E4DCD4;
  border-radius: 12px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.calm-time-chip:hover {
  background: rgba(110, 138, 126, 0.10);
  border-color: #CFC4B8;
}
.calm-time-chip:focus-visible {
  outline: none;
  border-color: #6E8A7E;
  box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.18);
}
.calm-time-chip[aria-selected="true"] {
  background: rgba(110, 138, 126, 0.16);
  border-color: #6E8A7E;
}
.calm-chip-label {
  max-width: 100%;
  overflow: hidden;
  color: #3A2F26;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calm-time-chip[aria-selected="true"] .calm-chip-label {
  color: #4A7A68;
}
.calm-chip-time {
  color: #9A8E82;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1.2;
}
.calm-time-footnote {
  grid-column: 1 / -1;
  padding: 6px 4px 2px;
  color: #9A8E82;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
  letter-spacing: 0;
  text-align: center;
}
[data-theme="dark"] .calm-time-input {
  background: rgba(27, 24, 21, 0.92);
  border-color: rgba(232, 224, 216, 0.14) !important;
  color: #E8DDD4;
}
[data-theme="dark"] .calm-time-input::placeholder {
  color: rgba(232, 221, 212, 0.62);
}
[data-theme="dark"] .calm-time-clear,
[data-theme="dark"] .calm-time-toggle {
  color: rgba(232, 221, 212, 0.62);
}
[data-theme="dark"] .calm-time-clear:hover,
[data-theme="dark"] .calm-time-toggle:hover {
  background: rgba(110, 138, 126, 0.18);
  color: #9DB8AC;
}
[data-theme="dark"] .calm-time-popover {
  background: #211D19;
  border-color: rgba(232, 224, 216, 0.14);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.58), 0 2px 6px -2px rgba(0, 0, 0, 0.42);
}
[data-theme="dark"] .calm-time-chip {
  background: rgba(255, 252, 247, 0.05);
  border-color: rgba(232, 224, 216, 0.14);
}
[data-theme="dark"] .calm-time-chip:hover {
  background: rgba(110, 138, 126, 0.18);
  border-color: rgba(157, 184, 172, 0.46);
}
[data-theme="dark"] .calm-time-chip[aria-selected="true"] {
  background: rgba(110, 138, 126, 0.22);
  border-color: #9DB8AC;
}
[data-theme="dark"] .calm-chip-label {
  color: #E8DDD4;
}
[data-theme="dark"] .calm-time-chip[aria-selected="true"] .calm-chip-label {
  color: #B8D0C5;
}
[data-theme="dark"] .calm-chip-time,
[data-theme="dark"] .calm-time-footnote {
  color: rgba(232, 221, 212, 0.62);
}

@media (prefers-reduced-motion: reduce) {
  .calm-time-input,
  .calm-time-clear,
  .calm-time-toggle,
  .calm-time-chip {
    transition: none;
  }
}

@media (max-width: 767px) {
  .calm-time-wrap .calm-time-input {
    font-size: max(16px, var(--font-size-sm));
  }
}

/* ── Compact calm-time inside snooze (#3373 / #3409) ── */
.task-snooze-custom .calm-time-input {
  height: 40px;
  padding: 8px 56px 8px 10px;
}
.task-snooze-custom .calm-time-toggle {
  right: 4px;
}
.task-snooze-custom .calm-time-clear {
  right: 32px;
  opacity: 0;
  transition: opacity 120ms ease;
  pointer-events: none;
}
.task-snooze-custom .calm-time-wrap:hover .calm-time-clear,
.task-snooze-custom .calm-time-wrap:focus-within .calm-time-clear {
  opacity: 0.55;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .task-snooze-custom .calm-time-clear { transition: none; }
}

/* ── Calm date picker ── */
.calm-dp-wrap {
  position: relative;
  display: block;
  width: 218px;
  max-width: 100%;
  justify-self: start;
}
.calm-dp-wrap #task-edit-date {
  width: 100%;
  box-sizing: border-box;
  padding-right: 38px;
}
.calm-dp-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #9A8E82;
  cursor: pointer;
  padding: 0;
  transform: translateY(-50%);
  transition: background 140ms ease, color 140ms ease;
}
.calm-dp-toggle:hover {
  background: rgba(110, 138, 126, 0.10);
  color: #4A7A68;
}
.calm-dp-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.18);
}
.calm-dp-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
}
.calm-dp-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10000;
  width: 304px;
  max-width: 92vw;
  box-sizing: border-box;
  padding: 12px;
  background: #FFFEFB;
  border: 1px solid rgba(228, 220, 212, 0.9);
  border-radius: 14px;
  box-shadow: 0 12px 32px -16px rgba(58, 47, 38, 0.22), 0 2px 6px -2px rgba(58, 47, 38, 0.08);
}
.calm-dp-popup[hidden] {
  display: none;
}
.calm-dp-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
}
.calm-dp-preset {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 8px;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: #3A2F26;
  background: #FBF8F2;
  border: 1px solid #E4DCD4;
  border-radius: 10px;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.calm-dp-preset:hover {
  background: rgba(110, 138, 126, 0.10);
  border-color: #CFC4B8;
}
.calm-dp-preset:focus-visible {
  outline: none;
  border-color: #6E8A7E;
  box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.18);
}
.calm-dp-preset[aria-pressed="true"] {
  background: rgba(110, 138, 126, 0.16);
  border-color: #6E8A7E;
  color: #4A7A68;
}
.calm-dp-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.calm-dp-title {
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: #3A2F26;
  text-transform: capitalize;
}
.calm-dp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9A8E82;
  cursor: pointer;
  padding: 0;
  transition: background 140ms ease, color 140ms ease;
}
.calm-dp-nav-btn:hover {
  background: rgba(110, 138, 126, 0.10);
  color: #4A7A68;
}
.calm-dp-nav-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.18);
}
.calm-dp-nav-btn svg {
  display: block;
  width: 14px;
  height: 14px;
}
.calm-dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  margin-bottom: 2px;
}
.calm-dp-weekdays span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: #9A8E82;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.calm-dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.calm-dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
  color: #3A2F26;
  cursor: pointer;
  padding: 0;
  transition: background 140ms ease, color 140ms ease;
}
.calm-dp-day:hover {
  background: rgba(110, 138, 126, 0.10);
}
.calm-dp-day:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.18);
}
.calm-dp-day--out {
  color: #C4B9AE;
}
.calm-dp-day--today {
  font-weight: var(--font-weight-bold);
  color: #4A7A68;
}
.calm-dp-day--selected,
.calm-dp-day[aria-pressed="true"] {
  background: rgba(110, 138, 126, 0.18);
  color: #3A6B58;
  font-weight: var(--font-weight-bold);
}
.calm-dp-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(228, 220, 212, 0.6);
}
.calm-dp-clear,
.calm-dp-close {
  padding: 6px 14px;
  font-family: var(--font-family);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  color: #9A8E82;
  background: transparent;
  border: 1px solid #E4DCD4;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.calm-dp-clear:hover,
.calm-dp-close:hover {
  background: rgba(110, 138, 126, 0.10);
  border-color: #CFC4B8;
  color: #4A7A68;
}
.calm-dp-clear:focus-visible,
.calm-dp-close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.18);
}
[data-theme="dark"] .calm-dp-toggle {
  color: rgba(232, 221, 212, 0.62);
}
[data-theme="dark"] .calm-dp-toggle:hover {
  background: rgba(110, 138, 126, 0.18);
  color: #9DB8AC;
}
[data-theme="dark"] .calm-dp-popup {
  background: #211D19;
  border-color: rgba(232, 224, 216, 0.14);
  box-shadow: 0 12px 32px -16px rgba(0, 0, 0, 0.58), 0 2px 6px -2px rgba(0, 0, 0, 0.42);
}
[data-theme="dark"] .calm-dp-preset {
  background: rgba(255, 252, 247, 0.05);
  border-color: rgba(232, 224, 216, 0.14);
  color: #E8DDD4;
}
[data-theme="dark"] .calm-dp-preset:hover {
  background: rgba(110, 138, 126, 0.18);
  border-color: rgba(157, 184, 172, 0.46);
}
[data-theme="dark"] .calm-dp-preset[aria-pressed="true"] {
  background: rgba(110, 138, 126, 0.22);
  border-color: #9DB8AC;
  color: #B8D0C5;
}
[data-theme="dark"] .calm-dp-title {
  color: #E8DDD4;
}
[data-theme="dark"] .calm-dp-nav-btn {
  color: rgba(232, 221, 212, 0.62);
}
[data-theme="dark"] .calm-dp-nav-btn:hover {
  background: rgba(110, 138, 126, 0.18);
  color: #9DB8AC;
}
[data-theme="dark"] .calm-dp-weekdays span {
  color: rgba(232, 221, 212, 0.46);
}
[data-theme="dark"] .calm-dp-day {
  color: #E8DDD4;
}
[data-theme="dark"] .calm-dp-day:hover {
  background: rgba(110, 138, 126, 0.14);
}
[data-theme="dark"] .calm-dp-day--out {
  color: rgba(232, 221, 212, 0.28);
}
[data-theme="dark"] .calm-dp-day--today {
  color: #9DB8AC;
}
[data-theme="dark"] .calm-dp-day--selected,
[data-theme="dark"] .calm-dp-day[aria-pressed="true"] {
  background: rgba(110, 138, 126, 0.22);
  color: #B8D0C5;
}
[data-theme="dark"] .calm-dp-footer {
  border-top-color: rgba(232, 224, 216, 0.10);
}
[data-theme="dark"] .calm-dp-clear,
[data-theme="dark"] .calm-dp-close {
  color: rgba(232, 221, 212, 0.62);
  border-color: rgba(232, 224, 216, 0.14);
}
[data-theme="dark"] .calm-dp-clear:hover,
[data-theme="dark"] .calm-dp-close:hover {
  background: rgba(110, 138, 126, 0.18);
  border-color: rgba(157, 184, 172, 0.46);
  color: #9DB8AC;
}
@media (prefers-reduced-motion: reduce) {
  .calm-dp-toggle,
  .calm-dp-preset,
  .calm-dp-nav-btn,
  .calm-dp-day,
  .calm-dp-clear,
  .calm-dp-close {
    transition: none;
  }
}

/* Repeat badge on task items */
.task-repeat-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: var(--font-size-xs);
  color: var(--opgaver-sage-text);
  white-space: nowrap;
}
.task-repeat-badge svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Edit modal repeat row */
.task-edit-row--repeat {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
}
.task-edit-row--repeat > label {
  flex: 1 1 auto;
  min-width: 120px;
}
.task-edit-repeat-info {
  font-size: var(--font-size-xs);
  color: var(--opgaver-muted);
  padding: 4px 0;
}
.task-stop-repeat-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: var(--font-size-xs);
  border: 1px solid rgba(212, 168, 154, 0.35);
  border-radius: 6px;
  background: transparent;
  color: var(--opgaver-rose-text);
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
  white-space: nowrap;
}
.task-stop-repeat-btn:hover {
  background: rgba(212, 168, 154, 0.10);
  border-color: rgba(212, 168, 154, 0.50);
}
.task-stop-repeat-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
[data-theme="dark"] .task-stop-repeat-btn {
  border-color: rgba(212, 168, 154, 0.20);
  color: var(--opgaver-rose-text);
}
[data-theme="dark"] .task-stop-repeat-btn:hover {
  background: rgba(212, 168, 154, 0.08);
}

/* Recurrence parse chip */
.parse-chip--recurrence {
  border-color: rgba(168, 197, 184, 0.35);
  color: var(--opgaver-sage-text);
}

@media (max-width: 600px) {
  .task-edit-row--repeat {
    flex-direction: column;
    align-items: stretch;
  }
  .task-stop-repeat-btn {
    align-self: flex-start;
  }
}

/* ══════════════════════════════════════════════════════════ */
/* AI Command Review Modal                                   */
/* ══════════════════════════════════════════════════════════ */

.ai-command-review-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 16, 14, 0.46);
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.ai-command-review-backdrop[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}
.ai-command-review-panel {
  position: relative;
  width: 92vw;
  max-width: 580px;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(255, 254, 251, 0.97);
  border-radius: 20px;
  border: 1px solid rgba(228, 220, 212, 0.56);
  box-shadow: 0 24px 64px rgba(92, 77, 67, 0.14), 0 4px 16px rgba(92, 77, 67, 0.06);
  padding: 28px 24px 24px;
  transform: translateY(8px) scale(0.98);
  transition: transform 0.2s ease;
}
.ai-command-review-backdrop[aria-hidden="false"] .ai-command-review-panel {
  transform: translateY(0) scale(1);
}
.ai-command-review-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--opgaver-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ai-command-review-close:hover {
  background: rgba(212, 168, 154, 0.12);
  color: var(--warm-text);
}
.ai-command-review-close:focus-visible {
  outline: 2px solid var(--opgaver-action);
  outline-offset: 2px;
}
.ai-command-review-close svg {
  width: 18px;
  height: 18px;
}
.ai-command-review-heading {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--warm-text);
  margin: 0 0 8px;
  padding-right: 36px;
}
.ai-command-review-summary {
  font-size: var(--font-size-sm);
  color: var(--opgaver-muted);
  margin: 0 0 16px;
  line-height: 1.5;
}
.ai-command-review-warning {
  font-size: var(--font-size-sm);
  color: var(--opgaver-rose-text);
  background: rgba(212, 168, 154, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 0 12px;
}
.ai-command-review-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
}
.ai-command-review-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(74, 122, 104, 0.2);
  border-top-color: var(--opgaver-action);
  border-radius: 50%;
  animation: ai-review-spin 0.8s linear infinite;
}
@keyframes ai-review-spin {
  to { transform: rotate(360deg); }
}
.ai-command-review-loading-text {
  font-size: var(--font-size-sm);
  color: var(--opgaver-muted);
  margin: 0;
}
.ai-command-review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  max-height: 50vh;
  overflow-y: auto;
}
.ai-command-draft-card {
  position: relative;
  background: var(--cream, #FFFEFB);
  border: 1px solid rgba(228, 220, 212, 0.56);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ai-command-draft-card:hover {
  border-color: rgba(74, 122, 104, 0.3);
  box-shadow: 0 2px 8px rgba(92, 77, 67, 0.06);
}
.ai-command-draft-card.low-confidence {
  border-color: rgba(212, 168, 154, 0.5);
}
.ai-command-draft-badge {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: var(--opgaver-rose-text);
  background: rgba(212, 168, 154, 0.12);
  border-radius: 6px;
  padding: 2px 8px;
  margin-bottom: 8px;
}
.ai-command-draft-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-command-draft-title {
  flex: 1;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--warm-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 6px 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
  font-family: inherit;
}
.ai-command-draft-title:hover {
  background: rgba(228, 220, 212, 0.2);
}
.ai-command-draft-title:focus {
  outline: none;
  border-color: var(--opgaver-action);
  background: #fff;
}
.ai-command-draft-remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--opgaver-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ai-command-draft-remove:hover {
  background: rgba(212, 168, 154, 0.15);
  color: var(--opgaver-rose-text);
}
.ai-command-draft-remove:focus-visible {
  outline: 2px solid var(--opgaver-action);
  outline-offset: 2px;
}
.ai-command-draft-remove svg {
  width: 14px;
  height: 14px;
}
.ai-command-draft-desc {
  font-size: var(--font-size-sm);
  color: var(--opgaver-muted);
  margin: 6px 0 0;
  padding-left: 8px;
  line-height: 1.5;
}
.ai-command-draft-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding-left: 8px;
}
.ai-command-draft-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-sm);
  color: var(--opgaver-muted);
}
.ai-command-draft-field span {
  font-weight: var(--font-weight-medium);
}
.ai-command-draft-field input[type="date"],
.ai-command-draft-field input[type="time"],
.ai-command-draft-field select {
  font-size: var(--font-size-sm);
  font-family: inherit;
  color: var(--warm-text);
  background: rgba(228, 220, 212, 0.18);
  border: 1px solid rgba(228, 220, 212, 0.4);
  border-radius: 6px;
  padding: 4px 8px;
  min-height: 32px;
}
.ai-command-draft-field input:focus,
.ai-command-draft-field select:focus {
  outline: none;
  border-color: var(--opgaver-action);
}
.ai-command-draft-recurrence {
  color: var(--opgaver-sage-text);
}
.ai-command-field-icon {
  width: 14px;
  height: 14px;
}

/* ===== Agent edit-ring: #task-input pill + AI-command draft fields =====
   The shared sage ring (.ss-agent-edited, injected by ss-dom-operator.js) is swallowed by the
   pill's own box-shadow, so re-assert it for the pill at higher specificity. SCOPE SPLIT: the pill
   lives inside <main id="main-content">, but the AI-command review modal mounts OUTSIDE it (a
   sibling of <main>), so the draft-field rules must NOT be scoped under #main-content (that would
   be dead CSS). The draft fields carry no competing box-shadow; the override gives them the rounded
   12px ring-radius + the explicit light/dark/fade. The agent rings the pill on a task write, and
   the opgaver render flashes each draft field (title/date/time/priority) as Sofia fills it. */
#main-content .task-input-card.ss-agent-edited,
.ai-command-draft-title.ss-agent-edited,
.ai-command-draft-field input.ss-agent-edited,
.ai-command-draft-field select.ss-agent-edited {
  box-shadow: 0 0 0 2px rgba(110, 138, 126, 0.62), 0 0 0 5px rgba(110, 138, 126, 0.12) !important;
}
.ai-command-draft-title.ss-agent-edited,
.ai-command-draft-field input.ss-agent-edited,
.ai-command-draft-field select.ss-agent-edited {
  border-radius: 12px !important;
}
[data-theme="dark"] #main-content .task-input-card.ss-agent-edited,
[data-theme="dark"] .ai-command-draft-title.ss-agent-edited,
[data-theme="dark"] .ai-command-draft-field input.ss-agent-edited,
[data-theme="dark"] .ai-command-draft-field select.ss-agent-edited {
  box-shadow: 0 0 0 2px rgba(166, 203, 187, 0.65), 0 0 0 5px rgba(166, 203, 187, 0.14) !important;
}
/* fade-out kept at this specificity so the ring eases away instead of snapping off */
#main-content .task-input-card.ss-agent-edited.ss-agent-edited--out,
.ai-command-draft-title.ss-agent-edited.ss-agent-edited--out,
.ai-command-draft-field input.ss-agent-edited.ss-agent-edited--out,
.ai-command-draft-field select.ss-agent-edited.ss-agent-edited--out {
  box-shadow: 0 0 0 2px rgba(110, 138, 126, 0), 0 0 0 5px rgba(110, 138, 126, 0) !important;
}
.ai-command-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}
.ai-command-save-btn {
  flex: 1;
  min-width: 120px;
  min-height: 44px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  font-family: inherit;
  color: #fff;
  background: var(--opgaver-action);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.ai-command-save-btn:hover {
  background: var(--opgaver-action-dark);
}
.ai-command-save-btn:focus-visible {
  outline: 2px solid var(--opgaver-action);
  outline-offset: 2px;
}
.ai-command-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.ai-command-single-btn {
  min-height: 44px;
  font-size: var(--font-size-sm);
  font-family: inherit;
  color: var(--opgaver-muted);
  background: transparent;
  border: 1px solid rgba(228, 220, 212, 0.56);
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.ai-command-single-btn:hover {
  border-color: var(--opgaver-action);
  color: var(--opgaver-action);
}
.ai-command-single-btn:focus-visible {
  outline: 2px solid var(--opgaver-action);
  outline-offset: 2px;
}
.ai-command-cancel-btn {
  min-height: 44px;
  font-size: var(--font-size-sm);
  font-family: inherit;
  color: var(--opgaver-muted);
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: color 0.15s ease;
}
.ai-command-cancel-btn:hover {
  color: var(--opgaver-rose-text);
}
.ai-command-cancel-btn:focus-visible {
  outline: 2px solid var(--opgaver-action);
  outline-offset: 2px;
}

/* ── Clarification state ── */
.ai-command-clarification-question {
  font-size: var(--font-size-base);
  color: var(--opgaver-text);
  line-height: 1.5;
  margin: 0 0 16px;
}
.ai-command-clarification-label {
  display: block;
  margin-bottom: 16px;
}
.ai-command-clarification-label span {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--opgaver-muted);
  margin-bottom: 6px;
}
.ai-command-clarification-input {
  width: 100%;
  min-height: 80px;
  font-size: var(--font-size-base);
  font-family: inherit;
  color: var(--opgaver-text);
  background: rgba(228, 220, 212, 0.12);
  border: 1px solid rgba(228, 220, 212, 0.3);
  border-radius: 10px;
  padding: 12px 14px;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s ease;
}
.ai-command-clarification-input:focus {
  outline: none;
  border-color: var(--opgaver-action);
}

/* ── Dark mode ── */
[data-theme="dark"] .ai-command-clarification-question {
  color: #E8DDD4;
}
[data-theme="dark"] .ai-command-clarification-input {
  color: #E8DDD4;
  background: rgba(232, 224, 216, 0.06);
  border-color: rgba(232, 224, 216, 0.15);
}
[data-theme="dark"] .ai-command-clarification-input:focus {
  border-color: var(--opgaver-action);
}
[data-theme="dark"] .ai-command-review-backdrop {
  background: rgba(18, 16, 14, 0.6);
}
[data-theme="dark"] .ai-command-review-panel {
  background: rgba(36, 31, 27, 0.97);
  border-color: rgba(232, 224, 216, 0.10);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.36), 0 4px 16px rgba(0, 0, 0, 0.18);
}
[data-theme="dark"] .ai-command-review-heading {
  color: #E8DDD4;
}
[data-theme="dark"] .ai-command-review-close {
  color: rgba(232, 224, 216, 0.6);
}
[data-theme="dark"] .ai-command-review-close:hover {
  background: rgba(232, 224, 216, 0.1);
  color: #E8DDD4;
}
[data-theme="dark"] .ai-command-draft-card {
  background: rgba(30, 26, 22, 0.8);
  border-color: rgba(232, 224, 216, 0.10);
}
[data-theme="dark"] .ai-command-draft-card:hover {
  border-color: rgba(74, 122, 104, 0.3);
}
[data-theme="dark"] .ai-command-draft-title {
  color: #E8DDD4;
}
[data-theme="dark"] .ai-command-draft-title:hover {
  background: rgba(232, 224, 216, 0.06);
}
[data-theme="dark"] .ai-command-draft-title:focus {
  background: rgba(30, 26, 22, 0.95);
}
[data-theme="dark"] .ai-command-draft-desc {
  color: rgba(232, 224, 216, 0.6);
}
[data-theme="dark"] .ai-command-draft-field input,
[data-theme="dark"] .ai-command-draft-field select {
  color: #E8DDD4;
  background: rgba(232, 224, 216, 0.06);
  border-color: rgba(232, 224, 216, 0.12);
}
[data-theme="dark"] .ai-command-draft-remove:hover {
  background: rgba(212, 168, 154, 0.15);
}
[data-theme="dark"] .ai-command-review-warning {
  background: rgba(212, 168, 154, 0.08);
}
[data-theme="dark"] .ai-command-single-btn {
  border-color: rgba(232, 224, 216, 0.15);
  color: rgba(232, 224, 216, 0.6);
}
[data-theme="dark"] .ai-command-single-btn:hover {
  border-color: var(--opgaver-action);
  color: var(--opgaver-action);
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .ai-command-review-panel {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    padding: 20px 16px;
  }
  .ai-command-review-list {
    max-height: 60vh;
  }
  .ai-command-review-actions {
    flex-direction: column;
  }
  .ai-command-save-btn,
  .ai-command-single-btn,
  .ai-command-cancel-btn {
    width: 100%;
  }
  .ai-command-draft-fields {
    flex-direction: column;
    gap: 6px;
  }
}

/* ══════════════════════════════════════════════════════════ */
/* Klar Reply Panel (#3488)                                 */
/* ══════════════════════════════════════════════════════════ */

.oq-klar-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 14px; min-height: 30px;
  font-family: var(--font-family); font-size: var(--font-size-xs, 12px); font-weight: var(--font-weight-semibold, 600);
  color: #fff; background: var(--opgaver-action); border: none; border-radius: 6px;
  cursor: pointer; white-space: nowrap; line-height: 1.2;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.oq-klar-btn:hover { background: var(--opgaver-action-dark); }
.oq-klar-btn:focus-visible { outline: 2px solid var(--opgaver-action); outline-offset: 2px; }
[data-theme="dark"] .oq-klar-btn { background: #3D6B57; color: #fff; }
[data-theme="dark"] .oq-klar-btn:hover { background: #4A7A68; }

.oq-reply-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 440px; max-width: 100vw;
  background: var(--white, #FFFCF7); border-left: 1px solid var(--divider, rgba(0,0,0,0.08));
  box-shadow: -4px 0 24px rgba(0,0,0,0.08);
  z-index: 1100;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow: hidden;
}
.oq-reply-panel--visible { transform: translateX(0); }

.oq-reply-panel__inner {
  display: flex; flex-direction: column; height: 100%; min-height: 0;
}
.oq-reply-panel__header {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 20px; border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.oq-reply-panel__title-text {
  font-size: var(--font-size-lg, 17px); font-weight: var(--font-weight-bold, 650);
  color: var(--warm-text); flex-shrink: 0;
}
.oq-reply-panel__task-title {
  display: none;
}
.oq-reply-panel__close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--opgaver-subtle); border-radius: 8px;
  transition: color 0.15s ease, background 0.15s ease;
}
.oq-reply-panel__close:hover { color: var(--warm-text); background: rgba(168,176,196,0.12); }
.oq-reply-panel__close:focus-visible { outline: 2px solid var(--opgaver-action); outline-offset: -2px; }
.oq-reply-panel__close svg { width: 18px; height: 18px; }

.oq-reply-panel__body {
  flex: 1; min-height: 0; overflow-y: auto; padding: 20px;
}
.oq-reply-panel__loading {
  text-align: center; padding: 40px 0;
  color: var(--opgaver-muted); font-size: var(--font-size-sm, 13px);
}
.oq-reply-panel__error {
  text-align: center; padding: 40px 0;
  color: var(--opgaver-rose-text); font-size: var(--font-size-sm, 13px);
}
.oq-reply-panel__source {
  margin-bottom: 20px;
}
.oq-reply-panel__source-label {
  font-size: var(--font-size-xs, 12px); font-weight: var(--font-weight-semibold, 600);
  color: var(--opgaver-muted); text-transform: uppercase; letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.oq-reply-panel__quote {
  margin: 0; padding: 12px 16px;
  background: rgba(168,197,184,0.08); border-left: 3px solid var(--opgaver-action);
  border-radius: 0 8px 8px 0;
  font-size: var(--font-size-sm, 13px); color: var(--opgaver-subtle);
  line-height: 1.55; max-height: 200px; overflow-y: auto;
  white-space: pre-wrap; word-break: break-word;
  scrollbar-width: thin; scrollbar-color: rgba(168,197,184,0.3) transparent;
}
.oq-reply-panel__quote::-webkit-scrollbar { width: 5px; }
.oq-reply-panel__quote::-webkit-scrollbar-track { background: transparent; }
.oq-reply-panel__quote::-webkit-scrollbar-thumb { background: rgba(168,197,184,0.3); border-radius: 999px; }
.oq-reply-panel__draft-section {
  margin-top: 4px;
}
.oq-reply-panel__draft-label {
  display: block; font-size: var(--font-size-xs, 12px); font-weight: var(--font-weight-semibold, 600);
  color: var(--opgaver-muted); text-transform: uppercase; letter-spacing: 0.03em;
  margin-bottom: 8px;
}
.oq-reply-panel__to-row {
  margin-bottom: 16px;
}
.oq-reply-panel__to-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-family);
  font-size: var(--font-size-xs, 12px);
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1.4;
  color: var(--opgaver-muted);
  text-transform: uppercase;
  letter-spacing: 0;
}
.oq-reply-panel__to-value {
  font-family: var(--font-family);
  font-size: var(--font-size-sm, 13px);
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1.4;
  color: var(--warm-text);
}
.oq-reply-panel__from-row {
  margin-bottom: 16px;
}
.oq-reply-panel__from-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-family);
  font-size: var(--font-size-xs, 12px);
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1.4;
  color: var(--opgaver-muted);
  text-transform: uppercase;
  letter-spacing: 0;
}
.oq-reply-panel__from-select {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.oq-select {
  position: relative;
}
.oq-select__trigger {
  display: flex; align-items: center; gap: 8px;
  width: 100%; min-height: 40px;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--divider); border-radius: 8px;
  font-family: var(--font-family);
  font-size: var(--font-size-sm, 13px);
  font-weight: var(--font-weight-semibold, 600);
  line-height: 1.4; color: var(--warm-text);
  background: var(--white, #FFFCF7);
  cursor: pointer; text-align: left;
  transition: border-color 0.15s ease;
}
.oq-select__trigger::after {
  content: ''; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--opgaver-muted);
  pointer-events: none;
}
.oq-select__trigger:hover { border-color: var(--opgaver-action); }
.oq-select__trigger:focus-visible {
  outline: 2px solid var(--opgaver-action); outline-offset: 2px;
}
.oq-select__list {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: 100; max-height: 200px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--white, #FFFCF7);
  border: 1px solid var(--divider); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  scrollbar-width: thin; scrollbar-color: rgba(168,197,184,0.3) transparent;
}
.oq-select--open .oq-select__list { display: block; }
.oq-select__option {
  display: flex; align-items: center;
  padding: 8px 12px; min-height: 36px;
  border-radius: 6px; cursor: pointer;
  font-family: var(--font-family);
  font-size: var(--font-size-sm, 13px);
  font-weight: var(--font-weight-medium, 500);
  color: var(--warm-text);
  transition: background 0.1s ease;
}
.oq-select__option:hover,
.oq-select__option--focused { background: rgba(168,197,184,0.12); }
.oq-select__option--selected { font-weight: var(--font-weight-semibold, 600); color: var(--opgaver-action); }
.oq-select__option--selected::after {
  content: ''; margin-left: auto; width: 6px; height: 10px;
  border-right: 2px solid var(--opgaver-action); border-bottom: 2px solid var(--opgaver-action);
  transform: rotate(45deg); flex-shrink: 0;
}
.oq-reply-panel__draft {
  min-height: 120px; padding: 12px 16px;
  border: 1px solid var(--divider); border-radius: 8px;
  font-family: var(--font-family); font-size: var(--font-size-base, 15px);
  line-height: 1.55; color: var(--warm-text);
  background: var(--white, #FFFCF7);
  outline: none; word-break: break-word;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.oq-reply-panel__draft:focus {
  border-color: var(--opgaver-action);
  box-shadow: 0 0 0 2px rgba(74,122,104,0.15);
}

.oq-reply-panel__sent {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 24px; color: var(--opgaver-action);
  font-size: var(--font-size-base, 15px); font-weight: var(--font-weight-semibold, 600);
}
.oq-reply-panel__sent svg { width: 22px; height: 22px; stroke: var(--opgaver-action); }

.oq-reply-panel__actions {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--divider);
  flex-shrink: 0;
}
.oq-reply-panel__send-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; min-height: 44px;
  font-family: var(--font-family); font-size: var(--font-size-base, 15px); font-weight: var(--font-weight-bold, 650);
  color: #fff; background: var(--opgaver-action); border: none; border-radius: 10px;
  cursor: pointer; transition: background 0.15s ease;
}
.oq-reply-panel__send-btn:hover:not(:disabled) { background: var(--opgaver-action-dark); }
.oq-reply-panel__send-btn:disabled { opacity: 0.5; cursor: default; }
.oq-reply-panel__send-btn:focus-visible { outline: 2px solid var(--opgaver-action); outline-offset: 2px; }

.oq-reply-panel__improve-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; min-height: 44px;
  font-family: var(--font-family); font-size: var(--font-size-sm, 13px); font-weight: var(--font-weight-semibold, 600);
  color: var(--opgaver-action); background: transparent;
  border: 1px solid var(--opgaver-action); border-radius: 10px;
  cursor: pointer; transition: background 0.15s ease;
}
.oq-reply-panel__improve-btn:hover { background: rgba(74,122,104,0.06); }
.oq-reply-panel__improve-btn:focus-visible { outline: 2px solid var(--opgaver-action); outline-offset: 2px; }
.oq-reply-panel__improve-btn:disabled,
.oq-reply-panel__improve-btn[aria-disabled="true"] {
  opacity: 0.5; cursor: default;
}
.oq-reply-panel__improve-btn:disabled:hover,
.oq-reply-panel__improve-btn[aria-disabled="true"]:hover {
  background: transparent;
}

.oq-reply-panel__back-btn {
  display: none;
}

/* ── Klar panel: dock anchor (#3595) ── */
body.oq-reply-panel-open > .cvm-dock {
  left: auto !important; top: auto !important;
  right: 20px; bottom: 93px;
  width: 399px; max-width: calc(100vw - 40px);
  max-height: 300px !important; margin: 0;
}

/* ── Klar panel: dark mode ── */
[data-theme="dark"] .oq-reply-panel {
  background: #211D19; border-left-color: rgba(232,224,216,0.10);
  box-shadow: -4px 0 24px rgba(0,0,0,0.3);
}
[data-theme="dark"] .oq-reply-panel__header { border-bottom-color: rgba(232,224,216,0.08); }
[data-theme="dark"] .oq-reply-panel__quote {
  background: rgba(168,197,184,0.06); border-left-color: var(--opgaver-action);
}
[data-theme="dark"] .oq-reply-panel__draft {
  background: #1A1714; border-color: rgba(232,224,216,0.10); color: var(--warm-text);
}
[data-theme="dark"] .oq-select__trigger {
  background: #1A1714; border-color: rgba(232,224,216,0.10); color: var(--warm-text);
}
[data-theme="dark"] .oq-select__trigger::after { border-top-color: rgba(232,224,216,0.5); }
[data-theme="dark"] .oq-select__list {
  background: #1A1714; border-color: rgba(232,224,216,0.10);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
[data-theme="dark"] .oq-select__option:hover,
[data-theme="dark"] .oq-select__option--focused { background: rgba(90,142,122,0.15); }
[data-theme="dark"] .oq-reply-panel__draft:focus {
  border-color: var(--opgaver-action); box-shadow: 0 0 0 2px rgba(90,142,122,0.2);
}
[data-theme="dark"] .oq-reply-panel__actions { border-top-color: rgba(232,224,216,0.08); }
[data-theme="dark"] .oq-reply-panel__send-btn { background: #3D6B57; color: #fff; }
[data-theme="dark"] .oq-reply-panel__send-btn:hover:not(:disabled) { background: #4A7A68; }
[data-theme="dark"] .oq-reply-panel__improve-btn { color: var(--opgaver-action); border-color: var(--opgaver-action); }
[data-theme="dark"] .oq-reply-panel__improve-btn:hover { background: rgba(90,142,122,0.1); }

/* ── Klar panel: mobile ── */
@media (max-width: 767px) {
  .oq-reply-panel {
    width: 100vw; top: auto; bottom: 0; left: 0; right: 0;
    height: min(85vh, calc(100vh - 24px));
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - 12px);
    border-left: none;
    border-top: 1px solid var(--divider);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
    transform: translateY(100%);
  }
  .oq-reply-panel--visible { transform: translateY(0); }
  .oq-reply-panel__actions { flex-wrap: wrap; }
  .oq-reply-panel__send-btn { flex: 1; min-width: 0; }
  body.oq-reply-panel-open > .cvm-dock {
    right: 20px; left: 20px !important;
    width: auto; max-width: calc(100vw - 40px);
    bottom: 93px;
  }
}

@media (max-width: 380px) {
  .oq-klar-btn {
    padding: 4px 10px; min-height: 28px;
    font-size: var(--font-size-xxs, 11px);
  }
  .task-item .task-actions { gap: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #add-task-btn.is-loading::before {
    animation-duration: 1.6s !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
 * #3544 — CalmAiDock fixed-variant + calm-letter–body model for Klar
 * Duplicated from chat/css/chat-ny-blod-bolge.css for surface isolation.
 * ═══════════════════════════════════════════════════════════════════════ */

/* ── calm-letter body model ── */
.calm-letter {
  display: block;
  min-height: 1.5em;
  padding: 10px 14px;
  font-size: var(--font-size-base, 15px);
  line-height: 1.55;
  color: var(--warm-text, #3D3028);
  background: rgba(253, 247, 243, 0.5);
  border: 1px solid rgba(228, 220, 212, 0.7);
  border-radius: 12px;
  overflow-wrap: anywhere;
}
.calm-letter--body {
  min-height: 130px;
  padding: 16px 18px;
}
.calm-letter--body p { margin: 1em 0; }
.calm-letter--body p:first-child { margin-top: 0; }
.calm-letter--body p:last-child { margin-bottom: 0; }
.calm-letter--body ul,
.calm-letter--body ol { margin: 0.5em 0; padding-left: 1.5em; }
.calm-letter--body [data-calm-body] { min-height: 96px; outline: none; }
.calm-letter--body [data-calm-body]:empty::before {
  content: attr(data-placeholder);
  color: var(--warm-text-light, #8C7B6F);
  opacity: 0.7;
}
.calm-letter--loading { cursor: default; }
.calm-letter--loading .calm-skel-line {
  display: block; height: 0.72em; margin: 0 0 0.66em; border-radius: 6px;
  background-color: rgba(228, 220, 212, 0.6);
  background-image: linear-gradient(90deg, rgba(228,220,212,0) 0%, rgba(253,247,243,0.9) 50%, rgba(228,220,212,0) 100%);
  background-repeat: no-repeat; background-size: 180% 100%;
  animation: calm-skel-shimmer 1.5s ease-in-out infinite;
}
.calm-letter--loading .calm-skel-line:first-child { margin-top: 3px; }
.calm-letter--loading .calm-skel-line:nth-child(1) { width: 94%; }
.calm-letter--loading .calm-skel-line:nth-child(2) { width: 82%; }
.calm-letter--loading .calm-skel-line:nth-child(3) { width: 64%; }
@keyframes calm-skel-shimmer {
  0% { background-position: 180% 0; }
  100% { background-position: -80% 0; }
}
.calm-letter--flash { animation: calmLetterFlash 0.9s ease; }
@keyframes calmLetterFlash {
  0% { box-shadow: 0 0 0 3px rgba(110, 138, 126, 0.35); }
  100% { box-shadow: 0 0 0 3px rgba(110, 138, 126, 0); }
}

/* ── calm-sig-preview ── */
.calm-sig-preview {
  margin-top: 14px;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  color: var(--warm-text-light, #8C7B6F);
  overflow-wrap: anywhere;
  outline: none;
}
.calm-sig-preview[hidden] { display: none; }

/* ── CVM dock (fixed variant) ── */
.cvm-dock {
  position: fixed; z-index: 9000; top: 0; left: 0;
  width: 374px; max-width: calc(100vw - 16px); max-height: 620px;
  display: flex; flex-direction: column; overflow: hidden;
  background: #FBF8F2; border: 1px solid #ECE7DF; border-radius: 14px;
  box-shadow: 0 6px 24px rgba(58, 47, 38, 0.10); color: #3A2F26;
  animation: cvmDockIn 0.2s ease;
}
@keyframes cvmDockIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
.cvm-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid #ECE7DF;
}
.cvm-head-icon .calm-ico { width: 20px; height: 20px; }
.cvm-head-icon {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  background: rgba(110, 138, 126, 0.12); color: #6E8A7E;
}
.cvm-head-text { flex: 1 1 auto; min-width: 0; }
.cvm-title {
  margin: 0; font-size: var(--font-size-base, 15px);
  font-weight: var(--font-weight-semibold); color: #3A2F26;
}
.cvm-subtitle {
  margin: 2px 0 0; font-size: var(--font-size-sm);
  line-height: 1.4; color: #8C7B6F;
}
.cvm-close {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: none; border-radius: 8px;
  background: transparent; color: #8C7B6F; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.cvm-close:hover { background: rgba(58, 47, 38, 0.06); color: #3A2F26; }
.cvm-body {
  flex: 1 1 auto; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.cvm-dock .ask-ai-welcome { margin: 0 0 2px; }
.cvm-dock:not(.cvm-dock--inline) .cvm-body:has(.ask-ai-welcome) { padding-bottom: 10px; }
.cvm-dock .ask-ai-suggestions { display: flex; flex-direction: column; gap: 8px; }
.cvm-dock .ask-ai-suggestion {
  display: inline-flex; align-items: center; justify-content: flex-start;
  gap: 8px; min-height: 36px; width: 100%; padding: 8px 10px;
  border: 1px solid rgba(110, 138, 126, 0.24); border-radius: 10px;
  background: #FFFEFB; color: #4A6157;
  font-size: var(--font-size-sm); font-weight: var(--font-weight-medium);
  text-align: left; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cvm-dock .ask-ai-suggestion svg { flex: 0 0 auto; color: #6E8A7E; }
.cvm-dock .ask-ai-suggestion:hover,
.cvm-dock .ask-ai-suggestion:focus-visible {
  background: rgba(110, 138, 126, 0.10);
  border-color: rgba(110, 138, 126, 0.42); color: #3D3028;
}
.cvm-dock .ask-ai-suggestion--primary {
  background: #6E8A7E; border-color: #6E8A7E; color: #FFFEFB;
}
.cvm-dock .ask-ai-suggestion--primary svg { color: #FFFEFB; }
.cvm-dock .ask-ai-suggestion--primary:hover,
.cvm-dock .ask-ai-suggestion--primary:focus-visible {
  background: #5F7B70; border-color: #5F7B70; color: #FFFEFB;
}
.cvm-body::-webkit-scrollbar { width: 7px; }
.cvm-body::-webkit-scrollbar-track { background: transparent; }
.cvm-body::-webkit-scrollbar-thumb { background: rgba(58, 47, 38, 0.18); border-radius: 999px; }
.cvm-body::-webkit-scrollbar-thumb:hover { background: rgba(58, 47, 38, 0.30); }
@supports not selector(::-webkit-scrollbar) {
  .cvm-body { scrollbar-width: thin; scrollbar-color: rgba(58, 47, 38, 0.18) transparent; }
}
.cvm-bubble {
  max-width: 88%; padding: 10px 12px; font-size: var(--font-size-sm);
  line-height: 1.5; border-radius: 12px; overflow-wrap: anywhere; white-space: pre-wrap;
}
.cvm-bubble--bot { align-self: flex-start; background: rgba(58, 47, 38, 0.05); color: #3D3028; }
.cvm-bubble--user { align-self: flex-end; background: #6E8A7E; color: #FFFEFB; }
.cvm-dock [data-cvm-actions] {
  align-self: flex-start; display: flex; align-items: center;
  gap: 6px; margin-top: -6px; margin-left: 2px;
}
.cvm-dock [data-cvm-opening-actions] {
  align-self: flex-start; display: flex; align-items: center;
  gap: 6px; margin-top: 2px; margin-left: 2px;
}
.cvm-dock [data-cvm-actions] .chat-msg-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid rgba(110, 138, 126, 0.22); border-radius: 999px;
  background: transparent; color: #6E8A7E; opacity: 0.72; cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cvm-dock [data-cvm-opening-actions] .chat-msg-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid rgba(110, 138, 126, 0.22); border-radius: 999px;
  background: transparent; color: #6E8A7E; opacity: 0.72;
  cursor: default; pointer-events: none;
  transition: opacity 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.cvm-dock [data-cvm-actions] .chat-msg-action-btn svg,
.cvm-dock [data-cvm-opening-actions] .chat-msg-action-btn svg { width: 15px; height: 15px; }
.cvm-dock [data-cvm-actions] .chat-msg-action-btn:hover,
.cvm-dock [data-cvm-actions] .chat-msg-action-btn:focus-visible,
.cvm-dock [data-cvm-actions] .chat-msg-action-btn.done,
.cvm-dock [data-cvm-actions] .chat-msg-action-btn.tts-playing,
.cvm-dock [data-cvm-actions] .chat-msg-action-btn.active {
  opacity: 1; background: rgba(110, 138, 126, 0.10);
  border-color: rgba(110, 138, 126, 0.36); color: #4A6157;
}
.cvm-thinking { margin: 0; align-self: flex-start; font-size: var(--font-size-sm); color: #8C7B6F; }
.cvm-suggestion {
  align-self: stretch; padding: 12px 14px;
  background: #FFFEFB; border: 1px solid #ECE7DF; border-radius: 12px;
}
.cvm-label {
  margin: 0 0 6px; font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold); text-transform: uppercase;
  letter-spacing: 0.06em; color: #6E8A7E;
}
.cvm-suggestion-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 0 0 6px;
}
.cvm-suggestion-head .cvm-label { margin: 0; }
.cvm-listen {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; border: none; border-radius: 999px;
  background: transparent; color: #6E8A7E; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.cvm-listen:hover { background: rgba(110, 138, 126, 0.14); }
.cvm-listen svg { width: 18px; height: 18px; }
.cvm-listen.loading { background: rgba(110, 138, 126, 0.14); color: #4A6157; }
.cvm-listen.tts-playing,
.cvm-listen.active { background: rgba(110, 138, 126, 0.22); color: #4A6157; }
.cvm-old {
  margin: 0 0 4px; font-size: var(--font-size-sm); line-height: 1.5;
  color: #A99E92; text-decoration: line-through; white-space: pre-wrap; overflow-wrap: anywhere;
}
.cvm-new {
  margin: 0 0 12px; font-size: var(--font-size-base, 15px);
  font-weight: var(--font-weight-semibold); line-height: 1.5;
  color: #3A2F26; white-space: pre-wrap; overflow-wrap: anywhere;
}
.cvm-confirm { display: flex; gap: 8px; }
.cvm-yes {
  flex: 0 0 auto; padding: 8px 16px; border: 1px solid #6E8A7E;
  border-radius: 999px; background: #6E8A7E; color: #FFFEFB;
  font-size: var(--font-size-sm); font-weight: var(--font-weight-semibold);
  cursor: pointer; transition: background 0.15s ease;
}
.cvm-yes:hover { background: #5F7A6F; }
.cvm-no {
  flex: 0 0 auto; padding: 8px 16px;
  border: 1px solid rgba(58, 47, 38, 0.18); border-radius: 999px;
  background: #FFFEFB; color: #5C4D43;
  font-size: var(--font-size-sm); font-weight: var(--font-weight-medium);
  cursor: pointer; transition: background 0.15s ease;
}
.cvm-no:hover { background: rgba(58, 47, 38, 0.05); }
.cvm-result {
  margin: 0; align-self: flex-start; font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold); color: #6E8A7E;
}
.cvm-error { margin: 0; align-self: flex-start; font-size: var(--font-size-sm); color: #B08068; }
.cvm-foot { padding: 12px 16px; border-top: 1px solid #ECE7DF; }
.cvm-composer {
  display: flex; align-items: flex-end; gap: 6px;
  padding: 5px 6px 5px 8px; border: 1px solid #DAD2C6; border-radius: 24px;
  background: #FFFEFB; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.cvm-composer:focus-within {
  border-color: #6E8A7E; box-shadow: 0 0 0 1px rgba(110, 138, 126, 0.35);
}
.cvm-mic {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: none; border-radius: 999px;
  background: transparent; color: #6E8A7E; cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.cvm-mic:hover { background: rgba(110, 138, 126, 0.16); }
.cvm-mic.ss-mic--connecting { background: rgba(110, 138, 126, 0.18); color: #5F7A6F; }
.cvm-mic.ss-mic--listening {
  background: rgba(110, 138, 126, 0.12); color: #4A6B5C;
  box-shadow: inset 0 0 0 1.5px rgba(110, 138, 126, 0.45);
  animation: cvmMicPulse 2s ease-in-out infinite;
}
.cvm-mic.ss-mic--error { background: rgba(194, 96, 63, 0.12); color: #C2603F; }
@keyframes cvmMicPulse {
  0%, 100% { box-shadow: inset 0 0 0 1.5px rgba(110, 138, 126, 0.45); }
  50% { box-shadow: inset 0 0 0 1.5px rgba(110, 138, 126, 0.25); }
}
.cvm-type-field {
  flex: 1 1 auto; min-width: 0; min-height: 24px; height: 24px;
  max-height: min(24vh, 112px); border: none; background: transparent;
  outline: none; padding: 6px 2px; font: inherit;
  font-size: var(--font-size-sm); line-height: 1.4; color: #3D3028;
  overflow-y: hidden; overflow-x: hidden; resize: none;
  scrollbar-width: thin; scrollbar-color: rgba(110, 138, 126, 0.24) transparent;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.cvm-type-field::placeholder { color: #A89B8C; }
.cvm-type-field::-webkit-scrollbar { width: 5px; }
.cvm-type-field::-webkit-scrollbar-track { background: transparent; }
.cvm-type-field::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.cvm-type-field::-webkit-scrollbar-thumb { background: rgba(110, 138, 126, 0.24); border-radius: 999px; }
.cvm-type-field::-webkit-scrollbar-thumb:hover { background: rgba(110, 138, 126, 0.34); }
.cvm-type-send {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: none; border-radius: 999px;
  background: #6E8A7E; color: #FFFEFB; cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.cvm-type-send:hover { background: #5F7A6F; }
.cvm-type-send:disabled { background: rgba(110, 138, 126, 0.30); color: #FBF8F2; cursor: default; }
.cvm-icon { width: 20px; height: 20px; flex: 0 0 auto; }
.cvm-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.cvm-dock:focus { outline: none; }
.cvm-close:focus-visible,
.cvm-mic:focus-visible,
.cvm-listen:focus-visible,
.cvm-type-send:focus-visible,
.cvm-quick-chip:focus-visible,
.cvm-yes:focus-visible,
.cvm-no:focus-visible { outline: 3px solid #6E8A7E; outline-offset: 2px; }
.cvm-dock:not(.cvm-dock--inline) .cvm-body:empty { display: none; }
.cvm-dock:not(.cvm-dock--inline):has(> .cvm-body:empty) .cvm-head { border-bottom: none; }
.cvm-dock:not(.cvm-dock--inline):has(> .cvm-body:empty) .cvm-foot { border-top: none; padding: 14px 16px; }
.cvm-quick { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.cvm-quick-chip {
  padding: 6px 12px; border: 1px solid rgba(110, 138, 126, 0.34); border-radius: 999px;
  background: rgba(110, 138, 126, 0.08); color: #4A6157;
  font-size: var(--font-size-sm); cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cvm-quick-chip:hover { background: rgba(110, 138, 126, 0.16); }
.cvm-dock .ask-ai-action-btn.done {
  background: rgba(110, 138, 126, 0.12);
}
.cvm-dock [data-cvm-actions] .chat-msg-action-btn.ss-tts-stop {
  opacity: 1;
}

/* ── CVM dock + calm-letter dark mode ── */
html[data-theme="dark"] .calm-letter {
  background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] .calm-sig-preview { color: var(--color-text-secondary, #A89B91); }
html[data-theme="dark"] .cvm-dock {
  background: #2A2520 !important; border-color: rgba(232, 224, 216, 0.16) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34) !important; color: #FAF5EF !important;
}
html[data-theme="dark"] .cvm-head,
html[data-theme="dark"] .cvm-foot { border-color: rgba(232, 224, 216, 0.12) !important; }
html[data-theme="dark"] .cvm-head-icon { background: rgba(125, 156, 142, 0.18) !important; color: #B7CDC1 !important; }
html[data-theme="dark"] .cvm-title,
html[data-theme="dark"] .cvm-new,
html[data-theme="dark"] .cvm-type-field { color: #FAF5EF !important; }
html[data-theme="dark"] .cvm-subtitle,
html[data-theme="dark"] .cvm-close,
html[data-theme="dark"] .cvm-thinking,
html[data-theme="dark"] .cvm-old,
html[data-theme="dark"] .cvm-type-field::placeholder { color: #B8ADA3 !important; }
html[data-theme="dark"] .cvm-close:hover { background: rgba(232, 224, 216, 0.08) !important; color: #FAF5EF !important; }
html[data-theme="dark"] .cvm-bubble--bot { background: rgba(232, 224, 216, 0.08) !important; color: #F5EEE7 !important; }
html[data-theme="dark"] .cvm-bubble--user { background: #6F8D80 !important; color: #FFFEFB !important; }
html[data-theme="dark"] .cvm-dock .ask-ai-suggestion {
  background: #322C26 !important; border-color: rgba(232, 224, 216, 0.14) !important; color: #F5EEE7 !important;
}
html[data-theme="dark"] .cvm-dock .ask-ai-suggestion svg { color: #B7CDC1 !important; }
html[data-theme="dark"] .cvm-dock .ask-ai-suggestion:hover,
html[data-theme="dark"] .cvm-dock .ask-ai-suggestion:focus-visible {
  background: rgba(232, 224, 216, 0.08) !important;
  border-color: rgba(183, 205, 193, 0.34) !important; color: #FAF5EF !important;
}
html[data-theme="dark"] .cvm-dock .ask-ai-suggestion--primary {
  background: #6F8D80 !important; border-color: #6F8D80 !important; color: #FFFEFB !important;
}
html[data-theme="dark"] .cvm-dock .ask-ai-suggestion--primary svg { color: #FFFEFB !important; }
html[data-theme="dark"] .cvm-dock [data-cvm-actions] .chat-msg-action-btn {
  border-color: rgba(232, 224, 216, 0.16) !important; color: #B7CDC1 !important;
}
html[data-theme="dark"] .cvm-dock [data-cvm-opening-actions] .chat-msg-action-btn {
  border-color: rgba(232, 224, 216, 0.16) !important; color: #B7CDC1 !important;
}
html[data-theme="dark"] .cvm-dock [data-cvm-actions] .chat-msg-action-btn:hover,
html[data-theme="dark"] .cvm-dock [data-cvm-actions] .chat-msg-action-btn:focus-visible,
html[data-theme="dark"] .cvm-dock [data-cvm-actions] .chat-msg-action-btn.done,
html[data-theme="dark"] .cvm-dock [data-cvm-actions] .chat-msg-action-btn.tts-playing,
html[data-theme="dark"] .cvm-dock [data-cvm-actions] .chat-msg-action-btn.active {
  background: rgba(232, 224, 216, 0.10) !important;
  border-color: rgba(183, 205, 193, 0.36) !important; color: #FAF5EF !important;
}
html[data-theme="dark"] .cvm-dock [data-cvm-opening-actions] .chat-msg-action-btn:hover,
html[data-theme="dark"] .cvm-dock [data-cvm-opening-actions] .chat-msg-action-btn:focus-visible {
  background: rgba(232, 224, 216, 0.10) !important;
  border-color: rgba(183, 205, 193, 0.36) !important; color: #FAF5EF !important;
}
html[data-theme="dark"] .cvm-dock .ask-ai-action-btn.done { background: rgba(183, 205, 193, 0.14) !important; }
html[data-theme="dark"] .cvm-suggestion {
  background: #322C26 !important; border-color: rgba(232, 224, 216, 0.12) !important; color: #F5EEE7 !important;
}
html[data-theme="dark"] .cvm-label,
html[data-theme="dark"] .cvm-listen,
html[data-theme="dark"] .cvm-result,
html[data-theme="dark"] .cvm-mic { color: #B7CDC1 !important; }
html[data-theme="dark"] .cvm-listen:hover,
html[data-theme="dark"] .cvm-mic:hover { background: rgba(125, 156, 142, 0.20) !important; }
html[data-theme="dark"] .cvm-listen.loading { background: rgba(125, 156, 142, 0.16) !important; }
html[data-theme="dark"] .cvm-listen.tts-playing,
html[data-theme="dark"] .cvm-listen.active {
  background: rgba(125, 156, 142, 0.26) !important; color: #FAF5EF !important;
}
html[data-theme="dark"] .cvm-no {
  background: #241F1B !important; border-color: rgba(232, 224, 216, 0.14) !important; color: #F5EEE7 !important;
}
html[data-theme="dark"] .cvm-no:hover { background: rgba(232, 224, 216, 0.08) !important; }
html[data-theme="dark"] .cvm-error { color: #E1A184 !important; }
html[data-theme="dark"] .cvm-composer {
  background: #241F1B !important; border-color: rgba(232, 224, 216, 0.18) !important;
}
html[data-theme="dark"] .cvm-composer:focus-within {
  border-color: #B7CDC1 !important; box-shadow: 0 0 0 1px rgba(183, 205, 193, 0.32) !important;
}
html[data-theme="dark"] .cvm-mic.ss-mic--connecting { background: rgba(125, 156, 142, 0.22) !important; color: #B7CDC1 !important; }
html[data-theme="dark"] .cvm-mic.ss-mic--listening {
  background: rgba(125, 156, 142, 0.14) !important; color: #B7CDC1 !important;
  box-shadow: inset 0 0 0 1.5px rgba(183, 205, 193, 0.40) !important;
}
html[data-theme="dark"] .cvm-mic.ss-mic--error { background: rgba(225, 161, 132, 0.14) !important; color: #E1A184 !important; }
html[data-theme="dark"] .cvm-type-send { background: #7D9C8E !important; color: #1F1B17 !important; }
html[data-theme="dark"] .cvm-type-send:hover { background: #8EAD9F !important; }
html[data-theme="dark"] .cvm-type-send:disabled {
  background: rgba(125, 156, 142, 0.28) !important; color: rgba(250, 245, 239, 0.68) !important;
}
html[data-theme="dark"] .cvm-quick-chip {
  background: rgba(125, 156, 142, 0.14); border-color: rgba(125, 156, 142, 0.30); color: #B7CDC1;
}
html[data-theme="dark"] .cvm-quick-chip:hover { background: rgba(125, 156, 142, 0.22); }
html[data-theme="dark"] .cvm-body::-webkit-scrollbar-thumb { background: rgba(232, 224, 216, 0.24) !important; }
html[data-theme="dark"] .cvm-body::-webkit-scrollbar-thumb:hover { background: rgba(232, 224, 216, 0.36) !important; }
@supports not selector(::-webkit-scrollbar) {
  html[data-theme="dark"] .cvm-body { scrollbar-color: rgba(232, 224, 216, 0.24) transparent; }
}

/* ── CVM dock mobile bottom-sheet ── */
@media (max-width: 768px) {
  .cvm-dock {
    position: fixed !important; top: auto !important;
    bottom: var(--mn-bar-height, 60px) !important;
    left: 0 !important; right: 0 !important;
    width: auto !important; max-width: none !important;
    max-height: min(60dvh, 400px);
    border-radius: 18px 18px 0 0;
    animation: cvmDockInMobile 0.2s ease;
  }
  body:has(.cvm-dock:not(.cvm-dock--inline)) :is(#bb-mobile-nav, .mn-fab-group, .mn-more-sheet, .mn-more-backdrop) {
    display: none !important;
  }
  body:has(.cvm-dock:not(.cvm-dock--inline)) .cvm-dock:not(.cvm-dock--inline) {
    bottom: 0 !important; padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .cvm-body { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
}
@keyframes cvmDockInMobile {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   Desktop opgavekort-grid (2026-06-12)
   Bred rail + hver opgave som sit eget kort, 2-3 pr. række,
   ensartet sektionsrytme. Kun ≥1100px — mobil/tablet uændret.
   Valideret live på staging (CSS-injektion) og godkendt.
   ══════════════════════════════════════════════════════════ */
@media (min-width: 1500px) {
  .content { max-width: min(1320px, calc(100vw - 560px)); }
  .stats-bar,
  .task-input-form,
  .parse-chips { max-width: 100%; }
}
@media (min-width: 1100px) {
  #tasks-container .task-card {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 14px;
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }
  #tasks-container .task-item {
    background: var(--white, #FFFEFB);
    border: 1px solid rgba(228, 220, 212, 0.55);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: border-color 0.2s ease, background 0.2s ease;
  }
  #tasks-container .task-item:hover {
    border-color: rgba(92, 77, 67, 0.25);
    background: var(--white, #FFFEFB);
  }
  #tasks-container .done-section .task-item,
  #tasks-container .task-section--deferred .task-item {
    background: rgba(247, 243, 238, 0.75);
    border-color: rgba(228, 220, 212, 0.45);
  }
  #tasks-container .task-section + .task-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid rgba(184, 168, 152, 0.3);
  }
  [data-theme="dark"] #tasks-container .task-card {
    background: transparent;
    border: none;
    box-shadow: none;
  }
  [data-theme="dark"] #tasks-container .task-item {
    background: #241F1B;
    border-color: rgba(232, 224, 216, 0.08);
  }
  [data-theme="dark"] #tasks-container .task-item:hover {
    border-color: rgba(232, 224, 216, 0.18);
    background: #241F1B;
  }
  [data-theme="dark"] #tasks-container .done-section .task-item,
  [data-theme="dark"] #tasks-container .task-section--deferred .task-item {
    background: rgba(168, 176, 196, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
  }
  [data-theme="dark"] #tasks-container .task-section + .task-section {
    border-top-color: rgba(255, 255, 255, 0.06);
  }
}
