/* SPDX-License-Identifier: ISC */
/* Copyright (c) 2026 iBorkedIt */

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ==========================================================================
   Capture overlay — global scope (Blazor scoped CSS does not propagate
   correctly to overlays rendered at the layout level outside any page scope).

   Mobile default: picker floats above the FAB + nav bar; form is a bottom
   sheet that slides up. Desktop (≥640px): both are centred modal cards.
   ========================================================================== */

/* ── Backdrop ──────────────────────────────────────────────────────────── */

.capture-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);           /* 200 — above nav rail (100) */
    background: rgba(0, 0, 0, 0.48);
    opacity: 0;
    transition: opacity 200ms ease;
}

.capture-backdrop--visible {
    opacity: 1;
}

/* ── Picker (pill row) — mobile ────────────────────────────────────────── */

.capture-picker {
    position: fixed;
    left: var(--space-4);
    right: var(--space-4);
    /*
     * Stack above: bottom nav (56px) + safe area + FAB height (56px) +
     * FAB bottom gap (var(--space-3)) + picker gap (var(--space-2)).
     */
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 56px + var(--space-3) + var(--space-2));
    z-index: calc(var(--z-modal) + 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-surface-card);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card-raised);
    opacity: 1;
    transition: opacity 150ms ease;
}

.capture-picker--exiting {
    opacity: 0;
    pointer-events: none;
}

.capture-picker__prompt {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--color-text-secondary);
}

.capture-picker__pills {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    justify-content: center;
}

/* ── Pill buttons ──────────────────────────────────────────────────────── */

.capture-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-accent);
    background: transparent;
    color: var(--color-accent);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.capture-pill:hover {
    background: var(--color-accent-glow);
}

.capture-pill:active {
    background: var(--color-accent);
    color: #fff;
}

.capture-pill:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.capture-pill__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ── Capture sheet — mobile bottom sheet ───────────────────────────────── */

.capture-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--z-modal) + 1);
    max-height: 85svh;
    background: var(--color-surface-card);
    border-top: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.32);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Initial hidden state — JS adds --visible to trigger the transition */
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.capture-sheet--visible {
    transform: translateY(0);
}

.capture-sheet__handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border-subtle);
    margin: var(--space-2) auto var(--space-1);
    flex-shrink: 0;
}

.capture-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4) var(--space-3);
    border-bottom: 1px solid var(--color-border-subtle);
    flex-shrink: 0;
}

.capture-sheet__title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--color-text-primary);
}

.capture-sheet__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.capture-sheet__close svg {
    width: 18px;
    height: 18px;
}

.capture-sheet__close:hover {
    background: var(--color-surface-hover);
}

.capture-sheet__close:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}

.capture-sheet__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* ── Capture form fields ───────────────────────────────────────────────── */

.capture-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.capture-field__label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text-secondary);
}

.capture-field__input,
.capture-field__textarea {
    padding: var(--space-2) var(--space-3);
    background: var(--color-s0);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.capture-field__input:focus,
.capture-field__textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.capture-field__input--error,
.capture-field__textarea--error {
    border-color: var(--color-error);
}

.capture-field__input--error:focus,
.capture-field__textarea--error:focus {
    box-shadow: 0 0 0 3px var(--color-error-glow);
}

.capture-field__textarea {
    resize: vertical;
    min-height: 7rem;
    line-height: var(--leading-normal);
}

.capture-field__error {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--color-error);
}

.capture-form__error {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-error);
}

.capture-form__actions {
    display: flex;
    justify-content: flex-end;
    padding-top: var(--space-1);
}

.capture-form__save-btn {
    padding: var(--space-2) var(--space-5);
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

.capture-form__save-btn:hover {
    opacity: 0.88;
}

.capture-form__save-btn:active {
    opacity: 0.76;
}

.capture-form__save-btn:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: 2px;
}

.capture-form__save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── Capture tag picker ─────────────────────────────────────────────────── */

.capture-tags { gap: var(--space-2); }

.capture-tags__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1-5);
}

.capture-tag-chip {
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-s1);
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: background var(--duration-fast), color var(--duration-fast), border-color var(--duration-fast);
}

.capture-tag-chip.is-selected {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

.capture-tag-chip--confidential.is-selected {
    background: var(--color-error);
    border-color: var(--color-error);
}

.capture-tag-chip--add {
    border-style: dashed;
    color: var(--color-text-tertiary);
}

.capture-tags__new-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-1-5);
    margin-top: var(--space-1);
}

.capture-tags__new-input {
    flex: 1 1 8rem;
    min-width: 0;
    padding: 2px var(--space-2);
    background: var(--color-s0);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: var(--text-xs);
}

.capture-tags__new-sensitivity {
    padding: 2px var(--space-1);
    background: var(--color-s0);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-size: var(--text-xs);
}

.capture-tags__new-confirm,
.capture-tags__new-cancel {
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: transparent;
}

.capture-tags__new-confirm { color: var(--color-accent); }
.capture-tags__new-cancel  { color: var(--color-text-tertiary); }

/* ── Image capture ─────────────────────────────────────────────────────── */

.capture-image__format {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    flex-wrap: wrap;
    margin-bottom: var(--space-2);
}

.capture-image__format-btn {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--color-border, rgba(255,255,255,0.12));
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-base);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.capture-image__format-btn.is-active {
    background: var(--color-accent-glow);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

.capture-image__quality-note {
    margin-left: var(--space-1);
    font-size: var(--text-base);
    color: var(--color-text-tertiary);
}

/* Hidden native file input — activated by the label area */
.capture-image__file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Click-to-browse / paste area */
.capture-image__pick-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-3);
    border: 1.5px dashed var(--color-border, rgba(255,255,255,0.16));
    border-radius: var(--radius-sm, 6px);
    cursor: pointer;
    text-align: center;
    color: var(--color-text-secondary);
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.capture-image__pick-area:hover {
    border-color: var(--color-accent);
    background: var(--color-accent-glow);
}

.capture-image__pick-area--compact {
    flex-direction: row;
    justify-content: flex-start;
    padding: var(--space-2) var(--space-3);
    gap: var(--space-2);
    text-align: left;
}

.capture-image__pick-icon {
    width: 2rem;
    height: 2rem;
    color: var(--color-text-tertiary);
    flex-shrink: 0;
}

.capture-image__pick-icon--small {
    width: 1.25rem;
    height: 1.25rem;
}

.capture-image__pick-text {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-text-primary);
}

.capture-image__pick-hint {
    font-size: var(--text-base);
    color: var(--color-text-tertiary);
}

.capture-image__pick-filename {
    font-size: var(--text-base);
    font-weight: 500;
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.capture-image__pick-change {
    font-size: var(--text-base);
    color: var(--color-accent);
    flex-shrink: 0;
}

.capture-image__preview-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-2);
}

.capture-image__preview {
    display: block;
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: var(--radius-sm, 6px);
    background: var(--color-s1);
}

.capture-image__meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    font-size: var(--text-base);
    color: var(--color-text-secondary);
}

.capture-image__size--over {
    color: var(--color-error);
    font-weight: 500;
}

.capture-image__scale-label {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
}

.capture-image__scale-slider {
    width: 100%;
    accent-color: var(--color-accent);
}

/* ── Image source mode toggle (File | Camera) ─────────────────────────── */

.capture-image__mode-toggle {
    display: flex;
    gap: var(--space-1);
    margin-bottom: var(--space-2);
}

.capture-image__mode-btn {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-base);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.capture-image__mode-btn.is-active {
    background: var(--color-accent-glow);
    color: var(--color-accent);
    border-color: var(--color-accent);
}

/* ── Camera viewfinder ─────────────────────────────────────────────────── */

.capture-camera {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.capture-camera__feed {
    width: 100%;
    max-height: 280px;
    border-radius: var(--radius-sm);
    background: var(--color-s1);
    display: block;
    object-fit: cover;
}

.capture-camera__controls {
    display: flex;
    justify-content: center;
    padding: var(--space-1) 0;
}

.capture-camera__shutter {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    border: 3px solid var(--color-text-primary);
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: transform 0.1s;
}

.capture-camera__shutter:active {
    transform: scale(0.92);
}

.capture-camera__shutter::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    background: var(--color-text-primary);
    transition: background 0.1s;
}

.capture-camera__shutter:hover::after {
    background: var(--color-accent);
}

.capture-camera__starting {
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: var(--text-base);
    padding: var(--space-3) 0;
}

.capture-image__retake-btn {
    align-self: flex-start;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-base);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.capture-image__retake-btn:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

/* ── Desktop: centred modal (≥ 640px) ─────────────────────────────────── */

@media (min-width: 640px) {

    .capture-picker {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        min-width: 320px;
        transform: translate(-50%, -50%);
    }

    /*
     * On desktop the picker does not slide — it is centred from the start.
     * JS still adds --exiting to fade it out before the sheet appears.
     */

    .capture-sheet {
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        width: min(480px, 90vw);
        max-height: 80vh;
        border-radius: var(--radius-lg);
        border: 1px solid var(--color-border-subtle);
        box-shadow: var(--shadow-card-raised);
        /* Desktop enter: scale + fade instead of translateY */
        transform: translate(-50%, -50%) scale(0.96);
        opacity: 0;
        transition: transform 200ms ease, opacity 200ms ease;
    }

    .capture-sheet--visible {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .capture-sheet__handle {
        display: none;
    }
}

/* ==========================================================================
   LongOperationOverlay — global scope (Blazor scoped CSS does not propagate
   correctly when the component is a child inside a parent card).
   Dot animation is CSS-driven so it runs on the compositor thread,
   remaining smooth while Argon2id blocks the WASM thread.
   ========================================================================== */

.long-op-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-5);
    padding: var(--space-10) var(--space-8);
    min-height: 280px;
    text-align: center;
}

/* Primary message — e.g. "Deriving encryption key" */
.long-op-overlay__primary {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
    margin: 0;
}

/* Three dots — CSS animated, compositor-thread independent */
.long-op-overlay__dots {
    display: flex;
    gap: var(--space-3);
    align-items: center;
}

.long-op-overlay__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--color-accent);
    opacity: 0.25;
    transform: scale(0.75);
    animation: dot-pulse 1.5s ease-in-out infinite;
}

/* Negative delays pre-start each dot at a different phase of the same cycle.
   All three are already animating the instant they're painted — no waiting. */
.long-op-overlay__dot--1 {
    animation-delay: -1.0s;
}

.long-op-overlay__dot--2 {
    animation-delay: -0.5s;
}

.long-op-overlay__dot--3 {
    animation-delay: 0.0s;
}

@keyframes dot-pulse {
    0%, 100% {
        opacity: 0.25;
        transform: scale(0.75);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Rotating phrase with blinking cursor */
.long-op-overlay__phrase {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    min-height: 1.4em;
    margin: 0;
    font-style: italic;
}

.long-op-overlay__cursor {
    display: inline-block;
    color: var(--color-accent);
    font-style: normal;
    margin-left: 1px;
    animation: cursor-blink 800ms step-end infinite;
    animation-delay: -400ms;
}

@keyframes cursor-blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ==========================================================================
   Content detail sheet
   Overlay — styles here per Blazor CSS isolation note (app.css, not scoped).
   ========================================================================== */

.detail-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

.detail-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

.detail-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: calc(var(--z-modal) + 1);
    max-height: 85svh;
    background: var(--color-surface-card);
    border-top: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.32);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.detail-sheet--visible {
    transform: translateY(0);
}

.detail-sheet__handle {
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border-subtle);
    margin: var(--space-2) auto var(--space-1);
    flex-shrink: 0;
}

.detail-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4) var(--space-3);
    border-bottom: 1px solid var(--color-border-subtle);
    flex-shrink: 0;
}

.detail-sheet__title {
    margin: 0;
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
    color: var(--color-text-primary);
}

.detail-sheet__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.detail-sheet__close:hover    { background: var(--color-surface-hover); }
.detail-sheet__close:focus-visible {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -2px;
}

.detail-sheet__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.detail-sheet__status {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
}

.detail-sheet__status--error {
    color: var(--color-error);
}

.detail-sheet__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border-subtle);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 600ms linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Detail content elements */

.detail-fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: var(--space-1) var(--space-4);
    margin: 0;
}

.detail-fields dt {
    color: var(--color-text-tertiary);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-top: 2px;
    white-space: nowrap;
}

.detail-fields dd {
    color: var(--color-text-primary);
    font-size: var(--text-sm);
    margin: 0;
    word-break: break-all;
}

.detail-fields--compact {
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border-subtle);
}

.detail-link {
    color: var(--color-accent);
    text-decoration: none;
    word-break: break-all;
}

.detail-link:hover { text-decoration: underline; }

.detail-snippet {
    margin: 0;
    padding: var(--space-3);
    background: var(--color-s1);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
    font-family: var(--font-mono, monospace);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
}

.detail-note-title {
    margin: 0;
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--color-text-primary);
}

.detail-image-wrap {
    display: block;
    background: var(--color-s1);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-subtle);
    overflow: hidden;
    max-height: 50svh;
    text-align: center;   /* centres the inline-block img without flex quirks */
}

.detail-image-wrap--edit {
    max-height: 30svh;
}

.detail-image {
    display: inline-block;
    max-width: 100%;
    max-height: 50svh;
    object-fit: contain;
    vertical-align: top;
}

/* Desktop: centered card instead of bottom sheet */
@media (min-width: 640px) {
    .detail-sheet {
        left: 50%;
        right: auto;
        bottom: auto;
        top: 50%;
        width: min(640px, 90vw);
        max-height: 80svh;
        border-radius: var(--radius-lg);
        border: 1px solid var(--color-border-subtle);
        transform: translate(-50%, -50%) scale(0.96);
        transition: transform 250ms cubic-bezier(0.32, 0.72, 0, 1),
                    opacity   250ms ease;
        opacity: 0;
    }

    .detail-sheet--visible {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    .detail-sheet__handle {
        display: none;
    }
}

/* ── Detail sheet: meta line ──────────────────────────────────────────────── */

.detail-sheet__meta {
    margin: 0;
    padding: var(--space-1) var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary);
    border-bottom: 1px solid var(--color-border-subtle);
    flex-shrink: 0;
}

/* ── Detail sheet: action button (edit pencil) ────────────────────────────── */

.detail-sheet__actions {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin-left: auto;   /* push the group right, keeping the title left-aligned */
    padding-right: var(--space-2);
}

.detail-sheet__action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: background var(--duration-fast);
}
.detail-sheet__action:hover { background: var(--color-surface-hover); }
.detail-sheet__action--danger { color: var(--color-error); }
.detail-sheet__action--danger:hover { background: var(--color-error-glow); }

/* ── Detail sheet: delete confirmation ───────────────────────────────────── */

.detail-delete-confirm {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding: var(--space-4);
    background: var(--color-error-glow);
    border-bottom: 1px solid color-mix(in srgb, var(--color-error) 30%, transparent);
    flex-shrink: 0;
}

.detail-delete-confirm__text {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-error);
    font-weight: var(--weight-medium);
}

.detail-delete-confirm__actions {
    display: flex;
    gap: var(--space-2);
}

.detail-delete-confirm__yes {
    padding: var(--space-1-5) var(--space-3);
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-error);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: opacity var(--duration-fast);
}
.detail-delete-confirm__yes:hover { opacity: 0.85; }
.detail-delete-confirm__yes:disabled { opacity: 0.55; cursor: not-allowed; }

.detail-delete-confirm__no {
    padding: var(--space-1-5) var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
}
.detail-delete-confirm__no:hover { background: var(--color-surface-hover); }
.detail-delete-confirm__no:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Detail sheet: image area ─────────────────────────────────────────────── */

.detail-image-btn {
    position: relative;
    display: block;
    width: 100%;
    max-height: 50svh;
    border: none;
    padding: 0;
    background: none;
    cursor: zoom-in;
    overflow: hidden;
    text-align: center;
}

.detail-image-hint {
    position: absolute;
    bottom: var(--space-2);
    right: var(--space-2);
    font-size: var(--text-lg);
    line-height: 1;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    pointer-events: none;
    opacity: 0.8;
}

.detail-download-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1-5);
    margin-top: var(--space-2);
    padding: var(--space-1-5) var(--space-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    text-decoration: none;
    cursor: pointer;
    transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.detail-download-btn:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-border-strong);
    color: var(--color-text-primary);
}

/* ── Detail sheet: edit form ──────────────────────────────────────────────── */

.detail-edit-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.detail-edit-form__title {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    background: var(--color-s1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
}
.detail-edit-form__title:focus {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -1px;
}

.detail-edit-form__body {
    width: 100%;
    min-height: 180px;
    padding: var(--space-2) var(--space-3);
    background: var(--color-s1);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-primary);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    resize: vertical;
    line-height: 1.6;
}
.detail-edit-form__body--short { min-height: 80px; }
.detail-edit-form__body:focus {
    outline: 2px solid var(--color-focus-ring);
    outline-offset: -1px;
}

.detail-edit-form__error {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-error);
}

.detail-edit-form__actions {
    display: flex;
    gap: var(--space-2);
}

.detail-edit-form__save {
    padding: var(--space-1-5) var(--space-4);
    border-radius: var(--radius-sm);
    border: none;
    background: var(--color-accent);
    color: #fff;
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: opacity var(--duration-fast);
}
.detail-edit-form__save:disabled { opacity: 0.55; cursor: not-allowed; }

.detail-edit-form__cancel {
    padding: var(--space-1-5) var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: background var(--duration-fast);
}
.detail-edit-form__cancel:hover { background: var(--color-surface-hover); }
.detail-edit-form__cancel:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Detail sheet: tag picker ─────────────────────────────────────────────── */

.detail-tags {
    border-top: 1px solid var(--color-border-subtle);
    padding-top: var(--space-3);
    margin-top: var(--space-2);
}

.detail-tags__label {
    margin: 0 0 var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-tags__empty {
    margin: 0;
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    font-style: italic;
}

.detail-tags__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-1-5);
}

.detail-tag-chip {
    padding: 2px var(--space-2);
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--duration-fast), border-color var(--duration-fast), color var(--duration-fast);
}
.detail-tag-chip:hover { border-color: var(--color-border-strong); color: var(--color-text-primary); }
.detail-tag-chip:disabled { opacity: 0.55; cursor: default; }

.detail-tag-chip.is-selected {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #fff;
}
.detail-tag-chip--confidential.is-selected {
    background: var(--color-error);
    border-color: var(--color-error);
}

/* ── Lightbox ─────────────────────────────────────────────────────────────── */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-modal) + 10);
    display: flex;
    flex-direction: column;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox__toolbar {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    flex-shrink: 0;
}

.lightbox__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--duration-fast);
}
.lightbox__btn:hover { background: rgba(255,255,255,0.16); }

.lightbox__scroll {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    /* native pinch-to-zoom + pan on mobile */
    touch-action: pan-x pan-y pinch-zoom;
}

.lightbox__image {
    /* Natural size — scrollable/pannable on all devices.
       Object-fit not used here: we want native resolution accessible via scroll. */
    max-width: none;
    max-height: none;
    display: block;
    /* Small margin so the image doesn't hug the toolbar on desktop */
    margin: var(--space-4);
    border-radius: var(--radius-sm);
}

/* ── Export reminder modal ───────────────────────────────────────────────── */
/*    Global scope — overlay rendered in VaultLayout outside page CSS scope. */

.export-reminder-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.export-reminder-dialog {
    background: var(--color-s1);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-6) var(--space-6);
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.export-reminder-icon {
    color: var(--color-accent);
    display: flex;
}

.export-reminder-title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--color-text-primary);
    margin: 0;
}

.export-reminder-body {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin: 0;
}

.export-reminder-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-top: var(--space-1);
}

.export-reminder-btn {
    width: 100%;
    padding: var(--space-2-5) var(--space-4);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    cursor: pointer;
    transition: background var(--duration-fast), border-color var(--duration-fast);
}

.export-reminder-btn--primary {
    background: var(--color-accent);
    border: 1px solid var(--color-accent);
    color: #060a10;
}

.export-reminder-btn--primary:hover {
    background: color-mix(in srgb, var(--color-accent) 85%, white);
}

.export-reminder-btn--secondary {
    background: transparent;
    border: 1px solid var(--color-border-subtle);
    color: var(--color-text-secondary);
}

.export-reminder-btn--secondary:hover {
    background: var(--color-surface-hover);
    color: var(--color-text-primary);
}

/* ── Credential view mode ───────────────────────────────────────────────────── */

.detail-cred-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin: var(--space-4) 0;
}

.detail-cred-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.detail-cred-field__label {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-cred-field__value-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.detail-cred-field__value {
    flex: 1;
    min-width: 0;
    font-family: var(--font-mono, monospace);
    font-size: var(--text-sm);
    color: var(--color-text-primary);
    word-break: break-all;
    overflow-wrap: anywhere;
}

.detail-cred-field__value--masked {
    letter-spacing: 0.2em;
    color: var(--color-text-secondary);
}

.detail-cred-field__action-btn {
    flex-shrink: 0;
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: background var(--duration-fast), color var(--duration-fast);
    white-space: nowrap;
}

.detail-cred-field__action-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text-primary);
}

.detail-cred-field__action-btn--copy.copied,
.detail-cred-field__action-btn--copy[data-copied] {
    border-color: var(--color-success, #3d9e56);
    color: var(--color-success, #3d9e56);
}

.detail-cred-notes {
    margin-top: var(--space-3);
}

.detail-cred-notes__label {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: var(--space-1);
}

.detail-cred-version {
    margin-top: var(--space-4);
    font-size: var(--text-xs);
    color: var(--color-text-tertiary, var(--color-text-secondary));
    text-align: right;
}

/* ── Credential draft field row (capture + edit mode) ───────────────────────── */

.cred-draft-field {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: var(--space-2);
    align-items: center;
    margin-bottom: var(--space-2);
}

.cred-draft-field__label-input,
.cred-draft-field__value-input {
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: var(--color-s1);
    color: var(--color-text-primary);
    font-size: var(--text-sm);
}

.cred-draft-field__label-input:focus,
.cred-draft-field__value-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

.cred-draft-field__value-wrap {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    min-width: 0;
}

.cred-draft-field__value-wrap .cred-draft-field__value-input {
    flex: 1;
    min-width: 0;
}

.cred-draft-field__reveal-btn,
.cred-draft-field__remove-btn {
    flex-shrink: 0;
    padding: var(--space-1-5) var(--space-2);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-xs);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--duration-fast), color var(--duration-fast);
}

.cred-draft-field__reveal-btn:hover {
    background: var(--color-surface-hover);
    color: var(--color-text-primary);
}

.cred-draft-field__remove-btn:hover {
    background: rgba(208, 64, 64, 0.08);
    border-color: var(--color-error);
    color: var(--color-error);
}

.cred-draft-field__type-select {
    padding: var(--space-2) var(--space-2);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: var(--color-s1);
    color: var(--color-text-primary);
    font-size: var(--text-xs);
    cursor: pointer;
}

.capture-field__add-btn,
.detail-edit-form__add-field {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1-5) var(--space-3);
    border: 1px dashed var(--color-border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
    margin-top: var(--space-1);
    transition: border-color var(--duration-fast), color var(--duration-fast);
}

.capture-field__add-btn:hover,
.detail-edit-form__add-field:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.detail-edit-form__section-label {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: var(--space-4) 0 var(--space-2);
}

/* Mobile: stack draft field rows vertically */
@media (max-width: 479px) {
    .cred-draft-field {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .cred-draft-field__value-wrap {
        grid-column: 1 / -1;
    }
}

/* ==========================================================================
   Dictation capture
   ========================================================================== */

/* Model download progress bar */
.capture-dictation__progress {
    height: 6px;
    border-radius: 3px;
    background: var(--color-s1);
    overflow: hidden;
    margin-bottom: var(--space-2);
}

.capture-dictation__progress-bar {
    height: 100%;
    background: var(--color-accent);
    border-radius: 3px;
    transition: width 300ms ease;
    min-width: 2px;
}

.capture-dictation__progress-label {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-align: center;
    margin: 0 0 var(--space-3);
}

.capture-dictation__download-btn {
    display: block;
    width: 100%;
    padding: var(--space-3) var(--space-4);
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: opacity 150ms ease;
}

.capture-dictation__download-btn:hover { opacity: 0.88; }

/* Ready state — centred mic button */
.capture-dictation__ready {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-6) 0;
}

.capture-dictation__record-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--color-accent);
    background: transparent;
    color: var(--color-accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease, color 150ms ease;
}

.capture-dictation__record-btn:hover {
    background: var(--color-accent);
    color: #fff;
}

.capture-dictation__record-btn svg {
    width: 32px;
    height: 32px;
}

.capture-dictation__model-hint {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    margin: 0;
}

.capture-dictation__change-btn {
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: var(--text-sm);
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

/* Recording state */
.capture-dictation__recording {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6) 0;
}

/* Pulsing ring — CSS only, runs on the compositor thread */
.capture-dictation__pulse-ring {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--color-error);
    animation: dictation-pulse 1.2s ease-in-out infinite;
}

@keyframes dictation-pulse {
    0%, 100% { transform: scale(1);    opacity: 1;    box-shadow: 0 0 0 0 var(--color-error-glow); }
    50%       { transform: scale(1.12); opacity: 0.85; box-shadow: 0 0 0 10px transparent; }
}

.capture-dictation__timer {
    font-family: var(--font-mono, monospace);
    font-size: var(--text-2xl);
    color: var(--color-text-primary);
    letter-spacing: 0.08em;
}

.capture-dictation__stop-btn {
    padding: var(--space-2) var(--space-6);
    border: 2px solid var(--color-error);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-error);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.capture-dictation__stop-btn:hover {
    background: var(--color-error);
    color: #fff;
}

/* Transcribing state */
.capture-dictation__transcribing {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6) 0;
}

.capture-dictation__spinner {
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-s1);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: dictation-spin 0.75s linear infinite;
}

@keyframes dictation-spin {
    to { transform: rotate(360deg); }
}

.capture-dictation__transcribing-label {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    margin: 0;
}

/* Review state — record-again link */
.capture-dictation__record-again-btn {
    display: block;
    background: none;
    border: none;
    color: var(--color-accent);
    font-size: var(--text-sm);
    cursor: pointer;
    padding: 0;
    margin-top: calc(-1 * var(--space-2));
    text-decoration: underline;
    text-align: left;
}
