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

html {
    /* Prevents iOS Safari viewport jumping on full-height sections */
    scroll-behavior: smooth;
    font-size: 20px;
}

body {
    background-color: var(--surface-0);
    color: var(--txt);
    font-family: 'Outfit', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent orphaned words in longer text */
    text-wrap: pretty;
}

/* ==================== Focus Rings (Keyboard Accessibility) ==================== */
:focus-visible {
    outline: 2px solid rgba(0, 46, 192, 0.7);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==================== Tabular Numbers (Data Interfaces) ==================== */
.font-mono,
[class*="mono"],
.conversation-date,
.memory-cat-count,
.stat-value {
    font-variant-numeric: tabular-nums;
}

/* ==================== Heading Balance ==================== */
h1, h2, h3, h4, .panel-header-row h2, .empty-state {
    text-wrap: balance;
}

/* ==================== Animations ==================== */
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeUpIn {
    from { opacity: 0; transform: translateY(16px); filter: blur(2px); }
    to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.96) translateY(4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes subtlePulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* ==================== Panel Header Row ==================== */
.panel-header-row {
    height: 60px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ==================== Login Screen ==================== */
#loginOverlay {
    animation: fadeIn 500ms cubic-bezier(0.32, 0.72, 0, 1);
}

.login-card {
    /* Double-bezel: outer shell defines the ambient glow, inner card sits inside */
    box-shadow:
        0 0 0 1px var(--card-border),
        0 8px 24px -4px rgba(0, 46, 192, 0.08),
        0 32px 64px -12px var(--shadow-color);
    animation: scaleIn 600ms cubic-bezier(0.32, 0.72, 0, 1) 100ms both;
    /* Inner highlight simulating glass edge refraction */
    outline: 1px solid rgba(255, 255, 255, 0.04);
    outline-offset: -1px;
}

:root.light .login-card {
    outline-color: rgba(255, 255, 255, 0.6);
}

/* ==================== Sidebar ==================== */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--txt-secondary);
    text-decoration: none;
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
    cursor: pointer;
    background: none;
    border: none;
    text-align: left;
    position: relative;
}

.sidebar-item:hover {
    background: var(--hover-bg);
    color: var(--txt);
    transform: translateX(1px);
}

.sidebar-item:active {
    transform: scale(0.98) translateX(1px);
}

.sidebar-item.active {
    background: #002EC0;
    color: #fff;
    font-weight: 600;
    /* Tinted diffusion shadow — no harsh black drop shadow */
    box-shadow:
        0 1px 3px rgba(0, 46, 192, 0.2),
        0 4px 16px rgba(0, 46, 192, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: none;
}

.sidebar-item.active:hover {
    background: #0035d4;
    transform: none;
}

/* ==================== Conversations ==================== */
.conversation-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 220ms cubic-bezier(0.32, 0.72, 0, 1);
    border: 1px solid transparent;
    position: relative;
}

.conversation-item:hover {
    background: var(--hover-bg);
    border-color: var(--line);
    transform: translateX(1px);
}

.conversation-item:active {
    transform: scale(0.99);
}

.conversation-item.selected {
    background: rgba(0, 46, 192, 0.08);
    border-color: rgba(0, 46, 192, 0.2);
}

.conversation-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 55%;
    background: #002EC0;
    border-radius: 0 3px 3px 0;
}

/* ==================== Messages ==================== */
.message-bubble {
    max-width: 80%;
    padding: 0.625rem 0.875rem;
    border-radius: 0.875rem;
    font-size: 0.875rem;
    line-height: 1.55;
    animation: fadeSlideIn 200ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.message-user {
    background: #002EC0;
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 46, 192, 0.25);
}

.message-assistant {
    background: var(--msg-assistant-bg);
    color: var(--msg-assistant-color);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--msg-assistant-border);
}

/* ==================== Message Playback ==================== */
.message-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.375rem;
}

.message-wrapper.msg-user {
    flex-direction: row-reverse;
}

.message-bubble {
    position: relative;
    overflow: hidden;
}

.message-bubble .sweep-overlay {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    pointer-events: none;
    border-radius: inherit;
    transition: none;
}

.message-user .sweep-overlay {
    background: var(--sweep-user);
}

.message-assistant .sweep-overlay {
    background: var(--sweep-assistant);
}

.play-btn {
    flex-shrink: 0;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    background: var(--hover-bg);
    color: var(--txt-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 220ms cubic-bezier(0.32, 0.72, 0, 1);
    padding: 0;
    margin-bottom: 0.25rem;
}

.play-btn:hover {
    background: var(--brand-muted);
    border-color: rgba(0, 46, 192, 0.4);
    color: var(--txt);
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(0, 46, 192, 0.06);
}

.play-btn:active {
    transform: scale(0.94);
    transition-duration: 80ms;
}

.play-btn.playing {
    background: rgba(0, 46, 192, 0.2);
    border-color: rgba(0, 46, 192, 0.5);
    color: var(--txt);
}

.play-btn svg {
    width: 0.75rem;
    height: 0.75rem;
}

/* ==================== Upload Drop Zone ==================== */
.drop-zone {
    border: 2px dashed var(--line-strong);
    transition: all 250ms cubic-bezier(0.32, 0.72, 0, 1);
    position: relative;
    overflow: hidden;
    background: var(--brand-faint);
}

.drop-zone::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 46, 192, 0.04) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 220ms cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: none;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #002EC0;
    background: rgba(0, 46, 192, 0.03);
    box-shadow: 0 0 0 4px rgba(0, 46, 192, 0.06);
}

.drop-zone:hover::after,
.drop-zone.dragover::after {
    opacity: 1;
}

/* ==================== Buttons ==================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background: #002EC0;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    /* Pill shape per high-end-visual-design spec */
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 250ms cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow:
        0 1px 3px rgba(0, 46, 192, 0.2),
        0 4px 16px rgba(0, 46, 192, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-primary:hover {
    background: #0035d4;
    box-shadow:
        0 2px 6px rgba(0, 46, 192, 0.25),
        0 8px 24px rgba(0, 46, 192, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97) translateY(0);
    box-shadow:
        0 1px 2px rgba(0, 46, 192, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition-duration: 100ms;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: transparent;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 9999px;
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-danger:active {
    transform: scale(0.97);
    transition-duration: 80ms;
}

/* ==================== Inputs ==================== */
.input-field {
    width: 100%;
    padding: 0.5rem 0.875rem;
    background: var(--input-bg);
    border: 1px solid var(--line);
    border-radius: 0.625rem;
    color: var(--txt);
    font-size: 0.875rem;
    outline: none;
    transition: all 220ms cubic-bezier(0.32, 0.72, 0, 1);
    /* Inset shadow simulates physical depth of a recessed input */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08);
}

.input-field::placeholder {
    color: var(--txt-muted);
}

.input-field:focus {
    border-color: rgba(0, 46, 192, 0.45);
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.06),
        0 0 0 3px rgba(0, 46, 192, 0.09);
    background: var(--input-focus-bg);
}

:root.light .input-field {
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* ==================== File Cards ==================== */
.file-card {
    /* Double-bezel: card sits inside an implicit outer shell via border + inner highlight */
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    overflow: hidden;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    max-height: 340px;
    transition: all 280ms cubic-bezier(0.32, 0.72, 0, 1);
    animation: fadeUpIn 400ms cubic-bezier(0.32, 0.72, 0, 1) both;
    /* Inner top-edge highlight for glass depth */
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.file-card:hover {
    border-color: rgba(0, 46, 192, 0.22);
    transform: translateY(-3px);
    /* Tinted diffusion shadow — brand-colored ambient glow, no harsh black */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 4px 12px rgba(0, 46, 192, 0.06),
        0 12px 32px rgba(0, 0, 0, 0.14);
}

.file-card-preview {
    width: 100%;
    height: 160px;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    position: relative;
}

.file-card-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(14, 16, 24, 0.6) 100%);
    pointer-events: none;
}

.file-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 350ms cubic-bezier(0.32, 0.72, 0, 1);
}

.file-card:hover .file-card-thumb {
    transform: scale(1.03);
}

.file-card-media {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--input-bg);
}

.file-card-text-preview {
    width: 100%;
    height: 100%;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: var(--txt-secondary);
    overflow: hidden;
    white-space: pre-wrap;
    line-height: 1.3;
}

.file-card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    word-break: break-all;
    max-width: 100%;
}

.file-card-body {
    padding: 0.875rem 1rem;
    flex: 1;
    min-width: 0;
}

.file-card-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--txt);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.file-card-desc {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.file-delete-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.3125rem 0.625rem;
    background: transparent;
    color: #ef4444;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}

.file-delete-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
}

/* ==================== Preview Overlay ==================== */
.preview-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--overlay-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.preview-overlay.visible {
    display: flex;
    animation: fadeIn 200ms ease-out;
}

.preview-overlay-content {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0.75rem;
    animation: scaleIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-side-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    padding: 3.5rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    background: var(--surface-1);
    border-left: 1px solid var(--line);
    animation: fadeIn 200ms ease-out;
    z-index: 1;
}

.preview-overlay-text {
    width: min(900px, 90vw);
    max-height: 85vh;
    overflow: auto;
    padding: 1.5rem;
    border-radius: 0.75rem;
    background: var(--card-bg);
    border: 1px solid var(--line);
    white-space: pre-wrap;
    color: var(--txt);
    font-size: 0.875rem;
    line-height: 1.55;
    animation: scaleIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.preview-centered-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3rem;
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    animation: scaleIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 500px;
}

.preview-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: #002EC0;
    color: #fff;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 250ms cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 2px 6px rgba(0, 46, 192, 0.22),
        0 4px 16px rgba(0, 46, 192, 0.16);
    flex-shrink: 0;
}

.preview-download-btn:hover {
    background: #0035d4;
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 4px 10px rgba(0, 46, 192, 0.28),
        0 8px 24px rgba(0, 46, 192, 0.2);
}

.preview-download-btn:active {
    transform: scale(0.97);
    transition-duration: 80ms;
}

.preview-overlay-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--txt);
    border: 1px solid var(--line-strong);
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 220ms cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 2;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.preview-overlay-close:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
}

.preview-overlay-link {
    padding: 0.625rem 1.25rem;
    background: #002EC0;
    color: #fff;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 1px 4px rgba(0, 46, 192, 0.3);
}

.preview-overlay-link:hover {
    background: #0035d4;
    box-shadow: 0 2px 8px rgba(0, 46, 192, 0.4);
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--txt-muted);
    font-size: 0.8125rem;
    line-height: 1.6;
    animation: fadeIn 400ms ease-out;
}

/* ==================== Scrollbar ==================== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ==================== Progress Bar ==================== */
#progress-fill {
    background: linear-gradient(90deg, #002EC0 0%, #1a5ff8 50%, #002EC0 100%) !important;
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

/* ==================== Staggered Card Entrance ==================== */
.file-card:nth-child(1)  { animation-delay: 0ms; }
.file-card:nth-child(2)  { animation-delay: 40ms; }
.file-card:nth-child(3)  { animation-delay: 80ms; }
.file-card:nth-child(4)  { animation-delay: 120ms; }
.file-card:nth-child(5)  { animation-delay: 160ms; }
.file-card:nth-child(6)  { animation-delay: 200ms; }
.file-card:nth-child(7)  { animation-delay: 240ms; }
.file-card:nth-child(8)  { animation-delay: 280ms; }
.file-card:nth-child(9)  { animation-delay: 320ms; }
.file-card:nth-child(10) { animation-delay: 360ms; }
.file-card:nth-child(11) { animation-delay: 400ms; }
.file-card:nth-child(12) { animation-delay: 440ms; }

/* ==================== PERSONA CARDS ==================== */

.persona-card {
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 0;
    background: var(--card-bg);
    transition: all 280ms cubic-bezier(0.32, 0.72, 0, 1);
    animation: fadeUpIn 400ms cubic-bezier(0.32, 0.72, 0, 1) both;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.persona-card-top {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    padding: 1.5rem;
    cursor: pointer;
    min-height: 140px;
}
.persona-card:hover {
    border-color: rgba(0, 46, 192, 0.22);
    transform: translateY(-3px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.07),
        0 4px 12px rgba(0, 46, 192, 0.07),
        0 12px 32px rgba(0, 0, 0, 0.14);
}
.persona-card--active {
    border-color: rgba(0, 46, 192, 0.35);
    background: var(--surface-2);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 0 1px rgba(0, 46, 192, 0.15),
        0 4px 20px rgba(0, 46, 192, 0.1);
}
.persona-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
}
.persona-card-img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}
.persona-card-body {
    flex: 1;
    min-width: 0;
}
.persona-card-name {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--txt);
    margin-bottom: 2px;
}
.persona-card-traits {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--txt-muted);
    margin-bottom: 6px;
}
.persona-card-desc {
    font-size: 0.8125rem;
    color: var(--txt-secondary);
    line-height: 1.5;
}
.persona-card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 8px;
    background: #002EC0;
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 46, 192, 0.3);
}
.persona-card-select {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 8px;
    background: var(--hover-bg);
    color: var(--txt-muted);
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.persona-card-save {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 14px;
    border-radius: 8px;
    background: #22c55e;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(34, 197, 94, 0.3);
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.persona-card-save:hover {
    background: #16a34a;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.35);
}
.persona-card-voice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--card-border);
    background: var(--surface-0);
}
.persona-voice-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--txt-muted);
    flex-shrink: 0;
}
.persona-voice-select {
    flex: 1;
    min-width: 0;
    padding: 0.375rem 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    color: var(--txt);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.persona-voice-select:focus {
    border-color: rgba(0, 46, 192, 0.4);
    box-shadow: 0 0 0 2px rgba(0, 46, 192, 0.08);
}
.persona-voice-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.persona-voice-play {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(0, 46, 192, 0.25);
    background: rgba(0, 46, 192, 0.08);
    color: rgb(100, 140, 255);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}
.persona-voice-play:hover {
    background: rgba(0, 46, 192, 0.15);
}
.persona-preview-btn {
    width: 32px;
    height: 32px;
    border-radius: 0.375rem;
    border: 1px solid var(--line-strong);
    background: var(--hover-bg);
    color: var(--txt-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.persona-preview-btn:hover {
    background: rgba(0, 46, 192, 0.12);
    border-color: rgba(0, 46, 192, 0.3);
    color: #92b4ff;
}
.persona-preview-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}
.persona-preview-btn svg {
    width: 14px;
    height: 14px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.animate-spin {
    animation: spin 1s linear infinite;
}

/* ==================== MEMORY DASHBOARD ==================== */

.memory-cat-btn {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--txt-secondary);
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
}
.memory-cat-btn:hover {
    background: var(--hover-bg);
    color: var(--txt);
    transform: translateX(1px);
}
.memory-cat-btn:active {
    transform: scale(0.98);
}
.memory-cat-btn.active {
    background: #002EC0;
    color: #fff;
    font-weight: 600;
    box-shadow:
        0 1px 3px rgba(0, 46, 192, 0.2),
        0 4px 16px rgba(0, 46, 192, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: none;
}
.memory-cat-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.memory-cat-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--txt-muted);
    background: var(--hover-bg);
    padding: 1px 7px;
    border-radius: 10px;
}

.memory-item {
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    padding: 0.875rem 1rem;
    background: var(--card-bg);
    transition: all 250ms cubic-bezier(0.32, 0.72, 0, 1);
    animation: fadeUpIn 350ms cubic-bezier(0.32, 0.72, 0, 1) both;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.memory-item:hover {
    border-color: rgba(0, 46, 192, 0.14);
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 4px 16px rgba(0, 46, 192, 0.05),
        0 8px 24px rgba(0, 0, 0, 0.12);
}
.memory-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.375rem;
}
.memory-item-badge {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 6px;
}
.memory-item-content {
    font-size: 0.8125rem;
    color: var(--txt);
    line-height: 1.5;
    margin-bottom: 0.375rem;
}
.memory-item-meta {
    font-size: 0.8125rem;
    color: var(--txt-muted);
}
.memory-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.memory-item-actions button {
    font-size: 0.8125rem;
    font-weight: 500;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--txt-secondary);
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}
.memory-item-actions button:hover {
    background: var(--hover-bg);
    color: var(--txt);
    border-color: var(--line-strong);
}
.memory-item-actions button.action-danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}
.memory-item-actions button.action-danger:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
}
.memory-item-actions button.action-save {
    color: rgb(100, 140, 255);
    border-color: rgba(0, 46, 192, 0.25);
}
.memory-item-actions button.action-save:hover {
    background: rgba(0, 46, 192, 0.08);
    border-color: rgba(0, 46, 192, 0.4);
}
.memory-item-actions button.action-success {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
}
.memory-item-actions button.action-success:hover {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.4);
}

/* ==================== ADD MEMORY BUTTON ==================== */

.btn-add-memory {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid rgba(0, 46, 192, 0.25);
    background: rgba(0, 46, 192, 0.08);
    color: rgb(100, 140, 255);
    cursor: pointer;
    transition: all 0.15s;
}
.btn-add-memory:hover {
    background: rgba(0, 46, 192, 0.15);
}

/* ==================== MODAL ==================== */

.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}
.modal-card {
    background: var(--surface-1);
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--line);
}
.modal-close {
    font-size: 20px;
    line-height: 1;
    background: none;
    border: none;
    color: var(--txt-muted);
    cursor: pointer;
    padding: 0 4px;
}
.modal-close:hover { color: var(--txt); }
.modal-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.modal-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--txt-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.modal-field select,
.modal-field textarea,
.modal-field-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-0);
    color: var(--txt);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.modal-field select:focus,
.modal-field textarea:focus,
.modal-field-input:focus {
    border-color: rgba(0, 46, 192, 0.5);
}
.modal-field textarea {
    min-height: 80px;
    resize: vertical;
    line-height: 1.5;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 16px;
    border-top: 1px solid var(--line);
}
.modal-btn-cancel {
    font-size: 12px;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: var(--surface-1);
    color: var(--txt-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.modal-btn-cancel:hover { background: var(--surface-2); color: var(--txt); }
.modal-btn-save {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid rgba(0, 46, 192, 0.3);
    background: rgba(0, 46, 192, 0.12);
    color: rgb(100, 140, 255);
    cursor: pointer;
    transition: all 0.15s;
}
.modal-btn-save:hover { background: rgba(0, 46, 192, 0.22); }

/* ==================== INLINE EDIT ==================== */

.edit-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 60px;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface-0);
    color: var(--txt);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}
.edit-textarea:focus {
    border-color: rgba(0, 46, 192, 0.5);
}
.edit-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.edit-actions button {
    font-size: 13px;
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid var(--line);
    background: var(--surface-1);
    color: var(--txt-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.edit-actions button:hover {
    background: var(--surface-2);
    color: var(--txt);
}
.edit-actions .action-save {
    background: rgba(0, 46, 192, 0.1);
    border-color: rgba(0, 46, 192, 0.25);
    color: rgb(100, 140, 255);
}
.edit-actions .action-save:hover {
    background: rgba(0, 46, 192, 0.18);
}

/* ==================== JOURNAL ==================== */

.journal-list-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    animation: fadeUpIn 300ms cubic-bezier(0.32, 0.72, 0, 1) both;
}
.journal-list-item:hover {
    background: var(--surface-1);
    transform: translateX(1px);
}
.journal-list-item.active {
    background: var(--surface-2);
}
.journal-list-title {
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--txt);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.journal-list-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}
.journal-list-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--txt-muted);
    font-variant-numeric: tabular-nums;
}
.journal-list-sessions {
    font-size: 13px;
    color: var(--txt-muted);
    background: rgba(0, 46, 192, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
}

.journal-article {
    max-width: 680px;
    line-height: 1.75;
    font-size: 15px;
    color: var(--txt);
}
.journal-article h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 20px;
    color: var(--txt);
}
.journal-article h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    margin: 24px 0 10px;
    color: var(--txt);
}
.journal-article p {
    margin-bottom: 16px;
}
.journal-article strong {
    font-weight: 600;
}
.journal-article em {
    font-style: italic;
    color: var(--txt-secondary);
}
.journal-article ul, .journal-article ol {
    padding-left: 20px;
    margin-bottom: 16px;
}
.journal-article li {
    margin-bottom: 4px;
}
.journal-article blockquote {
    border-left: 3px solid rgba(0, 46, 192, 0.3);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--txt-secondary);
    font-style: italic;
}

.journal-image-wrap {
    margin: 24px 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface-1);
    border: 1px solid var(--line);
}
.journal-image {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s ease;
}
.journal-image:hover {
    opacity: 0.92;
}
.journal-image-caption {
    padding: 8px 14px 10px;
    font-size: 12px;
    color: var(--txt-muted);
    font-style: italic;
    margin: 0;
}

.journal-edit-textarea {
    width: 100%;
    height: 100%;
    min-height: 400px;
    box-sizing: border-box;
    padding: 16px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface-0);
    color: var(--txt);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}
.journal-edit-textarea:focus {
    border-color: rgba(0, 46, 192, 0.5);
}
.action-cancel-btn {
    border-color: rgba(239, 68, 68, 0.25) !important;
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.06) !important;
}
.action-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.12) !important;
}

/* ==================== USAGE DASHBOARD ==================== */

.usage-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
}
.usage-card {
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    padding: 1.25rem 1.5rem;
    animation: fadeUpIn 350ms cubic-bezier(0.32, 0.72, 0, 1) both;
}
.usage-card-wide { grid-column: span 6; }
.usage-card-third { grid-column: span 2; }
.usage-card-half { grid-column: span 3; }
.usage-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--txt-muted);
    margin-bottom: 0.875rem;
}
.usage-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--txt);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.usage-stat-label {
    font-size: 0.875rem;
    color: var(--txt-secondary);
    margin-top: 0.125rem;
}

/* Bar chart */
.usage-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 80px;
    margin-top: 1rem;
    padding-top: 4px;
}
.usage-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.375rem;
    height: 100%;
    justify-content: flex-end;
}
.usage-bar {
    width: 100%;
    max-width: 40px;
    border-radius: 4px 4px 0 0;
    background: #002EC0;
    min-height: 2px;
    transition: height 400ms cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.usage-bar-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}
.usage-bar-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--txt-secondary);
}

/* Calendar */
.usage-calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.usage-calendar-header span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--txt-secondary);
    text-align: center;
}
.usage-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.usage-cal-dot {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    border: 1px solid var(--line);
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 600;
    color: transparent;
    transition: all 0.15s;
}
.usage-cal-dot.active {
    background: #002EC0;
    border-color: #002EC0;
    box-shadow: 0 0 6px rgba(0, 46, 192, 0.25);
    color: #fff;
}
.usage-cal-dot.today {
    outline: 2px solid var(--txt-muted);
    outline-offset: 1px;
}

/* Memory overview rows */
.usage-mem-rows { display: flex; flex-direction: column; gap: 0.75rem; }
.usage-mem-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.usage-mem-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.usage-mem-label {
    font-size: 0.8125rem;
    color: var(--txt-secondary);
    flex: 1;
}
.usage-mem-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--txt);
    font-variant-numeric: tabular-nums;
}

/* Hourly heatmap */
.usage-heatmap {
    display: flex;
    gap: 3px;
    align-items: flex-end;
}
.usage-heat-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.usage-heat-cell {
    width: 100%;
    height: 28px;
    border-radius: 4px;
    transition: opacity 0.3s;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}
.usage-heat-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
}
.usage-heat-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--txt-secondary);
    height: 16px;
}

/* Horizontal bar chart */
.usage-hbar-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.usage-hbar-label {
    width: 80px;
    font-size: 0.875rem;
    color: var(--txt-secondary);
    text-transform: capitalize;
    flex-shrink: 0;
}
.usage-hbar-track {
    flex: 1;
    height: 6px;
    background: var(--surface-2);
    border-radius: 3px;
    overflow: hidden;
}
.usage-hbar-fill {
    height: 100%;
    background: #002EC0;
    border-radius: 3px;
    transition: width 500ms cubic-bezier(0.32, 0.72, 0, 1);
}
.usage-hbar-count {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--txt-muted);
    width: 28px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

/* Sentiment stacked bar */
.usage-sentiment-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}
.usage-sentiment-bar > div {
    transition: width 500ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* ==================== FAMILY SHARING ==================== */

.family-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(0, 46, 192, 0.08);
    border-bottom: 1px solid rgba(0, 46, 192, 0.15);
    color: var(--txt-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    flex-shrink: 0;
}

.family-member-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    background: var(--card-bg);
    transition: all 250ms cubic-bezier(0.32, 0.72, 0, 1);
    animation: fadeSlideIn 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.family-member-card:hover {
    border-color: rgba(0, 46, 192, 0.15);
}

.family-member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
    background: rgba(0, 46, 192, 0.12);
    color: rgb(100, 140, 255);
}

.family-member-info {
    flex: 1;
    min-width: 0;
}

.family-member-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--txt);
}

.family-member-date {
    font-size: 0.8125rem;
    color: var(--txt-muted);
}

.permission-badge {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 8px;
    border-radius: 6px;
}

.permission-badge.view {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
}

.permission-badge.edit {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.family-member-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.family-member-actions select {
    padding: 0.25rem 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    color: var(--txt);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
}

.family-member-actions .remove-btn {
    padding: 0.25rem 0.5rem;
    background: transparent;
    color: #ef4444;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
}

.family-member-actions .remove-btn:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
}

.owner-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay-bg);
    backdrop-filter: blur(16px);
    animation: fadeIn 200ms ease-out;
}

.owner-picker-card {
    background: var(--surface-1);
    border: 1px solid var(--line-strong);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    animation: scaleIn 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.owner-picker-card h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.owner-picker-card p {
    font-size: 0.8125rem;
    color: var(--txt-secondary);
    margin-bottom: 1.25rem;
}

.owner-picker-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 200ms cubic-bezier(0.32, 0.72, 0, 1);
    margin-bottom: 0.5rem;
}

.owner-picker-item:hover {
    border-color: rgba(0, 46, 192, 0.3);
    background: rgba(0, 46, 192, 0.05);
}

/* ==================== Skip to Content (Accessibility) ==================== */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    padding: 0.5rem 1rem;
    background: #002EC0;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0 0 0.5rem 0;
    z-index: 10000;
    transition: top 200ms cubic-bezier(0.32, 0.72, 0, 1);
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

/* ==================== INBOX + STAGED PHOTO ==================== */

.inbox-badge {
    margin-left: auto;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #002EC0;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}

.inbox-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface-1);
    position: relative;
}

.inbox-item-unread {
    border-color: rgba(0, 46, 192, 0.35);
    background: var(--brand-muted);
}

.inbox-play {
    margin-top: 0.1rem;
}

.inbox-item-body {
    flex: 1;
    min-width: 0;
    position: relative;
    border-radius: 0.5rem;
}

.inbox-item-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inbox-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #002EC0;
    flex-shrink: 0;
}

.inbox-item-title {
    font-weight: 600;
    color: var(--txt);
}

.inbox-item-from {
    font-size: 0.75rem;
    color: var(--txt-muted);
}

.inbox-item-transcript {
    margin-top: 0.25rem;
    color: var(--txt-secondary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.inbox-delete-btn {
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ef4444;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 0.5rem;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    transition: all 180ms ease;
}

.inbox-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.staged-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid rgba(0, 46, 192, 0.35);
    border-radius: 0.75rem;
    background: var(--brand-muted);
}

.staged-card-thumb {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid var(--line);
    flex-shrink: 0;
    background: var(--surface-2);
}

.staged-card-body {
    flex: 1;
    min-width: 0;
}

.staged-card-tag {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(0, 46, 192, 0.15);
    color: #3b82f6;
    margin-bottom: 0.35rem;
}

.staged-card-name {
    font-weight: 600;
    color: var(--txt);
}

.staged-confirm-btn {
    width: auto;
    display: inline-flex;
}
