/* Screens: dark on white, 18px minimum, 24px+ for anything read at arm's length,
   44px tap targets, one full-width primary action. Never color alone. */
/* Colors, type and the name come from brand.css, shared with the homepage. */
:root {
    --ink: var(--ct-ink);
    --muted: var(--ct-muted);
    --paper: var(--ct-paper);
    --rule: var(--ct-rule);
    --accent: var(--ct-green);
    font-family: var(--ct-sans);
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); }
body { font-size: 20px; line-height: 1.4; }
a { color: var(--accent); }

.loading { font-size: 32px; text-align: center; margin-top: 30vh; }

/* The brand bar on every screen. */
.ct-bar { background: var(--ct-card); border-bottom: 1px solid var(--rule); padding: 6px 16px; }
.ct-bar .ct-brand img { height: 36px; }
.ct-bar .ct-brand .ct-wordmark { font-size: 22px; }

.screen { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; }
.screen h1 { font-family: var(--ct-serif); font-size: 28px; margin: 8px 0 12px; }
.screen h2 { font-family: var(--ct-serif); }
.back { margin: 0 0 4px; font-size: 18px; }
.back a { display: inline-block; min-height: 44px; padding: 10px 0; text-decoration: none; }
.note { color: var(--muted); font-size: 18px; }

button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.4; }
button.primary {
    display: block; width: 100%; min-height: 56px; margin: 24px 0 8px;
    font-size: 24px; font-weight: 700; color: #fff; background: var(--accent);
    border: 0; border-radius: 10px;
}
button.primary:hover { background: var(--ct-green-dark); }
button.secondary {
    min-height: 44px; padding: 8px 16px; font-size: 20px; color: var(--accent);
    background: #fff; border: 2px solid var(--accent); border-radius: 8px;
}
button.link {
    min-height: 44px; padding: 0 4px; font-size: inherit; color: var(--accent);
    background: none; border: 0; text-decoration: underline;
}

/* Steppers: the number with − and + either side, so the door change is two taps. */
.stepper { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.stepper .label { flex: 1; font-size: 22px; }
.stepper .value { min-width: 2.5ch; text-align: center; font-size: 28px; font-weight: 600; }
.step {
    width: 56px; height: 56px; font-size: 32px; line-height: 1; border: 2px solid var(--ink);
    border-radius: 8px; background: #fff; color: var(--ink);
}
.stepper.big { justify-content: center; }
.count {
    width: 3.6ch; font-size: 64px; font-weight: 700; text-align: center;
    border: 0; border-bottom: 3px solid var(--ink); background: transparent; color: var(--ink);
    -moz-appearance: textfield;
}
.count::-webkit-outer-spin-button, .count::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.live-line { font-size: 24px; text-align: center; margin: 8px 0; }
.count-screen .note { text-align: center; }
.details { margin-top: 20px; border-top: 1px solid var(--rule); padding-top: 4px; }
.rounds-stepper { margin: 0; gap: 12px; }
.rounds-stepper .note { font-size: 16px; }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 18px; margin-bottom: 4px; }
.field .optional { color: var(--muted); }
.field input, .field textarea {
    width: 100%; min-height: 44px; font: inherit; font-size: 20px; padding: 6px 10px;
    border: 2px solid var(--ink); border-radius: 6px; background: #fff; color: var(--ink);
}
.field textarea { resize: vertical; }

/* The rotation */
.header { font-size: 24px; }
.header .link { font-size: 18px; font-weight: normal; }
.sub, .honest { margin: 4px 0; }
/* The header with the night's date, name and instructions in the top right, when set. */
.screen-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.screen-head > :first-child { min-width: 0; }
.screen-corner { flex: 0 1 auto; max-width: 45%; margin-top: 8px; text-align: right; font-size: 16px; line-height: 1.3; }
.screen-corner .nd-title { font-weight: 700; }
.screen-corner .nd-notes { color: var(--muted); font-style: italic; white-space: pre-line; overflow-wrap: anywhere; }
.sent-line, .stale { padding: 8px 12px; border: 2px solid var(--ink); border-radius: 8px; }
.round { border-top: 1px solid var(--rule); padding: 8px 0; }
.round h2 { font-size: 24px; margin: 4px 0; }
.table-line { margin: 6px 0; display: grid; grid-template-columns: 5.5ch 1fr; column-gap: 8px; }
.table-line .t { font-weight: 700; grid-row: span 3; }
.table-line .vs { color: var(--muted); font-size: 18px; }
.sits { font-style: italic; }
.wide-chart { display: none; }
.actions { position: sticky; bottom: 0; background: var(--paper); padding-top: 8px; border-top: 1px solid var(--rule); }
.actions .links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.actions .links a { display: inline-block; min-height: 44px; padding: 10px 0; }
.small-link { display: block; text-align: center; font-size: 18px; min-height: 44px; padding: 8px; }

/* On a laptop or a TV the rotation is the wall chart, the same as paper. */
@media (min-width: 900px) {
    .rotation-screen { max-width: none; padding: 16px 32px; }
    .rounds-list { display: none; }
    .wide-chart { display: block; overflow-x: auto; }
    .actions { position: static; max-width: 640px; margin: 16px auto 0; border-top: 0; }
    .wide-chart .chart-grid { width: 100%; border-collapse: collapse; font-size: 22px; }
    .wide-chart .chart-grid th, .wide-chart .chart-grid td { border: 1px solid var(--ink); padding: 6px 10px; }
    .wide-chart .chart-grid th.t { font-size: 28px; }
    .wide-chart .chart-grid td.r { font-size: 28px; font-weight: 700; text-align: center; }
    .wide-chart .chart-grid .second { border-top: 1px solid var(--rule); }
}

/* Names */
.count-note { font-size: 20px; font-weight: normal; color: var(--muted); margin-left: 8px; }
.name-list { list-style: none; padding: 0; margin: 0 0 16px; }
.name-list li { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
.name-list .num { width: 3ch; text-align: right; font-weight: 600; }
.name-list input { flex: 1; min-width: 0; min-height: 44px; font-size: 20px; padding: 6px 10px; border: 2px solid var(--ink); border-radius: 6px; }
.name-list .remove { width: 44px; height: 44px; font-size: 28px; border: 0; background: none; color: var(--ink); }
.name-list .hint { width: 100%; padding-left: calc(3ch + 8px); font-size: 18px; color: var(--muted); }
.undo-bar { padding: 8px 12px; border: 2px solid var(--ink); border-radius: 8px; }

/* Send */
.qr { width: min(80vw, 360px); margin: 8px auto; }
.qr svg { width: 100%; height: auto; display: block; }
.link-row { display: flex; gap: 8px; }
.link-text { flex: 1; min-width: 0; min-height: 44px; font-size: 16px; padding: 4px 8px; }

/* Choose what to print */
.check { display: flex; align-items: center; gap: 12px; min-height: 56px; border-bottom: 1px solid var(--rule); font-size: 22px; }
.check input { width: 28px; height: 28px; }
.check .pages { margin-left: auto; color: var(--muted); font-size: 18px; }

#blazor-error-ui {
    display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px;
    background: #fff; border-top: 3px solid var(--ink); font-size: 20px;
}
#blazor-error-ui .reload { margin-left: 12px; }
