/* ─── TOKENS ─────────────────────────────────────────────────── */
:root {
    /* Brand — pulled from logo gradient */
    --brand:          #7B89C8;
    --brand-dark:     #5C6BAA;
    --brand-light:    #E8EAF6;

    /* Home screen gradient — matches logo */
    --home-grad-start: #5BA8A0;
    --home-grad-end:   #7B6BAF;

    --danger:         #DC2626;
    --danger-light:   #FEE2E2;
    --success:        #16A34A;
    --success-light:  #DCFCE7;
    --warning:        #B45309;
    --warning-bg:     #FFFBEB;

    --reminder:       #9B7FCC;
    --reminder-light: #F3F0FA;
    --reminder-border:#D4C8F0;

    --bg:             #F5F4F2;
    --surface:        #FFFFFF;
    --surface-2:      #F0EFF0;
    --border:         #E4E2E8;

    --text-1:         #1C1B1F;
    --text-2:         #49454F;
    --text-3:         #79747E;

    --radius-sm:      12px;
    --radius-md:      18px;
    --radius-lg:      26px;
    --radius-full:    999px;

    --shadow-sm:      0 1px 4px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:      0 4px 16px rgba(0,0,0,0.10);

    --tab-height:     62px;
    --safe-bottom:    env(safe-area-inset-bottom, 12px);
    --safe-top:       env(safe-area-inset-top, 0px);
}

/* ─── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-1);
    max-width: 100%;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
}
button { font-family: inherit; touch-action: manipulation; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; }

/* ─── TOP BAR ────────────────────────────────────────────────── */


/* ─── SCREENS ────────────────────────────────────────────────── */
.screen { display: none; min-height: 100dvh; }
.screen.active { display: block; }

/* ─── SCROLL CONTENT (non-home) ──────────────────────────────── */
.screen-content {
    padding: 14px 14px calc(var(--tab-height) + var(--safe-bottom) + 16px);
}

/* ─── SECTION LABEL ─────────────────────────────────────────── */
.section-label {
    font-size: 0.7rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--text-3); margin: 18px 2px 8px;
}
.section-label:first-child { margin-top: 2px; }

/* ─── CARD ───────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card + .card { margin-top: 10px; }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 6px; padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem; font-weight: 600; line-height: 1;
    transition: opacity 0.12s, transform 0.1s;
}
.btn:active { transform: scale(0.96); opacity: 0.82; }
.btn-primary   { background: var(--brand); color: white; }
.btn-secondary { background: var(--surface); color: var(--brand); border: 1.5px solid var(--brand); }
.btn-ghost     { background: transparent; color: var(--text-3); }
.btn-danger    { background: var(--danger); color: white; }
.btn-white     { background: white; color: var(--brand-dark); font-weight: 700; }
.btn-white-outline { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.6); }
.btn-sm  { padding: 7px 13px; font-size: 0.8rem; }
.btn-xs  { padding: 5px 10px; font-size: 0.74rem; }

/* ─── INPUT ──────────────────────────────────────────────────── */
.input-field {
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem; color: var(--text-1);
    background: var(--surface); outline: none;
    transition: border-color 0.15s; width: 100%;
}
.input-field:focus { border-color: var(--brand); }
textarea.input-field { resize: none; line-height: 1.55; }


/* ═══════════════════════════════════════════════════════════════
   HOME SCREEN
   ═══════════════════════════════════════════════════════════════ */

/* Full-screen gradient background */
#screen-home {
    background: linear-gradient(160deg, var(--home-grad-start) 0%, var(--home-grad-end) 100%);
    height: calc(100dvh - 56px);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
    gap: 0;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}
#screen-home.active { display: flex; }


/* Greeting area */
.home-greeting {
    position: relative; z-index: 1;
    padding: clamp(10px, 2.5dvh, 18px) 16px;
    display: flex; flex-direction: row;
    align-items: center;
    gap: 12px;
}
.home-logo-wrap {
    width: clamp(40px, 10vw, 64px);
    height: clamp(40px, 10vw, 64px);
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    opacity: 0.95;
}
.home-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.3) translateY(8%);
}
.home-greeting-text {
    display: flex; flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.home-avatar {
    width: clamp(32px, 8vw, 40px); height: clamp(32px, 8vw, 40px);
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    color: white; font-size: clamp(0.8rem, 3vw, 1rem); font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid rgba(255,255,255,0.45);
    cursor: pointer;
    flex-shrink: 0;
    align-self: flex-start;
}
.home-greeting-title {
    font-size: clamp(1rem, 5.5vw, 2.35rem); font-weight: 800;
    color: white;
    letter-spacing: -0.3px;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0,0,0,0.18);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.home-greeting-tagline {
    font-size: clamp(0.65rem, 3vw, 1.25rem); font-weight: 700;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.5px;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}






.home-buttons-group { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 0; flex-shrink: 0; }
.btn-row-label:first-child { margin-top: 0; }
.btn-row-label {
    font-size: clamp(0.7rem, 2.8vw, 1.1rem); font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: rgba(255,255,255,0.90);
    padding-left: 4px;
    margin-top: clamp(6px, 2dvh, 14px);
    margin-bottom: 2px;
}

/* ── Three big capture buttons ─────────────────────────────── */
.capture-buttons {
    position: relative; z-index: 1;
    display: flex;
    gap: 10px;
    padding: 0;
    margin: 0;
}
/* shared styles for both button rows */
.capture-btn, .nav-btn {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 8px;
    padding: clamp(6px, 2dvh, 12px) 6px;
    min-height: clamp(70px, 13dvh, 100px);
    box-sizing: border-box;
    border-radius: var(--radius-md);
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(10px);
    border: 1.5px solid rgba(255,255,255,0.28);
    color: white;
    transition: transform 0.15s, background 0.15s;
    cursor: pointer;
    position: relative;
}
.capture-btn:active, .nav-btn:active { transform: scale(0.95); background: rgba(255,255,255,0.28); }

.capture-btn-icon, .nav-btn-icon {
    font-size: clamp(1.4rem, 5vw, 2.4rem); line-height: 1;
    width: clamp(40px, 10vw, 62px); height: clamp(40px, 10vw, 62px);
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
}
.capture-btn-label, .nav-btn-label {
    font-size: clamp(0.7rem, 2.8vw, 1.05rem); font-weight: 700;
    color: white;
}

/* .capture-buttons and .nav-buttons share styles above */
.nav-btn-badge {
    position: absolute; top: 10px; right: 14px;
    min-width: 22px; height: 22px;
    background: var(--danger);
    border-radius: var(--radius-full);
    color: white; font-size: 0.75rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
    border: 2px solid rgba(255,255,255,0.3);
}

/* ── Reminder strip (today's urgent ones only) ─────────────── */
.home-reminders {
    position: relative; z-index: 1;
    padding: 0 16px;
    margin-top: 20px;
    margin-bottom: 16px;
}
.home-reminder-label {
    font-size: clamp(0.7rem, 2.8vw, 1.1rem); font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.5px;
    color: rgba(255,255,255,0.90);
    margin-bottom: 8px; padding-left: 4px;
}
.home-reminder-card {
    background: rgba(255,255,255,0.14);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.home-reminder-card:active { background: rgba(255,255,255,0.22); }
.home-reminder-dot {
    width: 12px; height: 12px; border-radius: var(--radius-full);
    flex-shrink: 0;
}
.home-reminder-dot.overdue { background: #FF6B6B; }
.home-reminder-dot.today   { background: #FFD166; }
.home-reminder-content { flex: 1; }
.home-reminder-text {
    font-size: clamp(0.85rem, 3vw, 1.1rem); font-weight: 600; color: white; line-height: 1.3;
}
.home-reminder-when {
    font-size: clamp(0.8rem, 2.5vw, 1rem); font-weight: 600; color: rgba(255,255,255,0.92); margin-top: 4px;
}
.home-reminder-dismiss {
    font-size: 1rem; color: rgba(255,255,255,0.6);
    padding: 4px 6px; align-self: center;
}

/* Safe-area spacer at bottom */

/* ── Active recording state overlay ──────────────────────────── */
.recording-active-bar {
    position: relative; z-index: 1;
    margin: 0 16px 8px;
    background: rgba(220, 38, 38, 0.20);
    border: 1.5px solid rgba(255,100,100,0.45);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    display: none;
}
.recording-active-bar.visible { display: block; }
.recording-top-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px;
}
.recording-pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 700; color: white;
}
.rec-dot { width: 8px; height: 8px; border-radius: 50%; background: #FF6B6B; animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }
.recording-timer { font-size: 1.4rem; font-weight: 700; color: white; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.recording-actions { display: flex; gap: 8px; }
.recording-actions .btn { flex: 1; font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════════════════
   TIMELINE SCREEN
   ═══════════════════════════════════════════════════════════════ */
.filter-bar {
    display: flex; gap: 7px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px; scrollbar-width: none;
    margin-bottom: 12px;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-chip {
    padding: 6px 14px; border-radius: var(--radius-full);
    font-size: 0.78rem; font-weight: 600; white-space: nowrap;
    background: var(--surface); color: var(--text-3);
    border: 1.5px solid var(--border); transition: all 0.15s;
}
.filter-chip.active { background: var(--brand); color: white; border-color: var(--brand); }

.memory-card {
    background: var(--surface); border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm); overflow: hidden; margin-top: 10px;
}
.memory-card-body { padding: 13px 15px 10px; cursor: pointer; }
.memory-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 5px; }
.memory-date { font-size: 0.9rem; color: var(--text-3); font-weight: 500; }
.memory-topic { font-size: 1.1rem; font-weight: 700; color: var(--text-1); margin-bottom: 5px; line-height: 1.3; }
.memory-notes {
    font-size: 1rem; color: var(--text-2); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.memory-notes.expanded { -webkit-line-clamp: unset; }
.expand-hint { font-size: 0.74rem; color: var(--brand); font-weight: 600; margin-top: 4px; display: block; }

.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 7px; border-radius: var(--radius-full);
    font-size: clamp(0.65rem, 2.2vw, 0.75rem); font-weight: 600;
    background: var(--brand-light); color: var(--brand-dark);
}
.tag.loc    { background: #E8F5E9; color: #2E7D32; }
.tag.feel   { background: var(--success-light); color: var(--success); }
.tag.sad    { background: #F3E5F5; color: #7B1FA2; }
.tag.worried{ background: var(--danger-light); color: var(--danger); }
.tag.reminder { background: var(--reminder-light); color: var(--reminder); border: 1px solid var(--reminder-border); font-weight: 700; }

.card-media-strip { display: flex; gap: 6px; padding: 0 15px 10px; overflow-x: auto; }
.card-media-thumb {
    width: 54px; height: 54px; border-radius: var(--radius-sm);
    flex-shrink: 0; background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; border: 1px solid var(--border);
}
.card-play-row { display: flex; align-items: center; gap: 10px; padding: 6px 15px 10px; }
.play-btn {
    width: 34px; height: 34px; border-radius: var(--radius-full);
    background: var(--brand); color: white;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; font-size: 0.8rem;
    box-shadow: 0 2px 8px rgba(92,107,192,0.25);
}
.seeker {
    flex: 1; height: 4px; -webkit-appearance: none; appearance: none;
    background: var(--border); border-radius: var(--radius-full); outline: none;
}
.seeker::-webkit-slider-thumb {
    -webkit-appearance: none; width: 13px; height: 13px;
    border-radius: var(--radius-full); background: var(--brand); cursor: pointer;
}
.card-actions {
    display: flex; align-items: center;
    padding: 8px 10px; border-top: 1px solid var(--border); gap: 4px;
}
.card-actions .spacer { flex: 1; }
.action-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 10px; border-radius: var(--radius-sm);
    font-size: 0.78rem; font-weight: 600; color: var(--text-3);
}
.action-btn:hover { background: var(--surface-2); color: var(--text-1); }
.more-btn {
    width: 30px; height: 30px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-3); font-size: 1rem; letter-spacing: 1.5px; font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════
   SEARCH SCREEN
   ═══════════════════════════════════════════════════════════════ */
.search-bar-wrap { position: relative; margin-bottom: 4px; }
.search-bar {
    width: 100%; padding: 11px 16px 11px 42px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.92rem; background: var(--surface); color: var(--text-1);
    outline: none; transition: border-color 0.15s;
}
.search-bar:focus { border-color: var(--brand); }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 1rem; color: var(--text-3); }
.search-hint { font-size: 0.76rem; color: var(--text-3); margin-top: 6px; margin-left: 2px; }
.search-result { padding: 13px 15px; border-bottom: 1px solid var(--border); cursor: pointer; }
.search-result:last-child { border-bottom: none; }
.search-result-topic { font-size: 1.05rem; font-weight: 700; color: var(--text-1); margin-bottom: 3px; }
.search-result-snippet { font-size: 0.95rem; color: var(--text-2); line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════════
   REMINDERS SCREEN
   ═══════════════════════════════════════════════════════════════ */
.reminder-full-item { padding: 14px 15px; border-bottom: 1px solid var(--border); }
.reminder-full-item:last-child { border-bottom: none; }
.reminder-full-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.reminder-full-text { font-size: 0.92rem; font-weight: 600; color: var(--text-1); line-height: 1.35; flex: 1; padding-right: 8px; }
.reminder-badge { padding: 3px 9px; border-radius: var(--radius-full); font-size: 0.68rem; font-weight: 700; flex-shrink: 0; }
.reminder-badge.overdue  { background: var(--danger-light); color: var(--danger); }
.reminder-badge.today    { background: var(--warning-bg); color: var(--warning); }
.reminder-badge.upcoming { background: var(--reminder-light); color: var(--reminder); }
.reminder-full-meta { font-size: 0.74rem; color: var(--text-3); margin-bottom: 4px; }
.reminder-full-from { font-size: 0.74rem; color: var(--reminder); font-weight: 600; margin-bottom: 8px; }
.reminder-full-actions { display: flex; gap: 7px; }

/* ═══════════════════════════════════════════════════════════════
   REGISTRY SCREEN
   ═══════════════════════════════════════════════════════════════ */
.registry-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 15px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.registry-item:last-of-type { border-bottom: none; }
.person-avatar {
    width: 40px; height: 40px; border-radius: var(--radius-full);
    font-size: 0.9rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.person-name  { font-size: 1.05rem; font-weight: 600; color: var(--text-1); }
.person-meta  { font-size: 0.9rem; color: var(--text-3); margin-top: 1px; }
.chevron      { margin-left: auto; color: var(--text-3); font-size: 1rem; }
.add-row { display: flex; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--border); }
.add-row .input-field { flex: 1; }
.location-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 13px 15px; }
.loc-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 12px; background: var(--surface-2);
    border: 1.5px solid var(--border); border-radius: var(--radius-full);
    font-size: 0.8rem; font-weight: 600; color: var(--text-2); cursor: pointer;
}

/* ═══════════════════════════════════════════════════════════════
   BOTTOM SHEETS
   ═══════════════════════════════════════════════════════════════ */
.overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.42); backdrop-filter: blur(3px);
    z-index: 300; display: flex; flex-direction: column; justify-content: flex-end;
    animation: overlayIn 0.2s ease;
}
@keyframes overlayIn { from{opacity:0} to{opacity:1} }
.bottom-sheet {
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90dvh; overflow-y: auto;
    padding-bottom: calc(16px + var(--safe-bottom));
    animation: sheetUp 0.28s cubic-bezier(0.32,0.72,0,1);
}
@keyframes sheetUp { from{transform:translateY(100%)} to{transform:translateY(0)} }
.sheet {
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(16px + var(--safe-bottom));
    animation: sheetUp 0.28s cubic-bezier(0.32,0.72,0,1);
}
.sheet-handle { width: 36px; height: 4px; border-radius: var(--radius-full); background: var(--border); margin: 12px auto 0; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 12px; border-bottom: 1px solid var(--border); }
.sheet-title { font-size: 1.02rem; font-weight: 700; color: var(--text-1); }
.sheet-close { width: 28px; height: 28px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-2); display: flex; align-items: center; justify-content: center; font-size: 0.85rem; }
.sheet-body { padding: 16px 18px; }
.sheet-actions { display: flex; gap: 9px; padding: 12px 18px; border-top: 1px solid var(--border); }
.sheet-actions .btn { flex: 1; }
.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-3); margin-bottom: 5px; }
.form-row.halves { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-list-item {
    display: flex; align-items: center; gap: 14px;
    padding: 15px 18px; font-size: 0.92rem; font-weight: 500; color: var(--text-1);
    border-bottom: 1px solid var(--border); cursor: pointer;
}
.action-list-item:last-child { border-bottom: none; }
.action-list-item.danger { color: var(--danger); }
.action-icon { font-size: 1.1rem; width: 22px; text-align: center; }
.confirm-body { padding: 22px 18px 16px; }
.confirm-title { font-size: 1rem; font-weight: 700; color: var(--text-1); margin-bottom: 10px; }
.confirm-msg { font-size: 0.88rem; color: var(--text-2); line-height: 1.6; margin-bottom: 18px; }
.confirm-actions { display: flex; gap: 9px; }
.confirm-actions .btn { flex: 1; }

/* ── Review reminder detection section ───────────────────────── */
.reminder-detect-box {
    background: var(--reminder-light);
    border: 1.5px solid var(--reminder-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px; margin-top: 6px;
}
.reminder-detect-label {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--reminder); margin-bottom: 6px;
}
.reminder-detect-text { font-size: 0.9rem; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.reminder-detect-when { font-size: 0.78rem; color: var(--reminder); font-weight: 600; margin-bottom: 8px; }
.reminder-detect-actions { display: flex; gap: 8px; align-items: center; }

/* ── Home bar (non-home screens) ── */

/* Home screen text colour — override per theme */
.home-text { color: white; }

/* Shared card style — buttons + reminder cards */
.home-card {
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(8px);
    border: 1.5px solid rgba(255,255,255,0.18);
    box-shadow: none;
}

/* ─── NON-HOME SCREENS ──────────────────────────────────────── */
.home-bar-btn-wrap {
    padding: 12px 16px 0;
}
.home-bar-btn {
    background: var(--brand-light);
    color: var(--brand);
    border: none;
    border-radius: var(--radius-sm);
    padding: 8px 18px;
    font-size: 0.95rem; font-weight: 700;
    cursor: pointer;
}
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 14px;
}
.screen-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-1);
    padding: 0;
}
.screen-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.screen-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--border);
    color: var(--text-1);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.search-controls {
    display: flex; gap: 10px;
    padding: 0 16px 16px;
}
.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text-1);
}
.search-input:focus {
    outline: none;
    border-color: var(--brand);
}
.screen-help-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
/* keep old name as alias */
.search-help-btn { display: none; }
.search-help-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.search-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}
.search-help-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
}
.search-help-body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.search-help-section {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-2);
}
.search-help-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 4px;
}
.search-help-list li {
    font-size: 0.88rem;
    color: var(--text-2);
    padding-left: 12px;
    position: relative;
}
.search-help-list li::before {
    content: '›';
    position: absolute;
    left: 0;
    color: var(--brand);
    font-weight: 700;
}
.search-help-list em {
    background: var(--brand-light);
    color: var(--brand-dark);
    padding: 1px 6px;
    border-radius: 4px;
    font-style: normal;
    font-weight: 600;
    font-size: 0.82rem;
}
.search-help-tip {
    font-size: 0.85rem;
    color: var(--text-2);
    background: var(--warning-bg);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    line-height: 1.5;
}
.search-category-chips {
    display: flex;
    gap: 8px;
    padding: 0 16px 16px;
}
.search-chip {
    flex: 0 0 auto;
    padding: 6px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--text-3);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.search-chip.active {
    background: var(--brand);
    color: white;
    border-color: var(--brand);
}
/* Category Modal Styles */
.category-modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}
.category-modal-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-1);
    cursor: pointer;
}
.category-modal-btn.active {
    background: var(--brand);
    color: white;
}
.search-person-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    border: 1px solid var(--border);
}
.spc-avatar { font-size: 1.3rem; }
.spc-name { flex: 1; font-size: 0.95rem; font-weight: 600; color: var(--text-1); }
.spc-arrow { font-size: 1.2rem; color: var(--text-3); }
.search-context-label {
    font-size: 0.85rem;
    color: var(--text-3);
    padding: 0 4px 12px;
}
.search-context-label strong { color: var(--text-1); }

/* ─── MEMORY CARD (timelineComponent classes) ───────────────── */
.memory-header {
    display: flex; flex-direction: column;
    padding: 8px 12px 5px;
    border-bottom: 1px solid var(--border);
}
.memory-date {
    font-size: clamp(0.65rem, 2.5vw, 0.75rem); color: var(--text-3); font-weight: 500; margin-bottom: 3px;
}
.memory-topic {
    font-size: clamp(0.85rem, 3vw, 0.95rem); font-weight: 700; color: var(--text-1); line-height: 1.3;
}
.memory-body {
    padding: 8px 12px 10px;
}
.memory-notes {
    font-size: clamp(0.8rem, 2.8vw, 0.88rem); color: var(--text-2); line-height: 1.5;
    margin-bottom: 6px;
}
.memory-tags {
    display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.memory-actions {
    display: flex; gap: 4px; flex-wrap: wrap;
    padding: 6px 12px; border-top: 1px solid var(--border);
}
.memory-media {
    display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0;
}
.media-thumb {
    width: 54px; height: 54px; border-radius: var(--radius-sm);
    object-fit: cover; border: 1px solid var(--border); cursor: pointer;
}
.tag.speaker-tag  { background: var(--brand-light); color: var(--brand-dark); }
.tag.location-tag { background: #E8F5E9; color: #2E7D32; }
.tag.time-tag     { background: #FFF8E1; color: #F57F17; }
.tag.people-tag   { background: #F3E5F5; color: #7B1FA2; }
.tag.present-tag  { background: #E8EAF6; color: #3949AB; }
.tag.feeling-tag  { background: var(--success-light); color: var(--success); }
.tag.reminder-tag { background: var(--reminder-light); color: var(--reminder); font-weight: 700; }
.tag.geo-tag      { background: #E0F7FA; color: #00838F; cursor: pointer; }
.memory-seeker, .seeker-bar {
    width: 100%; margin: 6px 0;
}
.primary-actions, .secondary-actions {
    display: flex; gap: 6px; flex-wrap: wrap;
}
/* ─── CAMERA SHEET ───────────────────────────────────────────── */
.camera-sheet-inner {
    padding-bottom: calc(20px + var(--safe-bottom));
    max-height: 95dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
@media (orientation: landscape) {
    #camera-sheet {
        justify-content: center;
        align-items: center;
        padding: 0 12px;
    }
    #camera-sheet .camera-sheet-inner {
        width: 100%;
        max-height: 98dvh;
        border-radius: var(--radius-md);
    }
}
.cam-viewfinder-wrap {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 3/4;
    margin-bottom: 14px;
    max-height: 55vh;
}
@media (orientation: landscape) {
    .cam-viewfinder-wrap {
        aspect-ratio: 16/9;
        max-height: 52vh;
    }
}
.cam-viewfinder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cam-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cam-flash {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.05s;
}
.cam-flash.flash { opacity: 1; }
.cam-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 14px;
}
.cam-btn {
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: opacity 0.15s;
}
.cam-btn-capture {
    width: 68px;
    height: 68px;
    background: white;
    border: 4px solid var(--border);
    font-size: 1.8rem;
    box-shadow: var(--shadow-md);
}
.cam-btn-switch, .cam-btn-close, .cam-btn-help {
    width: 44px;
    height: 44px;
    background: var(--surface-2);
    font-size: 1.2rem;
    color: var(--text-2);
}
.cam-btn-help {
    background: var(--brand-light);
    color: var(--brand-dark);
    font-size: 1rem;
    font-weight: 700;
}
.cam-post {
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.cam-strip {
    display: flex;
    gap: 8px;
    padding: 0 4px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.cam-strip-thumb {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid var(--border);
}
.cam-strip-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cam-strip-audio {
    background: linear-gradient(135deg, var(--home-grad-start), var(--home-grad-end));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 60px;
    height: 60px;
}
.cam-strip-audio-icon {
    font-size: 1.4rem;
    line-height: 1;
}
.cam-strip-audio-label {
    font-size: 0.55rem;
    color: white;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    padding: 0 2px;
}
.cam-strip-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cam-empty-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 36px 20px;
    text-align: center;
    color: var(--text-2);
}
.cam-empty-hint span {
    font-size: 3rem;
    opacity: 0.6;
}
.cam-empty-hint p {
    font-size: 0.92rem;
    line-height: 1.5;
    max-width: 260px;
    margin: 0;
}

/* ─── ONE SHEET TO RULE THEM ALL ────────────────────────────── */
.one-sheet-inner {
    padding-bottom: calc(20px + var(--safe-bottom));
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.one-add-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}
.one-add-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.one-add-btns {
    display: flex;
    gap: 8px;
}
.one-add-btn {
    flex: 1;
    padding: 10px 6px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-1);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.one-add-btn:hover {
    background: var(--brand-light);
    border-color: var(--brand);
}

/* ─── AUDIO LIST (multiple recordings) ──────────────────────── */
.one-audio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}
.one-audio-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}
.one-audio-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
}
.one-audio-player {
    width: 100%;
    height: 32px;
}
.one-audio-remove {
    width: 26px;
    height: 26px;
    border: none;
    background: var(--surface-3, #e0e0e0);
    border-radius: 50%;
    font-size: 0.7rem;
    cursor: pointer;
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ─── VOICE RECORDING SHEET ─────────────────────────────────── */
.rec-sheet-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0 20px;
    gap: 12px;
}
.rec-visualiser {
    width: 100%;
    height: 90px;
    border-radius: var(--radius-md);
    background: var(--surface-2);
    display: block;
}
.rec-timer {
    font-size: 2.2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-1);
    letter-spacing: 0.05em;
}
.rec-btns {
    display: flex;
    gap: 16px;
    justify-content: center;
    width: 100%;
}
.rec-start-btn, .rec-stop-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.rec-start-btn {
    background: linear-gradient(135deg, var(--home-grad-start), var(--home-grad-end));
    color: white;
}
.rec-stop-btn {
    background: var(--danger);
    color: white;
}
.rec-start-btn:disabled, .rec-stop-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.process-status {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}
.process-status-loading {
    background: var(--brand-light);
    color: var(--brand-dark);
    animation: pulse 1.5s ease-in-out infinite;
}
.process-status-success {
    background: var(--success-light);
    color: var(--success);
}
.process-status-error {
    background: var(--danger-light);
    color: var(--danger);
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.process-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}
.process-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.process-btn-primary {
    background: linear-gradient(135deg, var(--home-grad-start), var(--home-grad-end));
    color: white;
}
.process-btn-secondary {
    background: var(--surface-2);
    color: var(--text-2);
    border: 1.5px solid var(--border);
}

/* ─── SIMPLE MEMORY CARDS ────────────────────────────────────── */
.mc {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 14px 14px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: box-shadow 0.15s, transform 0.1s;
}
.mc:active { transform: scale(0.98); box-shadow: none; }
.mc-body {
    flex: 1;
    min-width: 0;
}
.mc-date {
    font-size: 0.72rem;
    color: var(--text-3);
    margin-bottom: 4px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.mc-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mc-thumb {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--surface-2);
}
.mc-thumb-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--home-grad-start), var(--home-grad-end));
    color: white;
}
.mc-badges {
    display: flex;
    gap: 4px;
    margin-top: 5px;
}
.mc-badge {
    font-size: 0.75rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    line-height: 1.6;
}

/* ─── MEMORY DETAIL OVERLAY ──────────────────────────────────── */
#memory-detail-overlay {
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
}
.md-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 0;
    padding-top: var(--safe-top);
    padding-bottom: 0;
}
.md-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
}
.md-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-1);
    flex: 1;
    margin-right: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.md-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--surface-2);
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    flex-shrink: 0;
}
.md-date {
    padding: 8px 20px 0;
    font-size: 0.78rem;
    color: var(--text-3);
    font-weight: 500;
}
.md-media-wrap {
    margin: 14px 20px;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
}
.md-media-img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    border-radius: var(--radius-md);
}
.md-media-video {
    width: 100%;
    height: auto;
    max-height: 70vh;
    border-radius: var(--radius-md);
    display: block;
    background: #000;
}
.md-audio-player {
    width: 100%;
    padding: 16px 14px 12px;
}
.md-visualiser {
    width: 100%;
    height: 80px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    display: block;
    margin-bottom: 10px;
}
.md-audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}
.md-play-btn, .md-stop-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.md-play-btn {
    background: linear-gradient(135deg, var(--home-grad-start), var(--home-grad-end));
    color: white;
}
.md-stop-btn {
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 0.9rem;
}
.md-seeker {
    flex: 1;
    height: 4px;
    cursor: pointer;
    accent-color: var(--brand);
}
.md-time {
    font-size: 0.75rem;
    color: var(--text-3);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.md-notes {
    padding: 0 20px 14px;
    font-size: 0.9rem;
    color: var(--text-2);
    line-height: 1.55;
    white-space: pre-wrap;
}
.md-tags {
    padding: 0 20px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.md-tag {
    background: var(--brand-light);
    color: var(--brand-dark);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
}
.md-expand-field {
    margin: 0 20px 14px;
}
.md-expand-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, var(--text-2));
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.md-expand-content {
    font-size: 0.83rem;
    color: var(--text-2);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: break-word;
    background: var(--surface-2);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    max-width: 100%;
    box-sizing: border-box;
}
.md-expandable {
    cursor: pointer;
}
.md-expand-toggle {
    font-size: 0.8rem;
    color: var(--accent, var(--primary));
    cursor: pointer;
    padding: 4px 14px 0;
    user-select: none;
}
.md-transcript-toggle {
    margin: 0 20px 6px;
    padding: 10px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
}
.md-transcript {
    display: none;
    margin: 0 20px 14px;
    padding: 12px 14px;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    color: var(--text-2);
    line-height: 1.6;
    white-space: pre-wrap;
}
.md-transcript.md-open { display: block; }
.md-actions {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 20px calc(var(--safe-bottom) + 10px);
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: var(--surface);
    gap: 6px;
    z-index: 10;
    margin-top: auto;
}
.md-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 600;
    transition: background 0.15s;
}
.md-action-btn span:first-child { font-size: 1.5rem; line-height: 1; }
.md-action-btn span:last-child { font-size: 0.7rem; }
.md-action-btn:hover, .md-action-btn:active { background: var(--surface-2); }
.md-action-danger { color: var(--danger); }

.obs-chip {
    display: inline-block; background: var(--surface-2);
    padding: 3px 8px; border-radius: var(--radius-full);
    font-size: 0.8rem; color: var(--text-2); margin: 2px;
}

/* ─── MEMORY EDIT OVERLAY ────────────────────────────────────── */
#memory-edit-overlay {
    background: var(--bg);
}
.me-container {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding-bottom: 40px;
    padding-top: var(--safe-top);
}
.me-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.me-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
}
.me-more-toggle {
    text-align: center;
    padding: 12px;
    margin: 4px 0 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--brand);
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.me-save-btn {
    background: linear-gradient(135deg, var(--home-grad-start), var(--home-grad-end));
    color: white;
    border: none;
    border-radius: var(--radius-full);
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}
.me-mode-toggle {
    display: flex;
    gap: 8px;
    padding: 14px 20px 6px;
}
.me-mode-btn {
    flex: 1;
    padding: 8px;
    border: 2px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--surface);
    color: var(--text-2);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.me-mode-btn.active {
    border-color: var(--brand);
    background: var(--brand-light);
    color: var(--brand-dark);
}
.me-fields {
    padding: 10px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.me-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.me-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-3);
}
.me-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text-1);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s;
}
.me-input:focus {
    border-color: var(--brand);
}
.me-textarea {
    min-height: 60px;
    resize: none;
    line-height: 1.5;
    overflow: hidden;
}
.me-textarea-lg {
    min-height: 60px;
}
.me-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.me-input-row .me-input {
    flex: 1;
}
.me-pin-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.me-pin-btn:active {
    background: var(--brand-light);
    border-color: var(--brand);
}

/* ─── ABOUT MODAL ────────────────────────────────────────────── */
.about-sheet {
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    width: 100%;
    max-height: 92dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 24px calc(40px + var(--safe-bottom));
    position: relative;
    text-align: center;
    animation: sheetUp 0.3s cubic-bezier(0.32,0.72,0,1);
}
.about-handle {
    width: 36px; height: 4px;
    border-radius: var(--radius-full);
    background: var(--border);
    margin: 12px auto 16px;
}
.about-close {
    position: absolute;
    top: 14px;
    right: 16px;
}
.about-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(160deg, var(--home-grad-start), var(--home-grad-end));
    margin-bottom: 24px;
    padding: 16px 24px 20px;
    border-radius: var(--radius-md);
}
.about-logo-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--border);
    margin: 0 auto 16px;
    background: var(--surface);
}
.about-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.3) translateY(8%);
}
.about-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: white;
    margin-bottom: 4px;
}
.about-tagline {
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.about-manifesto {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(91,168,160,0.12), rgba(123,107,175,0.12));
    border: 1px solid rgba(123,107,175,0.2);
    border-radius: var(--radius-md);
}
.about-manifesto p {
    font-size: 0.92rem;
    line-height: 1.65;
    color: var(--text-2);
    text-align: justify;
}
.about-manifesto strong {
    color: var(--brand-dark);
}
.about-attribution {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding-top: 8px;
}
.about-wombat {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--brand-light);
    margin-bottom: 6px;
}
.about-built {
    font-size: 0.8rem;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.about-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-1);
}
.about-version {
    font-size: 0.78rem;
    color: var(--text-3);
}

/* ─── TOAST NOTIFICATION ─────────────────────────────────────── */
.pm-toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, var(--home-grad-start), var(--home-grad-end));
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    z-index: 2000;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}
.pm-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.pm-toast-error {
    background: var(--danger);
}

/* ─── BULK SELECT / DELETE ───────────────────────────────────── */
.bulk-label-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.bulk-delete-inline-btn {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: var(--danger);
    border-radius: var(--radius-full);
    padding: 3px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.bulk-cancel-inline-btn {
    background: transparent;
    border: 1px solid var(--brand);
    color: var(--brand);
    border-radius: var(--radius-full);
    padding: 3px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.bulk-confirm-inline-btn {
    background: rgba(220, 38, 38, 0.15);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: var(--danger);
    border-radius: var(--radius-full);
    padding: 3px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.bulk-confirm-inline-btn:disabled {
    opacity: 0.35;
    cursor: default;
}
.mc-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    background: var(--surface-2);
    transition: background 0.15s, border-color 0.15s;
}
.mc-checkbox-checked {
    background: var(--danger);
    border-color: var(--danger);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 2l6 6M8 2l-6 6' stroke='white' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 10px;
}
.mc-selected {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 8%, var(--surface));
}

/* ─── REGISTRY LIST HEADER ───────────────────────────────────── */
.registry-list-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 8px;
}

/* ─── MERGE MODAL ────────────────────────────────────────────── */
.merge-modal-box {
    width: 100%;
    max-width: 360px;
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-md);
}
.merge-modal-label {
    font-size: 0.9rem;
    color: var(--text-2);
    margin-bottom: 12px;
}
.merge-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-1);
}
.merge-option input[type="radio"] {
    accent-color: var(--brand);
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.merge-modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding: 12px 0 0;
    border-top: 1px solid var(--border);
    margin-top: 4px;
}
.merge-modal-btn {
    padding: 8px 18px;
    font-size: 0.88rem;
}
.bulk-merge-inline-btn {
    background: rgba(123, 137, 200, 0.15);
    border: 1px solid rgba(123, 137, 200, 0.35);
    color: var(--brand);
    border-radius: var(--radius-full);
    padding: 3px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.bulk-merge-inline-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ─── PERSON FACTS ───────────────────────────────────────────── */
.person-facts-box {
    max-height: 80vh;
    overflow-y: auto;
}
.search-context-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.search-context-row .search-context-label {
    margin: 0;
}
.person-facts-btn {
    background: rgba(123, 137, 200, 0.15);
    border: 1px solid rgba(123, 137, 200, 0.35);
    color: var(--brand);
    border-radius: var(--radius-full);
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.pf-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.pf-label {
    color: var(--text-3);
    font-weight: 500;
}
.pf-value {
    color: var(--text-1);
    font-weight: 600;
    text-align: right;
}
.pf-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    margin: 14px 0 6px;
}
.pf-fact {
    font-size: 0.9rem;
    color: var(--text-1);
    padding: 5px 0;
    border-bottom: 1px solid var(--border);
    line-height: 1.4;
}

.person-back-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-2);
    border-radius: var(--radius-full);
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}

.bulk-edit-inline-btn {
    background: rgba(123, 137, 200, 0.15);
    border: 1px solid rgba(123, 137, 200, 0.35);
    color: var(--brand);
    border-radius: var(--radius-full);
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}


/* ── Reminder screen cards ──────────────────────────────────── */
.reminder-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.15s;
    box-shadow: var(--shadow-sm);
}
.reminder-card:active { background: var(--surface-2); }
.reminder-card-header {
    display: flex; justify-content: space-between; align-items: baseline;
    gap: 8px; margin-bottom: 6px;
}
.reminder-card-topic {
    font-size: clamp(0.85rem, 3vw, 1rem); font-weight: 700; color: var(--text-1);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reminder-card-date {
    font-size: clamp(0.75rem, 2.5vw, 0.85rem); font-weight: 600;
    color: var(--text-3); white-space: nowrap;
}
.reminder-card-text {
    font-size: clamp(0.85rem, 3vw, 1rem); color: var(--text-2); line-height: 1.4;
}

/* ── Home reminder chips ────────────────────────────────────── */
.home-reminder-chip {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.20);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex; flex-direction: column; gap: 3px;
}
.home-reminder-chip:active { background: rgba(255,255,255,0.22); }
.home-reminder-chip-topic {
    font-size: clamp(0.8rem, 2.8vw, 0.95rem); font-weight: 700; color: white;
}
.home-reminder-chip-text {
    font-size: clamp(0.8rem, 2.8vw, 0.95rem); color: rgba(255,255,255,0.75); line-height: 1.3;
}
.reminders-state-msg { color: var(--text-3); padding: 16px; font-size: 1rem; }
.reminder-card-actions {
    display: flex; gap: 8px; margin-top: 10px;
}
.reminder-btn-edit, .reminder-btn-dismiss {
    font-size: 0.82rem; font-weight: 600;
    border-radius: var(--radius-full);
    padding: 5px 14px;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s;
}
.reminder-btn-edit {
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border);
}
.reminder-btn-dismiss {
    background: var(--brand-light);
    color: var(--brand-dark);
}

/* ── Reminders screen tabs & add button ─────────────────────── */
.reminders-tab-bar {
    display: flex; gap: 8px; margin-bottom: 16px; align-items: center;
}
.reminders-tab {
    flex: 1; padding: 8px 12px; border-radius: var(--radius-full);
    border: 1.5px solid var(--border); background: transparent;
    color: var(--text-2); font-weight: 600; font-size: 0.9rem; cursor: pointer;
    transition: all 0.15s;
}
.reminders-tab.active {
    background: var(--brand); border-color: var(--brand); color: white;
}
.reminders-add-btn {
    display: block; width: 100%; margin-top: 16px;
    padding: 12px; border-radius: var(--radius-sm);
    background: var(--brand-light); color: var(--brand-dark);
    border: 1.5px dashed var(--brand); font-weight: 700; font-size: 1rem;
    cursor: pointer; transition: background 0.15s;
}
.reminders-add-btn:active { background: var(--brand); color: white; }

/* Add button in tab bar — compact, not stretched */
.reminders-tab-add {
    flex: 0 !important;
    padding: 8px 14px !important;
    background: rgba(220, 53, 69, 0.12) !important;
    color: #dc3545 !important;
    border-color: rgba(220, 53, 69, 0.35) !important;
    white-space: nowrap;
}
.reminders-tab-add:hover, .reminders-tab-add:active {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

/* ── Voice settings toggle switch ──────────────────────────── */
.voice-toggle { position: relative; display: inline-block; width: 48px; height: 26px; flex-shrink: 0; }
.voice-toggle input { opacity: 0; width: 0; height: 0; }
.voice-toggle-slider {
    position: absolute; inset: 0; background: var(--border);
    border-radius: 26px; cursor: pointer; transition: background 0.2s;
}
.voice-toggle-slider:before {
    content: ''; position: absolute;
    width: 20px; height: 20px; left: 3px; bottom: 3px;
    background: white; border-radius: 50%; transition: transform 0.2s;
}
.voice-toggle input:checked + .voice-toggle-slider { background: var(--brand); }
.voice-toggle input:checked + .voice-toggle-slider:before { transform: translateX(22px); }

/* ── Reminder audio record button ───────────────────────────── */
.reminder-record-big-btn {
    display: flex; flex-direction: row; align-items: center; justify-content: center;
    gap: 8px; width: 100%; padding: 10px 16px;
    background: var(--brand); color: white;
    border: none; border-radius: var(--radius-full);
    font-size: 0.9rem; font-weight: 600; cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}
.reminder-record-big-btn #reminder-record-btn-icon { font-size: 1.1rem; line-height: 1; }
.reminder-record-big-btn:active { transform: scale(0.98); }
.reminder-record-big-btn.recording {
    background: #dc3545;
    animation: pulse-record 1.4s ease-in-out infinite;
}
@keyframes pulse-record {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,53,69,0.4); }
    50%       { box-shadow: 0 0 0 10px rgba(220,53,69,0); }
}

/* ── Waveform animation ─────────────────────────────────────── */
.reminder-waveform {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; height: 36px; margin-top: 8px;
}
.reminder-waveform span {
    display: block; width: 4px; border-radius: 2px;
    background: var(--brand);
    animation: wave-bar 1s ease-in-out infinite;
}
.reminder-waveform span:nth-child(1) { animation-delay: 0s;    height: 10px; }
.reminder-waveform span:nth-child(2) { animation-delay: 0.1s;  height: 20px; }
.reminder-waveform span:nth-child(3) { animation-delay: 0.2s;  height: 30px; }
.reminder-waveform span:nth-child(4) { animation-delay: 0.3s;  height: 36px; }
.reminder-waveform span:nth-child(5) { animation-delay: 0.2s;  height: 28px; }
.reminder-waveform span:nth-child(6) { animation-delay: 0.1s;  height: 18px; }
.reminder-waveform span:nth-child(7) { animation-delay: 0s;    height: 10px; }
@keyframes wave-bar {
    0%, 100% { transform: scaleY(0.4); opacity: 0.6; }
    50%       { transform: scaleY(1);   opacity: 1; }
}

/* ── Processing spinner ─────────────────────────────────────── */
.reminder-processing-spinner {
    width: 32px; height: 32px; margin: 0 auto;
    border: 3px solid var(--border);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Reminder card (new structured version) ─────────────────── */
.reminder-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}
.reminder-card-title {
    font-size: 1rem; font-weight: 700; color: var(--text-1); margin-bottom: 6px;
}
.reminder-card-due {
    font-size: 0.875rem; color: var(--text-2); margin-bottom: 4px;
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.reminder-due-text { color: var(--text-2); }
.reminder-no-date { color: var(--text-3); font-style: italic; }
.reminder-card-notes {
    font-size: 0.875rem; color: var(--text-3); margin-top: 4px; margin-bottom: 4px;
    line-height: 1.4;
}
.reminder-badge {
    font-size: 0.72rem; font-weight: 700; padding: 2px 8px;
    border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.5px;
}
.reminder-badge.overdue   { background: var(--danger-light); color: var(--danger); }
.reminder-badge.soon      { background: #FFF3CD; color: #856404; }
.reminder-badge.today     { background: var(--reminder-light); color: var(--reminder); }
.reminder-badge.tomorrow  { background: #E8F4FD; color: #2471a3; }
.reminder-completed-at {
    font-size: 0.78rem; color: #27ae60; font-weight: 600; margin-top: 2px;
}
.reminder-card-actions {
    display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap;
}
.reminder-btn-edit, .reminder-btn-done, .reminder-btn-undo,
.reminder-btn-delete, .reminder-btn-source {
    font-size: 0.82rem; font-weight: 600;
    border-radius: var(--radius-full); padding: 5px 14px;
    cursor: pointer; border: none; transition: opacity 0.15s;
}
.reminder-btn-edit   { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.reminder-btn-done   { background: var(--success-light); color: var(--success); }
.reminder-btn-undo   { background: var(--surface-2); color: var(--text-3); border: 1px solid var(--border); }
.reminder-btn-delete { background: var(--danger-light); color: var(--danger); }
.reminder-btn-source { background: var(--brand-light); color: var(--brand-dark); }

/* ── Reminder modal inputs ───────────────────────────────────── */
.reminder-modal-label {
    display: block; font-size: 0.82rem; font-weight: 700;
    color: var(--text-2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.reminder-modal-input {
    width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--text-1); font-size: 0.95rem;
}
.reminder-modal-input:focus { outline: none; border-color: var(--brand); }
.reminder-modal-hint {
    font-size: 0.78rem; color: var(--text-3); margin-top: 4px;
}

/* ── Linked reminders panel in edit modal ───────────────────── */
.me-reminders-list {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-size: 0.875rem;
    min-height: 40px;
}
.me-reminders-empty {
    color: var(--text-3); font-style: italic;
}
.me-reminder-row {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.me-reminder-row:last-child { border-bottom: none; }
.me-reminder-row-title {
    font-weight: 600; color: var(--text-1); margin-bottom: 2px;
}
.me-reminder-row-due {
    color: var(--text-3); font-size: 0.8rem;
    display: flex; align-items: center; gap: 6px;
}
.me-reminder-badge {
    font-size: 0.7rem; font-weight: 700; padding: 1px 7px;
    border-radius: var(--radius-full); text-transform: uppercase;
}
.me-reminder-badge.pending { background: var(--reminder-light); color: var(--reminder); }
.me-reminder-badge.done    { background: var(--success-light); color: var(--success); }

/* ── Alert chips ─────────────────────────────────────────────── */
.reminder-alert-chips {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px;
}
.alert-chip {
    padding: 7px 14px; border-radius: var(--radius-full);
    border: 1.5px solid var(--border); background: var(--surface-2);
    color: var(--text-2); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
}
.alert-chip.active {
    background: var(--brand); border-color: var(--brand); color: white;
}
.alert-chip-custom {
    border-style: dashed;
}
.alert-chip-add {
    border-style: dashed; color: var(--brand); border-color: var(--brand);
    background: transparent;
}
.reminder-custom-popup {
    display: flex; align-items: center; gap: 8px;
    flex-wrap: wrap; margin-top: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 10px 12px;
}
.reminder-custom-num {
    width: 72px; padding: 7px 10px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--text-1); font-size: 0.9rem; text-align: center;
}
.reminder-custom-unit {
    padding: 7px 10px; border-radius: var(--radius-sm);
    border: 1.5px solid var(--border); background: var(--surface);
    color: var(--text-1); font-size: 0.9rem; cursor: pointer;
}
.reminder-custom-add-btn {
    padding: 7px 16px; border-radius: var(--radius-full);
    background: var(--brand); color: white;
    font-size: 0.85rem; font-weight: 700; cursor: pointer; border: none;
}
.reminder-custom-cancel-btn {
    padding: 7px 16px; border-radius: var(--radius-full);
    background: transparent; color: var(--text-3);
    font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none;
}

/* ── Home reminders strip — scrollable ──────────────────────── */
#home-reminders-list {
    max-height: 40vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── Upload source grid ──────────────────────────────────────── */
.upload-source-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}
.upload-source-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 18px 8px;
    background: var(--surface); border: 1.5px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.upload-source-btn:active { background: var(--surface-2); border-color: var(--brand); }
.upload-source-icon { font-size: 1.8rem; line-height: 1; }
.upload-source-label {
    font-size: 0.8rem; font-weight: 600; color: var(--text-2); text-align: center;
}

/* ── Memory Detail Gallery ───────────────────────── */
.md-gallery {
    display: flex;
    flex-direction: row;
    width: 100%;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    background: var(--surface-2);
    border-radius: var(--radius-md);
    margin: 14px 0 0;
    flex-shrink: 0;
}
.md-gallery::-webkit-scrollbar { display: none; }
.md-slide {
    flex-shrink: 0;
    min-width: 100%;
    height: 60vw;
    max-height: 70vh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-md);
}
.md-slide-img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    cursor: zoom-in;
}
.md-slide-video {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #000;
}
.md-gallery-counter {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-2);
    padding: 4px 0 8px;
}
.md-extra-audio {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 20px 0;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}
.md-extra-audio-label {
    font-size: 0.82rem;
    color: var(--text-2);
    font-weight: 600;
}
.md-extra-audio-player {
    width: 100%;
    height: 36px;
}

/* ── Fullscreen Lightbox ─────────────────────────── */
#lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
#lightbox[style*="display: none"], #lightbox[style*="display:none"] {
    display: none !important;
}
#lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
#lightbox-video {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    display: block;
    background: #000;
    object-fit: contain;
}
#lightbox-close {
    position: absolute;
    top: max(16px, env(safe-area-inset-top, 16px));
    right: 16px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 1.4rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Lightbox Document Display */
.lb-doc-card {
    background: rgba(255,255,255,0.1);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 80vw;
}
.lb-doc-icon {
    font-size: 64px;
}
.lb-doc-name {
    font-size: 1.1rem;
    font-weight: 500;
    word-break: break-all;
    color: white;
}
.lb-doc-link {
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
}

/* Lightbox Navigation */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 40px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: background 0.2s;
}
.lightbox-nav:hover {
    background: rgba(255,255,255,0.2);
}
#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }

/* Hide arrows on mobile touch devices (they can swipe) */
@media (hover: none) and (pointer: coarse) {
    .lightbox-nav { display: none !important; }
}

/* ─── NOTES SYSTEM ────────────────────────────────────────────── */

/* Notes screen capture bar */
.notes-capture-bar {
    display: flex;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.notes-voice-btn,
.notes-type-btn {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.notes-voice-btn { background: var(--brand); color: #fff; }
.notes-type-btn  { background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border); }
.notes-voice-btn:active, .notes-type-btn:active { opacity: 0.7; }

/* Category filter bar */
.notes-filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px;
    scrollbar-width: none;
}
.notes-filter-bar::-webkit-scrollbar { display: none; }

/* Note card */
.note-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 0 12px 10px;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.note-card:active { box-shadow: 0 0 0 2px var(--brand); }
.note-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.note-card-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.note-card-date {
    font-size: 0.75rem;
    color: var(--text-3);
}
.note-card-title {
    font-size: 0.97rem;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 4px;
}
.note-card-preview {
    font-size: 0.85rem;
    color: var(--text-2);
    line-height: 1.4;
}
.note-badge {
    margin-left: 4px;
    font-size: 0.75rem;
}

/* Voice capture sheet */
.note-capture-sheet {
    background: var(--surface);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 520px;
    padding: 24px;
}
.note-sheet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.note-sheet-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-1);
}
.note-sheet-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 8px 0 16px;
}
.note-record-status {
    font-size: 0.95rem;
    color: var(--text-2);
}
.note-record-timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}
.note-record-btn {
    padding: 14px 36px;
    border-radius: 50px;
    border: none;
    background: var(--brand);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s;
}
.note-record-btn:disabled { opacity: 0.5; }
.note-processing-msg {
    font-size: 0.9rem;
    color: var(--text-3);
    font-style: italic;
}

/* Note detail */
.note-detail-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.note-detail-date {
    font-size: 0.82rem;
    color: var(--text-3);
}
.note-detail-content {
    font-size: 0.95rem;
    color: var(--text-1);
    line-height: 1.6;
    white-space: pre-wrap;
    background: var(--surface-2);
    border-radius: 8px;
    padding: 12px;
}
.note-detail-assets {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.note-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 4px;
}

/* ── Recurring reminders ────────────────────────────────── */
.reminder-badge.recurring { background: #EAF0FB; color: #1a5276; font-weight: 700; }
.reminder-btn-stop-recurring {
    font-size: 0.82rem; font-weight: 600;
    background: #fdf2f8; color: #922b21; border: 1px solid #f1948a;
    border-radius: 8px; padding: 5px 10px; cursor: pointer;
}
.reminder-recur-summary {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--card-bg); border-radius: 12px;
    padding: 12px 16px; margin-bottom: 6px; cursor: pointer;
    font-weight: 600; font-size: 0.95rem; color: var(--text-1);
    border: 1.5px solid var(--border);
}
.reminder-recur-count { font-size: 0.85rem; color: var(--text-3); }
.reminder-recur-group { display: none; padding-left: 12px; }
.reminder-recur-group.open { display: block; }
.reminder-recur-edit-info {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: #EAF0FB; border-radius: 8px; padding: 8px 12px;
    font-size: 0.85rem; font-weight: 600; color: #1a5276;
}
