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

:root {
    --font-base: 'Sora', 'Segoe UI', sans-serif;
    --font-display: 'Fraunces', 'Times New Roman', serif;
    --app-height: 100dvh;
    --color-bg-body: #fdf6ee;
    --color-bg-card: #ffffff;
    --color-text-primary: #1e293b;
    --color-text-secondary: #475569;
    --color-text-muted: #64748b;
    --color-link: #0f766e;
    --color-accent-primary: #14b8a6;
    --color-accent-secondary: #f97316;
    --color-border-strong: rgba(15,23,42,0.18);
    --color-border-medium: rgba(15,23,42,0.12);
    --color-border-weak: rgba(15,23,42,0.08);
    --color-surface-soft: rgba(15,23,42,0.05);
    --color-surface-glass: rgba(15,23,42,0.12);
    --color-surface-haze: rgba(15,23,42,0.08);
    --color-surface-modal: rgba(0, 0, 0, 0.6);
    --color-overlay-dim: rgba(5, 8, 15, 0.65);
    --color-light-1: #fff7ed;
    --color-light-2: #fde68a;
    --color-light-3: #cbd5e1;
    --color-text-on-dark: #e5e7eb;
    --color-reticle: rgba(255,255,255,0.42);
    --color-danger-bg: rgb(245, 103, 103);
    --color-danger-border: rgb(159, 2, 2);
    --color-info-bg: rgba(20,184,166,0.08);
    --color-info-border: rgba(20,184,166,0.25);
    --shadow-strong: 0 20px 60px rgba(0,0,0,0.5);
    --shadow-medium: 0 16px 40px rgba(15,23,42,0.25);
    --shadow-soft: 0 8px 20px rgba(15,23,42,0.18);
    --shadow-modal: 0 25px 80px rgba(0,0,0,0.5);
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 12px;
    --radius-xs: 10px;
    --radius-pill: 999px;
    --space-bottom: 40px;
    --blur-strong: 12px;
    --blur-medium: 10px;
    --blur-soft: 8px;
    --gradient-accent: linear-gradient(135deg, #14b8a6 0%, #f97316 100%);
    --bg-pastel: radial-gradient(70% 70% at 12% 18%, rgba(255, 237, 213, 0.9), rgba(255, 237, 213, 0) 60%),
        radial-gradient(70% 70% at 92% 12%, rgba(204, 251, 241, 0.8), rgba(204, 251, 241, 0) 60%),
        radial-gradient(80% 80% at 20% 86%, rgba(254, 215, 170, 0.7), rgba(254, 215, 170, 0) 60%),
        radial-gradient(90% 90% at 88% 82%, rgba(186, 230, 253, 0.6), rgba(186, 230, 253, 0) 60%);
}

body {
    font-family: var(--font-base);
    background: var(--bg-pastel);
    background-size: 240% 240%;
    animation: pastelShift 26s ease-in-out infinite;
    color: var(--color-text-primary);
    min-height: var(--app-height, 100dvh);
    height: var(--app-height, 100dvh);
    margin: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
    overflow: auto;
}

.container {
    width: 100%;
    height: var(--app-height, 100dvh);
    display: flex;
    flex-direction: column;
}

.card {
    flex: 1;
    position: relative;
    background: transparent;
    overflow: hidden;
}

.header { display: none; }

.change-key-btn {
    display: none;
    color: var(--color-link);
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
}

.grid { display: none; }

.camera-shell {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: calc(20px + env(safe-area-inset-top)) 20px calc(10px + env(safe-area-inset-bottom));
    gap: 8px;
    animation: fadeLift 0.6s ease-out;
}

.top-controls {
    width: var(--controls-width, min(92vw, 100%));
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 0;
}

.viewfinder {
    position: relative;
    width: 100%;
    flex: 1;
    min-height: 0;
    height: auto;
    max-height: none;
    background: transparent;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 0;
}

.capture-area {
    position: relative;
    width: var(--capture-size, min(92vw, 100%));
    height: var(--capture-size, min(92vw, 100%));
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(15,23,42,0.22);
    margin: 0 auto;
}

video, canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

canvas { display: none; }

.reticle {
    position: absolute;
    inset: 14px;
    border: 1.1px dashed var(--color-reticle);
    border-radius: var(--radius-sm);
    pointer-events: none;
}

.result-carousel {
    position: absolute;
    inset: 0;
    display: none;
    z-index: 2;
}

.result-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.result-viewport::-webkit-scrollbar { display: none; }

.result-slide {
    position: relative;
    flex: 0 0 100%;
    height: 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.result-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

.result-pager {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-pill);
    background: rgba(15,23,42,0.35);
    backdrop-filter: blur(var(--blur-soft));
    z-index: 4;
}

.result-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: none;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, width 0.2s ease, height 0.2s ease;
}

.result-dot.active {
    width: 12px;
    height: 12px;
    background: var(--color-accent-primary);
}

.status-bar { display: none; }

.mode-selector {
    position: relative;
    display: flex;
    z-index: 4;
    padding: 10px;
    background: rgba(255,255,255,0.45);
    border: 1px solid rgba(15,23,42,0.16);
    border-radius: 18px;
    backdrop-filter: blur(var(--blur-medium));
    width: 100%;
    overflow: hidden;
}

.mode-selector-track {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.mode-selector-track::-webkit-scrollbar { display: none; }

.mode-btn {
    flex: 0 0 auto;
    min-width: 80px;
    height: 80px;
    /* padding: 8px 8px 10px; */
    border-radius: 10px;
    border: 1px solid rgba(15,23,42,0.16);
    background: var(--color-light-1);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    display: grid;
    grid-template-rows: 36px auto;
    justify-items: center;
    align-content: center;
    gap: 6px;
    font-size: 12rem;
    font-weight: 400;
    scroll-snap-align: start;
    text-align: center;
}

.mode-btn span {
    font-size: 0.68rem;
    letter-spacing: 0.02em;
    color: var(--color-text-secondary);
    white-space: nowrap;
    font-weight: 400;
    line-height: 1.1;
}

.mode-btn svg {
    width: 36px;
    height: 36px;
    display: block;
    aspect-ratio: 1 / 1;
}

.mode-btn:focus-visible {
    outline: 2px solid rgba(255,255,255,0.7);
    outline-offset: 2px;
}

.key-btn,
.flip-btn,
.icon-btn {
    width: 56px;
    height: 56px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 1px solid var(--color-border-strong);
    background: var(--color-light-1);
    color: var(--color-text-primary);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    backdrop-filter: blur(var(--blur-soft));
    transition: transform 0.12s ease;
}

.key-btn:active,
.flip-btn:active,
.icon-btn:active { transform: scale(0.96); }

.key-btn svg,
.flip-btn svg,
.icon-btn svg {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    max-width: 24px;
    max-height: 24px;
    display: block;
    aspect-ratio: 1 / 1;
}

.settings-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.settings-wrapper.settings-floating {
    position: fixed;
    right: 5px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 7;
}

.settings-wrapper.settings-floating .settings-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
}

.settings-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    min-width: 280px;
    max-width: min(94vw, 360px);
    width: min(94vw, 360px);
    background: #ffffff;
    border: 1px solid rgba(15,23,42,0.08);
    border-radius: 18px;
    padding: 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 0;
    box-shadow: 0 10px 28px rgba(15,23,42,0.12);
    z-index: 12;
}

.settings-item {
    width: 100%;
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--color-text-primary);
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-item svg {
    width: 20px;
    height: 20px;
    color: #64748b;
}

.settings-divider {
    width: 100%;
    height: 1px;
    background: rgba(148, 163, 184, 0.35);
    margin: 6px 0;
    border-radius: 999px;
}

.settings-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 2px 6px;
}

.settings-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    letter-spacing: 0.01em;
}

.settings-provider-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.provider-option {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.provider-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.provider-option span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 14px;
    border: none;
    background: transparent;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    width: 100%;
    justify-content: flex-start;
    min-height: 36px;
}

.provider-option span::before {
    content: '';
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid #cbd5f5;
    background: #ffffff;
    display: inline-block;
    box-sizing: border-box;
    flex-shrink: 0;
}

.provider-option input:checked + span {
    background: transparent;
    color: #1d4ed8;
}

.provider-option input:checked + span::before {
    border-color: #2563eb;
    background: #2563eb;
    box-shadow: inset 0 0 0 3px #eef6ff;
}

.settings-quality,
.settings-auto-save {
    cursor: default;
}

.settings-toggle {
    margin-left: auto;
    position: relative;
    width: 48px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.settings-toggle input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    margin: 0;
}

.settings-toggle .toggle-track {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #e2e8f0;
    border: 1px solid var(--color-border-medium);
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.settings-toggle .toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.2);
    transition: transform 0.2s ease;
}

.settings-toggle input:checked + .toggle-track {
    background: #22c55e;
    border-color: rgba(21, 128, 61, 0.4);
}

.settings-toggle input:checked + .toggle-track::after {
    transform: translateX(20px);
}

.settings-item:hover {
    background: #f8fafc;
}

.settings-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.settings-item.danger {
    color: #b91c1c;
    margin-top: 0;
    padding-top: 12px;
    border-top: none;
}

.settings-item.danger svg {
    color: #ef4444;
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--color-light-1) 0%, var(--color-light-2) 100%);
    border-color: rgba(15,118,110,0.6);
    box-shadow: none;
    color: var(--color-link);
}

.mode-btn.active span {
    color: var(--color-link);
}

.controls-row {
    position: relative;
    width: 100%;
    max-width: var(--controls-width, min(92vw, 100%));
    display: grid;
    grid-template-columns: 1fr var(--center-control-size, 80px) 1fr;
    align-items: center;
    column-gap: 16px;
    z-index: 4;
    padding: 0 12px;
    min-height: var(--controls-row-height, auto);
    margin: 0 auto;
}

.controls-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: min(180px, 100%);
    justify-self: center;
}

.controls-slot.left {
    justify-content: center;
}

.controls-slot.center {
    justify-content: center;
    width: 100%;
}

.controls-slot.right {
    justify-content: center;
}

.capture-btn {
    width: 80px;
    height: 80px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid #00000080;
    background: #b91c1c;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: transform 0.12s ease;
}

.capture-btn:active { transform: scale(0.96); }

.capture-btn svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
}

.capture-btn:disabled {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
}

.capture-btn:disabled svg {
    color: #64748b;
}

.regen-btn {
    background: var(--color-light-1);
    border-color: var(--color-border-strong);
}

.regen-btn svg {
    color: var(--color-link);
}

.controls-row.is-measuring {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    visibility: hidden;
    pointer-events: none;
}

.processing-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.processing-spinner .spinner {
    width: 80px;
    height: 80px;
    border-width: 4px;
}

.processing-time {
    position: absolute;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.pill-btn {
    padding: 12px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border-strong);
    background: var(--color-light-1);
    color: var(--color-text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.pill-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.pill-btn.icon-only {
    width: 44px;
    height: 44px;
    aspect-ratio: 1 / 1;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
}

.pill-btn.icon-only svg {
    margin-right: 0;
}

.mode-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-danger-border);
    background: var(--color-danger-bg);
    color: #fecdd3;
    position: absolute;
    top: auto;
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    width: min(520px, 90vw);
    text-align: center;
    box-shadow: var(--shadow-medium);
}

.hidden { display: none !important; }

.side-panel {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--color-border-weak);
    border-radius: var(--radius-lg);
    padding: 18px;
}

.side-panel h3 { margin-bottom: 12px; color: #f9fafb; }
.side-panel p { color: var(--color-text-muted); line-height: 1.5; font-size: 0.95rem; }
.badge { display: inline-block; padding: 6px 10px; border-radius: var(--radius-pill); background: var(--color-surface-soft); color: #c7d2fe; font-size: 0.85rem; margin-bottom: 10px; }
.textarea-group { margin-top: 16px; }
.textarea-group label { display: block; margin-bottom: 6px; color: var(--color-text-secondary); font-weight: 600; }
.textarea-group textarea {
    width: 100%;
    min-height: 96px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--color-border-weak);
    background: rgba(255,255,255,0.04);
    color: #f9fafb;
    resize: vertical;
}

.prompt-floating {
    position: relative;
    background: rgba(255,255,255,0.5);
    border: 1px solid rgba(15,23,42,0.16);
    border-radius: 20px;
    padding: 10px 10px;
    z-index: 3;
    box-shadow: none;
    color: var(--color-text-primary);
    width: 100%;
}

.prompt-floating label { display: none; }
.prompt-input-wrap {
    position: relative;
}

.prompt-floating textarea {
    width: 100%;
    padding: 10px 42px 36px 10px;
    border-radius: 10px;
    border: 1px solid rgba(15,23,42,0.12);
    background: rgba(255,255,255,0.65);
    color: var(--color-text-primary);
    resize: none;
    font-size: 1rem;
    line-height: 1.4;
}

.prompt-floating textarea[readonly] {
    opacity: 0.75;
    cursor: not-allowed;
}

.prompt-floating textarea.is-modified {
    color: var(--color-link);
    border-color: rgba(15,23,42,0.16);
}

.prompt-meta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--color-text-muted);
    gap: 10px;
}

.model-label {
    letter-spacing: 0.01em;
    background: transparent;
    border: none;
    padding: 0;
    color: var(--color-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.model-label-value {
    font-weight: 700;
}

.model-label.is-modified {
    color: var(--color-link);
}

.model-label:focus-visible {
    outline: 2px solid rgba(37,99,235,0.45);
    outline-offset: 4px;
    border-radius: 8px;
}

.dictate-btn {
    width: 30px;
    height: 30px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 1px solid rgba(15,23,42,0.16);
    background: var(--color-light-1);
    color: var(--color-text-primary);
    cursor: pointer;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}

.dictate-btn svg { width: 16px; height: 16px; }

.dictate-btn:active { transform: scale(0.96); }

.dictate-btn.active {
    background: var(--color-light-1);
    color: var(--color-link);
    border-color: rgba(15,118,110,0.6);
}

.clear-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(15,23,42,0.14);
    background: var(--color-light-1);
    color: var(--color-text-primary);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
}

.prompt-clear-btn {
    top: 5px;
    right: 5px;
}

.prompt-dictate-btn {
    top: auto;
    bottom: 10px;
    right: 5px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
}

.clear-btn svg { width: 18px; height: 18px; }

.reference-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(15,23,42,0.14);
    background: rgba(255,255,255,0.85);
    color: var(--color-text-primary);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
    z-index: 6;
    transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.reference-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
}

.reference-btn:active {
    transform: scale(0.96);
}

.reference-btn.is-reference {
    border-color: rgba(15,23,42,0.32);
}

.reference-btn.is-reference svg {
    fill: currentColor;
    stroke: currentColor;
}

.result-delete-btn {
    z-index: 6;
}

body[data-ui-mode="processing"] .result-delete-btn {
    display: none;
}

body[data-ui-mode="processing"] .reference-btn {
    display: none;
}

.processing-overlay {
    position: absolute;
    inset: 0;
    backdrop-filter: blur(0px);
    background: rgba(5,8,15,0);
    display: none;
    z-index: 5;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
}

.processing-overlay.active {
    display: flex;
    animation: blurPulse 2.4s ease-in-out infinite;
}

@keyframes blurPulse {
    0% { backdrop-filter: blur(0px); background: rgba(5,8,15,0); }
    50% { backdrop-filter: blur(6px); background: rgba(5,8,15,0.35); }
    100% { backdrop-filter: blur(0px); background: rgba(5,8,15,0); }
}

.spinner {
    width: 56px;
    height: 56px;
    border: 5px solid var(--color-border-medium);
    border-top-color: var(--color-accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes pastelShift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 100%; }
}

@keyframes fadeLift {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,247,237,0.88);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(6px);
}

.modal.active { display: flex; }

.modal-content {
    background: #ffffff;
    border: 1px solid var(--color-border-weak);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 480px;
    width: 100%;
    color: var(--color-text-primary);
    box-shadow: var(--shadow-medium);
}

.modal-content .form-group label {
    color: var(--color-text-primary);
}

.modal-content .form-group input {
    color: var(--color-text-primary);
    border-color: var(--color-border-strong);
    background: #ffffff;
}

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 8px; color: var(--color-text-secondary); font-weight: 600; }
.form-group input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border-strong);
    background: rgba(255,255,255,0.04);
    color: var(--color-text-primary);
}

.info-box {
    background: rgba(37,99,235,0.08);
    border: 1px solid rgba(37,99,235,0.22);
    color: #1e3a8a;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-actions .pill-btn {
    flex: 1;
    justify-content: center;
}

.pill-btn.primary {
    background: var(--color-light-1);
    border-color: rgba(15,118,110,0.5);
    color: var(--color-link);
}

.pill-btn.ghost {
    background: var(--color-light-1);
}

a { color: var(--color-link); }

.version-badge {
    position: fixed;
    right: 5px;
    left: auto;
    bottom: calc(2px + env(safe-area-inset-bottom));
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--color-text-muted);
    opacity: 0.75;
    z-index: 6;
    pointer-events: none;
}

.install-banner {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 520px);
    background: #ffffff;
    border: 1px solid var(--color-border-strong);
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-medium);
    z-index: 1200;
}

.install-text {
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--color-text-secondary);
    flex: 1 1 220px;
}

.install-actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}

.install-banner .pill-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}
