    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
    :root {
      --accent: #5B4FE9; --accent-dim: #EAE8FF;
      --logo-from: #5B4FE9; --logo-to: #9747FF; --logo-glow: rgba(91,79,233,0.0);
      --green: #34C759; --red: #FF3B30; --orange: #FF9500; --blue: #007AFF;
      --bg: #F2F2F7; --surface: #FFFFFF; --text: #1C1C1E; --text2: #6E6E73; --text3: #AEAEB2;
      --border: #E5E5EA; --r: 16px; --r-sm: 12px;
      --shadow: 0 2px 12px rgba(0,0,0,0.07), 0 1px 3px rgba(0,0,0,0.04);
      /* note hues — vivid base colors; cards mix these at 20% over --surface */
      --note-1: #F87171; --note-2: #C084FC; --note-3: #60A5FA; --note-4: #4ADE80;
      --note-5: #FACC15; --note-6: #FB923C; --note-7: #2DD4BF; --note-8: #94A3B8;
      /* component semantic tokens */
      --chip-tasks-bg: #E8F5E9; --chip-tasks-fg: #1B5E20;
      --chip-notes-bg: #E3F2FD; --chip-notes-fg: #0D47A1;
      --chip-goals-bg: var(--accent-dim); --chip-goals-fg: #8B7CF8;
      --chip-archive-bg: #F0F0F5; --chip-archive-fg: #6E6E73;
      --swipe-pin-bg: var(--accent-dim);
      --swipe-del-bg: #fee2e2;
      --arch-date-color: #b0bec5;
    }
    [data-theme^="dark"] {
      --bg: #000000; --surface: #1C1C1E; --text: #FFFFFF; --text2: #AEAEB2; --text3: #636366;
      --border: #38383A; --shadow: 0 2px 12px rgba(0,0,0,0.4); --accent-dim: #2D2952;
      --chip-tasks-bg: #1B3320; --chip-tasks-fg: #A5D6A7;
      --chip-goals-bg: #2D1B6B; --chip-goals-fg: #C4B5FD;
      --chip-notes-bg: #0D2A5C; --chip-notes-fg: #90CAF9;
      --chip-archive-bg: #2C2C2E; --chip-archive-fg: #AEAEB2;
      --swipe-pin-bg: #3D2F7A;
      --swipe-del-bg: #6B2020;
      --arch-date-color: var(--text3);
      color-scheme: dark;
    }
[data-theme^="dark"] .app-header { background: var(--surface); }
    [data-theme^="dark"] .notif-banner { background: #3A3A3C; }
    [data-theme^="dark"] .overdue-banner { background: #3E0000; border-color: #7F1D1D; color: #FCA5A5; }
    [data-theme^="dark"] .pbtn.p-low.sel    { background: #003E47; border-color: #0097A7; color: #4DD0E1; }
    [data-theme^="dark"] .pbtn.p-medium.sel { background: #4A2500; border-color: var(--orange); color: #FFCC80; }
    [data-theme^="dark"] .pbtn.p-high.sel   { background: #4A0000; border-color: var(--red); color: #FF8A80; }
    [data-theme^="dark"] .arch-badge.task { background: #1B3320; color: #A5D6A7; }
    [data-theme^="dark"] .arch-badge.goal { background: #2D1B6B; color: #D1C4E9; }
    [data-theme^="dark"] .arch-badge.note { background: #0D2A5C; color: #90CAF9; }
    [data-theme^="dark"] .sr-badge.task   { background: #1B3320; color: #A5D6A7; }
    [data-theme^="dark"] .sr-badge.goal   { background: #2D1B6B; color: #D1C4E9; }
    [data-theme^="dark"] .sr-badge.note   { background: #0D2A5C; color: #90CAF9; }
    [data-theme^="dark"] input[type="datetime-local"], [data-theme^="dark"] input[type="date"] { color-scheme: dark; }

    html { min-height: 100dvh; background: var(--bg); }
    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
      background: var(--bg); color: var(--text);
      min-height: 100vh; min-height: 100dvh;
      padding-bottom: 72px;
      overscroll-behavior: none;
      user-select: none; -webkit-user-select: none;
    }

    /* ── Header ── */
    .app-header {
      background: var(--surface); padding: 14px 16px 10px;
      padding-top: 14px;
      border-bottom: 0.5px solid var(--border);
      position: sticky; top: 0; z-index: 50;
    }
    .header-row { display: flex; justify-content: space-between; align-items: center; }
    .app-name {
      font-size: 26px; font-weight: 800; letter-spacing: -0.5px;
      background: linear-gradient(135deg, var(--logo-from), var(--logo-to));
      -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
      filter: drop-shadow(0 0 8px var(--logo-glow));
    }
    .header-right { display: flex; align-items: center; gap: 6px; }
    .header-date { font-size: 12px; color: var(--text2); font-weight: 500; }
    .icon-btn {
      background: var(--bg); border: none; width: 34px; height: 34px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 16px; cursor: pointer; transition: background 0.2s; color: var(--accent);
    }
    .icon-btn:active { background: var(--border); }
    .header-sub { font-size: 13px; color: var(--text2); margin-top: 2px; min-height: 18px; }

    /* ── Tab Bar ── */
    .tab-bar {
      position: fixed; bottom: 0; left: 0; right: 0;
      height: calc(72px + env(safe-area-inset-bottom));
      background: var(--surface);
      backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
      border-top: 0.5px solid var(--border);
      display: flex; align-items: flex-start; justify-content: space-around;
      padding: 8px 8px env(safe-area-inset-bottom); z-index: 100;
    }
    .tab-btn {
      flex: 1; background: none; border: none; padding: 4px 0;
      display: flex; flex-direction: column; align-items: center; gap: 3px;
      cursor: pointer; color: var(--text3); font-family: inherit; transition: color 0.2s; position: relative;
    }
    .tab-btn.active { color: var(--accent); }
    .tab-icon  { font-size: 20px; line-height: 1; }
    .tab-label { font-size: 10px; font-weight: 700; letter-spacing: 0.2px; }
    .tab-dot   { display: block; width: 4px; height: 4px; border-radius: 50%; background: transparent; }
    .tab-btn.active .tab-dot { background: var(--accent); }
    .tab-badge {
      position: absolute; top: 2px; right: calc(50% - 18px);
      background: var(--red); color: #fff; font-size: 9px; font-weight: 800;
      min-width: 15px; height: 15px; border-radius: 8px;
      display: flex; align-items: center; justify-content: center; padding: 0 3px;
    }
    .tab-badge:empty { display: none; }

    /* ── Sections ── */
    .section { display: none; }
    .section.active { display: block; }

    textarea, input, [contenteditable] { user-select: text; -webkit-user-select: text; }
    textarea.field, input.field {
      flex: 1; background: var(--bg); border: 1.5px solid var(--border);
      border-radius: var(--r-sm); padding: 10px 12px; font-size: 16px;
      font-family: inherit; color: var(--text); outline: none; resize: none;
      transition: border-color 0.2s; -webkit-appearance: none; appearance: none;
    }
    select.field {
      flex: 1; background: var(--bg); border: 1.5px solid var(--border);
      border-radius: var(--r-sm); padding: 10px 32px 10px 12px; font-size: 14px;
      font-family: inherit; color: var(--text); outline: none;
      transition: border-color 0.2s; -webkit-appearance: none; appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg width='12' height='7' viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236E6E73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: right 12px center;
    }
    textarea.field:focus, input.field:focus { border-color: var(--accent); }
    select.field:focus { border-color: var(--accent); }
    textarea.field::placeholder, input.field::placeholder { color: var(--text3); }
    .field.shake { animation: shake 0.4s ease; }
    input[type="datetime-local"].field { font-size: 13px; padding: 8px 10px; color-scheme: light; }
    .repeat-custom-row { display: none; align-items: center; gap: 8px; margin-top: 8px; }
    .repeat-custom-row .repeat-sub { font-size: 13px; color: var(--text2); white-space: nowrap; }
    .weekday-picker { display: flex; gap: 6px; padding: 4px 0; }
    .wday-btn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--border); background: none; font-size: 13px; font-weight: 700; color: var(--text2); cursor: pointer; font-family: inherit; transition: background 0.15s, border-color 0.15s, color 0.15s; flex-shrink: 0; }
    .wday-btn.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
    .monthday-picker { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 0; }
    .mday-btn { width: 36px; height: 30px; border-radius: 8px; border: 1.5px solid var(--border); background: none; font-size: 12px; font-weight: 600; color: var(--text2); cursor: pointer; font-family: inherit; transition: background 0.15s, border-color 0.15s, color 0.15s; }
    .mday-btn.sel { background: var(--accent); border-color: var(--accent); color: #fff; }

    /* ── Labels & Priority ── */
    .labels-mini-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 28px; }
    .lchip { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 100px; }
    .lchip-x { background: none; border: none; cursor: pointer; font-size: 14px; line-height: 1; color: inherit; padding: 0; opacity: 0.7; }
    .label-inp { border: none; background: none; font-size: 16px; font-family: inherit; color: var(--text2); outline: none; flex: 1; min-width: 100px; }
    .label-inp::placeholder { color: var(--text3); }
    .prow { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
    .prow-lbl { font-size: 13px; color: var(--text2); white-space: nowrap; }
    .pbtn {
      background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px;
      padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
      font-family: inherit; color: var(--text2); transition: all 0.15s; flex-shrink: 0;
    }
    .pbtn.p-none.sel   { background: var(--surface); border-color: var(--text3); color: var(--text); }
    .pbtn.p-low.sel    { background: #E0F7FA; border-color: #0097A7; color: #006064; }
    .pbtn.p-medium.sel { background: #FFF3E0; border-color: var(--orange); color: #E65100; }
    .pbtn.p-high.sel   { background: #FFEBEE; border-color: var(--red); color: var(--red); }

    /* ── Task Row Layout ── */
    .list { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 80px; }
    /* Inset grouped list container */
    .task-group { margin-bottom: 8px; }
    .task-group-header {
      font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px;
      color: var(--text3); padding: 0 4px 5px; margin-bottom: 0;
    }
    .task-group-header.pinned-header { color: var(--orange); }
    .task-group-header.overdue-header { color: var(--red); }
    .task-group-list {
      background: var(--surface); border-radius: 13px; overflow: hidden;
    }
    .task-card {
      display: flex; align-items: center; gap: 10px;
      padding: 11px 14px;
      position: relative; overflow: hidden;
      user-select: none; -webkit-user-select: none;
      cursor: pointer;
      transition: opacity 0.3s, transform 0.3s;
      border-bottom: 0.5px solid var(--border);
      background: var(--surface);
      touch-action: pan-y;
    }
    .task-card:last-child { border-bottom: none; }
    .task-card.completing { opacity: 0; transform: translateX(60px); transition: opacity 0.3s, transform 0.3s; }
    .task-card.sortable-ghost { opacity: 0.3; }
    .task-card.sortable-drag { background: var(--surface); box-shadow: 0 8px 28px rgba(0,0,0,0.14); z-index: 10; }
    /* Circle checkbox */
    .check-btn {
      width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border);
      background: none; cursor: pointer; flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 11px; color: transparent; transition: all 0.2s;
    }
    .check-btn.checking { background: var(--green); border-color: var(--green); color: #fff; }
    .check-btn.done-check { background: none; border-color: var(--border); color: var(--text3); }
    .task-body { flex: 1; min-width: 0; }
    .task-text { font-size: 14px; font-weight: 500; line-height: 1.35; word-break: break-word; unicode-bidi: plaintext; }
    .task-meta { font-size: 11px; color: var(--text3); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
    .task-meta-overdue { color: var(--red); font-weight: 600; }
    .task-meta-label { font-size: 11px; font-weight: 600; }
    .task-chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 5px; }
    .task-chip  { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 100px; cursor: pointer; }
    .rem-badge { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text2); margin-top: 4px; }
    .rem-badge.overdue { color: var(--red); font-weight: 600; }
    .rem-badge.soon    { color: var(--orange); }
    /* Priority dot */
    .priority-dot {
      width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    }
    .priority-dot.low    { background: #0097A7; }
    .priority-dot.medium { background: var(--orange); }
    .priority-dot.high   { background: var(--red); }
    /* Grip handle (reorder mode) */
    .row-grip { width: 16px; flex-shrink: 0; display: flex; flex-direction: column; gap: 3px; align-items: center; justify-content: center; cursor: grab; color: var(--text3); padding: 4px 0; }
    .row-grip span { display: block; width: 14px; height: 1.5px; background: currentColor; border-radius: 1px; }
    .row-grip:active { cursor: grabbing; }
    /* Done task styling */
    .task-card.done-card { opacity: 0.6; }
    .task-card.done-card .task-text { text-decoration: line-through; color: var(--text3); }
    /* Bulk select box */
    .select-box { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; transition: all 0.15s; }
    .select-box.sel { background: var(--accent); border-color: var(--accent); color: #fff; }
    .task-card.bulk-sel { background: var(--accent-dim); }
    /* Pinned card highlight */
    .task-card.pinned-card { background: rgba(255,149,0,0.04); }
    .del-btn  { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; padding: 6px; border-radius: 8px; flex-shrink: 0; line-height: 1; transition: color 0.2s, background 0.2s; }
    .del-btn:active { color: var(--red); background: #FFF0EF; }

    /* ── Section strip (universal thin strip below global header) ── */
    .sec-strip {
      background: var(--surface); border-bottom: 0.5px solid var(--border);
      padding: 7px 12px; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    }
    .sec-strip .seg-ctrl { flex: 1; margin-bottom: 0; }
    .th-btn {
      background: none; border: none; width: 32px; height: 32px; border-radius: 50%;
      display: flex; align-items: center; justify-content: center;
      font-size: 17px; cursor: pointer; transition: background 0.2s; flex-shrink: 0;
    }
    .th-btn:active { background: var(--border); }

    /* ── Segmented control ── */
    .seg-ctrl {
      display: flex; background: var(--border); border-radius: 10px; padding: 2px; gap: 0;
      position: relative;
    }
    .seg-btn {
      flex: 1; background: none; border: none; border-radius: 8px;
      padding: 6px 4px; font-size: 12px; font-weight: 600; font-family: inherit;
      color: var(--text3); cursor: pointer; transition: color 0.15s; position: relative; z-index: 1;
      white-space: nowrap;
    }
    .seg-btn.active {
      background: var(--surface); color: var(--text);
      box-shadow: 0 1px 4px rgba(0,0,0,0.12); border-radius: 8px;
    }
    [data-theme^="dark"] .seg-btn.active { box-shadow: 0 1px 4px rgba(0,0,0,0.4); }

    /* ── ⋯ Dropdown menu ── */
    .dots-menu-wrap { position: relative; }
    .dots-dropdown {
      position: absolute; top: calc(100% + 6px); right: 0;
      background: var(--surface); border-radius: 14px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.16); z-index: 200;
      min-width: 180px; overflow: hidden;
      animation: fadeUp 0.18s ease;
    }
    [data-theme^="dark"] .dots-dropdown { box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
    .dots-item {
      display: flex; align-items: center; gap: 10px;
      padding: 13px 16px; font-size: 15px; font-weight: 500;
      background: none; border: none; width: 100%; text-align: left;
      font-family: inherit; color: var(--text); cursor: pointer;
      transition: background 0.12s;
    }
    .dots-item:active { background: var(--bg); }
    .dots-item-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
    .dots-divider { height: 0.5px; background: var(--border); margin: 2px 0; }
    .dots-backdrop { position: fixed; inset: 0; z-index: 199; }

    /* ── Reorder mode subtitle ── */
    .tasks-reorder-sub { font-size: 11px; color: var(--text3); margin-bottom: 6px; text-align: center; }
    .done-pill {
      background: var(--accent); color: #fff; border: none;
      border-radius: 100px; padding: 6px 16px; font-size: 13px; font-weight: 700;
      font-family: inherit; cursor: pointer; transition: opacity 0.15s;
    }
    .done-pill:active { opacity: 0.8; }

    /* ── Swipe actions ── */
    .swipe-actions {
      position: absolute; right: 0; top: 0; bottom: 0;
      display: flex; align-items: stretch; transform: translateX(100%);
      pointer-events: none;
    }
    .swipe-action-btn {
      display: flex; align-items: center; justify-content: center;
      width: 56px; border: none; cursor: pointer; padding: 0;
    }
    .swipe-pin-btn { background: var(--swipe-pin-bg); }
    .swipe-del-btn { background: var(--swipe-del-bg); }
    .task-row-inner {
      display: contents;
    }

    /* ── Context menu (bottom sheet) ── */
    .ctx-backdrop { position: fixed; inset: 0; z-index: 499; background: rgba(0,0,0,0.45); }
    .ctx-menu {
      position: fixed; bottom: 0; left: 0; right: 0; z-index: 500;
      background: var(--surface); border-radius: 20px 20px 0 0;
      padding: 8px 0 calc(16px + env(safe-area-inset-bottom));
      overflow: hidden; animation: slideUp 0.25s cubic-bezier(0.32,0.72,0,1);
    }
    @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .ctx-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 8px auto 12px; }
    .ctx-task-title { font-size: 13px; font-weight: 600; color: var(--text2); padding: 0 16px 10px; border-bottom: 0.5px solid var(--border); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: start; }
    .ctx-item {
      display: flex; align-items: center; gap: 12px;
      padding: 14px 20px; font-size: 16px; font-weight: 500;
      background: none; border: none; width: 100%; text-align: left;
      font-family: inherit; color: var(--text); cursor: pointer;
      transition: background 0.12s;
    }
    .ctx-item:active { background: var(--bg); }
    .ctx-item.danger { color: var(--red); }
    .ctx-item-icon { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
    .ctx-item-icon.tint-default { background: #EBEBEB; color: #3C3C3E; }
    .ctx-item-icon.tint-accent  { background: var(--accent-dim); color: var(--accent); }
    .ctx-item-icon.tint-bell    { background: #FFF3E0; color: #E65100; }
    .ctx-item-icon.tint-green   { background: #E8F5E9; color: #2E7D32; }
    .ctx-item-icon.tint-archive { background: #E3F2FD; color: #0D47A1; }
    .ctx-item-icon.tint-gold    { background: #FFFDE7; color: #F9A825; }
    .ctx-item-icon.tint-teal    { background: #E0F7F4; color: #00796B; }
    .ctx-item-icon.tint-red     { background: #FFEBEE; color: var(--red); }
    [data-theme^="dark"] .ctx-item-icon.tint-default { background: #2C2C2E; color: #AEAEB2; }
    [data-theme^="dark"] .ctx-item-icon.tint-bell    { background: #3D2800; color: #FFB74D; }
    [data-theme^="dark"] .ctx-item-icon.tint-green   { background: #1B3320; color: #A5D6A7; }
    [data-theme^="dark"] .ctx-item-icon.tint-archive { background: #0D2A5C; color: #90CAF9; }
    [data-theme^="dark"] .ctx-item-icon.tint-gold    { background: #3D3000; color: #FFD54F; }
    [data-theme^="dark"] .ctx-item-icon.tint-teal    { background: #003D35; color: #4DB6AC; }
    [data-theme^="dark"] .ctx-item-icon.tint-red     { background: #4A1515; color: #FF6B6B; }
    .ctx-divider { height: 0.5px; background: var(--border); margin: 4px 0; }


    .overdue-banner { background: #FFEBEE; border: 1px solid #FFCDD2; border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: #B71C1C; font-weight: 600; cursor: pointer; }
    .overdue-banner span { flex: 1; }
    .no-filter-results { text-align: center; padding: 36px 20px; color: var(--text2); }
    .no-filter-results .empty-icon { font-size: 42px; margin-bottom: 10px; opacity: 0.6; }
    .no-filter-results p { font-size: 15px; line-height: 1.5; }
    .link-btn { background: none; border: none; color: var(--accent); font-size: 15px; cursor: pointer; font-family: inherit; text-decoration: underline; }

    /* ── Goal Cards ── */
    .goal-card { background: var(--surface); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); border-top: 3px solid var(--accent); }
    .goal-body { min-width: 0; }
    .goal-text { font-size: 15px; line-height: 1.6; word-break: break-word; unicode-bidi: plaintext; }
    .goal-meta { font-size: 12px; color: var(--text2); margin-top: 4px; }
    .goal-chips { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 6px; }
    .goal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; align-items: center; }
    .btn-achieved { background: var(--accent-dim); color: var(--accent); border: none; border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; transition: all 0.2s; }
    .btn-achieved:active { background: var(--accent); color: #fff; }

    /* ── Note Cards ── */
    .note-new-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; background: var(--accent); color: #fff; border: none; border-radius: var(--r); padding: 14px; font-size: 15px; font-weight: 700; font-family: inherit; cursor: pointer; margin-bottom: 16px; box-shadow: var(--shadow); transition: opacity 0.15s, transform 0.1s; }
    .note-new-btn:active { opacity: 0.8; transform: scale(0.98); }
    .note-card { background: var(--surface); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s; position: relative; overflow: hidden; }
    .note-card:active { transform: scale(0.98); }
    .note-card-title { font-size: 15px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
    .note-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
    .note-chip  { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 100px; }
    .note-preview { font-size: 13px; color: var(--text2); line-height: 1.4; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .note-card-footer { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
    .note-card.pin-border { border-left: 3px solid var(--accent); padding-left: 11px; }
    .list.list-grid { display: grid; grid-template-columns: 1fr 1fr; }
    .list.list-grid .note-card.pin-border { grid-column: 1 / -1; }

    /* ── Goal card v2 ── */
    .goal-card-v2 { background: var(--surface); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); border: 0.5px solid var(--border); cursor: pointer; transition: transform 0.15s; }
    .goal-card-v2:active { transform: scale(0.98); }
    .goal-card-v2.pin-border { border-left: 3px solid var(--accent); padding-left: 13px; }
    .gcv2-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
    .gcv2-emoji { font-size: 22px; line-height: 1; flex-shrink: 0; }
    .gcv2-title { font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .gcv2-progress { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
    .gcv2-track { flex: 1; height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; }
    .gcv2-fill { height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.3s; }
    .gcv2-fill.orange { background: var(--orange); }
    .gcv2-fill.green  { background: var(--green); }
    .gcv2-pct { font-size: 11px; font-weight: 700; color: var(--text3); min-width: 28px; text-align: right; }
    .gcv2-footer { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
    .gcv2-chip { display: flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: var(--bg); color: var(--text2); }
    .gcv2-chip.overdue { background: #FFF3E0; color: var(--orange); }
    [data-theme^="dark"] .gcv2-chip.overdue { background: #3D2800; }

    /* ── Goal editor extra fields ── */
    #gedExtra { flex-shrink: 0; overflow-y: auto; max-height: 45vh; }
    .ged-top-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 0.5px solid var(--border); flex-shrink: 0; }
    .ged-emoji-btn { font-size: 22px; line-height: 1; background: none; border: 1.5px solid var(--border); border-radius: 10px; padding: 4px 8px; cursor: pointer; font-family: inherit; }
    .ged-date-row { display: flex; align-items: center; gap: 6px; color: var(--text3); }
    .ged-date-lbl { font-size: 12px; font-weight: 600; color: var(--text3); white-space: nowrap; letter-spacing: 0.2px; }
    .ged-date-row input[type=date] { border: 1.5px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 13px; font-family: inherit; background: var(--bg); color: var(--text); height: 32px; box-sizing: border-box; }
    .ged-date-clear { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; padding: 0 2px; line-height: 1; opacity: 0.6; }
    .ged-progress-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--surface); border-bottom: 0.5px solid var(--border); flex-shrink: 0; }
    .ged-pct { font-size: 12px; font-weight: 700; color: var(--text2); min-width: 30px; text-align: right; }
    .ged-steps-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--surface); border-bottom: 0.5px solid var(--border); flex-shrink: 0; }
    .ged-steps-lbl { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: var(--text3); text-transform: uppercase; }
    .ged-steps-done { font-size: 12px; color: var(--text3); }
    .ged-step { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface); border-bottom: 0.5px solid var(--border); }
    .ged-cb { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: none; cursor: pointer; }
    .ged-cb.done { background: var(--green); border-color: var(--green); }
    .ged-step-body { flex: 1; min-width: 0; cursor: pointer; }
    .ged-step-text { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.3; }
    .ged-step-text.done { text-decoration: line-through; color: var(--text3); }
    .ged-step-bar-row { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
    .ged-step-track { flex: 1; height: 3px; background: var(--border); border-radius: 99px; overflow: hidden; }
    .ged-step-fill { height: 100%; border-radius: 99px; background: var(--accent); }
    .ged-step-ratio { font-size: 11px; font-weight: 700; color: var(--text3); white-space: nowrap; }
    .ged-step-del { background: none; border: none; color: var(--text3); padding: 4px 6px; cursor: pointer; flex-shrink: 0; line-height: 1; font-size: 18px; font-weight: 400; }
    .ged-step-del:active { color: var(--red); }
    .ged-step-done-row { opacity: 0.55; padding: 7px 16px; }
    .ged-step-done-row .ged-step-text { font-size: 13px; flex: 1; min-width: 0; }
    .ged-achieve-row { background: var(--green); color: #fff; padding: 13px 16px; font-size: 14px; font-weight: 600; text-align: center; cursor: pointer; flex-shrink: 0; }
    .ged-achieve-row:active { opacity: 0.85; }
    .ged-step-edit-wrap { flex: 1; min-width: 0; }
    .ged-step-inp { width: 100%; border: none; border-bottom: 1.5px solid var(--accent); background: transparent; font-family: inherit; font-size: 14px; font-weight: 500; color: var(--text); outline: none; padding: 2px 0; box-sizing: border-box; }
    .ged-step-edit-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--text3); }
    .ged-target-inp { width: 58px; border: 1.5px solid var(--border); border-radius: 8px; padding: 3px 6px; font-size: 13px; font-weight: 700; text-align: center; background: var(--bg); font-family: inherit; color: var(--text); }
    .ged-unit-inp { flex: 1; border: 1.5px solid var(--border); border-radius: 8px; padding: 3px 8px; font-size: 13px; background: var(--bg); font-family: inherit; color: var(--text); }
    .ged-step-done-btn { font-size: 12px; font-weight: 700; color: var(--accent); background: none; border: none; cursor: pointer; padding: 4px 8px; flex-shrink: 0; font-family: inherit; }
    .ged-log-row { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border-bottom: 0.5px solid var(--border); }
    .ged-log-inp { flex: 1; border: 1.5px solid var(--accent); border-radius: 10px; padding: 6px 10px; font-size: 16px; font-weight: 700; text-align: center; background: var(--bg); font-family: inherit; color: var(--text); }
    .ged-log-unit { font-size: 13px; color: var(--text3); white-space: nowrap; }
    .ged-log-done { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 6px 12px; font-size: 13px; font-weight: 700; font-family: inherit; cursor: pointer; }
    .ged-add-row { display: flex; background: var(--surface); border-bottom: 0.5px solid var(--border); }
    .ged-add-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 12px; background: none; border: none; font-size: 13px; font-weight: 600; color: var(--text2); cursor: pointer; font-family: inherit; }
    .ged-add-btn:first-child { border-right: 0.5px solid var(--border); }
    .ged-add-btn:active { background: var(--bg); }
    .step-plus-btn { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: var(--accent-dim); color: var(--accent); border: none; font-size: 20px; font-weight: 300; display: flex; align-items: center; justify-content: center; cursor: pointer; line-height: 1; }
    .ged-counter-pill { background: var(--accent-dim); border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; flex-shrink: 0; }
    .ged-counter-pill.done { background: color-mix(in srgb, var(--green) 15%, var(--surface)); color: var(--green); }
    .ged-done-toggle { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--surface); border-bottom: 0.5px solid var(--border); font-size: 13px; color: var(--text3); }
    .ged-show-btn { background: none; border: none; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; padding: 0; }
    /* ── Counter step edit sheet ── */
    .gcs-body { padding: 4px 0 8px; }
    .gcs-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; color: var(--text3); text-transform: uppercase; display: block; margin-bottom: 5px; margin-top: 14px; }
    .gcs-inp { width: 100%; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit; background: var(--bg); color: var(--text); box-sizing: border-box; outline: none; }
    .gcs-inp:focus { border-color: var(--accent); }
    .gcs-row { display: flex; gap: 12px; }
    .gcs-field { flex: 1; min-width: 0; }
    .gcs-prog-row { display: flex; align-items: center; gap: 10px; }
    .gcs-cur { width: 84px !important; flex-shrink: 0; text-align: center; font-weight: 700; font-size: 18px !important; }
    .gcs-of { font-size: 14px; color: var(--text3); white-space: nowrap; }
    .gcs-compl-lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; color: var(--text3); text-transform: uppercase; }
    .gcs-compl-val { font-size: 22px; font-weight: 800; color: var(--accent); line-height: 1.1; }
    .gcs-save { width: 100%; padding: 15px; border-radius: var(--r-sm); border: none; font-size: 17px; font-weight: 700; font-family: inherit; cursor: pointer; background: var(--accent); color: #fff; margin-top: 20px; }
    .gcs-save:active { opacity: 0.85; }
    .gcs-delete { width: 100%; padding: 10px; border: none; background: none; font-size: 15px; color: var(--red); cursor: pointer; font-family: inherit; margin-top: 6px; }

    /* ── Note Editor ── */
    .note-editor-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 400; display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.32s cubic-bezier(0.32,0.72,0,1); }
    .note-editor-overlay.open { transform: translateX(0); }
    .editor-nav { background: var(--surface); border-bottom: 0.5px solid var(--border); padding: 12px 14px; padding-top: 12px; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
    .editor-back { background: none; border: none; font-size: 15px; color: var(--accent); cursor: pointer; padding: 6px 8px; border-radius: 8px; font-family: inherit; font-weight: 600; display: flex; align-items: center; gap: 2px; white-space: nowrap; transition: background 0.15s; flex-shrink: 0; }
    .editor-back:active { background: var(--accent-dim); }
    .editor-nav-title { flex: 1; font-size: 15px; font-weight: 700; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .editor-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; margin-left: auto; }
    .editor-save { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 7px 14px; font-size: 14px; font-weight: 700; font-family: inherit; cursor: pointer; transition: opacity 0.15s; }
    .editor-save:active { opacity: 0.75; }
    .editor-icon-btn { background: none; border: none; cursor: pointer; padding: 6px; border-radius: 8px; color: var(--text3); display: flex; align-items: center; justify-content: center; transition: background 0.15s, color 0.15s; }
    .editor-icon-btn:hover { background: var(--bg); color: var(--text2); }
    .editor-icon-btn:active { background: var(--border); }
    .editor-icon-btn.danger:hover { color: var(--red); background: #FFF0EF; }
    [data-theme^="dark"] .editor-icon-btn.danger:hover { background: #3B0A0A; }
    .editor-icon-btn.active { color: var(--accent); }
    .editor-icon-btn.active svg path { fill: var(--accent); stroke: var(--accent); }
    .editor-icon-btn.active svg line { stroke: var(--accent); }
    .editor-body { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
    .ed-title-wrap { background: var(--surface); border-bottom: 0.5px solid var(--border); padding: 12px 16px; flex-shrink: 0; }
    .ed-title-input { width: 100%; border: none; background: none; font-size: 22px; font-weight: 700; font-family: inherit; color: var(--text); outline: none; unicode-bidi: plaintext; }
    .ed-title-input::placeholder { color: var(--text3); font-weight: 400; }
    .ed-labels-wrap { background: var(--surface); border-bottom: 0.5px solid var(--border); padding: 8px 14px; flex-shrink: 0; }
    .labels-row { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 30px; }
    .editor-toolbar { background: var(--surface); border-bottom: 0.5px solid var(--border); padding: 5px 10px; display: flex; gap: 2px; overflow-x: auto; flex-shrink: 0; -webkit-overflow-scrolling: touch; }
    .editor-toolbar::-webkit-scrollbar { display: none; }
    .tbtn { min-width: 36px; height: 36px; background: none; border: none; border-radius: 8px; cursor: pointer; font-family: inherit; font-size: 14px; color: var(--text); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: background 0.12s, color 0.12s; }
    .tbtn:active { background: var(--accent-dim); color: var(--accent); }
    .tbtn-sep { width: 1px; height: 22px; background: var(--border); margin: 7px 3px; flex-shrink: 0; }
    .md-row { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
    .md-split { flex: 1; overflow: hidden; display: grid; grid-template-rows: 1fr; }
    .md-input {
      width: 100%;
      height: 100%;
      border: none;
      background: transparent;
      padding: 14px 16px;
      font-size: 16px;
      line-height: 1.65;
      font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
      color: var(--text);
      outline: none;
      resize: none;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      unicode-bidi: plaintext;
    }
    .md-input::placeholder { color: var(--text3); }
    .md-preview {
      height: 100%;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      padding: 14px 16px;
      font-size: 16px;
      line-height: 1.7;
      color: var(--text);
      display: none;
    }
    .md-preview.active { display: block; }
    .md-input.hidden { display: none; }
    .md-hint { font-size: 12px; color: var(--text3); padding: 8px 16px; border-top: 0.5px solid var(--border); background: var(--surface); }

    /* ── Markdown typography ── */
    .md h1 { font-size: 22px; line-height: 1.2; margin: 10px 0 8px; }
    .md h2 { font-size: 19px; line-height: 1.25; margin: 10px 0 6px; }
    .md h3 { font-size: 17px; line-height: 1.25; margin: 10px 0 6px; }
    .md p { margin: 8px 0; }
    .md a { color: var(--accent); text-decoration: underline; }
    .md code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.92em; background: var(--bg); border: 1px solid var(--border); padding: 1px 6px; border-radius: 8px; }
    .md pre { background: var(--bg); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; overflow-x: auto; }
    .md pre code { background: transparent; border: none; padding: 0; }
    .md ul, .md ol { padding-left: 22px; margin: 8px 0; }
    .md li { margin: 4px 0; }
    .md blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--text2); margin: 10px 0; }
    .md hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
    .md .md-todo { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
    .md .md-todo .box { width: 20px; text-align: center; flex-shrink: 0; opacity: 0.9; cursor: pointer; user-select: none; -webkit-user-select: none; font-size: 18px; }
    .md .md-todo.done { opacity: 0.75; }
    .md .md-todo.done .text { text-decoration: line-through; color: var(--text3); }

    /* ── Archive ── */
    .btn-clear { background: none; border: 1.5px solid var(--red); color: var(--red); border-radius: 8px; padding: 5px 12px; font-size: 12px; font-weight: 700; font-family: inherit; cursor: pointer; transition: all 0.2s; }
    .btn-clear:active { background: var(--red); color: #fff; }
    .icon-toggle { background: none; border: none; cursor: pointer; padding: 5px 6px; border-radius: 8px; color: var(--text3); display: flex; align-items: center; justify-content: center; transition: color 0.15s, background 0.15s; }
    .icon-toggle:active { background: var(--border); }
    .icon-toggle.active { color: var(--accent); }
    .archive-list-wrap { background: var(--surface); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); margin-bottom: 0; }
    .arch-group-header { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; padding: 14px 4px 6px; }
    #archiveList > .archive-list-wrap + .arch-group-header { margin-top: 4px; }
    .archive-card { background: transparent; border-radius: 0; padding: 11px 14px; box-shadow: none; display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden; border-bottom: 0.5px solid var(--border); }
    .archive-card:last-child { border-bottom: none; }
    .arch-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 4px 8px; border-radius: 6px; flex-shrink: 0; }
    .arch-badge.task { background: #E8F5E9; color: #1B5E20; }
    .arch-badge.goal { background: var(--accent-dim); color: var(--accent); }
    .arch-badge.note { background: #E3F2FD; color: #0D47A1; }
    .arch-body { flex: 1; min-width: 0; }
    .arch-text { font-size: 14px; font-weight: 500; line-height: 1.35; word-break: break-word; unicode-bidi: plaintext; color: var(--text2); }
    .arch-date { font-size: 11px; color: var(--arch-date-color); margin-top: 2px; }
    .restore-btn { background: none; border: none; color: var(--text3); cursor: pointer; padding: 6px; border-radius: 8px; flex-shrink: 0; line-height: 0; display: flex; align-items: center; transition: background 0.15s, color 0.15s; }
    .restore-btn:hover { background: var(--bg); color: var(--text2); }
    .restore-btn:active { background: var(--border); }
    .arch-count { font-size: 11px; font-weight: 600; color: var(--accent); background: rgba(91,79,233,0.12); border-radius: 20px; padding: 2px 8px; margin-left: 4px; }
    .done-date { font-size: 11px; color: var(--text3); margin-top: 2px; }
    .history-badge { font-size: 11px; font-weight: 600; color: var(--accent); background: rgba(91,79,233,0.12); border: none; border-radius: 20px; padding: 2px 8px; cursor: pointer; font-family: inherit; margin-top: 3px; display: inline-block; }
    /* History sheet */
    .history-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 800; display: flex; align-items: flex-end; }
    .history-sheet { background: var(--surface); border-radius: 20px 20px 0 0; width: 100%; max-height: 82vh; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
    .hist-handle { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto 16px; }
    .hist-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; unicode-bidi: plaintext; text-align: start; }
    .hist-stats { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 0.5px solid var(--border); }
    .hist-section-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
    .hist-date-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 0.5px solid var(--border); gap: 8px; }
    .hist-date-row:last-child { border-bottom: none; }
    .hist-date-text { font-size: 14px; color: var(--text); flex: 1; }
    .hist-date-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
    .hist-actions { display: flex; gap: 6px; flex-shrink: 0; }
    .hist-btn { border: none; background: none; color: var(--text3); border-radius: 8px; padding: 5px 7px; cursor: pointer; font-family: inherit; display: flex; align-items: center; justify-content: center; transition: color 0.15s; }
    .hist-btn:active { color: var(--text); }
    .hist-remove { font-size: 18px; font-weight: 400; line-height: 1; }
    .hist-close-btn { width: 100%; margin-top: 16px; padding: 13px; background: var(--border); color: var(--text); font-size: 15px; font-weight: 600; border: none; border-radius: 12px; cursor: pointer; font-family: inherit; }

    /* ── Empty State ── */
    .empty { text-align: center; padding: 44px 20px; color: var(--text2); }
    .empty-icon { font-size: 52px; margin-bottom: 12px; opacity: 0.55; }
    .empty p { font-size: 15px; line-height: 1.5; }

    /* ── Calendar ── */
    .cal-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 300; display: flex; flex-direction: column; transform: translateY(100%); transition: transform 0.32s cubic-bezier(0.32,0.72,0,1); }
    .cal-overlay.open { transform: translateY(0); }
    .cal-nav { background: var(--surface); border-bottom: 0.5px solid var(--border); padding: 12px 16px; padding-top: 12px; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    .cal-close { background: none; border: none; font-size: 15px; color: var(--accent); cursor: pointer; padding: 6px 8px; border-radius: 8px; font-family: inherit; font-weight: 600; flex-shrink: 0; transition: background 0.15s; }
    .cal-close:active { background: var(--accent-dim); }
    .cal-nav-title { flex: 1; font-size: 16px; font-weight: 700; text-align: center; }
    .cal-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px; }
    .cal-month-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
    .cal-arrow { background: var(--surface); border: none; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; box-shadow: var(--shadow); color: var(--accent); transition: background 0.15s; }
    .cal-arrow:active { background: var(--accent-dim); }
    .cal-month-lbl { font-size: 18px; font-weight: 700; }
    .cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; margin-bottom: 6px; }
    .cal-wd { font-size: 11px; font-weight: 700; color: var(--text3); padding: 4px 0; }
    .cal-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
    .cal-cell { aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500; position: relative; transition: background 0.15s; }
    .cal-cell.empty { cursor: default; }
    .cal-cell:not(.empty):active { background: var(--accent-dim); }
    .cal-cell.today    { background: var(--accent-dim); color: var(--accent); font-weight: 800; }
    .cal-cell.selected { background: var(--accent) !important; color: #fff !important; }
    .cal-cell.has-tasks::after { content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
    .cal-cell.today.has-tasks::after, .cal-cell.selected::after { background: #fff; }
    .cal-cell.has-tasks:not(.has-done)::after { left: 50%; }
    .cal-cell.has-tasks.has-done::after { left: calc(50% - 5px); }
    .cal-cell.has-done::before { content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
    .cal-cell.has-tasks.has-done::before { left: calc(50% + 5px); }
    .cal-cell.today.has-done::before, .cal-cell.selected.has-done::before { background: rgba(255,255,255,0.85); }
    .cal-day-panel { background: var(--surface); border-radius: var(--r); padding: 14px 16px; margin-top: 16px; box-shadow: var(--shadow); }
    .cal-day-title { font-size: 13px; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
    .cal-task-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 0.5px solid var(--border); }
    .cal-task-row:last-child { border-bottom: none; padding-bottom: 0; }
    .cal-task-time { font-size: 12px; color: var(--accent); font-weight: 600; flex-shrink: 0; min-width: 58px; }
    .cal-task-txt  { font-size: 14px; line-height: 1.35; unicode-bidi: plaintext; }
    .cal-no-tasks  { font-size: 14px; color: var(--text2); text-align: center; padding: 8px 0; }

    /* ── Search ── */
    .search-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 300; display: flex; flex-direction: column; transform: translateY(-100%); transition: transform 0.32s cubic-bezier(0.32,0.72,0,1); }
    .search-overlay.open { transform: translateY(0); }
    .search-header { background: var(--surface); border-bottom: 0.5px solid var(--border); padding: 12px 14px; padding-top: 12px; display: flex; flex-direction: column; gap: 0; flex-shrink: 0; }
    .search-bar { flex: 1; display: flex; align-items: center; gap: 8px; background: var(--bg); border-radius: 12px; padding: 8px 12px; }
    .search-bar span { font-size: 15px; }
    .search-inp { flex: 1; border: none; background: none; font-size: 16px; font-family: inherit; color: var(--text); outline: none; }
    .search-inp::placeholder { color: var(--text3); }
/* Search inline filter */
    .search-inp-clear { background: none; border: none; color: var(--text3); font-size: 18px; line-height: 1; padding: 0 2px; cursor: pointer; display: flex; align-items: center; flex-shrink: 0; }
    .sf-toggle { background: none; border: 1.5px solid var(--border); border-radius: 100px; padding: 4px 10px; font-size: 12px; font-weight: 600; font-family: inherit; color: var(--text2); cursor: pointer; white-space: nowrap; transition: all 0.15s; flex-shrink: 0; }
    .sf-toggle.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
    .sf-chips-row { display: flex; align-items: center; padding: 5px 14px; border-bottom: 0.5px solid var(--border); background: var(--surface); flex-shrink: 0; }
    .sf-chips { display: flex; flex-wrap: wrap; gap: 4px; }
    .sf-chip { background: var(--accent-dim); color: var(--accent); font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 100px; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
    .sf-chip-x { background: none; border: none; cursor: pointer; color: inherit; font-size: 13px; padding: 0; line-height: 1; }
    .sf-panel { background: var(--surface); border-bottom: 0.5px solid var(--border); padding: 12px 14px 14px; flex-shrink: 0; }
    .sf-section { margin-bottom: 12px; }
    .sf-lbl { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 7px; }
    .sf-label-chips { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
    .sf-type-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .date-clear-btn { background: none; border: none; color: var(--text3); font-size: 16px; cursor: pointer; padding: 0 4px; line-height: 1; flex-shrink: 0; }
    .date-inp-wrap { position: relative; flex: 1; display: flex; align-items: center; }
    .date-inp-wrap .date-inp { width: 100%; padding-right: 28px; }
    .date-inp-wrap .date-clear-btn { position: absolute; right: 4px; padding: 0 4px; }
    .sf-type-chip { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 4px 10px; border-radius: 6px; cursor: pointer; border: 1.5px solid transparent; transition: all 0.15s; flex-shrink: 0; }
    .sf-type-chip.tasks   { background: var(--chip-tasks-bg);   color: var(--chip-tasks-fg); }
    .sf-type-chip.goals   { background: var(--chip-goals-bg);   color: var(--chip-goals-fg); }
    .sf-type-chip.notes   { background: var(--chip-notes-bg);   color: var(--chip-notes-fg); }
    .sf-type-chip.archive { background: var(--chip-archive-bg); color: var(--chip-archive-fg); }
    .sf-type-chip.sel { border-color: currentColor; outline: 2px solid currentColor; outline-offset: 1px; }
    .search-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px; }
    .sr-section { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin: 14px 0 6px; }
    .sr-section:first-child { margin-top: 0; }
    .sr-card { background: var(--surface); border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 6px; cursor: pointer; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; transition: transform 0.15s; }
    .sr-card:active { transform: scale(0.98); }
    .sr-ico  { font-size: 20px; flex-shrink: 0; }
    .sr-body { flex: 1; min-width: 0; }
    .sr-title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; }
    .sr-sub   { font-size: 12px; color: var(--text2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .sr-badge { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 7px; border-radius: 5px; flex-shrink: 0; }
    .sr-badge.task { background: #E8F5E9; color: #1B5E20; }
    .sr-badge.goal { background: var(--accent-dim); color: var(--accent); }
    .sr-badge.note { background: #E3F2FD; color: #0D47A1; }
    .sr-badge.arch { background: #F3F0FF; color: #5B4FE9; }

    /* ── Notification ── */
    .notif-banner { position: fixed; top: 12px; left: 12px; right: 12px; background: #1C1C1E; color: #fff; border-radius: 14px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; z-index: 999; box-shadow: 0 8px 28px rgba(0,0,0,0.35); cursor: pointer; transform: translateY(calc(-100% - 20px)); opacity: 0; transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s; }
    .notif-banner.show { transform: translateY(0); opacity: 1; }
    .notif-big { font-size: 28px; flex-shrink: 0; }
    .notif-title { font-size: 14px; font-weight: 700; }
    .notif-msg { font-size: 13px; color: rgba(255,255,255,0.72); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    /* ── Sheets ── */
    .sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 600; display: none; align-items: flex-end; }
    .sheet-overlay.open { display: flex; }
    .sheet { background: var(--surface); border-radius: 20px 20px 0 0; padding: 24px 20px calc(20px + env(safe-area-inset-bottom)); width: 100%; }
    .sheet-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
    .sheet-body  { font-size: 15px; color: var(--text2); line-height: 1.4; margin-bottom: 24px; }
    .sheet-btns  { display: flex; flex-direction: column; gap: 10px; }
    .sht-btn { width: 100%; padding: 15px; border-radius: var(--r-sm); border: none; font-size: 17px; font-weight: 700; font-family: inherit; cursor: pointer; transition: opacity 0.15s; }
    .sht-btn:active { opacity: 0.75; }
    .sht-btn.confirm { background: var(--accent); color: #fff; }
    .sht-btn.danger-confirm { background: var(--red); }
    .sht-btn.cancel  { background: var(--bg); color: var(--text); }

    /* ── Goal achieved modal ── */
    .goal-achieved-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 700; display: none; align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; }
    .goal-achieved-overlay.open { display: flex; }
    .goal-achieved-modal { background: var(--accent); border-radius: 22px; padding: 32px 24px 24px; text-align: center; max-width: 320px; width: 100%; box-shadow: 0 24px 64px rgba(0,0,0,0.5); }
    .gam-trophy { font-size: 54px; line-height: 1; margin-bottom: 14px; }
    .gam-title { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 8px; }
    .gam-sub { font-size: 14px; color: rgba(255,255,255,0.82); line-height: 1.55; margin-bottom: 24px; }
    .gam-sub strong { color: #fff; font-weight: 700; }
    .goal-achieved-modal .sheet-btns { gap: 10px; }
    .goal-achieved-modal .sht-btn.confirm { background: #fff; color: var(--accent); }
    .goal-achieved-modal .sht-btn.cancel  { background: rgba(255,255,255,0.18); color: #fff; }

    /* ── Goal card grid view ── */
    .gcv2-pct-big { font-size: 36px; font-weight: 800; color: var(--accent); line-height: 1; margin: 4px 0 2px; }
    .gcv2-pct-big.green  { color: var(--green); }
    .gcv2-pct-big.orange { color: var(--orange, #f59e0b); }
    .list-grid .gcv2-progress { display: none; }
    .list-grid .gcv2-pct-big-wrap { display: block; }
    .gcv2-pct-big-wrap { display: none; }

    .adv-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 550; display: none; align-items: flex-end; }
    .adv-sheet-overlay.open { display: flex; }
    .adv-sheet { background: var(--surface); border-radius: 20px 20px 0 0; padding: 12px 20px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .adv-sheet-handle { width: 40px; height: 5px; background: var(--border); border-radius: 99px; margin: 0 auto 16px; cursor: grab; flex-shrink: 0; }
    .adv-sheet-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
    .adv-sheet-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text3); }
    .ged-emoji-inp { font-size: 22px; line-height: 1; border: 1.5px solid var(--accent); border-radius: 10px; padding: 4px 8px; font-family: inherit; background: none; color: var(--text); width: 56px; text-align: center; outline: none; }
    .adv-section { margin-bottom: 18px; }
    .adv-lbl { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 8px; }
    .adv-search { width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; font-size: 16px; font-family: inherit; color: var(--text); background: var(--bg); outline: none; -webkit-appearance: none; }
    .adv-search:focus { border-color: var(--accent); }
    .adv-chips { display: flex; flex-wrap: wrap; gap: 6px; }
    .adv-chip { font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 100px; cursor: pointer; border: 2px solid transparent; transition: all 0.15s; }
    .adv-chip.sel { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
    .date-pair { display: flex; flex-direction: column; gap: 8px; }
    .date-pair-row { display: flex; align-items: center; gap: 8px; }
    .date-pair-row label { font-size: 13px; color: var(--text2); white-space: nowrap; width: 36px; }
    .date-inp { flex: 1; border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; font-size: 13px; font-family: inherit; color: var(--text); background: var(--bg); outline: none; -webkit-appearance: none; }
    .date-inp:focus { border-color: var(--accent); }
    .sort-opts { display: flex; gap: 6px; flex-wrap: wrap; }
    .sort-opt { background: var(--bg); border: 1.5px solid var(--border); border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; color: var(--text2); transition: all 0.15s; }
    .sort-opt.sel { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
    .adv-apply { width: 100%; background: var(--accent); color: #fff; border: none; border-radius: var(--r-sm); padding: 14px; font-size: 16px; font-weight: 700; font-family: inherit; cursor: pointer; transition: opacity 0.15s; }
    .adv-apply:active { opacity: 0.75; }
    .adv-reset { width: 100%; background: none; border: none; color: var(--text2); font-size: 14px; font-family: inherit; cursor: pointer; padding: 10px; margin-top: 4px; }

    .edit-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 550; display: none; align-items: flex-end; }
    .edit-sheet-overlay.open { display: flex; }
    .edit-sheet { background: var(--surface); border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .edit-sheet-title { font-size: 17px; font-weight: 700; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
    .edit-sheet-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text3); }
    .edit-delete-btn { width: 100%; margin-top: 8px; background: none; border: none; color: var(--red); font-size: 15px; font-weight: 500; font-family: inherit; cursor: pointer; padding: 10px; border-radius: var(--r-sm); transition: background 0.15s; }
    .edit-delete-btn:active { background: #FFF0EF; }
    .edit-section { margin-bottom: 14px; }
    .edit-lbl { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 6px; }
    .edit-field { width: 100%; border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 10px 12px; font-size: 16px; font-family: inherit; color: var(--text); background: var(--bg); outline: none; -webkit-appearance: none; color-scheme: light; }
    [data-theme^="dark"] .edit-field { color-scheme: dark; }
    .edit-field:focus { border-color: var(--accent); }
    textarea.edit-field { resize: none; }


    /* ── Pin button ── */
    .pin-btn { background: none; border: none; color: var(--text3); cursor: pointer; padding: 4px 5px; border-radius: 8px; flex-shrink: 0; line-height: 0; transition: color 0.15s, background 0.15s; display: flex; align-items: center; }
    .pin-btn.pinned { color: var(--orange); }
    .pin-btn:hover { background: var(--bg); color: var(--text2); }
    .pin-btn.pinned:hover { color: var(--orange); }
    .pin-btn:active { color: var(--accent); }

    /* ── Done section ── */
    .done-section { margin-top: 8px; }
    .done-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
    .done-toggle { display: flex; justify-content: space-between; align-items: center; width: 100%; background: var(--surface); border: none; border-radius: var(--r-sm); padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--text2); cursor: pointer; font-family: inherit; }
    .done-toggle:active { background: var(--border); }
    .done-archive-all { font-size: 11px; font-weight: 600; color: var(--text3); opacity: 0.8; }
    .done-toggle-left { display: flex; align-items: center; gap: 6px; }

    /* ── Animations ── */
    @keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes shake  { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
    .goal-card, .note-card, .archive-card { animation: fadeUp 0.25s ease; }
  /* ── Note colors ──────────────────────────────────────────────────────────── */
  /* Old color system removed - using theme-based note-1 through note-8 variables */
  .goal-card-v2.note-1 { background: color-mix(in srgb, var(--note-1) 20%, var(--surface)); }
  .goal-card-v2.note-2 { background: color-mix(in srgb, var(--note-2) 20%, var(--surface)); }
  .goal-card-v2.note-3 { background: color-mix(in srgb, var(--note-3) 20%, var(--surface)); }
  .goal-card-v2.note-4 { background: color-mix(in srgb, var(--note-4) 20%, var(--surface)); }
  .goal-card-v2.note-5 { background: color-mix(in srgb, var(--note-5) 20%, var(--surface)); }
  .goal-card-v2.note-6 { background: color-mix(in srgb, var(--note-6) 20%, var(--surface)); }
  .goal-card-v2.note-7 { background: color-mix(in srgb, var(--note-7) 20%, var(--surface)); }
  .goal-card-v2.note-8 { background: color-mix(in srgb, var(--note-8) 20%, var(--surface)); }
  .note-card.note-1 { background: color-mix(in srgb, var(--note-1) 20%, var(--surface)); }
  .note-card.note-2 { background: color-mix(in srgb, var(--note-2) 20%, var(--surface)); }
  .note-card.note-3 { background: color-mix(in srgb, var(--note-3) 20%, var(--surface)); }
  .note-card.note-4 { background: color-mix(in srgb, var(--note-4) 20%, var(--surface)); }
  .note-card.note-5 { background: color-mix(in srgb, var(--note-5) 20%, var(--surface)); }
  .note-card.note-6 { background: color-mix(in srgb, var(--note-6) 20%, var(--surface)); }
  .note-card.note-7 { background: color-mix(in srgb, var(--note-7) 20%, var(--surface)); }
  .note-card.note-8 { background: color-mix(in srgb, var(--note-8) 20%, var(--surface)); }

  /* 1. LIGHT MODE: Neutral Milk */
  :root[data-theme='light'] {
    /* Core UI */
    --bg: #F5F5F7;
    --surface: #FFFFFF;
    --text: #1D1D1F;
    --accent: #A855F7; --accent-dim: #F3E8FF;
    --logo-from: #A855F7; --logo-to: #7C3AED; --logo-glow: rgba(168,85,247,0.0);

  }

  /* 2. DARK MODE: Nordic Night (Base) */
  :root[data-theme='dark-nordic'] {
    --bg: #2E3440;
    --surface: #3B4252;
    --text: #ECEFF4;
    --accent: #B48EAD; --accent-dim: #3A2D38;
    --logo-from: #B48EAD; --logo-to: #81A1C1; --logo-glow: rgba(180,142,173,0.55);

  }

  /* 3. DARK MODE: Midnight Velvet (Violet Accent) */
  :root[data-theme='dark-velvet'] {
    --bg: #121214;
    --surface: #1E1E22;
    --text: #E1E1E1;
    --accent: #BB86FC; --accent-dim: #2D1B4E;
    --logo-from: #BB86FC; --logo-to: #7C4DFF; --logo-glow: rgba(187,134,252,0.6);

  }

  /* ── Section toolbar (notes/goals) ───────────────────────────────────────── */
  .sec-sort { font-size:13px; font-family:inherit; background:var(--bg); border:none; border-radius:10px; padding:5px 26px 5px 10px; color:var(--text2); cursor:pointer; flex:1; -webkit-appearance:none; appearance:none; background-image:url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236E6E73' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 8px center; }
  .sec-icon-btn { background:var(--bg); border:none; border-radius:10px; padding:5px 9px; font-size:14px; cursor:pointer; color:var(--text2); transition:background 0.15s,color 0.15s; }
  .sec-icon-btn.active { background:var(--accent-dim); color:var(--accent); }

  /* ── Color picker ──────────────────────────────────────────────────────────── */
  .color-row { display:flex; gap:7px; padding:10px 0 4px; flex-wrap:wrap; }
  .color-swatch { width:24px; height:24px; border-radius:50%; border:2.5px solid transparent; cursor:pointer; transition:transform 0.15s,border-color 0.15s; flex-shrink:0; }
  .color-swatch:active { transform:scale(0.88); }
  .color-swatch.sel { border-color:var(--accent); transform:scale(1.15); }
  .color-swatch.note-default { background:var(--surface); border-color:var(--border); }

  /* ── Card MD preview ──────────────────────────────────────────────────────── */
  .card-md-preview { max-height: 72px; overflow: hidden; pointer-events: none; font-size: 13px; color: var(--text2); line-height: 1.45; margin-top: 6px; mask-image: linear-gradient(to bottom, black 40%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%); }
  .card-md-preview.expanded { max-height: none; mask-image: none; -webkit-mask-image: none; }
  .card-md-preview p, .card-md-preview li { margin: 0; }
  .card-md-preview h1,.card-md-preview h2,.card-md-preview h3 { font-size: 13px; font-weight: 700; margin: 0; }
  .expand-btn { background: none; border: none; font-size: 11px; color: var(--accent); cursor: pointer; padding: 2px 0; margin-top: 2px; font-family: inherit; font-weight: 600; }

  /* ── Task colors ─────────────────────────────────────────────────────────── */
  .task-card.note-1 { background: color-mix(in srgb, var(--note-1) 20%, var(--surface)); }
  .task-card.note-2 { background: color-mix(in srgb, var(--note-2) 20%, var(--surface)); }
  .task-card.note-3 { background: color-mix(in srgb, var(--note-3) 20%, var(--surface)); }
  .task-card.note-4 { background: color-mix(in srgb, var(--note-4) 20%, var(--surface)); }
  .task-card.note-5 { background: color-mix(in srgb, var(--note-5) 20%, var(--surface)); }
  .task-card.note-6 { background: color-mix(in srgb, var(--note-6) 20%, var(--surface)); }
  .task-card.note-7 { background: color-mix(in srgb, var(--note-7) 20%, var(--surface)); }
  .task-card.note-8 { background: color-mix(in srgb, var(--note-8) 20%, var(--surface)); }

  /* ── Subtasks ──────────────────────────────────────────────────────────────── */
  .subtask-list { display: flex; flex-direction: column; gap: 2px; }
  .subtask-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
  .subtask-row:last-child { border-bottom: none; }
  .subtask-check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border); background: none; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: transparent; transition: all 0.15s; }
  .subtask-check.done { background: var(--green); border-color: var(--green); color: #fff; }
  .subtask-text { flex: 1; font-size: 14px; color: var(--text); min-width: 0; word-break: break-word; }
  .subtask-text.done { text-decoration: line-through; color: var(--text3); }
  .subtask-del { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; flex-shrink: 0; }
  .subtask-add-row { display: flex; gap: 8px; margin-top: 8px; }
  .subtask-inp { flex: 1; background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--r-sm); padding: 8px 10px; font-size: 16px; font-family: inherit; color: var(--text); outline: none; transition: border-color 0.2s; }
  .subtask-inp:focus { border-color: var(--accent); }
  .subtask-add-btn { background: var(--accent); color: #fff; border: none; border-radius: var(--r-sm); padding: 8px 14px; font-size: 18px; font-weight: 400; font-family: inherit; cursor: pointer; line-height: 1; }
  /* Progress bar on task card */
  .task-progress { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
  .task-progress-bar { flex: 1; height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; }
  .task-progress-fill { height: 100%; background: var(--green); border-radius: 2px; transition: width 0.3s; }
  .task-progress-lbl { font-size: 11px; color: var(--text3); white-space: nowrap; }

  /* ── Streak badge ──────────────────────────────────────────────────────────── */
  .streak-badge { display: inline-flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--orange); background: rgba(255,149,0,0.12); border-radius: 100px; padding: 2px 7px; margin-top: 4px; }

  /* ── Bulk action strip (inside tasksStrip when bulk mode active) ── */
  .bulk-count { font-size: 13px; font-weight: 600; color: var(--text2); white-space: nowrap; }
  .bulk-btn { background: none; border: 1.5px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 12px; font-weight: 600; font-family: inherit; color: var(--text2); cursor: pointer; white-space: nowrap; }
  .bulk-btn.danger { color: var(--red); border-color: var(--red); }

  /* ── Settings ──────────────────────────────────────────────────────────────── */
  .settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 2px; border-bottom: 1px solid var(--border); }
  .settings-row:last-child { border-bottom: none; }
  .settings-lbl { font-size: 15px; color: var(--text); font-weight: 500; }
  .settings-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
  .settings-action { width: 100%; text-align: left; padding: 14px 2px; border: none; border-bottom: 1px solid var(--border); background: none; font-size: 15px; font-weight: 500; font-family: inherit; color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
  .settings-action.danger { color: var(--red); }
  .toggle-sw { width: 44px; height: 26px; border-radius: 13px; background: var(--border); border: none; cursor: pointer; position: relative; transition: background 0.2s; flex-shrink: 0; }
  .toggle-sw.on { background: var(--accent); }
  .toggle-sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s; }
  .toggle-sw.on::after { transform: translateX(18px); }
  .settings-select { font-size: 13px; font-weight: 600; color: var(--text2); background: var(--bg); border: none; border-radius: 8px; padding: 6px 26px 6px 10px; font-family: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23AEAEB2' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }

  /* ── Floating action button ───────────────────────────────────────────────── */
  .fab {
    position: fixed;
    bottom: calc(72px + 18px);
    right: 20px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent); color: #fff;
    font-size: 30px; line-height: 1;
    border: none; cursor: pointer;
    box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: center;
    z-index: 200;
    transition: transform 0.15s;
  }
  .fab:active { transform: scale(0.9); }
  body.bulk-mode .fab { display: none; }
  body.reorder-mode .fab { display: none; }

  /* ── Auth / Passphrase screens ────────────────────────────────────────────── */
  #authOverlay, #passphraseOverlay, #faceIdOverlay {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; padding: 40px; text-align: center;
  }
  #authOverlay    { z-index: 9000; }
  #passphraseOverlay { z-index: 9000; display: none; }
  #faceIdOverlay { z-index: 9000; display: none; }
  .auth-logo  { font-size: 56px; line-height: 1; }
  .auth-logo img { width: 80px; height: 80px; border-radius: 18px; }
  .auth-title { font-size: 30px; font-weight: 800; color: var(--text); }
  .auth-sub   { font-size: 14px; color: var(--text2); line-height: 1.55; max-width: 280px; }
  .google-btn {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: 14px; padding: 13px 22px;
    font-size: 15px; font-weight: 600; color: var(--text);
    cursor: pointer; box-shadow: var(--shadow); font-family: inherit;
    transition: opacity 0.15s;
  }
  .google-btn:active { opacity: 0.7; }
  .inp-wrap {
    position: relative; width: 100%; max-width: 300px;
  }
  .passphrase-inp {
    width: 100%; max-width: 300px; padding: 13px 44px 13px 15px; box-sizing: border-box;
    border-radius: 13px; border: 1.5px solid var(--border);
    background: var(--surface); font-size: 16px; color: var(--text);
    font-family: inherit; outline: none; transition: border-color 0.2s;
  }
  .passphrase-inp:focus { border-color: var(--accent); }
  .eye-btn {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 4px;
    color: var(--text3); display: flex; align-items: center; transition: color 0.15s;
  }
  .eye-btn:hover  { color: var(--text2); }
  .eye-btn.active { color: var(--accent); }
  .unlock-btn {
    width: 100%; max-width: 300px; background: var(--accent); color: #fff;
    border: none; border-radius: 13px; padding: 13px; font-size: 16px;
    font-weight: 700; cursor: pointer; font-family: inherit; transition: opacity 0.15s;
  }
  .unlock-btn:disabled { opacity: 0.5; cursor: default; }
  .auth-error { color: var(--red); font-size: 13px; max-width: 280px; display: none; }
  .auth-link  { background: none; border: none; color: var(--text3); font-size: 13px; cursor: pointer; padding: 4px; }
  #syncStatus { display: flex; align-items: center; width: 16px; height: 16px; }
