:root {
    color-scheme: dark;
    --navy: #0F1C2E;
    --navy-light: #17293f;
    --gold: #CFAF6A;
    --silver: #C9CED6;
    --error: #c0564a;
    --warning: #b9903a;
    --ok: #5c8f6f;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--navy);
    color: var(--silver);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.55;
}

h1, h2, h3, .brand-font {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    color: #fff;
    letter-spacing: 0.01em;
}

a { color: var(--gold); }

.wrap {
    max-width: 980px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

header.app-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(201, 206, 214, 0.15);
    padding-bottom: 16px;
    margin-bottom: 28px;
}

header.app-header .tag {
    color: var(--gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.steps {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 32px;
}

.steps a, .steps span {
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 3px;
    text-decoration: none;
    background: rgba(201, 206, 214, 0.06);
    color: var(--silver);
    border: 1px solid rgba(201, 206, 214, 0.12);
}

.steps a.active, .steps span.active {
    background: var(--gold);
    color: var(--navy);
    border-color: var(--gold);
    font-weight: 600;
}

.card {
    background: var(--navy-light);
    border: 1px solid rgba(201, 206, 214, 0.12);
    border-radius: 6px;
    padding: 22px 24px;
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--silver);
    margin-bottom: 4px;
    margin-top: 14px;
}

label .hint {
    display: block;
    font-size: 0.76rem;
    color: rgba(201, 206, 214, 0.65);
    font-weight: normal;
    margin-top: 2px;
}

input[type=text], input[type=password], input[type=url], input[type=email],
input[type=number], input[type=search], input[type=tel], textarea, select {
    width: 100%;
    padding: 9px 11px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(201, 206, 214, 0.25);
    border-radius: 4px;
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
}

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

/* The open dropdown list is drawn by the OS, not the page. Without explicit
   colours here Chrome renders it on a white system background while the option
   text inherits the select's white — invisible until hovered. */
select option,
select optgroup {
    background-color: #17293f;
    color: #E8EDF2;
}

select option:checked {
    background-color: #CFAF6A;
    color: #0F1C2E;
}

fieldset {
    border: 1px solid rgba(201, 206, 214, 0.15);
    border-radius: 5px;
    padding: 14px 16px 6px;
    margin: 18px 0;
}

legend {
    padding: 0 8px;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--gold);
    font-size: 0.95rem;
}

.btn {
    display: inline-block;
    background: var(--gold);
    color: var(--navy);
    border: none;
    padding: 11px 22px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    text-decoration: none;
    margin-top: 18px;
}

.btn.secondary {
    background: transparent;
    color: var(--silver);
    border: 1px solid rgba(201, 206, 214, 0.35);
}

.btn.danger { background: var(--error); color: #fff; }

table { width: 100%; border-collapse: collapse; margin: 10px 0 4px; }
td, th { text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid rgba(201,206,214,0.1); font-size: 0.86rem; vertical-align: top; }
th { color: var(--gold); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }

.pill {
    display: inline-block;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(207,175,106,0.15);
    color: var(--gold);
    margin-right: 4px;
}

.recipe-choice {
    border: 1px solid rgba(201,206,214,0.15);
    border-radius: 5px;
    padding: 14px 16px;
    margin-bottom: 10px;
}

.recipe-choice h3 { margin: 0 0 6px; font-size: 1.05rem; }
.recipe-choice .meta { font-size: 0.8rem; color: rgba(201,206,214,0.7); margin-bottom: 8px; }

.issue { padding: 10px 14px; border-radius: 4px; margin-bottom: 8px; font-size: 0.87rem; }
.issue.error { background: rgba(192,86,74,0.15); border-left: 3px solid var(--error); }
.issue.warning { background: rgba(185,144,58,0.15); border-left: 3px solid var(--warning); }
.issue.ok { background: rgba(92,143,111,0.15); border-left: 3px solid var(--ok); }

pre.compiled {
    background: #081120;
    border: 1px solid rgba(201,206,214,0.15);
    border-radius: 4px;
    padding: 14px 16px;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    color: #d8e2ea;
}

.muted { color: rgba(201,206,214,0.6); font-size: 0.85rem; }
.small { font-size: 0.8rem; }

ul.checklist { list-style: none; padding: 0; }
ul.checklist li { padding: 8px 0; border-bottom: 1px solid rgba(201,206,214,0.08); }
ul.checklist li b { color: #fff; }

/* --- Layer model strip: Job=WHY / Recipe=HOW / Scene=WHAT / Config=INSTANCE / Renderer=MECHANISM --- */
.layers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 26px;
    padding: 12px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(201,206,214,0.1);
    border-radius: 5px;
}

.layer {
    flex: 1 1 130px;
    padding: 7px 10px;
    border-radius: 4px;
    border: 1px solid transparent;
    opacity: 0.55;
}

.layer.current {
    opacity: 1;
    background: rgba(207,175,106,0.1);
    border-color: rgba(207,175,106,0.4);
}

.layer-name {
    display: block;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.82rem;
    color: #fff;
}

.layer-meaning {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--gold);
    margin-top: 2px;
}

.job-question {
    font-family: 'Space Grotesk', sans-serif;
    color: var(--gold);
    font-size: 1rem;
    margin: 4px 0 8px;
}

.recipe-choice.selected {
    border-color: rgba(207,175,106,0.5);
    background: rgba(207,175,106,0.05);
}

/* Chrome paints autofilled fields with its own white background, which
   overrides the dark theme. There is no way to set background-color on an
   autofilled field directly, so this uses a very long inset shadow to cover
   it — the standard workaround. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px #17293f inset;
    box-shadow: 0 0 0 1000px #17293f inset;
    caret-color: #fff;
    transition: background-color 9999s ease-in-out 0s;
}

/* The submit button belongs on its own line, not beside the last field. */
form .btn { display: block; }
