* {
    box-sizing: border-box;
}

:root {
    --bg: #eef2f5;
    --surface: #ffffff;
    --surface-soft: #f7f9fb;
    --text: #18212f;
    --muted: #667085;
    --border: #d7dee8;
    --primary: #1d5f6f;
    --primary-light: #3d8496;
    --primary-dark: #144a56;
    --accent: #b45f32;
    --danger: #a33a32;
    --danger-soft: #fff1ef;
    --success: #227343;
    --success-soft: #edf8f1;
    --shadow: 0 18px 45px rgba(25, 36, 52, .10);
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

.app-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 44px;
}

.app-shell.wide {
    width: min(1440px, calc(100% - 28px));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

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

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

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.brand-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
}

.brand-subtitle,
.eyebrow {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.top-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.icon-button {
    position: relative;
    display: inline-grid;
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
    place-items: center;
    padding: 0;
    border: 1px solid #bdc8d5;
    border-radius: 7px;
    background: #fff;
    color: var(--primary);
    font: inherit;
    font-size: 20px;
    font-weight: 850;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
    border-color: var(--primary);
    background: #f8fafc;
    outline: 3px solid rgba(29, 95, 111, .14);
}

.icon-button[data-tooltip]::after {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 40;
    padding: 6px 8px;
    transform: translateX(-50%);
    border-radius: 6px;
    background: #18212f;
    color: #fff;
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.icon-button[data-tooltip]:hover::after,
.icon-button[data-tooltip]:focus-visible::after {
    opacity: 1;
}

.help-menu {
    position: relative;
    flex: 0 0 auto;
}

.help-popover {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 30;
    width: min(520px, calc(100vw - 32px));
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 18px 45px rgba(25, 36, 52, .18);
}

.help-popover[hidden] {
    display: none;
}

.hero,
.panel,
.table-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
    gap: 32px;
    align-items: stretch;
    padding: 34px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 320px;
}

.hero-copy h1,
.page-header h1 {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
    letter-spacing: 0;
}

h1 {
    margin: 0 0 18px;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.12;
    letter-spacing: 0;
}

.lead {
    max-width: 680px;
    margin: 14px 0 0;
    color: #4e5b6b;
    font-size: 17px;
    line-height: 1.55;
}

.auth-panel {
    align-self: center;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 20px;
}

.page-header h1 {
    font-size: clamp(26px, 3vw, 38px);
}

.panel {
    padding: 24px;
    margin-bottom: 18px;
}

.panel.compact {
    max-width: 520px;
    margin-inline: auto;
}

.panel-title {
    margin: 0 0 16px;
    font-size: 19px;
}

h2 {
    margin: 0 0 16px;
    font-size: 21px;
}

p {
    line-height: 1.5;
}

form {
    display: grid;
    gap: 14px;
    margin: 0;
}

label {
    display: block;
    margin: 0 0 6px;
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.form-hint {
    margin: 6px 0 2px;
    color: var(--muted);
    font-size: 14px;
}

input,
select {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #c8d2df;
    border-radius: 7px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

input:focus,
select:focus {
    outline: 3px solid rgba(29, 95, 111, .18);
    border-color: var(--primary);
}

input[type="file"] {
    min-height: auto;
    padding: 8px;
}

.row-checkbox {
    width: 20px;
    min-height: 20px;
}

.consent-box {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.consent-checkbox {
    width: 18px;
    min-height: 18px;
    margin: 2px 0 0;
    padding: 0;
}

.consent-box label {
    margin: 0;
    color: #344054;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
}

.checkbox-field label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    margin: 0;
    font-weight: 650;
    cursor: pointer;
}

.checkbox-field input[type="checkbox"] {
    width: 18px;
    min-height: 18px;
    padding: 0;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px 16px;
    margin: 18px 0;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 48px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    width: 34px;
    min-height: 34px;
    height: 34px;
    padding: 0;
    transform: translateY(-50%);
    border-color: transparent;
    background: transparent;
    color: #5b6675;
}

.password-toggle:hover,
.password-toggle:focus-visible,
.password-toggle[aria-pressed="true"] {
    background: #eef4f7;
    color: var(--primary);
}

.password-toggle svg {
    display: block;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid #bdc8d5;
    border-radius: 7px;
    background: #fff;
    color: #243244;
    font: inherit;
    font-weight: 750;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button:hover {
    border-color: #99a8b8;
    background: #f8fafc;
}

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

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

.primary:hover {
    border-color: var(--primary-dark);
    background: var(--primary-dark);
}

.danger {
    border-color: #e2aaa5;
    background: var(--danger-soft);
    color: var(--danger);
}

.danger:hover {
    border-color: var(--danger);
    background: #ffe5e2;
}

.link-button {
    border-color: transparent;
    background: transparent;
    color: var(--primary);
    padding-inline: 4px;
}

.actions,
.menu {
    display: grid;
    gap: 12px;
}

.auth-link {
    margin: 16px 0 0;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

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

.compact-action-grid {
    margin-bottom: 22px;
}

.compact-action-grid .action-card {
    min-height: 86px;
}

.action-card {
    position: relative;
    display: flex;
    min-height: 102px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border: 1px solid var(--primary-light);
    border-radius: 8px;
    background: var(--primary-light);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(29, 95, 111, .2);
    cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease, background .15s ease;
}

.action-card:hover {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 14px 28px rgba(29, 95, 111, .32);
    transform: translateY(-1px);
}

.action-card strong {
    font-size: 18px;
    color: #fff;
}

.action-card span {
    color: rgba(255, 255, 255, .85);
    font-size: 14px;
}

.form-grid,
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    align-items: end;
}

.filter-bar {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.account-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
}

.account-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.account-action-grid .button {
    min-height: 54px;
}

.verification-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.verification-resend-form {
    margin-top: 10px;
}

.data-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 0;
}

.data-list div {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.data-list dt {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.data-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-weight: 750;
}

.split-filter-bar {
    margin-top: 12px;
}

.filter-details {
    display: grid;
    gap: 12px;
}

.filter-details summary {
    width: fit-content;
    cursor: pointer;
    color: var(--primary);
    font-weight: 800;
}

.filter-details .filter-bar {
    margin-top: 12px;
}

.book-card,
.user-card,
.summary-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.book-card {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
    padding: 18px;
    margin: 0 0 14px;
}

.book-image {
    display: block;
    width: 180px;
    height: 255px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.book-image-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.book-content,
.book-display {
    display: grid;
    gap: 14px;
}

.book-display h3 {
    margin: 0;
    font-size: 22px;
    line-height: 1.25;
}

.book-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px 16px;
    margin: 0;
}

.book-meta div {
    min-width: 0;
}

.book-meta dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.book-meta dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}

.book-edit-menu {
    display: grid;
    gap: 14px;
}

.book-edit-menu summary {
    width: fit-content;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid #b8c7d6;
    border-radius: 7px;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    font-weight: 800;
    list-style-position: inside;
}

.book-edit-menu summary:hover,
.book-edit-menu summary:focus-visible {
    border-color: var(--primary);
    outline: 3px solid rgba(29, 95, 111, .16);
}

.book-edit-menu[open] summary {
    margin-bottom: 14px;
}

.book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.user-list {
    display: grid;
    gap: 12px;
}

.user-card {
    padding: 16px;
}

.user-card p {
    margin: 0 0 8px;
}

.user-card p:last-child {
    margin-bottom: 0;
}

.info,
.instruction,
.alert,
.empty-state {
    padding: 13px 14px;
    border-radius: 8px;
    margin: 0 0 16px;
}

.info {
    border: 1px solid #acd7bb;
    background: var(--success-soft);
    color: #15532e;
}

.instruction {
    border: 1px solid #c8d2df;
    background: #f8fafc;
    color: #344054;
}

.alert {
    border: 1px solid #e2aaa5;
    background: var(--danger-soft);
    color: #7f211b;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(24, 33, 47, .46);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(520px, 100%);
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(25, 36, 52, .26);
}

.order-notice-modal {
    width: min(680px, 100%);
}

.order-confirm-modal {
    width: min(780px, 100%);
}

.modal-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
}

.danger-text {
    color: var(--danger);
}

.modal-message {
    margin: 0;
    color: #39465a;
    line-height: 1.5;
}

.modal-text {
    display: grid;
    gap: 12px;
    color: #39465a;
    line-height: 1.5;
}

.modal-text p {
    margin: 0;
}

.instruction-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
}

.split-actions {
    justify-content: space-between;
}

.order-confirm-list {
    display: grid;
    gap: 8px;
    max-height: min(42vh, 360px);
    overflow: auto;
}

.order-confirm-row {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(110px, .8fr) minmax(88px, .6fr);
    gap: 12px;
    align-items: start;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.order-confirm-row span {
    overflow-wrap: anywhere;
}

.order-confirm-child {
    margin: 8px 0 0;
    font-weight: 850;
}

.order-confirm-header {
    background: #eef4f7;
    color: #475467;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.order-confirm-total {
    margin-top: 4px;
    color: var(--text);
    font-size: 18px;
}

.empty-state {
    border: 1px dashed #b8c5d4;
    background: #f8fafc;
    color: var(--muted);
}

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

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0;
}

.number-input {
    width: 88px;
}

.table-panel {
    overflow: hidden;
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.user-table-wrap {
    max-height: 620px;
    overflow: auto;
}

.user-table {
    min-width: 1280px;
}

.user-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

/*
 * CSV-Importvorschau (neue/geaenderte Nutzer): kann je nach Datei hunderte Zeilen und viele
 * Spalten (SchuelerID bis FS 4) enthalten. Ohne begrenzte Hoehe waechst die Seite unbegrenzt in
 * die Laenge; mit fixiertem Tabellenkopf bleibt beim seitlichen Scrollen erkennbar, welche Spalte
 * (z. B. "FS 3") gerade sichtbar ist.
 */
.preview-table-wrap {
    max-height: 620px;
    overflow: auto;
}

.preview-table-wrap th {
    position: sticky;
    top: 0;
    z-index: 1;
}

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

th,
td {
    padding: 14px;
    border-bottom: 1px solid #e5eaf1;
    text-align: left;
    vertical-align: top;
}

th {
    background: #f4f7fa;
    color: #475467;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sort-link {
    color: inherit;
    text-decoration: none;
}

.sort-link:hover,
.sort-link:focus-visible {
    color: var(--primary);
    text-decoration: underline;
}

.sort-link span {
    display: inline-block;
    margin-left: 4px;
    color: var(--primary);
    font-size: 11px;
}

tr:last-child td {
    border-bottom: 0;
}

.row-ok td {
    background: #f4fbf6;
}

.block {
    display: block;
    margin-top: 5px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid #c8d2df;
    border-radius: 999px;
    background: #f5f7fa;
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.badge.ok {
    border-color: #98d6a4;
    background: #eaf8ed;
    color: #17612a;
}

.badge.muted-badge {
    border-color: #c8d2df;
    background: #f5f7fa;
    color: #475467;
}

.badge.warning {
    border-color: #e6c26b;
    background: #fff7df;
    color: #77520b;
}

.badge.danger {
    border-color: #e2aaa5;
    background: var(--danger-soft);
    color: var(--danger);
}

.danger-row td {
    background: var(--danger-soft);
    color: var(--danger);
}

.import-box {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.import-box h2 {
    margin-bottom: 0;
}

.import-preview-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.import-preview-summary p {
    margin: 0;
}

.order-summary-card {
    display: block;
    margin-bottom: 10px;
}

.import-confirm-actions {
    justify-content: flex-end;
    padding: 16px;
    margin-top: 0;
}

.order-status-banner {
    display: grid;
    gap: 6px;
    max-width: 720px;
    margin-top: 18px;
    padding: 20px 22px;
    border: 2px solid #72bd82;
    border-radius: 8px;
    background: #eaf8ed;
    color: #155a28;
    box-shadow: 0 12px 28px rgba(34, 115, 67, .14);
}

.order-status-banner strong {
    font-size: 24px;
    line-height: 1.15;
}

.order-status-banner span {
    font-size: 17px;
    font-weight: 750;
    line-height: 1.45;
}

.order-status-banner.danger {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: 0 12px 28px rgba(163, 58, 50, .14);
}

.order-status-banner.neutral {
    border-color: var(--border);
    background: var(--surface-soft);
    color: var(--text);
    box-shadow: none;
}

#order-status form,
#order-status .inline-actions {
    margin-top: 18px;
}

.order-lock-banner {
    display: grid;
    gap: 8px;
    padding: 22px 24px;
    border: 3px solid var(--danger);
    border-radius: 8px;
    background: var(--danger-soft);
    color: var(--danger);
    box-shadow: 0 12px 28px rgba(163, 58, 50, .18);
}

.order-lock-banner strong {
    font-size: 26px;
    line-height: 1.15;
}

.order-lock-banner p {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--danger);
}

.family-members-box {
    max-width: 760px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--text);
}

.family-members-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
    line-height: 1.25;
}

.family-members-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
}

.family-members-table th,
.family-members-table td {
    padding: 7px 9px;
    border-bottom: 1px solid #e5eaf1;
    text-align: left;
    vertical-align: top;
}

.family-members-table th {
    background: #eef2f5;
    color: #475467;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.family-members-table td {
    font-size: 13px;
    line-height: 1.35;
}

.actions-cell {
    min-width: 270px;
}

.actions-cell form {
    margin-bottom: 10px;
}

.user-table .actions-cell {
    display: flex;
    gap: 8px;
    min-width: 172px;
    align-items: center;
}

.user-table .actions-cell form {
    margin: 0;
}

.user-table .actions-cell .button,
.user-table .actions-cell button {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 13px;
}

.order-table {
    min-width: 860px;
}

.license-results-actions {
    display: flex;
    justify-content: flex-end;
    margin: -4px 0 16px;
}

.license-card-list {
    display: grid;
    gap: 14px;
}

.license-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 2px solid #aebdcd;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 22px rgba(25, 36, 52, .08);
}

.license-card-main,
.license-card-details {
    display: grid;
    gap: 14px;
    align-items: center;
}

.license-card-main {
    grid-template-columns: 84px minmax(260px, 420px) minmax(82px, max-content) minmax(120px, max-content) minmax(150px, max-content) minmax(96px, max-content);
    justify-content: start;
}

.license-card-details {
    grid-template-columns: minmax(100px, .7fr) repeat(3, minmax(126px, .75fr)) minmax(190px, 1fr);
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.license-card-label {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.license-book-title strong {
    display: block;
    overflow-wrap: anywhere;
    line-height: 1.3;
}

.license-import-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0;
}

.license-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.license-file-label {
    width: fit-content;
    margin: 0;
    cursor: pointer;
}

.order-book-image {
    display: block;
    width: 72px;
    height: 102px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-soft);
}

.order-book-image-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.order-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.license-child-block {
    margin-bottom: 24px;
}

.license-child-block h2 {
    margin: 0 0 12px;
}

.download-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.billing-scroll {
    display: grid;
    max-height: 660px;
    gap: 16px;
    overflow: auto;
    padding-right: 4px;
}

.billing-class-group {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}

.billing-class-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.billing-class-header h3 {
    margin: 0;
    font-size: 20px;
}

.billing-total {
    font-weight: 800;
}

.summary-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
    margin-bottom: 18px;
}

.summary-card h2 {
    margin: 0 0 8px;
}

.summary-card p {
    margin: 0 0 6px;
}

.code {
    font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-size: 14px;
}

.footer-link {
    margin-top: 18px;
}

.page-back-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

@media (max-width: 1120px) {
    .license-card-main,
    .license-card-details {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 640px) {
    .license-card-main {
        grid-template-columns: 72px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .app-shell,
    .app-shell.wide {
        width: min(100% - 20px, 100%);
        padding-top: 14px;
    }

    .topbar,
    .page-header,
    .summary-card {
        align-items: stretch;
        flex-direction: column;
    }

    .top-actions {
        justify-content: flex-start;
    }

    .brand-area {
        align-items: flex-start;
    }

    .help-popover {
        width: calc(100vw - 20px);
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .hero-copy {
        min-height: auto;
    }

    .panel {
        padding: 18px;
    }

    .book-card {
        grid-template-columns: 1fr;
    }

    .book-image {
        width: 132px;
        height: 188px;
    }
}
