:root {
    color-scheme: dark;
    --bg: #1f1b18;
    --bg-deep: #14110f;
    --panel: rgba(41, 35, 31, 0.96);
    --panel-soft: rgba(57, 49, 44, 0.9);
    --surface: #d5c8b9;
    --surface-soft: #b7a999;
    --ink: #f3ece3;
    --muted: #b7ab9e;
    --line: rgba(255, 243, 230, 0.08);
    --line-strong: rgba(255, 243, 230, 0.18);
    --accent: #f2bf72;
    --accent-strong: #c4853d;
    --accent-soft: rgba(242, 191, 114, 0.14);
    --success: #79c795;
    --warn: #d8a758;
    --danger: #d78773;
    --danger-soft: rgba(215, 135, 115, 0.12);
    --shadow-lg: 0 30px 72px rgba(0, 0, 0, 0.36);
    --shadow-md: 0 18px 34px rgba(0, 0, 0, 0.26);
    --shadow-sm: 0 12px 20px rgba(0, 0, 0, 0.18);
    --radius-xl: 34px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 10%, rgba(242, 191, 114, 0.08), transparent 20%),
        radial-gradient(circle at 84% 14%, rgba(255, 255, 255, 0.04), transparent 18%),
        linear-gradient(180deg, #231d19 0%, var(--bg) 38%, var(--bg-deep) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at center, rgba(255, 255, 255, 0.04), transparent 44%),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0, rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 72px);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.46), transparent 78%);
}

.hidden {
    display: none !important;
}

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

.eyebrow,
.note-label,
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(233, 223, 212, 0.74);
}

.eyebrow::before {
    content: "";
    width: 18px;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}

.light-table,
.surface-panel,
.control-card,
.insight-card,
.sidebar-card,
.notice {
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    background: var(--panel);
    box-shadow: var(--shadow-lg);
}

.light-table {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 360px;
    gap: 22px;
    padding: 30px;
    margin-bottom: 24px;
    background:
        linear-gradient(135deg, rgba(57, 49, 44, 0.96) 0%, rgba(30, 25, 22, 0.98) 100%);
}

.table-copy h1,
.panel-head h2,
.control-head h3,
.insight-card h2,
.sidebar-card strong {
    margin: 0;
    letter-spacing: -0.05em;
}

.table-copy h1 {
    font-size: 30px;
    line-height: 1;
}

.lead {
    max-width: 58ch;
    margin: 18px 0 0;
    font-size: 1.03rem;
    line-height: 1.78;
    color: var(--muted);
}

.table-notes {
    display: grid;
    gap: 12px;
    align-content: start;
}

.note-tile {
    padding: 18px 20px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 248, 240, 0.04);
    box-shadow: var(--shadow-sm);
}

.note-tile strong {
    display: block;
    line-height: 1.55;
    font-size: 1rem;
}

.material-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.workbench {
    display: grid;
    gap: 22px;
}

.insight-rail {
    display: grid;
    gap: 16px;
}

.surface-panel,
.insight-card,
.sidebar-card {
    padding: 22px;
}

.preview-panel {
    background:
        linear-gradient(180deg, rgba(53, 45, 40, 0.96) 0%, rgba(35, 29, 26, 0.98) 100%);
}

.panel-head {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.panel-head h2,
.insight-card h2 {
    font-size: 1.52rem;
    line-height: 1.04;
}

.panel-copy,
.dock-note,
.form-note,
.field-note,
.sidebar-card p,
.sidebar-card li,
.notice,
.summary-card p {
    color: var(--muted);
    line-height: 1.7;
}

.preset-dock {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.preset-button {
    min-height: 46px;
    padding: 0 18px;
    border: 1px solid rgba(242, 191, 114, 0.16);
    border-radius: 999px;
    background: rgba(255, 248, 240, 0.04);
    color: var(--ink);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease), box-shadow 180ms var(--ease);
}

.preset-button:hover {
    transform: translateY(-1px);
    border-color: rgba(242, 191, 114, 0.3);
}

.preset-button.is-active {
    color: #261d14;
    background: linear-gradient(180deg, rgba(242, 191, 114, 0.96) 0%, rgba(196, 133, 61, 0.94) 100%);
    box-shadow: 0 14px 28px rgba(242, 191, 114, 0.14);
}

.shadow-stage {
    margin-top: 18px;
    padding: 28px;
    border-radius: 28px;
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(255, 248, 240, 0.06) 0%, rgba(255, 248, 240, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stage-surface {
    min-height: 420px;
    padding: 34px;
    border-radius: 30px;
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.2), transparent 42%),
        linear-gradient(180deg, rgba(223, 212, 198, 0.92) 0%, rgba(191, 177, 160, 0.88) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.stage-grid {
    width: 100%;
    min-height: 352px;
    border-radius: 26px;
    border: 1px dashed rgba(35, 29, 26, 0.16);
    display: grid;
    place-items: center;
    padding: 34px;
}

.shadow-box {
    width: min(320px, 100%);
    min-height: 220px;
    padding: 26px;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 48px;
    background: linear-gradient(180deg, #fffdfa 0%, #f6f0e8 100%);
    color: #2c241c;
    text-align: center;
}

.shadow-box-label {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.shadow-box-meta {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(44, 36, 28, 0.74);
}

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

.control-card {
    padding: 22px;
    background:
        linear-gradient(180deg, rgba(52, 44, 39, 0.98) 0%, rgba(33, 27, 24, 0.98) 100%);
}

.control-head {
    margin-bottom: 16px;
}

.control-head h3 {
    font-size: 1.28rem;
    margin-bottom: 6px;
}

.field-stack {
    display: grid;
    gap: 16px;
}

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

.field > span {
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(233, 223, 212, 0.88);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    font: inherit;
    color: var(--ink);
    background: rgba(255, 248, 240, 0.06);
    transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease), transform 180ms var(--ease);
}

input[type="range"] {
    padding: 0;
    appearance: none;
    height: 4px;
    background: linear-gradient(90deg, rgba(242, 191, 114, 0.92) 0%, rgba(255, 255, 255, 0.18) 100%);
    border: 0;
    border-radius: 999px;
    box-shadow: none;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 0;
    background: #fff6ea;
    box-shadow: 0 0 0 4px rgba(242, 191, 114, 0.14);
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 0;
    background: #fff6ea;
    box-shadow: 0 0 0 4px rgba(242, 191, 114, 0.14);
    cursor: pointer;
}

input[type="color"] {
    min-height: 58px;
    padding: 8px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(242, 191, 114, 0.34);
    background: rgba(255, 248, 240, 0.1);
    box-shadow: 0 0 0 4px rgba(242, 191, 114, 0.08);
}

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

.range-value {
    min-width: 68px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 243, 230, 0.1);
    background: rgba(255, 248, 240, 0.05);
    text-align: right;
    font-weight: 800;
    color: var(--muted);
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 14px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: rgba(255, 248, 240, 0.06);
}

.toggle-row input {
    width: auto;
    accent-color: var(--accent);
}

.field-note {
    margin: 0;
}

.bay-footer {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

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

button {
    min-height: 52px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms var(--ease), box-shadow 180ms var(--ease), background 180ms var(--ease), opacity 180ms var(--ease);
}

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

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

#shadow-copy,
#shadow-copy-secondary {
    color: #241912;
    background: linear-gradient(180deg, rgba(242, 191, 114, 0.96) 0%, rgba(196, 133, 61, 0.94) 100%);
    box-shadow: 0 14px 28px rgba(196, 133, 61, 0.2);
}

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

.notice {
    padding: 16px 18px;
    background: rgba(33, 53, 43, 0.88);
    color: #dff5e6;
}

.summary-card strong {
    display: block;
    font-size: 1.6rem;
    letter-spacing: -0.05em;
    margin-bottom: 8px;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.chip {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 243, 230, 0.08);
    background: rgba(255, 248, 240, 0.04);
    color: #f0e5d8;
    font-weight: 700;
}

.code-card .panel-head {
    margin-bottom: 14px;
}

.code-block {
    margin: 0;
    padding: 20px;
    min-height: 180px;
    border-radius: 20px;
    border: 1px solid rgba(255, 243, 230, 0.08);
    background: linear-gradient(180deg, rgba(15, 13, 12, 0.86) 0%, rgba(24, 21, 19, 0.94) 100%);
    color: #f7efe5;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.72;
    white-space: pre-wrap;
    word-break: break-word;
}

.sidebar-card {
    background: linear-gradient(180deg, rgba(49, 41, 37, 0.96) 0%, rgba(30, 25, 22, 0.98) 100%);
}

.sidebar-card .sidebar-title {
    font-size: 1.38rem;
    letter-spacing: -0.04em;
}

.sidebar-card .sidebar-copy,
.sidebar-card .sidebar-placeholder-note {
    color: var(--muted);
}

.sidebar-card .sidebar-ad-slot,
.sidebar-card .sidebar-ad-placeholder {
    min-height: 320px;
    margin-top: 16px;
    border: 1px solid rgba(255, 243, 230, 0.08);
    border-radius: 20px;
    background: rgba(255, 248, 240, 0.04);
}

.sidebar-card .sidebar-ad-placeholder {
    padding: 14px;
}

.sidebar-card .sidebar-ad-mock {
    min-height: 288px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background:
        radial-gradient(circle at center, rgba(242, 191, 114, 0.12), transparent 44%),
        linear-gradient(180deg, rgba(255, 248, 240, 0.06) 0%, rgba(255, 248, 240, 0.02) 100%);
}

.sidebar-card .sidebar-ad-badge {
    width: 158px;
    height: 158px;
    border-radius: 999px;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 2px;
    color: #23170f;
    background: linear-gradient(180deg, rgba(242, 191, 114, 0.98) 0%, rgba(196, 133, 61, 0.94) 100%);
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

@media (max-width: 1260px) {
    .light-table,
    .material-grid,
    .control-bay {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .shell {
        width: min(100% - 20px, 100%);
        margin: 18px auto 28px;
    }

    .light-table,
    .surface-panel,
    .control-card,
    .insight-card,
    .sidebar-card {
        padding: 20px;
    }

    .stage-surface {
        min-height: 320px;
        padding: 20px;
    }

    .stage-grid {
        min-height: 260px;
        padding: 18px;
    }

    .shadow-box {
        min-height: 180px;
        gap: 26px;
    }

    .bay-footer,
    .action-row {
        flex-direction: column;
        align-items: stretch;
    }

    button,
    .preset-button,
    #shadow-copy,
    #shadow-copy-secondary,
    .ghost-button {
        width: 100%;
    }
}
