:root {
    color-scheme: light;
    --bg: #f0ebe1;
    --bg-deep: #e3ddd0;
    --panel: rgba(255, 252, 247, 0.94);
    --panel-strong: #fffdfa;
    --panel-soft: rgba(246, 241, 232, 0.88);
    --ink: #22262d;
    --muted: #68707d;
    --line: rgba(34, 38, 45, 0.1);
    --line-strong: rgba(34, 38, 45, 0.18);
    --accent: #7c5f42;
    --accent-strong: #5b4530;
    --accent-soft: rgba(124, 95, 66, 0.12);
    --success: #386f56;
    --danger: #b64848;
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
    --shadow: 0 24px 56px rgba(98, 86, 67, 0.13);
    --shadow-soft: 0 14px 28px rgba(98, 86, 67, 0.08);
    --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.72), transparent 30%),
        linear-gradient(180deg, #f4efe6 0%, var(--bg) 46%, var(--bg-deep) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.36), transparent 18%),
        radial-gradient(circle at 84% 80%, rgba(124, 95, 66, 0.08), transparent 22%);
}

.shell {
    width: min(1360px, calc(100% - 40px));
    margin: 24px auto 42px;
    position: relative;
    z-index: 1;
}

.ribbon,
.planning-card,
.editor-card,
.code-card,
.status-card,
.preview-card,
.sidebar-card,
.notice {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: linear-gradient(180deg, rgba(255, 253, 250, 0.96) 0%, rgba(246, 241, 233, 0.9) 100%);
    box-shadow: var(--shadow);
}

.ribbon {
    position: relative;
    overflow: hidden;
    padding: 34px;
    display: grid;
    grid-template-columns: minmax(0, 1.42fr) minmax(290px, 0.76fr);
    gap: 22px;
    margin-bottom: 24px;
}

.ribbon::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 24px;
    border: 1px solid rgba(34, 38, 45, 0.06);
    pointer-events: none;
}

.ribbon::after {
    content: "";
    position: absolute;
    top: 26px;
    right: 26px;
    width: 180px;
    height: 180px;
    border-radius: 24px;
    background:
        linear-gradient(rgba(66, 133, 244, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(52, 168, 83, 0.06) 1px, transparent 1px);
    background-size: 18px 18px;
    transform: rotate(8deg);
    pointer-events: none;
}

.ribbon-copy,
.ribbon-metrics,
.planning-rail,
.editor-column,
.preview-rail {
    display: grid;
    gap: 20px;
}

.eyebrow,
.card-kicker,
.metric-label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(101, 108, 120, 0.8);
}

h1,
.section-head h2,
.panel-head h2,
.planning-card h2,
.sidebar-card strong,
.status-card strong {
    margin: 0;
    letter-spacing: -0.05em;
}

h1 {
    font-size: 30px;
    line-height: 1.04;
}

.lead,
.section-head p,
.panel-head p,
.planning-card p,
.status-card p,
.sidebar-card p,
.metric-card p,
.form-note,
.notice,
.muted,
textarea::placeholder,
input::placeholder {
    color: var(--muted);
}

.lead {
    margin: 0;
    font-size: 1.03rem;
    line-height: 1.74;
}

.metric-card {
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.56);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, #4285f4 0%, #34a853 33%, #fbbc05 66%, #ea4335 100%);
}

.metric-label {
    display: inline-block;
    margin-bottom: 12px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
}

.metric-card strong {
    display: block;
    font-size: 1.22rem;
}

.metric-card p {
    margin: 10px 0 0;
    line-height: 1.68;
}

.meta-grid {
    display: grid;
    grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.42fr) minmax(320px, 0.84fr);
    gap: 24px;
    align-items: start;
}

.planning-card,
.editor-card,
.code-card,
.status-card,
.preview-card,
.sidebar-card {
    padding: 28px;
}

.planning-card h2,
.section-head h2,
.panel-head h2 {
    font-size: clamp(1.92rem, 2.9vw, 2.55rem);
    line-height: 0.98;
}

.planning-card p,
.section-head p,
.panel-head p,
.status-card p,
.sidebar-card p {
    margin: 12px 0 0;
    line-height: 1.72;
}

.planning-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.planning-list li {
    padding: 14px 16px;
    border: 1px solid rgba(34, 38, 45, 0.08);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.56);
    line-height: 1.6;
}

.planning-card-accent {
    background: linear-gradient(180deg, rgba(66, 133, 244, 0.92) 0%, rgba(26, 115, 232, 0.94) 100%);
    color: #fdf7f1;
}

.planning-card-accent .card-kicker,
.planning-card-accent p {
    color: rgba(240, 247, 255, 0.82);
}

.editor-card,
.code-card {
    background: linear-gradient(180deg, rgba(255, 254, 251, 0.97) 0%, rgba(245, 241, 235, 0.92) 100%);
}

.section-head,
.panel-head {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
}

.tool-form {
    display: grid;
    gap: 20px;
}

.field {
    display: grid;
    gap: 10px;
}

.field > span {
    font-size: 0.94rem;
    font-weight: 800;
}

.field-lg textarea {
    min-height: 150px;
}

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

input,
textarea {
    width: 100%;
    min-height: 58px;
    padding: 17px 18px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font: inherit;
    transition: border-color 160ms var(--ease-soft), box-shadow 160ms var(--ease-soft), transform 160ms var(--ease-soft), background 160ms var(--ease-soft);
}

textarea {
    resize: vertical;
    line-height: 1.68;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(124, 95, 66, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.94),
        0 0 0 4px rgba(124, 95, 66, 0.1);
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.95);
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    letter-spacing: -0.02em;
    cursor: pointer;
    transition: transform 180ms var(--ease-soft), box-shadow 180ms var(--ease-soft), background 180ms var(--ease-soft), opacity 180ms var(--ease-soft);
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:active:not(:disabled) {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button[type="submit"] {
    color: #fff9f5;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-strong) 100%);
    box-shadow: 0 14px 26px rgba(91, 69, 48, 0.22);
}

.ghost-button {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
}

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

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.form-note {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.62;
}

.notice {
    padding: 14px 16px;
    border-radius: var(--radius-md);
}

.notice.success {
    background: rgba(56, 111, 86, 0.1);
    color: var(--success);
    border: 1px solid rgba(56, 111, 86, 0.16);
}

.notice.error {
    background: rgba(182, 72, 72, 0.1);
    color: var(--danger);
    border: 1px solid rgba(182, 72, 72, 0.16);
}

.hidden {
    display: none !important;
}

.status-card strong,
.sidebar-card strong {
    display: block;
    font-size: 1.7rem;
    line-height: 1.02;
}

.search-box,
.social-box,
.code-block {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(34, 38, 45, 0.08);
    border-radius: 22px;
    padding: 18px;
}

.search-title {
    color: #1a0dab;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.45;
}

.search-url {
    margin-top: 8px;
    color: #0f7b0f;
    font-size: 0.9rem;
}

.search-box p,
.social-box p {
    margin: 10px 0 0;
}

.search-box,
.social-box {
    position: relative;
    overflow: hidden;
}

.search-box::before,
.social-box::before {
    content: "";
    display: block;
    width: 62px;
    height: 10px;
    border-radius: 999px;
    margin-bottom: 14px;
    background:
        radial-gradient(circle at 10px 50%, #ea4335 0 4px, transparent 5px),
        radial-gradient(circle at 31px 50%, #fbbc05 0 4px, transparent 5px),
        radial-gradient(circle at 52px 50%, #34a853 0 4px, transparent 5px);
}

.search-box::after {
    content: "";
    position: absolute;
    inset: auto 18px 18px 18px;
    height: 1px;
    background: linear-gradient(90deg, rgba(66, 133, 244, 0.14), transparent);
}

.social-box {
    display: grid;
    gap: 14px;
    background: linear-gradient(180deg, rgba(66, 133, 244, 0.06), rgba(255, 255, 255, 0.86));
}

.social-box img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(34, 38, 45, 0.06);
}

.code-block {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    font-family: "SFMono-Regular", Consolas, monospace;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.ad-shell {
    display: grid;
    gap: 18px;
}

.ad-slot,
.ad-placeholder {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 250, 244, 0.82);
}

.ad-placeholder {
    padding: 12px;
}

.ad-mockup {
    position: relative;
    overflow: hidden;
    min-height: 400px;
    border-radius: 22px;
    border: 1px solid rgba(66, 133, 244, 0.1);
    background: linear-gradient(180deg, rgba(255, 251, 245, 0.94) 0%, rgba(242, 236, 226, 0.94) 100%);
}

.ad-mockup-top,
.ad-mockup-media,
.ad-mockup-lines span {
    position: absolute;
    left: 18px;
    right: 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.34);
}

.ad-mockup-top {
    top: 18px;
    width: 34%;
    right: auto;
    height: 34px;
}

.ad-mockup-media {
    top: 92px;
    height: 150px;
}

.ad-mockup-lines {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 22px;
    display: grid;
    gap: 12px;
}

.ad-mockup-lines span:first-child,
.ad-mockup-lines span:last-child {
    position: static;
    height: 18px;
}

.ad-mockup-lines span:first-child {
    width: 62%;
    background: rgba(66, 133, 244, 0.16);
}

.ad-mockup-lines span:last-child {
    width: 44%;
    background: rgba(52, 168, 83, 0.11);
}

.ad-mockup-badge {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    width: 184px;
    height: 184px;
    margin: auto;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(66, 133, 244, 0.96) 0%, rgba(26, 115, 232, 0.96) 100%);
    color: #fff;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0.06em;
}

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

    .preview-rail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .ad-shell {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .ribbon,
    .grid-two,
    .preview-rail {
        grid-template-columns: 1fr;
    }

    .ribbon,
    .planning-card,
    .editor-card,
    .code-card,
    .status-card,
    .preview-card,
    .sidebar-card {
        padding: 22px;
    }

    .action-row {
        align-items: stretch;
    }

    button,
    .ghost-button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(100% - 20px, 100%);
        margin: 16px auto 24px;
    }
}
