:root {
    --black: #072e00;
    --white: #ffffff;
    --surface: #ffffff;
    --surface-alt: #f7f7f7;
    --line: #e1e8ed;
    --text: #0f1419;
    --muted: #536471;
    --muted-soft: #8b98a5;
    --accent: #40e378;
    --accent-dark: #25cc5f;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow: 0 18px 50px rgba(15, 20, 25, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--text);
    background: var(--white);
    font-family: Inter, system-ui, sans-serif;
}

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

button,
input,
textarea {
    font: inherit;
}

code {
    font-family: Consolas, monospace;
}

.publish-topbar {
    background: var(--black);
    color: var(--white);
}

.topbar-inner,
.hero-inner,
.options-inner {
    width: min(100% - 24px, 1040px);
    margin: 0 auto;
}

.topbar-inner {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.02rem;
    font-weight: 700;
}

.brand-logo {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.brand-mark {
    color: var(--white);
}

.brand-slash {
    color: rgba(255, 255, 255, 0.5);
}

.topbar-note {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.95rem;
}

.hero-block {
    min-height: 520px;
    background: var(--black);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-inner {
    text-align: center;
    padding: 40px 0 56px;
}

.hero-kicker {
    display: none;
}

.hero-inner h1,
.section-heading h2,
.code-panel h3,
.preview-panel h3 {
    margin: 0;
}

.hero-inner h1 {
    font-size: clamp(2.3rem, 4vw, 3.7rem);
    font-weight: 500;
    letter-spacing: -0.04em;
}

.hero-description {
    width: min(100%, 640px);
    margin: 16px auto 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.65;
    font-size: 1rem;
}

.publish-form {
    width: min(100%, 560px);
    margin: 24px auto 0;
    display: grid;
    grid-template-columns: 1fr 56px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    overflow: hidden;
    background: var(--white);
}

.publish-form input {
    width: 100%;
    min-width: 0;
    border: 0;
    padding: 16px 18px;
    color: var(--text);
    background: transparent;
}

.publish-form input::placeholder {
    color: #657786;
}

.publish-form button {
    border: 0;
    background: transparent;
    color: #7d8b97;
    cursor: pointer;
    font-size: 1.45rem;
}

.helper-text,
.message {
    margin: 14px 0 0;
    font-size: 0.96rem;
}

.helper-text {
    color: rgba(255, 255, 255, 0.7);
}

.helper-text code {
    color: rgba(255, 255, 255, 0.92);
}

.message {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 999px;
}

.message.error {
    color: #ffd4d4;
    background: rgba(255, 77, 77, 0.14);
}

.message.success {
    color: #d7ffe4;
    background: rgba(64, 227, 120, 0.16);
}

.options-block {
    background: var(--surface);
    padding: 36px 0 64px;
}

.section-heading {
    text-align: center;
}

.section-heading h2 {
    font-size: 2rem;
    font-weight: 500;
    color: var(--text);
}

.section-heading p {
    width: min(100%, 560px);
    margin: 12px auto 0;
    color: var(--muted);
    line-height: 1.6;
}

.display-options,
.empty-options {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 32px;
}

.option-card {
    width: 210px;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
}

.option-card.is-active {
    border-color: rgba(64, 227, 120, 0.35);
    background: rgba(64, 227, 120, 0.06);
}

.option-thumb {
    height: 172px;
    border-radius: 12px;
    background: linear-gradient(180deg, #eef2f5 0%, #d9e1e7 100%);
    position: relative;
    overflow: hidden;
}

.option-thumb::before,
.option-thumb::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    border-radius: 999px;
    background: #dde5eb;
}

.option-thumb::before {
    top: 18px;
    right: auto;
    width: 82px;
    height: 10px;
}

.option-thumb::after {
    top: 56px;
    height: 74px;
    border-radius: 4px;
    background: var(--black);
}

.option-thumb-text::after {
    top: 56px;
    left: 18px;
    right: 18px;
    height: 10px;
    border-radius: 999px;
    background: #dde5eb;
    box-shadow:
        0 18px 0 0 #dde5eb,
        0 36px 0 0 #dde5eb;
}

.option-thumb-text::before {
    width: 66px;
}

.option-thumb-text {
    background: linear-gradient(180deg, #eef2f5 0%, #d9e1e7 100%);
}

.option-thumb-text span {
    display: none;
}

.option-card strong {
    display: block;
    margin-top: 16px;
    font-size: 1.1rem;
    font-weight: 500;
}

.option-card span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.55;
}

.option-card.is-active strong {
    color: var(--text);
}

.theme-toolbar {
    margin-top: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.theme-toolbar-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.theme-switcher {
    display: inline-flex;
    gap: 8px;
    padding: 4px;
    border-radius: 999px;
    background: #f2f4f5;
    border: 1px solid var(--line);
}

.theme-chip {
    min-width: 96px;
    padding: 10px 14px;
    border-radius: 999px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
    transition: 0.18s ease;
}

.theme-chip.is-active {
    color: var(--white);
    background: var(--text);
}

.result-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
    gap: 24px;
    text-align: left;
    margin-top: 40px;
    align-items: start;
}

.code-panel,
.preview-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.code-panel h3,
.preview-panel h3 {
    font-size: 1.18rem;
    font-weight: 500;
}

.code-panel p,
.preview-panel p {
    margin-top: 10px;
    line-height: 1.6;
}

.code-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    margin-top: 16px;
}

.code-row textarea {
    width: 100%;
    min-height: 240px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    color: var(--text);
    background: #fbfcfd;
    line-height: 1.55;
}

.copy-code {
    border: 0;
    border-radius: 12px;
    padding: 14px 16px;
    background: var(--text);
    color: var(--white);
    cursor: pointer;
    font-weight: 700;
}

.widget-preview {
    min-height: 320px;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8px;
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--text);
    color: var(--white);
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: 0.2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.publish-footer {
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.publish-footer-inner {
    width: min(100% - 24px, 1040px);
    margin: 0 auto;
    padding: 10px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.publish-footer-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

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

.publish-footer-nav a {
    color: var(--muted);
}

.publish-footer-button {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.publish-footer-button:hover {
    color: var(--text);
}

.publish-footer-nav a:hover {
    color: var(--text);
}

@media (max-width: 860px) {
    .topbar-inner {
        min-height: 78px;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 14px 0;
    }

    .hero-block {
        min-height: 400px;
    }

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

@media (max-width: 560px) {
    .topbar-inner,
    .hero-inner,
    .options-inner {
        width: min(100% - 16px, 1040px);
    }

    .hero-inner h1 {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 0.95rem;
    }

    .publish-form {
        grid-template-columns: 1fr 48px;
    }

    .code-row {
        grid-template-columns: 1fr;
    }

    .publish-footer-inner {
        width: min(100% - 16px, 1040px);
        justify-content: center;
        text-align: center;
    }
}
