:root {
    --ps-primary: #8a5ac5;
    --ps-bg: #f5f7fb;
    --ps-border: #e2e8f0;
    --ps-text: #0f172a;
    --ps-muted: #475569;
    --ps-success: #166534;
    --ps-danger: #991b1b;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    color: var(--ps-text);
    background:
        radial-gradient(circle at 16% 0%, rgba(138, 90, 197, 0.07), transparent 42%),
        radial-gradient(circle at 92% 10%, rgba(53, 195, 255, 0.07), transparent 38%),
        var(--ps-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.psg-container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.psg-container-wide {
    width: min(1240px, calc(100% - 28px));
}

.fallback-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--ps-border);
    background: rgba(255, 255, 255, 0.94);
}

.fallback-header-inner {
    height: 70px;
    display: flex;
    align-items: center;
}

.fallback-logo {
    color: var(--ps-primary);
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.generator-shell {
    padding-bottom: 48px;
    flex: 1 0 auto;
}

.hero {
    padding: 44px 0 52px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 251, 255, 0.9));
    border-bottom: 1px solid rgba(203, 213, 225, 0.75);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    right: -130px;
    top: -130px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(138, 90, 197, 0.14), rgba(53, 195, 255, 0.02) 65%, transparent 78%);
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    justify-items: center;
    text-align: center;
    max-width: 920px;
}

.hero h1 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #101626;
    font-size: clamp(1.65rem, 3.4vw, 2.45rem);
}

.hero p {
    margin: 0;
    color: #334155;
    line-height: 1.58;
}

.hero-cta {
    display: inline-flex;
    margin-top: 4px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #d5dde9;
    text-decoration: none;
    color: #364152;
    font-size: 0.82rem;
    font-weight: 700;
}

.generator-stage {
    margin-top: 20px;
    border: 1px solid #dbe4f2;
    border-radius: 20px;
    background: rgba(252, 253, 255, 0.92);
    box-shadow: 0 24px 34px -30px rgba(15, 23, 42, 0.55);
    overflow: hidden;
}

.builder-strip {
    padding: 14px 18px 12px;
    background: rgba(246, 249, 255, 0.75);
    border-bottom: 1px solid #e4ebf7;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.builder-pill {
    border: 1px solid #d3dce8;
    background: #fff;
    border-radius: 999px;
    color: #475569;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.tabs-section {
    padding: 14px 18px 12px;
    background: rgba(246, 249, 255, 0.75);
    border-bottom: 1px solid #e4ebf7;
}

.tabs-wrap {
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    gap: 8px;
}

.tabs-wrap.tabs-static {
    grid-template-columns: 1fr;
}

.tabs-arrow {
    border: 1px solid #d3dce8;
    background: #fff;
    border-radius: 10px;
    height: 36px;
    color: #64748b;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    line-height: 1;
}

.tabs-arrow.is-hidden {
    display: none;
}

.tabs-arrow.is-disabled {
    opacity: 0.35;
    pointer-events: none;
}

.tabs-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 2px 1px;
    scrollbar-width: none;
    justify-content: flex-start;
}

.tabs-nav::-webkit-scrollbar {
    display: none;
}

.tabs-nav.tabs-centered {
    justify-content: center;
    overflow-x: visible;
}

.tab-btn {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    border: 1px solid #d3dce8;
    background: #fff;
    border-radius: 999px;
    color: #475569;
    padding: 7px 11px;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.tab-btn.is-active {
    color: #fff;
    background: #8a5ac5;
    border-color: #8a5ac5;
}

.content-section {
    padding: 24px 22px 30px;
}

.tab-panel {
    display: none;
}

.tab-panel.is-active {
    display: block;
    animation: fade-in 0.26s ease-out;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    border: 1px solid #dbe4f0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 26px -26px rgba(15, 23, 42, 0.55);
    padding: 18px;
}

.card-header {
    margin-bottom: 16px;
}

.card-header h2 {
    margin: 0;
    font-size: 1.08rem;
}

.card-header p {
    margin: 8px 0 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.52;
}

.card-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

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

label {
    display: grid;
    gap: 6px;
    font-size: 0.83rem;
    color: #334155;
    font-weight: 600;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #0f172a;
    font: inherit;
    padding: 10px 11px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea {
    resize: vertical;
    min-height: 130px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #8a5ac5;
    box-shadow: 0 0 0 4px rgba(138, 90, 197, 0.14);
}

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

.result-wrap textarea {
    min-height: 170px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.8rem;
    line-height: 1.45;
}

.btn-primary,
.copy-btn {
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 10px 12px;
    cursor: pointer;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #8a5ac5, #6f3eaf);
    border-color: #7f4bbb;
}

.copy-btn {
    color: #334155;
    background: #fff;
    border-color: #cbd5e1;
}

.generator-seo {
    padding: 42px 0;
    margin-top: 12px;
    border-top: 1px solid #deebf7;
    background: linear-gradient(180deg, rgba(248, 250, 253, 0.9), rgba(241, 247, 255, 0.85));
}

.generator-seo h2 {
    margin: 0;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    font-size: clamp(1rem, 2.2vw, 1.34rem);
}

.seo-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.seo-grid article {
    border: 1px solid #dbe4f0;
    border-radius: 14px;
    background: #fff;
    padding: 14px;
}

.seo-grid h3 {
    margin: 0;
    font-size: 0.95rem;
}

.seo-grid p {
    margin: 8px 0 0;
    color: #475569;
    line-height: 1.58;
    font-size: 0.9rem;
}

.generator-footer {
    padding: 14px 0 24px;
}

.generator-footer p {
    margin: 0;
    text-align: center;
    color: #64748b;
    font-size: 0.82rem;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 18px);
    opacity: 0;
    background: #0f172a;
    color: #fff;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 300;
}

.toast.is-visible {
    transform: translate(-50%, 0);
    opacity: 1;
}

.toast.is-error {
    background: #b91c1c;
}

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

@media (max-width: 760px) {
    .content-section {
        padding: 18px 14px 24px;
    }

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

    .tool-card {
        padding: 14px;
    }

    .btn-primary,
    .copy-btn {
        width: 100%;
    }
}
