/* ==========================================================================
   Chat Animator - Custom Stylesheet
   Design Paradigm: Roland Gruenewald brand system
   ========================================================================== */

/* Variables */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('assets/fonts/inter-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400 800;
    font-display: swap;
    src: url('assets/fonts/outfit-latin.woff2') format('woff2');
}

:root {
    --rg-dark: #0f0f0f;
    --rg-dark2: #1a1a1a;
    --rg-card: #1a1a2e;
    --rg-gray: #f5f5f7;
    --rg-gray2: #e8e8ed;
    --rg-text: #1d1d1f;
    --rg-muted: #6e6e73;
    --rg-teal: #006d77;
    --rg-teal2: #008695;
    --rg-teal3: #004d54;
    --rg-amber: #ffb703;
    --rg-amber2: #fb8500;
    --bg-dark: var(--rg-dark);
    --bg-card: rgba(26, 26, 46, 0.78);
    --bg-card-hover: rgba(26, 26, 46, 0.92);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 183, 3, 0.35);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.62);
    --primary: var(--rg-teal);
    --primary-gradient: linear-gradient(135deg, var(--rg-teal) 0%, var(--rg-teal2) 58%, var(--rg-teal3) 100%);
    --accent: var(--rg-amber);
    --danger: #ef4444;
    --success: var(--rg-teal2);
    --shadow: 0 18px 54px rgba(0, 0, 0, 0.38);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', var(--font-sans);
}

/* Reset & Basics */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background:
        radial-gradient(circle at top left, rgba(0, 109, 119, 0.28), transparent 34rem),
        linear-gradient(180deg, #111111 0%, var(--bg-dark) 38%, #080808 100%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    padding: 2rem;
    overflow-x: hidden;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 183, 3, 0.28);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 183, 3, 0.45);
}

/* Layout */
.app-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.language-switcher {
    position: absolute;
    top: 0;
    right: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-secondary);
}

.language-switcher svg {
    width: 1rem;
    height: 1rem;
}

.language-switcher select {
    width: auto;
    min-width: 8rem;
    padding: 0.55rem 2rem 0.55rem 0.8rem;
    font-size: 0.85rem;
}

.logo-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--primary);
    filter: drop-shadow(0 0 12px rgba(0, 134, 149, 0.42));
}

.logo-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    color: #ffffff;
    background: var(--primary-gradient);
    font-family: var(--font-heading);
    font-weight: 800;
    box-shadow: 0 0 22px rgba(0, 109, 119, 0.42);
}

.app-header h1 {
    font-family: var(--font-heading);
    font-size: 2.75rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--rg-amber) 0%, #ffd60a 38%, var(--rg-amber2) 72%, var(--rg-amber) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.app-header .subtitle {
    font-family: var(--font-heading);
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Main Layout Grid */
.main-layout {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--bg-card);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: rgba(255, 183, 3, 0.22);
}

/* Controls Column */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.settings-card {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.card-header i {
    color: var(--primary);
    width: 1.5rem;
    height: 1.5rem;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Form Grid */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group.span-2 {
    grid-column: 1 / -1;
}

.theme-select {
    font-weight: 600;
    cursor: pointer;
}

.input-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Input Fields */
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 109, 119, 0.28);
}

/* Sliders */
.range-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

input[type="range"] {
    flex-grow: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(0, 109, 119, 0.18), 0 0 16px rgba(0, 134, 149, 0.55);
    transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.range-val {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    min-width: 3.5rem;
    text-align: right;
}

/* Color Picker Wrapper */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

/* Checkboxes */
.card-footer-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: "✓";
    font-size: 0.75rem;
    color: var(--rg-dark);
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-secondary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--rg-amber) 0%, var(--rg-amber2) 100%);
    color: var(--rg-dark);
    box-shadow: 0 10px 28px rgba(255, 183, 3, 0.24);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 38px rgba(255, 183, 3, 0.34);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Partners List */
.partners-list,
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.partner-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
    transition: border-color 0.2s;
}

.partner-row:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

/* Avatar Preview Circle */
.avatar-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}

.avatar-preview:hover {
    border-color: var(--accent);
    background: rgba(255, 183, 3, 0.12);
}

.avatar-preview.has-image {
    border-style: solid;
    border-color: var(--border-color);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview .upload-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--accent);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rg-dark);
    font-size: 9px;
    font-weight: bold;
}

.align-checkbox-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.align-checkbox-wrapper label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* Message Log rows */
.message-row {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem;
}

.message-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.message-row select {
    width: 150px;
    flex-shrink: 0;
}

.message-extras {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.55rem;
    border-top: 1px dashed var(--border-color);
}

.message-extras select {
    width: auto;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.message-extras .ext-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.message-extras input[type="number"] {
    width: 74px;
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
}

.message-extras .btn-mini.img-set {
    color: var(--success);
    border-color: var(--success);
}

.message-text-input {
    flex-grow: 1;
}

.message-actions {
    display: flex;
    gap: 0.35rem;
}

.btn-mini {
    padding: 0.4rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
}

.btn-mini:hover {
    background: rgba(255, 255, 255, 0.12);
}

.btn-mini.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
}

/* Right Column: Preview Panel */
.preview-panel {
    display: flex;
    flex-direction: column;
}

.preview-sticky-wrapper {
    position: sticky;
    top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

/* Smartphone Mockup */
.phone-mockup {
    width: 360px;
    height: 640px;
    max-width: 100%;
    background: linear-gradient(145deg, #050505, #171717);
    border-radius: 40px;
    padding: 12px;
    box-shadow: 0 28px 70px rgba(0, 0, 0, 0.58), 0 0 0 4px #1a1a1a, 0 0 0 5px rgba(255, 183, 3, 0.08);
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

.phone-camera-notch {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: 110px;
    height: 30px;
    background: #050505;
    border-radius: 20px;
    z-index: 10;
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.1);
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
}

#chat-canvas {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #f4f5f7;
}

/* Video Controls */
.playback-controls {
    width: 100%;
    padding: 1.25rem;
}

.controls-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#timeline-scrubber {
    flex-grow: 1;
}

#time-display {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 5.5rem;
    text-align: right;
}

/* Export Panel */
.export-actions {
    width: 100%;
    padding: 1.5rem;
}

.export-actions h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.export-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
}

.export-audio-status {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: center;
}

.export-audio-status.is-active {
    color: #61d8c6;
}

.export-notice {
    margin-top: 0.85rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid rgba(255, 183, 3, 0.42);
    border-radius: 12px;
    background: rgba(255, 183, 3, 0.09);
    color: #ffd36c;
    font-size: 0.85rem;
    line-height: 1.45;
}

.export-notice.is-error {
    border-color: rgba(255, 105, 120, 0.5);
    background: rgba(255, 105, 120, 0.1);
    color: #ffadb6;
}

.export-notice.is-success {
    border-color: rgba(0, 134, 149, 0.52);
    background: rgba(0, 109, 119, 0.18);
    color: #8fe4dc;
}

.export-progress-container {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-bar-wrapper {
    background: rgba(255, 255, 255, 0.1);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    background: linear-gradient(90deg, var(--rg-teal), var(--rg-amber));
    height: 100%;
    border-radius: 4px;
    transition: width 0.1s;
}

#export-progress-status {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 440px;
    max-width: 90%;
    max-height: min(760px, 92vh);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.modal-header h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.modal-body h4 {
    font-size: 0.9rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 0.65rem;
}

.emoji-option {
    font-size: 1.85rem;
    width: 100%;
    aspect-ratio: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.emoji-option:hover {
    background: rgba(255, 183, 3, 0.12);
    border-color: var(--accent);
    transform: scale(1.1);
}

.emoji-option.selected {
    background: linear-gradient(135deg, var(--rg-amber) 0%, var(--rg-amber2) 100%);
    border-color: var(--accent);
    color: var(--rg-dark);
}

.divider {
    text-align: center;
    position: relative;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0.5rem 0;
}

.divider::before,
.divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

.file-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s;
}

.file-upload-wrapper:hover {
    border-color: var(--primary);
}

.file-upload-label {
    cursor: pointer;
}

.file-name-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
}

.hidden {
    display: none !important;
}

/* Helper Class */
.text-center { text-align: center; }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    body {
        padding: 1rem;
    }
    .preview-sticky-wrapper {
        position: static;
        width: 100%;
        max-width: 440px;
        margin: 0 auto;
    }
}

@media (max-width: 720px) {
    .app-header {
        padding-top: 3.25rem;
    }

    .language-switcher {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   Support / Coffee Panel
   ========================================================================== */
.support-panel {
    padding: 1.75rem 1.5rem;
    text-align: center;
    margin-top: 1.5rem;
}
.support-panel .support-emoji {
    font-size: 2.4rem;
    line-height: 1;
    margin-bottom: 0.4rem;
    filter: drop-shadow(0 0 12px rgba(255, 193, 7, 0.5));
}
.support-panel h3 {
    margin: 0 0 0.4rem;
}
.support-panel p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0 0 1.1rem;
}
.btn-coffee {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8rem 1rem;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    color: #2b2200;
    background: linear-gradient(135deg, #ffd54a 0%, #ffb300 100%);
    box-shadow: 0 6px 18px rgba(255, 179, 0, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-coffee:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(255, 179, 0, 0.5);
}

/* ==========================================================================
   Project actions + Script import
   ========================================================================== */
.project-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.project-actions .btn {
    flex: 1;
    min-width: 150px;
}

.script-import {
    margin-top: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 0.9rem;
    background: rgba(0, 0, 0, 0.15);
}
.script-import summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-secondary);
    list-style: none;
    padding: 0.35rem 0;
}
.script-import summary::-webkit-details-marker { display: none; }
.script-import[open] summary { color: var(--text-primary); }
.script-hint {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 0.75rem;
    line-height: 1.5;
}
.script-hint code {
    background: rgba(255, 255, 255, 0.08);
    padding: 0.1rem 0.35rem;
    border-radius: 5px;
    font-size: 0.85em;
}
.script-import textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    resize: vertical;
    outline: none;
    margin-bottom: 0.75rem;
}
.script-import textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 109, 119, 0.28);
}

/* ==========================================================================
   Indexable content for search engines and AI answer systems
   ========================================================================== */
.seo-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-bottom: 2rem;
    color: var(--rg-text);
}

.seo-hero-text,
.seo-copy,
.seo-faq {
    padding: 1.75rem;
    background: var(--rg-gray);
    border: 1px solid var(--rg-gray2);
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.seo-kicker {
    margin: 0 0 0.5rem;
    color: var(--rg-teal);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.seo-content h2 {
    margin: 0 0 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.7rem;
    line-height: 1.2;
}

.seo-content h3 {
    margin: 0 0 0.45rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
}

.seo-content p {
    color: var(--rg-muted);
    line-height: 1.7;
}

.seo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.seo-grid article {
    padding: 1.25rem;
    background: #ffffff;
    border: 1px solid var(--rg-gray2);
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.seo-faq {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.seo-faq details {
    padding: 1rem;
    background: #ffffff;
    border: 1px solid var(--rg-gray2);
    border-radius: 18px;
}

.seo-faq summary {
    cursor: pointer;
    font-family: var(--font-heading);
    font-weight: 700;
}

.seo-faq details p {
    margin-top: 0.65rem;
}

.legal-footer {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 0 0 2rem;
}

.legal-footer nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.legal-footer a {
    color: var(--rg-amber);
    text-decoration: none;
}

.legal-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.legal-section {
    padding: 1.75rem;
    background: var(--rg-gray);
    border: 1px solid var(--rg-gray2);
    border-radius: 24px;
    color: var(--rg-text);
}

.legal-section h2 {
    margin: 0 0 1rem;
    font-family: var(--font-heading);
    font-size: 1.45rem;
}

.legal-section h3 {
    margin: 0 0 0.4rem;
    font-family: var(--font-heading);
    font-size: 1rem;
}

.legal-section p {
    color: var(--rg-muted);
    line-height: 1.65;
}

.legal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.legal-copy {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.legal-page {
    max-width: 960px;
}

.legal-page .app-header .subtitle a {
    color: var(--rg-amber);
    text-decoration: none;
}

.legal-page .app-header .subtitle a:hover {
    color: #ffffff;
    text-decoration: underline;
}

@media (max-width: 900px) {
    .seo-grid {
        grid-template-columns: 1fr;
    }

    .seo-content h2 {
        font-size: 1.45rem;
    }

    .legal-grid {
        grid-template-columns: 1fr;
    }
}
