:root {
    color-scheme: light;
    --bg: #f4f7f8;
    --panel: #ffffff;
    --ink: #132236;
    --muted: #66768a;
    --line: #d9dee8;
    --teal: #0d6f73;
    --teal-soft: #e7f3f2;
    --amber: #bd7d16;
    --red: #b83235;
    --green: #21885f;
    --blue: #2f64b7;
}

* {
    box-sizing: border-box;
}

html,
body {
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    margin: 0;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 1.75rem;
    font-weight: 800;
}

h2 {
    font-size: 0.95rem;
    font-weight: 800;
}

.workspace {
    min-height: 100vh;
    padding: 1rem;
}

.workspace-header {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin: 0 auto 1rem;
    max-width: 1180px;
}

.eyebrow {
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.decision-pill {
    align-items: center;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    min-width: 190px;
    padding: 0.7rem 0.85rem;
    justify-content: space-between;
}

.decision-pill span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.decision-pill strong {
    color: var(--teal);
    font-size: 1rem;
}

.control-grid,
.activation-grid,
.decision-surface {
    margin: 0 auto 1rem;
    max-width: 1180px;
}

.route-panel,
.word-panel {
    margin: 0 auto 1rem;
    max-width: 1180px;
}

.control-grid,
.activation-grid {
    display: grid;
    gap: 1rem;
}

.control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.activation-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.control-panel,
.activation-panel,
.decision-surface {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.control-panel h2,
.activation-panel h2 {
    margin-bottom: 0.75rem;
}

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

.route-grid,
.word-grid {
    display: grid;
    gap: 0.5rem;
}

.route-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.word-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.option-button {
    align-items: center;
    background: #f8fafb;
    border: 1px solid #dce2ea;
    border-radius: 7px;
    color: #233449;
    display: flex;
    gap: 0.55rem;
    min-height: 44px;
    padding: 0.55rem;
    text-align: left;
}

.option-button.selected {
    background: var(--teal-soft);
    border-color: #69aaa9;
    box-shadow: inset 0 0 0 1px #69aaa9;
}

.word-grid .option-button {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
}

.word-grid .option-button span {
    font-size: 1.05rem;
    font-weight: 850;
}

.word-grid .option-button strong {
    color: var(--muted);
    font-size: 0.76rem;
}

.swatch,
.shape-icon {
    display: inline-block;
    flex: 0 0 auto;
}

.swatch {
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 50%;
    height: 20px;
    width: 20px;
}

.swatch.red_bright {
    background: #d93c3c;
}

.swatch.red_orange {
    background: #d65724;
}

.swatch.red_pinkish {
    background: #dd5a75;
}

.swatch.yellow {
    background: #e2c62f;
}

.swatch.green {
    background: #29905d;
}

.swatch.blue {
    background: #2d63bf;
}

.shape-icon {
    border: 2px solid #2f4056;
    height: 21px;
    width: 21px;
}

.shape-icon.round {
    border-radius: 50%;
}

.shape-icon.oval {
    border-radius: 50%;
    width: 28px;
}

.shape-icon.elongated {
    border-radius: 999px;
    width: 32px;
}

.shape-icon.angular {
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    background: transparent;
}

.shape-icon.irregular {
    clip-path: polygon(20% 5%, 78% 12%, 98% 48%, 72% 96%, 16% 82%, 0 36%);
    background: transparent;
}

.decision-surface {
    display: grid;
    gap: 1rem;
}

.decision-surface p {
    font-size: 1rem;
    font-weight: 750;
}

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

.expectation-grid div {
    border-left: 3px solid var(--amber);
    padding-left: 0.65rem;
}

.expectation-grid span {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 0.15rem;
    text-transform: uppercase;
}

.expectation-grid strong {
    font-size: 0.9rem;
}

.reading-list {
    display: grid;
    gap: 0.75rem;
}

.reading-row {
    min-height: 58px;
}

.reading-label {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.reading-label span {
    color: #24364d;
    font-size: 0.84rem;
    font-weight: 750;
    min-width: 0;
    overflow-wrap: anywhere;
}

.reading-label strong {
    color: var(--teal);
    font-size: 0.78rem;
    white-space: nowrap;
}

.meter {
    background: #edf1f4;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.meter span {
    background: linear-gradient(90deg, var(--teal), var(--amber));
    display: block;
    height: 100%;
}

small {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    margin-top: 0.25rem;
}

#blazor-error-ui {
    background: #fff0c5;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.7rem 1rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
}

.loading-progress {
    display: block;
    height: 5rem;
    margin: 30vh auto 1rem;
    width: 5rem;
}

.loading-progress circle {
    fill: none;
    stroke: #d9dee8;
    stroke-width: 0.6rem;
}

.loading-progress circle:last-child {
    stroke: var(--teal);
}

.loading-progress-text {
    color: var(--muted);
    text-align: center;
}

@media (max-width: 1100px) {
    .activation-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .workspace-header,
    .control-grid,
    .activation-grid,
    .expectation-grid,
    .route-grid,
    .word-grid {
        grid-template-columns: 1fr;
    }

    .workspace-header {
        align-items: stretch;
        display: grid;
    }

    .control-grid,
    .activation-grid {
        grid-template-columns: 1fr;
    }

    .option-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
