:root {
    --navy: #112340;
    --ink: #172744;
    --muted: #536684;
    --line: #dbe4ef;
    --surface: #f2f6fb;
    --blue: #2455c9;
    --danger: #a32d38;
    --radius: 14px;
    font-family: system-ui,"Noto Sans Sinhala","Iskoola Pota",sans-serif;
    color: var(--ink);
    background: var(--surface);
}

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

body {
    margin: 0;
    min-height: 100vh;
}

button,input,select,textarea {
    font: inherit;
    min-height: 42px;
}

button {
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: .55rem .85rem;
    background: white;
    color: var(--ink);
    font-weight: 650;
    cursor: pointer;
}

button:hover:not(:disabled) {
    filter: brightness(.94);
}

button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

button.primary,a.primary {
    color: white;
    background: var(--blue);
    border-color: var(--blue);
}

button.danger {
    color: var(--danger);
    border-color: #e7adb3;
}

button.quiet {
    background: transparent;
    color: inherit;
}

:focus-visible {
    outline: 3px solid #5d8efc;
    outline-offset: 2px;
}

input:not([type="checkbox"]):not([type="color"]),select,textarea {
    border: 1px solid #b9c8dc;
    border-radius: 8px;
    padding: .55rem .65rem;
    background: white;
    color: var(--ink);
    min-width: 0;
}

input[type="checkbox"] {
    min-height: auto;
}

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

h1,h2,h3,p {
    margin-top: 0;
}

h1 {
    font-size: clamp(1.55rem,3vw,2.45rem);
    line-height: 1.19;
    letter-spacing: -.035em;
}

.topbar {
    color: white;
    background: var(--navy);
}

.topbar-content {
    width: min(100% - 2rem,1440px);
    min-height: 64px;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem 1.25rem;
    padding: .55rem 0;
}

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

.topbar a:hover {
    text-decoration: underline;
}

.topbar nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .8rem;
    font-size: .9rem;
}

.topbar button {
    border-color: #60718a;
    min-height: 35px;
    font-size: .86rem;
}

.brand {
    font-size: 1.12rem;
    font-weight: 800;
    letter-spacing: .025em;
}

.brand span {
    margin-left: .45rem;
    font-size: .86rem;
    font-weight: 500;
    color: #bacbe4;
}

#app {
    width: min(100% - 2rem,1440px);
    margin: 1.5rem auto;
}

body[data-view="display"] #app {
    margin: 0;
    width: 100%;
}

.card {
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.entry {
    max-width: 490px;
    margin: clamp(1.2rem,7vh,5.5rem) auto;
    padding: clamp(1.15rem,5vw,2.2rem);
    box-shadow: 0 8px 28px #11234012;
}

.entry h1 {
    margin-bottom: .65rem;
}

.muted {
    color: var(--muted);
}

.notice {
    color: #28504b;
    margin: 0;
    overflow-wrap: anywhere;
}

.notice:empty {
    display: none;
}

.error,.connection.error {
    color: var(--danger);
}

.form-stack {
    display: grid;
    gap: 1rem;
}

.form-stack label {
    display: grid;
    gap: .4rem;
    font-weight: 650;
}

.form-stack input {
    width: 100%;
}

.form-stack button {
    min-height: 48px;
}

.pin-input {
    font-variant-numeric: tabular-nums;
    font-size: 1.35rem;
    letter-spacing: .25em;
}

.student-card {
    max-width: 600px;
}

.student-meta {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: .5rem;
    overflow-wrap: anywhere;
}

.student-meta strong {
    flex: 1;
}

.connection {
    font-size: .87rem;
    color: #2b6956;
}

.student-activity {
    margin: 1rem 0 1.5rem;
}

.student-prompt {
    white-space: pre-wrap;
}

.student-answers {
    display: grid;
    gap: .65rem;
    margin-bottom: 1rem;
}

.answer-button {
    color: white;
    background: #224dac;
    border: none;
    min-height: 56px;
    overflow-wrap: anywhere;
}

.answer-button:nth-child(4n+2) {
    background: #00715f;
}

.answer-button:nth-child(4n+3) {
    background: #78489c;
}

.answer-button:nth-child(4n+4) {
    background: #935222;
}

.student-frame {
    width: 100%;
    min-height: 340px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

@media(max-width:500px) {
    #app,.topbar-content {
        width: min(100% - 1rem,1440px);
    }

    #app {
        margin-top: 1rem;
    }
}
