:root {
    --bg: #f5f6f3;
    --surface: #ffffff;
    --surface-muted: #eef1ec;
    --ink: #17201b;
    --muted: #69736d;
    --line: #d9ded7;
    --brand: #1f6f50;
    --brand-dark: #15543d;
    --accent: #b4552c;
    --danger: #b42318;
    --warning: #a16207;
    --sidebar: #1f2421;
    --sidebar-text: #f4f7f4;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    max-width: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    max-width: 100%;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

a {
    color: inherit;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    color: var(--ink);
}

textarea {
    resize: vertical;
}

label {
    display: grid;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--muted);
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--ink);
}

.check-label input {
    width: auto;
    min-height: auto;
}

fieldset {
    border: 1px solid var(--line);
    border-radius: 6px;
    margin: 14px 0;
    padding: 12px;
}

legend {
    padding: 0 6px;
    color: var(--muted);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    background: var(--surface-muted);
    color: #374039;
    font-size: 0.82rem;
    text-transform: uppercase;
}

.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sortable-header::after {
    content: " <>";
    color: var(--muted);
    font-size: 0.78rem;
}

.sortable-header[data-sort-direction="asc"]::after {
    content: " ^";
    color: var(--brand);
}

.sortable-header[data-sort-direction="desc"]::after {
    content: " v";
    color: var(--brand);
}

.sidebar {
    width: 250px;
    min-height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
    padding: 18px;
    background: var(--sidebar);
    color: var(--sidebar-text);
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 0;
}

.brand > div {
    min-width: 0;
}

.brand strong {
    overflow-wrap: anywhere;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #e6bf5c;
    color: #211b0d;
    font-weight: 700;
}

.brand-logo {
    display: block;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    object-fit: cover;
    background: #fff;
}

.brand small,
.account-panel label {
    display: block;
    color: #cbd5cf;
    font-size: 0.78rem;
}

.nav-links {
    display: grid;
    gap: 4px;
}

.nav-toggle {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.nav-toggle-button {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    user-select: none;
}

.nav-links a {
    padding: 10px 12px;
    border-radius: 6px;
    text-decoration: none;
    color: #eef3ef;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.account-panel {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.account-name {
    font-weight: 700;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 28px;
    position: relative;
    isolation: isolate;
}

.screen-watermark {
    position: fixed;
    inset: 0 0 0 250px;
    z-index: -1;
    pointer-events: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: min(52vw, 620px);
    opacity: 0.045;
}

.school-screen-header,
.school-screen-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
}

.school-screen-header {
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.school-screen-header strong {
    display: block;
    color: var(--ink);
}

.school-screen-header span {
    display: block;
    margin-top: 3px;
    font-size: 0.88rem;
}

.school-screen-footer {
    margin-top: 26px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    flex-wrap: wrap;
}

.auth-page {
    display: block;
}

.auth-page .main {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.auth-shell {
    width: min(420px, calc(100vw - 32px));
}

.auth-form,
.panel,
.metric,
.action-grid a,
.table-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.auth-form {
    display: grid;
    gap: 16px;
    padding: 28px;
}

.login-logo {
    width: 72px;
    height: 72px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

.auth-form h1,
.page-header h1,
.panel h2,
.table-section h2 {
    margin: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 22px;
}

.page-header p {
    margin: 6px 0 0;
    color: var(--muted);
}

.header-actions,
.scanner-actions,
.row-actions,
.form-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.offline-tools {
    margin-top: 0.75rem;
}

.offline-tools summary {
    cursor: pointer;
    color: var(--muted);
    font-weight: 600;
}

.offline-tools[hidden] {
    display: none;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    min-height: 38px;
    padding: 8px 13px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}

.button.primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.button.ghost {
    border-color: rgba(255, 255, 255, 0.22);
    background: transparent;
    color: #fff;
}

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

.button.small {
    min-height: 32px;
    padding: 5px 9px;
    font-size: 0.86rem;
}

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

.avatar {
    display: block;
    width: 44px;
    height: 44px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.placeholder-avatar {
    display: grid;
    place-items: center;
    font-weight: 700;
    color: var(--brand-dark);
}

.small-avatar {
    width: 38px;
    height: 38px;
}

.profile-photo,
.empty-photo {
    width: min(220px, 100%);
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.profile-photo {
    display: block;
    object-fit: cover;
}

.empty-photo {
    display: grid;
    place-items: center;
    padding: 18px;
    color: var(--muted);
    background: var(--surface-muted);
    text-align: center;
}

.muted-text {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric {
    padding: 18px;
}

.metric span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
}

.metric strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.action-grid a {
    display: grid;
    gap: 8px;
    padding: 18px;
    text-decoration: none;
}

.action-grid span {
    color: var(--muted);
    line-height: 1.35;
}

.scope-tree {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
}

.scope-card,
.scope-child {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.scope-card {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.scope-card-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.scope-card-head strong,
.scope-card-head small,
.scope-card-head span {
    display: block;
}

.scope-card-head small,
.scope-card-head span {
    color: var(--muted);
    font-size: 0.84rem;
}

.scope-actions,
.scope-nav,
.scope-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.scope-children {
    display: grid;
    gap: 8px;
}

.scope-child {
    padding: 10px;
}

.scope-child a,
.scope-groups a,
.scope-pill {
    text-decoration: none;
}

.scope-child > a {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-weight: 700;
}

.scope-child span,
.scope-groups span {
    color: var(--muted);
}

.scope-groups {
    margin-top: 8px;
}

.scope-groups a,
.scope-pill {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-muted);
    font-size: 0.88rem;
}

.scope-pill.active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.split-layout,
.scanner-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
    gap: 16px;
    margin-bottom: 18px;
}

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

.panel {
    padding: 18px;
}

.panel h2,
.table-section h2 {
    margin-bottom: 14px;
    font-size: 1.05rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0;
}

.form-grid.single {
    grid-template-columns: 1fr;
}

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

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

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
    margin-bottom: 12px;
}

.inline-form input,
.inline-form select {
    width: auto;
    min-width: 150px;
}

.table-section {
    overflow-x: auto;
    max-width: 100%;
    padding: 0;
    margin-bottom: 18px;
    -webkit-overflow-scrolling: touch;
}

.table-section h2 {
    padding: 16px 16px 0;
}

.role-list,
.role-editor {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.reminder-control-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
}

.reminder-control-grid p {
    margin: 6px 0 0;
    color: var(--muted);
}

.reminder-timing-form {
    display: grid;
    grid-template-columns: 78px 104px auto;
    gap: 6px;
    align-items: center;
    min-width: 250px;
}

.reminder-timing-form input,
.reminder-timing-form select {
    min-height: 34px;
    padding: 6px 8px;
}

.due-row td {
    background: #fff7ed;
}

.in-progress-row td {
    background: #ecfdf5;
}

.pending-row td {
    background: #fefce8;
}

.role-list label,
.role-editor label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
}

.role-list input,
.role-editor input {
    width: auto;
    min-height: auto;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
}

.qr-card {
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
}

.qr-card img,
.qr-preview img {
    width: 132px;
    height: 132px;
    image-rendering: pixelated;
}

.qr-preview {
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 18px;
}

dialog {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
}

dialog::backdrop {
    background: rgba(15, 23, 18, 0.36);
}

.confirm-dialog form {
    width: min(420px, calc(100vw - 32px));
    padding: 18px;
}

.confirm-dialog h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.confirm-dialog p {
    margin: 0 0 18px;
    color: var(--muted);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.reader-wrap {
    position: relative;
    width: min(100%, 360px);
    margin: 10px 0;
}

#reader {
    width: min(100%, 360px);
    min-height: 220px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #111;
}

.scan-cross-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(180, 35, 24, 0.26);
    color: #fff;
    font-size: 10rem;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
}

.scan-cross-overlay[hidden] {
    display: none;
}

body.booth-mode {
    overflow: auto;
}

body.booth-mode .sidebar,
body.booth-mode .school-screen-header,
body.booth-mode .school-screen-footer,
body.booth-mode .page-header,
body.booth-mode .scanner-layout > .panel:not(.scanner-panel) {
    display: none;
}

body.booth-mode .main {
    min-height: 100vh;
    padding: 12px;
    background: #0f1713;
    overflow: auto;
}

body.booth-mode .scanner-layout {
    display: grid;
    grid-template-columns: 1fr;
    min-height: calc(100vh - 24px);
    margin: 0;
}

body.booth-mode .scanner-panel {
    display: grid;
    align-content: start;
    justify-items: center;
    gap: 8px;
    min-height: calc(100vh - 24px);
    padding: 12px;
    background: #111812;
    color: #f4f7f4;
    border-color: #2e3a33;
    overflow: auto;
}

body.booth-mode .scanner-panel label,
body.booth-mode .muted-text {
    color: #d6ddd8;
}

body.booth-mode .reader-wrap,
body.booth-mode #reader {
    width: min(82vw, 560px);
}

body.booth-mode #reader {
    min-height: min(52vh, 420px);
}

body.booth-mode .scanner-actions {
    justify-content: center;
}

body.booth-mode .scan-avatar {
    width: 56px;
    height: 56px;
}

body.booth-mode dialog.confirm-dialog[open],
body.booth-mode #booth-dialog[open] {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(420px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    transform: translate(-50%, -50%);
}

body.booth-mode #booth-dialog form {
    display: grid;
    gap: 12px;
}

.scan-result {
    min-height: 44px;
    padding: 12px;
    border-radius: 6px;
    background: var(--surface-muted);
}

.scan-result[data-type="success"] {
    background: #dff3e8;
    color: var(--brand-dark);
}

.scan-result[data-type="error"] {
    background: #fde3df;
    color: var(--danger);
}

.scan-result[data-type="warning"] {
    background: #fef3c7;
    color: var(--warning);
}

.scan-person-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #b8e2c9;
    border-radius: 8px;
    background: #eef9f2;
    color: var(--brand-dark);
}

.scan-person-banner[hidden] {
    display: none;
}

.scan-avatar {
    width: 72px;
    height: 72px;
}

.scan-person-banner strong,
.scan-person-banner span,
.scan-person-banner small {
    display: block;
}

.scan-person-banner small {
    margin-top: 4px;
    color: var(--muted);
}

.logs-table {
    overflow-x: auto;
}

.offline-task-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 10px;
    background: #fff;
}

.offline-task-card summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
}

.offline-task-card summary span {
    color: var(--muted);
    font-size: 0.88rem;
}

.embedded-table {
    border-top: 1px solid var(--line);
    border-radius: 0;
    margin: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.subject-student-picker {
    display: grid;
    gap: 9px;
    max-height: min(58vh, 520px);
    overflow: auto;
    padding: 4px 0 12px;
    -webkit-overflow-scrolling: touch;
}

.offline-metrics .metric strong {
    font-size: 1.7rem;
}

.offline-setup {
    margin-bottom: 18px;
}

.quick-schedule-panel {
    margin-bottom: 18px;
}

.timetable-builder-panel {
    margin-bottom: 18px;
}

.timetable-control-panel {
    margin-bottom: 18px;
}

.compact-panel {
    display: grid;
    gap: 14px;
    min-width: 0;
    padding: 4px 0;
}

.compact-panel h3 {
    margin: 0;
    font-size: 1rem;
}

.timetable-period-guide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.period-chip {
    display: grid;
    gap: 2px;
    min-height: 54px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
    color: var(--muted);
}

.period-chip strong {
    color: var(--text);
    font-size: 0.9rem;
}

.period-chip.fixed {
    border-color: #d7b85d;
    background: #fff5d8;
    color: #6b5520;
}

.manual-timetable-rows {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.manual-timetable-days {
    display: grid;
    gap: 14px;
    margin: 14px 0;
}

.manual-day-block {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.manual-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.manual-day-head h3 {
    margin: 0;
    font-size: 1rem;
}

.manual-timetable-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
}

.manual-timetable-row label {
    min-width: 0;
}

.manual-timetable-row .button {
    align-self: end;
}

.temporary-lesson-panel {
    margin-top: 18px;
}

.offline-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.offline-check {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
}

.offline-check.ready {
    border-color: #b8e2c9;
    background: #eef9f2;
}

.offline-check.missing {
    border-color: #f2c6c2;
    background: #fde3df;
}

.verification-code {
    display: inline-block;
    margin-top: 8px;
    padding: 8px 10px;
    border: 1px dashed var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.verification-code.compact {
    margin-top: 0;
    padding: 5px 7px;
    font-size: 0.9rem;
}

.flash-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.flash,
.inline-result {
    padding: 10px 12px;
    border-radius: 6px;
    background: var(--surface-muted);
}

.flash.success,
.alert-box.success {
    background: #dff3e8;
    color: var(--brand-dark);
}

.flash.error,
.alert-box.error {
    background: #fde3df;
    color: var(--danger);
}

.flash.warning,
.alert-box.warning {
    background: #fef3c7;
    color: var(--warning);
}

.alert-box {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 14px;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

@media (max-width: 980px) {
    body {
        display: block;
    }

    .sidebar {
        position: sticky;
        z-index: 900;
        top: 0;
        width: 100%;
        min-height: auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    }

    .nav-toggle-button {
        display: inline-flex;
        grid-column: 2;
        grid-row: 1;
    }

    .nav-links {
        display: none;
        grid-column: 1 / -1;
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
        max-height: min(58vh, 420px);
        overflow-y: auto;
        padding-top: 8px;
        -webkit-overflow-scrolling: touch;
    }

    .account-panel {
        display: none;
        grid-column: 1 / -1;
        margin-top: 0;
        padding-top: 10px;
        border-top: 1px solid rgba(255, 255, 255, 0.16);
    }

    .nav-toggle:checked ~ .nav-links,
    .nav-toggle:checked ~ .account-panel {
        display: grid;
    }

    .nav-toggle:checked + .nav-toggle-button {
        background: rgba(255, 255, 255, 0.12);
    }

    .main {
        padding: 18px;
    }

    .screen-watermark {
        inset: 0;
    }

    .metric-grid,
    .action-grid,
    .split-layout,
    .split-layout.three,
    .scanner-layout,
    .form-grid.wide-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body {
        font-size: 15px;
    }

    .sidebar {
        padding: 12px;
        gap: 8px;
    }

    .brand {
        align-items: center;
    }

    .brand > div {
        min-width: 0;
    }

    .brand-logo,
    .brand-mark {
        width: 36px;
        height: 36px;
    }

    .brand strong {
        display: -webkit-box;
        max-height: 2.4em;
        overflow: hidden;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.2;
    }

    .main {
        padding: 12px;
    }

    .auth-shell {
        width: min(420px, calc(100vw - 20px));
    }

    .auth-form,
    .panel {
        padding: 16px;
    }

    .school-screen-header,
    .school-screen-footer {
        display: grid;
        gap: 8px;
    }

    .page-header {
        display: grid;
    }

    .nav-links,
    .metric-grid,
    .action-grid,
    .split-layout,
    .split-layout.three,
    .scanner-layout,
    .reminder-control-grid,
    .manual-timetable-row,
    .form-grid,
    .form-grid.wide-grid {
        grid-template-columns: 1fr;
    }

    .inline-form,
    .reminder-timing-form,
    .row-actions,
    .header-actions,
    .scanner-actions,
    .form-actions,
    .dialog-actions {
        align-items: stretch;
        width: 100%;
    }

    .scanner-actions {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    }

    .inline-form input,
    .inline-form select,
    .button,
    .form-actions .button,
    .dialog-actions .button {
        width: 100%;
    }

    .reader-wrap,
    #reader,
    body.booth-mode .reader-wrap,
    body.booth-mode #reader {
        width: 100%;
    }

    #reader {
        min-height: 260px;
    }

    body.booth-mode .main {
        min-height: 100dvh;
        padding: 8px;
    }

    body.booth-mode .scanner-layout,
    body.booth-mode .scanner-panel {
        min-height: calc(100dvh - 16px);
    }

    body.booth-mode .scanner-panel {
        align-content: start;
        padding: 10px;
    }

    body.booth-mode #reader {
        min-height: min(54vh, 420px);
    }

    body.booth-mode .scanner-actions {
        grid-template-columns: 1fr;
    }

    body.booth-mode .scan-person-banner {
        width: 100%;
    }

    table {
        min-width: 620px;
    }
}
