/*
 * §11.3: monochrome, white background, Inter, gold #FFD700 for the mark only.
 * Inter is not bundled — the stack falls back to the system UI face, which is
 * close enough on screen. The PDF is the place where the real Inter matters.
 */

:root {
    --ink: #111111;
    --muted: #666666;
    --rule: #dddddd;
    --wash: #f6f6f6;
    --gold: #FFD700;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: #ffffff;
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
}

a { color: inherit; }

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--rule);
}

.mark {
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
}

.mark-glyph { color: var(--gold); }

.masthead nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.masthead nav form { margin: 0; }

main {
    max-width: 62rem;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

main.narrow { max-width: 24rem; }

h1 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0 0 1.5rem;
}

h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
}

label {
    display: block;
    margin: 0 0 1rem;
    font-size: 0.8125rem;
    color: var(--muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--ink);
    outline-offset: -1px;
}

button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--ink);
    border-radius: 2px;
    background: var(--ink);
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

button.secondary {
    background: #ffffff;
    color: var(--ink);
}

button.link {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.notice,
.error {
    margin: 0 0 1.25rem;
    padding: 0.625rem 0.875rem;
    border-left: 2px solid var(--ink);
    background: var(--wash);
    font-size: 0.875rem;
}

.error { border-left-color: #b00020; }

.hint {
    color: var(--muted);
    font-size: 0.8125rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

th,
td {
    padding: 0.5rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
}

th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
}

td.num,
th.num { text-align: right; }

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.875em;
}

/* Dashboard */
.dashboard-actions {
    display: flex;
    gap: 0.75rem;
    margin: 0 0 1.5rem;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1rem;
    margin: 0 0 2rem;
}

.kpi {
    padding: 1rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: var(--wash);
}

.kpi-warn {
    border-left: 3px solid #b00020;
}

.kpi-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.kpi-label {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.8125rem;
}

.dashboard-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr));
    gap: 2rem;
    margin: 0 0 2rem;
}

.dashboard-column h2 {
    margin-top: 0;
}

/* Settings sub-navigation: two screens under one heading. */
.subnav {
    display: flex;
    gap: 1.5rem;
    margin: -0.5rem 0 1.5rem;
    border-bottom: 1px solid var(--rule);
}

.subnav a {
    padding: 0 0 0.5rem;
    border-bottom: 2px solid transparent;
    color: var(--muted);
    font-size: 0.9375rem;
    text-decoration: none;
}

.subnav a.current {
    border-bottom-color: var(--ink);
    color: var(--ink);
    font-weight: 600;
}

/* Layout screen: options on the left, the live PDF on the right. */
.layout-split {
    display: grid;
    grid-template-columns: minmax(20rem, 1fr) minmax(24rem, 1.15fr);
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 62rem) {
    .layout-split { grid-template-columns: 1fr; }
}

.layout-form h2:first-of-type {
    margin-top: 0;
}

/* Hints on this screen are full sentences, not a parenthesis after the
   label — they need their own line. */
.layout-form label > .hint {
    display: block;
}

.layout-preview {
    position: sticky;
    top: 1.5rem;
}

.layout-preview h2 {
    margin-top: 0;
}

.layout-preview iframe {
    width: 100%;
    height: 40rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: var(--wash);
    transition: opacity 0.12s ease-out;
}

/* While a fresh render is on its way. Dimmed, not blanked — the old page
   staying put is less jarring than an empty frame. */
.layout-preview iframe.is-loading {
    opacity: 0.45;
}

/* A switch is a checkbox with its label beside it, not above it. */
label.switch {
    display: flex;
    gap: 0.625rem;
    align-items: baseline;
    margin: 0 0 0.625rem;
    color: var(--ink);
    font-size: 0.9375rem;
}

label.switch input {
    flex: none;
    margin: 0;
}

label.switch .hint {
    display: inline;
    margin-left: 0.25rem;
}

.choices {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
}

label.choice {
    display: flex;
    gap: 0.625rem;
    align-items: baseline;
    margin: 0;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    color: var(--ink);
    font-size: 0.9375rem;
    cursor: pointer;
}

label.choice:has(input:checked) {
    border-color: var(--ink);
    background: var(--wash);
}

label.choice input {
    flex: none;
    margin: 0;
}

.color-field input[type="color"] {
    display: block;
    width: 4rem;
    height: 2.25rem;
    margin-top: 0.25rem;
    padding: 0.125rem;
    border: 1px solid var(--rule);
    border-radius: 2px;
    background: #ffffff;
    cursor: pointer;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}
