/* ==========================================================================
   SensoryInk Luxury Design System & Stylesheet
   ========================================================================== */

:root {
    --bg-base: #080a10;
    --bg-surface: #0f131f;
    --bg-card: rgba(18, 23, 37, 0.75);
    --bg-card-hover: rgba(26, 33, 53, 0.85);
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(56, 189, 248, 0.4);
    --border-focus: #38bdf8;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-accent: #38bdf8;

    --gradient-brand: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #ec4899 100%);
    --gradient-button: linear-gradient(135deg, #0284c7 0%, #4f46e5 100%);
    --gradient-glow: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.18) 0%, rgba(8, 10, 16, 0) 70%);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.25);
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
}

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

body {
    background-color: var(--bg-base);
    background-image: var(--gradient-glow);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-main);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

#app {
    overflow-x: hidden;
    width: 100%;
}

/* --- Top Navigation --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 10, 16, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
    max-width: 1360px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.brand-glyph {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--gradient-brand);
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glyph-core {
    width: 100%;
    height: 100%;
    background: var(--bg-base);
    border-radius: 8px;
    display: block;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-accent);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: var(--text-accent);
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.badge-mini {
    font-size: 11px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 999px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.credit-pill {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.credit-icon {
    color: #fbbf24;
}

.credit-refill-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-accent);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.credit-refill-btn:hover {
    background: var(--text-accent);
    color: #000;
}

/* --- Layout & Views --- */
.main-content {
    max-width: 1360px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.view-section {
    display: none;
}

.view-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Hero Header --- */
.hero-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px;
}

.hero-badge {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: var(--radius-full);
    color: var(--text-accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #ffffff 0%, #e2e8f0 70%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 17px;
    line-height: 1.6;
}

/* --- Studio Form Card --- */
.studio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 36px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    margin-bottom: 40px;
}

.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.flex-1 {
    flex: 1;
}

.form-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.form-label-sub {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.label-hint {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Domain Grid */
.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.domain-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.domain-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

.domain-card.selected {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--text-accent);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

.domain-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.domain-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.domain-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Presets Row */
.presets-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.presets-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preset-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-chip:hover {
    background: rgba(56, 189, 248, 0.15);
    border-color: rgba(56, 189, 248, 0.3);
    color: var(--text-primary);
}

/* Inputs */
.text-input, .textarea-input, .select-input {
    width: 100%;
    background: rgba(8, 10, 16, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    padding: 14px 16px;
    transition: all 0.2s ease;
}

.text-input:focus, .textarea-input:focus, .select-input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.textarea-input {
    resize: vertical;
    min-height: 110px;
}

.notes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.status-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge.safe {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.status-badge.warning {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Buttons */
.primary-btn {
    background: var(--gradient-button);
    border: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    padding: 16px 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.35);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(2, 132, 199, 0.5);
}

.primary-btn:active {
    transform: translateY(0);
}

.primary-btn.full-width {
    width: 100%;
}

.primary-btn-sm {
    background: var(--gradient-button);
    border: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.2);
}

.link-btn {
    background: none;
    border: none;
    color: var(--text-accent);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
}

.submit-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.btn-cost {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #cbd5e1;
}

/* --- Processing Card --- */
.processing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(56, 189, 248, 0.15);
    border-top-color: var(--text-accent);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

.processing-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.processing-step {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

.progress-bar-container {
    max-width: 400px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 25%;
    background: var(--gradient-brand);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* --- Results Showcase --- */
.result-showcase {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 36px;
    box-shadow: var(--shadow-card);
    margin-bottom: 60px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.domain-pill {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--text-accent);
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-full);
    margin-bottom: 6px;
}

.result-title {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.result-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
}

@media (min-width: 1024px) {
    .result-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.artwork-card, .radar-card {
    background: rgba(10, 14, 24, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

.card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-tag {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.texture-pill {
    font-size: 11px;
    font-weight: 800;
    background: rgba(236, 72, 153, 0.15);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.zoom-hint {
    font-size: 12px;
    color: var(--text-accent);
    cursor: pointer;
}

.image-frame {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #000000;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}

.result-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.result-img:hover {
    transform: scale(1.02);
}

.radar-svg-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.06);
}

.radar-svg-container svg {
    max-width: 100%;
    height: auto;
}

.metrics-breakdown {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric-bar-unit {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
}

.metric-bar-name { color: #cbd5e1; }
.metric-bar-value { color: var(--text-accent); font-weight: 800; }

.metric-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: var(--gradient-brand);
    border-radius: 3px;
    transition: width 0.6s ease-out;
}

.accords-section {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

.section-micro-title {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.accords-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.accord-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-subtle);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #f1f5f9;
}

.unmapped-section {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.unmapped-text {
    font-style: italic;
    color: var(--text-accent);
}

/* --- Vault / History View --- */
.vault-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.vault-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 6px;
}

.vault-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

/* --- Full-Screen Community Vault & Reversal Modal --- */
.vault-fullscreen-section {
    width: 100%;
    max-width: 100%;
    padding: 0 8px;
}

.vault-grid-fullscreen {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.reversal-modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 1020px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75);
}

.reversal-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    width: 100%;
}

.reversal-art-col,
.reversal-info-col {
    min-width: 0;
    width: 100%;
}

.rev-primer-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.rev-primer-row .text-input {
    min-width: 0;
    flex: 1;
}

.rev-decode-btn {
    white-space: nowrap;
    padding: 12px 20px;
    flex-shrink: 0;
}

@media (min-width: 860px) {
    .reversal-grid {
        grid-template-columns: 380px minmax(0, 1fr);
    }
}

.rev-narrative-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px 18px;
}

.rev-narrative-text {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.65;
    font-style: italic;
}

.rev-siblings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.rev-sibling-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rev-sibling-card:hover {
    border-color: var(--text-accent);
    transform: translateY(-2px);
}

.rev-sibling-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.rev-sibling-meta {
    padding: 8px 10px;
}

.rev-sibling-sim {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-accent);
}

.rev-sibling-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vault-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
}

.vault-item-card:hover {
    transform: translateY(-4px);
    border-color: rgba(56, 189, 248, 0.4);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.vault-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #000;
}

.vault-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vault-item-info {
    padding: 16px;
}

.vault-item-domain {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-accent);
    text-transform: uppercase;
}

.vault-item-name {
    font-size: 16px;
    font-weight: 700;
    margin: 4px 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vault-item-date {
    font-size: 12px;
    color: var(--text-muted);
}

.vault-empty {
    text-align: center;
    padding: 80px 20px;
    background: var(--bg-card);
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-lg);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* --- Science View --- */
.about-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 0;
}

.about-title {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 16px;
}

.about-lead {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 40px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

@media (min-width: 768px) {
    .about-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 28px;
}

.about-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-accent);
}

.about-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* --- Modals & Popups --- */
.modal-backdrop, .lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 36px;
    max-width: 440px;
    width: 100%;
    position: relative;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6);
}

.modal-close-btn {
    position: absolute;
    top: 18px;
    right: 18px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.modal-header {
    margin-bottom: 24px;
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.modal-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.auth-switch-link {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

.lightbox-content {
    max-width: 900px;
    max-height: 90vh;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

.lightbox-content img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #0f172a;
    border: 1px solid var(--text-accent);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Mobile & Tablet Responsive Optimization (< 680px)
   ========================================================================== */
@media (max-width: 680px) {
    .nav-container {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .brand-glyph {
        width: 30px;
        height: 30px;
    }

    .brand-name {
        font-size: 16px;
    }

    .brand-tag {
        display: none;
    }

    .nav-links {
        gap: 4px;
    }

    .nav-item {
        padding: 6px 10px;
        font-size: 13px;
        gap: 5px;
    }

    .credit-pill {
        padding: 5px 10px;
        font-size: 11px;
    }

    .main-content {
        padding: 20px 12px 48px;
    }

    .hero-header {
        margin-bottom: 24px;
    }

    .hero-title {
        font-size: 26px;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    .studio-card {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .form-label {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .notes-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .submit-container {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    #turnstile-widget {
        display: flex;
        justify-content: center;
        overflow-x: auto;
        max-width: 100%;
    }

    .primary-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }

    .result-showcase {
        padding: 20px 16px;
    }

    .result-title {
        font-size: 22px;
    }

    .artwork-card {
        padding: 14px;
    }

    .vault-fullscreen-section {
        padding: 0;
    }

    .vault-title {
        font-size: 26px;
    }

    .vault-subtitle {
        font-size: 13px;
    }

    .vault-upload-box,
    .vault-upload-box button {
        width: 100%;
        justify-content: center;
    }

    .vault-grid-fullscreen {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
        gap: 12px;
    }

    .vault-item-info {
        padding: 10px 12px;
    }

    .vault-item-name {
        font-size: 14px;
    }

    .modal-backdrop,
    .lightbox-backdrop {
        padding: 10px;
        align-items: flex-end;
    }

    .reversal-modal-card {
        padding: 20px 16px;
        border-radius: 18px 18px 12px 12px;
        max-height: 90vh;
    }

    .modal-close-btn {
        top: 12px;
        right: 14px;
        font-size: 26px;
        z-index: 10;
    }

    .reversal-grid {
        gap: 18px;
    }

    #rev-title {
        font-size: 20px !important;
        padding-right: 28px;
    }

    .rev-primer-row {
        flex-direction: column;
        gap: 8px;
    }

    .rev-decode-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 16px;
    }

    .rev-narrative-box {
        padding: 14px;
    }

    .rev-narrative-text {
        font-size: 14px;
    }

    .rev-siblings-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}
