﻿:root {
    --ink: #0f172a;
    --ink-soft: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --card: #ffffff;
    --bg: #f8fafc;
    --accent: #14b8a6;
    --accent-dark: #0f766e;
    --accent-warm: #f59e0b;
    --shadow: 0 20px 60px rgba(15, 23, 42, 0.12);
    --radius: 20px;
    --radius-sm: 12px;
    --max-width: 1120px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
}

h1, h2, h3, h4 {
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1.2;
    margin: 0 0 12px 0;
}

p {
    margin: 0 0 12px 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(100% - 32px, var(--max-width));
    margin: 0 auto;
}

.app .container {
    width: min(100% - 48px, 1500px);
}

.app .container.container-wide {
    width: calc(100% - 48px);
    max-width: none;
}

.app .container.container-landing {
    width: min(100% - 32px, var(--max-width));
    max-width: var(--max-width);
}

.site-bg,
.app-bg {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(20, 184, 166, 0.16), transparent 45%),
        radial-gradient(circle at 70% 20%, rgba(245, 158, 11, 0.14), transparent 45%),
        radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.08), transparent 45%);
    z-index: -1;
}

.site-header,
.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.brand-text {
    font-size: 18px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: #fff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--ink-soft);
    border-radius: 999px;
}

.nav-links a {
    color: var(--ink-soft);
    font-weight: 600;
}

.nav-links a.active {
    color: var(--accent-dark);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    background: transparent;
}

.header-inner .btn {
    height: 40px;
    padding: 0 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    box-shadow: 0 12px 30px rgba(20, 184, 166, 0.25);
}

.btn-primary:hover {
    transform: translateY(-1px);
}

.site-header .btn-primary {
    color: #fff;
}

.btn-ghost {
    border-color: var(--line);
    background: rgba(255, 255, 255, 0.7);
}

.btn-logout {
    border-radius: 999px;
    padding: 0 18px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    font-weight: 600;
    box-shadow: none;
    height: 40px;
}

.btn-logout:hover {
    background: rgba(15, 20, 36, 0.05);
    border-color: rgba(15, 20, 36, 0.2);
}

.app-header .btn-logout {
    min-height: 38px;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    margin-bottom: 0;
}

.nav-logout {
    display: none;
}

.hero {
    padding: 120px 0 80px;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    align-items: center;
}

.hero-copy {
    max-width: 560px;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    color: var(--muted);
}

.lead {
    font-size: 20px;
    color: var(--ink-soft);
}

.cta-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.hero-meta {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.meta-chip,
.pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(20, 184, 166, 0.12);
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 12px;
}

.hero-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.9));
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    padding: 28px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    backdrop-filter: blur(12px);
}

.hero-card-inner {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-weight: 600;
    font-size: 14px;
}

.hero-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.hero-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.signal {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(20, 184, 166, 0.8);
}

.section {
    padding: 80px 0;
}

.section-contrast {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0));
}

.section-head {
    max-width: 640px;
    margin-bottom: 40px;
}

.section-tight {
    padding: 40px 0 20px;
}

.trust-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    flex-wrap: wrap;
}

.trust-label {
    font-weight: 600;
    color: var(--ink-soft);
}

.trust-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.trust-pill {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 12px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.feature-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.workflow {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}

.workflow-step {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 24px;
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.step-number {
    font-weight: 700;
    color: var(--accent-dark);
}

.split-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 28px;
    align-items: center;
}

.split-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

.split-list {
    padding-left: 18px;
    color: var(--muted);
    margin-top: 16px;
    display: grid;
    gap: 8px;
}

.split-preview {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.preview-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid var(--line);
}

.preview-label {
    font-weight: 600;
    color: var(--ink-soft);
}

.preview-value {
    font-size: 12px;
    color: var(--muted);
}

.cta-card {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(245, 158, 11, 0.1));
    border-radius: var(--radius);
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.cta-section {
    padding-bottom: 100px;
}

.usecase-grid,
.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.usecase-card,
.faq-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

@media (max-width: 900px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .nav-toggle {
        display: inline-flex;
    }

    .app-header .header-inner {
        gap: 12px;
    }

    .app-header .nav-toggle {
        margin-left: auto;
    }

    .app-header .user-chip {
        display: none;
    }

    .nav-logout {
        display: inline-flex;
        width: 100%;
    }

    .nav-links {
        width: 100%;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 16px;
        padding: 14px;
        box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
    }

    .site-header.nav-open .nav-links,
    .app-header.nav-open .nav-links {
        display: flex;
    }

    .nav-links .btn {
        width: 100%;
        justify-content: center;
    }

    .nav-links .inline-form {
        width: 100%;
    }
}

.site-footer {
    padding: 40px 0 60px;
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 12px;
}

.muted {
    color: var(--muted);
}

.login-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 32px;
    align-items: center;
}

.login-section {
    padding-top: 120px;
}

.login-copy {
    max-width: 420px;
}

.login-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow);
    border: 1px solid var(--line);
    display: grid;
    gap: 16px;
}

.login-list {
    padding-left: 18px;
    color: var(--muted);
}

.tiny {
    font-size: 12px;
}

.app {
    background: var(--bg);
}

.app-section {
    padding: 16px 0;
}

.app-main {
    padding: 36px 0 80px;
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

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

.guide-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(20, 184, 166, 0.4);
    background: rgba(20, 184, 166, 0.12);
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.guide-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(20, 184, 166, 0.2);
}

.toolbar-actions .btn-mini {
    white-space: nowrap;
}

.preset-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    width: fit-content;
}

.tab-link {
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 600;
    color: var(--ink-soft);
    background: rgba(255, 255, 255, 0.8);
}

.tab-link.active {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.18), rgba(15, 118, 110, 0.18));
    color: var(--accent-dark);
    border-color: rgba(20, 184, 166, 0.4);
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.metric-card h3 {
    margin-bottom: 6px;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.content-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 22px;
    border: 1px solid var(--line);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 10px;
}

.config-preview {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    font-size: 12px;
    max-height: 240px;
    overflow: auto;
}

.config-preview pre {
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

.action-list {
    display: grid;
    gap: 12px;
}

.action-item {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(20, 184, 166, 0.08);
    color: var(--ink-soft);
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.action-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
}

.form-card input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
    margin-top: 6px;
}

.form-card textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    margin-top: 6px;
    font-family: inherit;
    resize: vertical;
}

.form-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--line);
    padding: 24px;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    gap: 16px;
}

.form-actions {
    margin-top: 12px;
}

.field-error {
    color: #dc2626;
    font-size: 12px;
}

.rating-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.rating-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    font-weight: 600;
    font-size: 12px;
}

.rating-pill input {
    display: none;
}

.rating-pill input:checked + span {
    color: #fff;
}

.rating-pill input:checked + span::before {
    content: '★ ';
}

.rating-pill input:checked {
    display: none;
}

.rating-pill input:checked ~ span {
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    padding: 2px 10px;
    border-radius: 999px;
}

.feedback-user {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(15, 118, 110, 0.06);
}

.feedback-user-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
}

.generator-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 20px;
}

.generate-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
}

.generate-layout.generate-full {
    grid-template-columns: 1fr;
}

.editor-full {
    width: 100%;
}

.generate-guides {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.generate-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.ai-fab {
    --ai-fab-size: clamp(44px, 6vw, 56px);
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    width: var(--ai-fab-size);
    height: var(--ai-fab-size);
    border-radius: 50%;
    border: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
    display: grid;
    place-items: center;
    z-index: 90;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.22), 0 0 16px rgba(20, 184, 166, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: ai-fab-float 5s ease-in-out infinite;
}

.ai-fab::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 120deg, var(--accent), #00ffeb, var(--accent-warm), #00edd3, #00d0c0);
}

.ai-fab::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: #0f172a;
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.6);
}

.ai-fab:hover {
    transform: translateY(-2px) scale(1.02);
    animation-play-state: paused;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.28);
}

.ai-fab:focus-visible {
    outline: 3px solid rgba(125, 211, 252, 0.75);
    outline-offset: 4px;
}

.ai-fab-core {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    font-weight: 600;
    line-height: 1;
}

.ai-fab-icon {
    font-size: clamp(14px, 2.2vw, 18px);
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #00ffeb;
}

.ai-fab-text {
    display: none;
}

.ai-fab-spark {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #00ffeb, var(--accent-warm));
    border-radius: 2px;
    transform: rotate(45deg);
    box-shadow: 0 0 8px rgba(20, 184, 166, 0.45);
}

.ai-fab-spark::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    border-radius: 2px;
    transform: rotate(45deg);
    box-shadow: 0 0 6px rgba(15, 118, 110, 0.45);
}

.ai-fab-modal {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--line);
    width: min(90vw, 440px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
    border-radius: 18px;
}

.ai-fab-modal-body {
    display: grid;
    gap: 8px;
    text-align: center;
    padding: 8px 0 4px;
}

.ai-fab-modal-title {
    margin: 0;
    font-size: 18px;
}

.ai-fab-modal-body p {
    max-width: 260px;
    margin: 0 auto;
}

.ai-fab-chip {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-weight: 700;
    letter-spacing: 0.08em;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.16), rgba(245, 158, 11, 0.18));
    color: var(--ink);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.ai-fab-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-dark);
    background: rgba(20, 184, 166, 0.12);
}

@keyframes ai-fab-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ai-fab {
        animation: none;
    }
}

.quick-view {
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px 16px;
    display: grid;
    gap: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.quick-tabs {
    display: inline-flex;
    gap: 8px;
    background: rgba(248, 250, 252, 0.9);
    padding: 6px;
    border-radius: 999px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    width: fit-content;
}

.quick-panels {
    min-height: 80px;
}

.quick-panel {
    display: none;
}

.quick-panel.active {
    display: block;
}

.guide-modal-content {
    display: grid;
    gap: 10px;
}

.guide-row {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(248, 250, 252, 0.9);
    color: var(--ink-soft);
    font-weight: 600;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.template-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(248, 250, 252, 0.9);
    cursor: pointer;
    text-align: left;
}

.template-card:hover {
    border-color: rgba(20, 184, 166, 0.6);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.overview-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.9));
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.overview-card h3 {
    margin-top: 6px;
    margin-bottom: 0;
}

.generate-sidebar {
    display: grid;
    gap: 16px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.editor-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--muted);
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.status-chip {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(148, 163, 184, 0.16);
    color: var(--muted);
}

.status-chip.status-ok {
    background: rgba(16, 185, 129, 0.16);
    color: #047857;
}

.status-chip.status-bad {
    background: rgba(239, 68, 68, 0.16);
    color: #b91c1c;
}

.app-shell {
    display: grid;
    gap: 20px;
}

.app-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.editor-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.editor-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    color: var(--muted);
}

.editor-pane {
    height: 520px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.editor-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.editor-panel {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: grid;
    gap: 10px;
    min-height: 640px;
}

.editor-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    color: var(--ink-soft);
}

.panel-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.panel-btn {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(248, 250, 252, 0.9);
    color: var(--ink-soft);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.panel-fullscreen-active {
    overflow: hidden;
}

.editor-panel.panel-fullscreen {
    position: fixed;
    inset: 24px;
    z-index: 140;
    background: #0f172a;
    border-radius: 18px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 40px 80px rgba(15, 23, 42, 0.35);
}

.editor-panel.panel-fullscreen .editor-panel-head {
    color: #e2e8f0;
}

.editor-panel.panel-fullscreen .panel-btn {
    background: rgba(148, 163, 184, 0.15);
    color: #e2e8f0;
    border-color: rgba(148, 163, 184, 0.5);
}

.editor-panel.panel-fullscreen .editor-pane {
    height: calc(100vh - 140px);
}

.editor-panel.panel-fullscreen .muted {
    color: rgba(226, 232, 240, 0.7);
}

.editor-panel .editor-pane {
    height: 560px;
}

.panel-soft {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 14px;
}

.sticky-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 6px;
}

.preset-fields {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.preset-input label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
}

.preset-input input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #fff;
}

.preset-toggle {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(20, 184, 166, 0.08);
    color: var(--ink-soft);
    font-weight: 600;
}

.preset-toggle input {
    margin-right: 8px;
}

.preset-toggle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(20, 184, 166, 0.08);
}

.toggle-title {
    font-weight: 600;
    color: var(--ink-soft);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(148, 163, 184, 0.6);
    transition: .2s;
    border-radius: 999px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .2s;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}

.switch input:checked + .slider {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.switch input:checked + .slider:before {
    transform: translateX(18px);
}

.preset-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.preset-page-grid {
    display: grid;
    gap: 20px;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.preset-list {
    display: grid;
    gap: 12px;
}

.preset-item {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
}

.preset-note {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--ink-soft);
    font-size: 12px;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(248, 250, 252, 0.9);
}

.diff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.preset-modal-wide {
    width: min(90vw, 1100px);
}

.diff-block {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    max-height: 50vh;
    overflow: auto;
    font-size: 12px;
}

.diff-line.diff-change {
    background: rgba(239, 68, 68, 0.18);
}

.preview-list {
    display: grid;
    gap: 12px;
    max-height: 60vh;
    overflow: auto;
}

.preview-card {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 12px;
    padding: 12px;
    background: rgba(248, 250, 252, 0.9);
}

.preview-items {
    display: grid;
    gap: 6px;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}

.hint-box {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.6);
    background: rgba(248, 250, 252, 0.9);
    font-size: 12px;
    color: var(--muted);
}

.hint-row,
.hint-ok,
.hint-error {
    padding: 6px 0;
}

.hint-ok {
    color: #047857;
    font-weight: 600;
}

.hint-error {
    color: #b91c1c;
    font-weight: 600;
}
.preset-meta {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.preset-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--muted);
    display: inline-block;
}

.pill-muted {
    background: rgba(148, 163, 184, 0.2);
    color: var(--muted);
}

.preset-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 12px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-mini {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 999px;
    line-height: 1;
    min-height: 28px;
}

.preset-actions .inline-form {
    display: inline-flex;
    align-items: center;
    line-height: 1;
    margin: 0;
}

.preset-empty {
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed var(--line);
    background: rgba(148, 163, 184, 0.08);
    text-align: center;
}

.preset-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 120;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.preset-modal.show {
    display: flex;
    opacity: 1;
}

.preset-modal-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    width: min(90vw, 920px);
    max-height: 85vh;
    display: grid;
    gap: 16px;
    box-shadow: var(--shadow);
    transform: translateY(12px) scale(0.98);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.preset-modal.show .preset-modal-card {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.preset-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.preset-json {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 14px;
    padding: 16px;
    font-size: 12px;
    overflow: auto;
    max-height: 45vh;
}

.preset-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.side-panel {
    display: grid;
    gap: 16px;
}

.checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.checklist li::before {
    content: '-';
    color: var(--accent-dark);
    margin-right: 8px;
}

.metric-mini {
    display: flex;
    gap: 16px;
    margin: 12px 0;
}

.download-card {
    margin-top: 24px;
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(15, 118, 110, 0.2));
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.download-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-overlay.show {
    display: flex;
}

.loader-card {
    background: #fff;
    padding: 32px;
    border-radius: var(--radius);
    width: min(90%, 420px);
    text-align: center;
    box-shadow: var(--shadow);
}

.spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(20, 184, 166, 0.2);
    border-top-color: var(--accent-dark);
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 12px;
}

.alert.error {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.3);
    white-space: pre-line;
}

.alert.success {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    background: rgba(15, 118, 110, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent-dark);
    overflow: hidden;
}

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

.user-name {
    font-weight: 600;
}

.user-meta {
    display: none;
}

.hidden {
    display: none;
}

@media (min-width: 900px) {
    .user-meta {
        display: flex;
        flex-direction: column;
        font-size: 12px;
        line-height: 1.4;
    }
}

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

    .ai-fab {
        --ai-fab-size: clamp(40px, 12vw, 52px);
        right: max(10px, env(safe-area-inset-right));
        bottom: max(10px, env(safe-area-inset-bottom));
    }

    .ai-fab::after {
        inset: 3px;
    }

    .ai-fab-icon {
        font-size: 16px;
    }

    .app .container {
        width: min(100% - 32px, 100%);
    }

    .generate-layout {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) {
    .preset-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .nav-links {
        gap: 10px;
    }

    .hero {
        padding-top: 90px;
    }

    .editor-pane {
        height: 420px;
    }
}
