html, body {
    background: #fff;
    color: #1c1c1c;
    margin: 0;
}

.app-header {
    align-items: center;
    border-bottom: 1px solid #d8d8d8;
    display: flex;
    font-weight: 600;
    gap: 1rem;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
}

.app-header a {
    color: inherit;
    text-decoration: none;
}

.header-who {
    font-weight: 500;
    margin-right: 0.5rem;
}

.app-main {
    max-width: 40rem;
    padding: 1.5rem 1.25rem;
}

.manager-shell {
    max-width: 72rem;
}

.manager-nav-wrap {
    padding: 0.75rem 1.25rem 0;
}

.content-wide {
    max-width: 48rem;
}

.content-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.1rem;
    margin-bottom: 1.25rem;
}

.content-nav a {
    color: #1f4e79;
    font-weight: 700;
    text-decoration: none;
}

.content-nav a.is-current {
    text-decoration: underline;
}

.source-notes {
    color: #3d4a57;
    font-size: 0.95rem;
}

.review-block {
    border-top: 1px solid #d8d8d8;
    margin-top: 1.75rem;
    padding-top: 1.25rem;
}

.review-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0 1rem;
}

.review-question {
    margin-top: 1.25rem;
}

.review-edit {
    margin-top: 0.75rem;
}

.choice-static {
    cursor: default;
}

.choice-static.is-correct-choice {
    background: #0f7b4c;
}

.choice-mark {
    float: right;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tablet-body {
    background: #f7f8fa;
}

.tablet-shell {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 0 auto;
    max-width: 30rem;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0.75rem;
}

.tablet-shell h1 {
    font-size: clamp(1.35rem, 4.5vw, 1.85rem);
    line-height: 1.2;
    margin: 0 0 0.35rem;
}

.tablet-kicker {
    color: #3d4a57;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.35rem;
}

.tablet-message {
    font-size: clamp(1.05rem, 3vw, 1.25rem);
    line-height: 1.4;
    margin: 0 0 1rem;
}

.tablet-error {
    background: #fde8e8;
    border-radius: 0.75rem;
    color: #7f1d1d;
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0.5rem 0 0;
    padding: 0.75rem 0.9rem;
}

.tablet-footnote {
    margin: 0.9rem 0 0;
    text-align: center;
}

.tablet-footnote a {
    color: #1f4e79;
}

.keypad-display {
    background: #fff;
    border: 2px solid #1c1c1c;
    border-radius: 0.75rem;
    font-size: clamp(1.45rem, 6vw, 2rem);
    letter-spacing: 0.08em;
    margin: 0.75rem 0;
    min-height: 3.25rem;
    overflow: hidden;
    padding: 0.55rem 0.75rem;
    text-align: center;
}

.keypad-display.is-placeholder {
    color: #6b7280;
    letter-spacing: 0;
}

.keypad {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.keypad .key {
    background: #1f4e79;
    border: 0;
    border-radius: 0.75rem;
    color: #fff;
    font-size: clamp(1.2rem, 4.5vw, 1.65rem);
    font-weight: 700;
    min-height: clamp(3rem, 12dvh, 4.5rem);
    touch-action: manipulation;
    user-select: none;
}

.keypad .key-muted {
    background: #5c6770;
}

.keypad .key-ok {
    background: #0f7b4c;
    grid-column: 1 / -1;
}

.keypad .key-wide {
    grid-column: 1 / -1;
}

.tablet-action {
    background: #0f7b4c;
    border-radius: 0.75rem;
    color: #fff;
    display: block;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    font-weight: 700;
    margin-top: 0.5rem;
    padding: 0.9rem 1rem;
    text-align: center;
    text-decoration: none;
}

.tablet-action:hover,
.tablet-action:focus {
    color: #fff;
}

button.tablet-action {
    border: 0;
    cursor: pointer;
    width: 100%;
}

.tablet-action-secondary {
    background: #5c6770;
}

.player-shell {
    justify-content: flex-start;
    max-width: 40rem;
    padding-top: 1rem;
}

.player-who {
    color: #3d4a57;
    font-size: 1.05rem;
    margin: 0 0 0.75rem;
}

.player-progress {
    color: #1f4e79;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.player-prompt {
    font-size: clamp(1.35rem, 4.2vw, 1.85rem);
    line-height: 1.3;
    margin: 0.6rem 0 1rem;
}

.player-figure {
    border-radius: 0.75rem;
    display: block;
    margin: 0 0 1rem;
    max-height: 14rem;
    max-width: 100%;
    object-fit: contain;
}

.choice-button {
    background: #1f4e79;
    border: 0;
    border-radius: 0.85rem;
    color: #fff;
    display: block;
    font-size: clamp(1.15rem, 3.6vw, 1.45rem);
    font-weight: 700;
    margin-top: 0.75rem;
    min-height: 3.6rem;
    padding: 0.9rem 1rem;
    text-align: left;
    touch-action: manipulation;
    width: 100%;
}

.choice-button:hover,
.choice-button:focus {
    background: #163a5c;
}

.feedback-card,
.result-card {
    border-radius: 0.85rem;
    margin: 0.25rem 0 1rem;
    padding: 1rem 1.1rem;
}

.feedback-card p,
.result-card p {
    font-size: 1.15rem;
    line-height: 1.4;
    margin: 0.35rem 0 0;
}

.feedback-lead {
    font-size: clamp(1.45rem, 4vw, 1.9rem);
    font-weight: 800;
    margin: 0;
}

.feedback-card.is-correct,
.result-card.is-pass {
    background: #e5f6ee;
    color: #0d5c36;
}

.feedback-card.is-wrong,
.result-card.is-fail {
    background: #fff4e5;
    color: #7a4b00;
}

.result-card h1 {
    font-size: clamp(1.7rem, 5vw, 2.2rem);
    margin: 0;
}

.tap-button {
    min-height: 2.75rem;
    min-width: 2.75rem;
}

.path-row {
    cursor: grab;
}

.path-row.is-dragging {
    opacity: 0.45;
}

.status-pill {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
}

.status-pill.is-new {
    background: #e8eef5;
    color: #1f4e79;
}

.status-pill.is-progress {
    background: #fff4e5;
    color: #7a4b00;
}

.status-pill.is-done {
    background: #e5f6ee;
    color: #0d5c36;
}

.status-pill.is-review {
    background: #efe8f8;
    color: #4c1d95;
}

.status-pill.is-paused {
    background: #eceff3;
    color: #3d4754;
}

.path-dialog {
    background: #fff;
    border: 1px solid #d5dbe3;
    border-radius: 0.75rem;
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
}

@media (max-width: 720px) {
    .manager-shell {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .tap-button {
        margin-bottom: 0.35rem;
    }
}

@media (max-height: 700px) {
    .tablet-shell {
        justify-content: flex-start;
        padding-top: 0.5rem;
    }

    .keypad {
        gap: 0.35rem;
    }

    .keypad .key {
        min-height: 2.75rem;
    }
}
