:root {
    --bg: #f6f8fb;
    --panel: #ffffff;
    --ink: #132033;
    --muted: #617086;
    --line: #d7deea;
    --accent: #2563eb;
    --soft: #e9f0ff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
}

button,
input,
select,
textarea {
    font: inherit;
}

.app {
    width: min(1800px, calc(100% - 36px));
    margin: 0 auto;
    padding: 22px 0 46px;
}

.topbar,
.top-actions,
.section-title,
.section-head,
.hero-actions,
.contact-strip {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar {
    justify-content: space-between;
    margin-bottom: 30px;
    background: #0f0f13;
    border: 1px solid #27272a;
    border-radius: 12px;
    padding: 10px 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-logo {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #a78bfa, #60a5fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-product {
    font-size: 0.8rem;
    font-weight: 600;
    color: #71717a;
    border-left: 1px solid #27272a;
    padding-left: 10px;
}

.hero {
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 900;
    text-transform: uppercase;
}

h1 {
    max-width: 980px;
    margin: 0;
    font-size: clamp(38px, 7vw, 70px);
    line-height: 0.94;
}

.hero p:last-child,
.draft-message,
.muted-label {
    color: var(--muted);
}

.hero p:last-child {
    max-width: 760px;
    margin: 14px 0 0;
    font-size: 18px;
    line-height: 1.5;
}

.primary-button,
.ghost-button,
.hero-button {
    min-height: 40px;
    border-radius: 8px;
    padding: 0 14px;
    cursor: pointer;
    font-weight: 850;
}

.primary-button,
.hero-button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

.ghost-button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
}

.topbar .ghost-button {
    border-color: #27272a;
    background: #18181b;
    color: #a1a1aa;
}

.topbar .ghost-button:hover {
    border-color: #a78bfa;
    color: #fff;
}

.workspace {
    display: grid;
    grid-template-columns: minmax(580px, 0.84fr) minmax(780px, 1.16fr);
    gap: 24px;
    align-items: start;
}

.panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 18px 44px rgba(19, 32, 51, 0.08);
}

.editor {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.section-title {
    justify-content: space-between;
}

.section-title h2,
.section-head h3 {
    margin: 0;
}

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

.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.four {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    padding: 10px 11px;
}

textarea {
    resize: vertical;
}

.category-editor {
    display: grid;
    gap: 14px;
}

.category-card {
    display: grid;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcff;
    padding: 12px;
}

.category-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px 38px;
    gap: 8px;
    align-items: center;
}

.service-row {
    display: grid;
    grid-template-columns: 1.4fr 0.9fr 0.9fr 38px;
    gap: 8px;
}

.small-button,
.remove-button {
    min-height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 850;
}

.small-button {
    border: 1px solid var(--line);
    background: var(--soft);
    color: var(--ink);
}

.remove-button {
    width: 38px;
    border: 1px solid #efb2b6;
    background: #fff3f4;
    color: #b4232a;
}

.draft-message {
    min-height: 20px;
    margin: 0;
    font-size: 13px;
}

.live-profile-box {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcff;
    padding: 12px;
}

.live-profile-box p,
.live-link {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.live-profile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.live-link {
    overflow-wrap: anywhere;
}

.version-row {
    display: grid;
    gap: 7px;
}

.preview-shell {
    padding: 18px;
    overflow: auto;
}

.site-sheet {
    width: min(100%, 980px);
    min-height: 860px;
    margin: 0 auto;
    border-radius: 18px;
    background: var(--site-bg, #f6f8fb);
    color: var(--site-ink, #132033);
    padding: 28px;
}

.size-a4-landscape {
    width: min(100%, 1140px);
}

.site-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    gap: 18px;
    margin-bottom: 18px;
}

.hero-copy,
.hero-media,
.contact-strip > div,
.service-section,
.gallery-block,
.closing-panel {
    border: 1px solid color-mix(in srgb, var(--site-accent, #2563eb), #d7deea 74%);
    border-radius: 16px;
    background: var(--site-panel, #ffffff);
}

.hero-copy {
    padding: 24px;
}

.hero-copy h2 {
    margin: 0 0 10px;
    font-size: clamp(34px, 5vw, 56px);
    line-height: 0.94;
}

.preview-tagline,
.preview-intro,
.hero-subcopy,
.service-text,
.contact-strip span,
.gallery-empty,
.closing-panel p {
    color: var(--site-muted, #617086);
}

.preview-tagline {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
}

.preview-intro,
.closing-panel p {
    margin: 0;
    line-height: 1.6;
}

.hero-actions {
    margin-top: 18px;
    flex-wrap: wrap;
}

.hero-media {
    display: grid;
    place-items: center;
    min-height: 300px;
    overflow: hidden;
    padding: 18px;
}

.logo-mark {
    display: grid;
    place-items: center;
    width: 94px;
    height: 94px;
    border-radius: 24px;
    background: var(--site-accent, #2563eb);
    color: #fff;
    font-size: 28px;
    font-weight: 900;
}

.hero-media img {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

.contact-strip {
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.contact-strip > div {
    flex: 1 1 180px;
    display: grid;
    gap: 6px;
    padding: 14px 16px;
}

.contact-strip strong {
    color: var(--site-accent, #2563eb);
    font-size: 12px;
    text-transform: uppercase;
}

.service-sections {
    display: grid;
    gap: 16px;
}

.service-section {
    padding: 18px;
}

.service-section h3 {
    margin: 0 0 14px;
    font-size: 21px;
}

.service-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    padding: 14px 0;
    border-top: 1px solid color-mix(in srgb, var(--site-accent, #2563eb), transparent 84%);
}

.service-card:first-child {
    border-top: 0;
    padding-top: 0;
}

.service-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 17px;
}

.service-price {
    color: var(--site-accent, #2563eb);
    font-weight: 900;
    white-space: nowrap;
}

.gallery-block,
.closing-panel {
    margin-top: 18px;
    padding: 18px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.gallery-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    background: #eef3fb;
}

.gallery-empty {
    margin: 0;
}

.closing-panel {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.color-row {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 8px;
}

.color-row input[type="color"] {
    padding: 0;
    min-height: 42px;
}

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

@media (max-width: 860px) {
    .app {
        width: min(100% - 18px, 1400px);
    }

    .topbar,
    .top-actions,
    .hero-actions,
    .contact-strip,
    .closing-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .two,
    .three,
    .four,
    .category-head,
    .service-row,
    .site-hero,
    .gallery-grid,
    .color-row,
    .live-profile-actions {
        grid-template-columns: 1fr;
    }

    .remove-button {
        width: 100%;
    }
}

@media print {
    @page {
        margin: 8mm;
        size: A4 portrait;
    }

    body {
        background: #fff;
    }

    .topbar,
    .hero,
    .editor {
        display: none;
    }

    .app {
        width: 100%;
        padding: 0;
    }

    .workspace {
        display: block;
    }

    .preview-shell {
        border: 0;
        box-shadow: none;
        padding: 0;
    }

    .site-sheet {
        min-height: auto;
        border-radius: 0;
    }
}
