/* Admin portal style: the legacy portal's Material look (Quicksand, light and
   dark palettes, 8px radius) as CSS tokens. body.dark-theme switches the
   palette, as on the auth test site. */

:root {
    --primary: #1976d2;
    --primary-dark: #1565c0;
    /* Height of every text box, select and multi-select in a search row. */
    --control-height: 40px;
    /* Height of the stage bar above the top bar. */
    --stage-bar-height: 34px;
    --primary-contrast: #ffffff;
    --secondary: #9c27b0;
    --success: #2e7d32;
    --warning: #ed6c02;
    --wave-learner-progress: #ffca28;
    --error: #d32f2f;
    --info: #0288d1;
    --toast-success: #43a047;
    --toast-error: #d32f2f;
    --background: #ffffff;
    --paper: #ffffff;
    --text: rgba(0, 0, 0, 0.87);
    --text-secondary: rgba(0, 0, 0, 0.6);
    --text-disabled: rgba(0, 0, 0, 0.38);
    --divider: rgba(0, 0, 0, 0.12);
    --hover: rgba(0, 0, 0, 0.04);
    --field-border: rgba(0, 0, 0, 0.23);
    --subtle: rgba(158, 158, 158, 0.05);
    --card-shadow: 0 5px 22px 0 rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.06);
    --overlay: rgba(0, 0, 0, 0.5);
    --side-nav-width: 280px;
    --side-nav-collapsed-width: 80px;
    --mobile-nav-width: 320px;
    --nav-color: #d1d5db;
    --nav-icon-color: #9ca3af;
    --nav-active-background: #818181;
    --nav-hover-background: rgba(255, 255, 255, 0.04);
}

body.dark-theme {
    --primary: #90caf9;
    --primary-dark: #42a5f5;
    --primary-contrast: rgba(0, 0, 0, 0.87);
    --secondary: #ce93d8;
    --success: #66bb6a;
    --warning: #ffa726;
    --wave-learner-progress: #0d47a1;
    --error: #f44336;
    --info: #29b6f6;
    --background: #121212;
    --paper: #1e1e1e;
    --text: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-disabled: rgba(255, 255, 255, 0.5);
    --divider: rgba(255, 255, 255, 0.12);
    --hover: rgba(255, 255, 255, 0.08);
    --field-border: rgba(255, 255, 255, 0.23);
    --card-shadow: 0 5px 22px 0 rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Quicksand", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    background: var(--background);
    color: var(--text);
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
    margin: 0;
}

.h4 {
    font-size: 2rem;
    font-weight: 500;
    line-height: 1.2;
}

.h5 {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.2;
}

.h6 {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.2;
}

.overline {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 2.5;
    text-transform: uppercase;
}

.subtitle1 {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.57;
}

.subtitle2 {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.57;
}

.body2 {
    font-size: 0.875rem;
    line-height: 1.57;
}

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

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

.monospace {
    font-family: monospace;
}

/* Icons */

.icon {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
    flex: 0 0 auto;
}

.icon.small {
    width: 1.25rem;
    height: 1.25rem;
}

.icon.large {
    width: 2.1875rem;
    height: 2.1875rem;
}

/* Buttons */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    color: var(--primary);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.75;
    cursor: pointer;
    transition: background-color 0.2s;
}

.button:hover {
    background: var(--hover);
}

.button:disabled {
    color: var(--text-disabled);
    cursor: default;
}

.button.small {
    padding: 6px 16px;
}

.button.large {
    padding: 11px 24px;
    font-size: 0.9375rem;
}

.button.contained {
    background: var(--primary);
    color: var(--primary-contrast);
}

.button.contained:hover {
    background: var(--primary-dark);
}

.button.contained:disabled {
    background: var(--divider);
    color: var(--text-disabled);
}

/* A link the account may not use (v-can, ui/permission.js). */
a.denied,
.button.denied {
    color: var(--text-disabled);
    cursor: default;
}

.button.denied:hover {
    background: none;
}

.button.contained.denied,
.button.contained.denied:hover {
    background: var(--divider);
    color: var(--text-disabled);
}

.button.outlined {
    border-color: var(--primary);
}

.button.error {
    color: var(--error);
}

.button.outlined.error {
    border-color: var(--error);
}

.button.outlined.success {
    border-color: var(--success);
}

.button.outlined.warning {
    border-color: var(--warning);
}

.button.full-width {
    width: 100%;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border: none;
    border-radius: 50%;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.icon-button:hover {
    background: var(--hover);
}

.icon-button.small {
    padding: 5px;
}

.icon-button.success {
    color: var(--success);
}

/* Form fields */

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.field label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.field input,
.field select {
    padding: 12px 14px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--paper);
    color: var(--text);
    font: inherit;
}

.field select {
    padding-right: 40px;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--text-secondary) 50%),
        linear-gradient(135deg, var(--text-secondary) 50%, transparent 50%);
    background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
}

.field input:focus,
.field select:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

/* Cards and grid */

.card {
    background: var(--paper);
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.card.outlined {
    box-shadow: none;
    border: 1px solid var(--divider);
    border-radius: 24px;
}

.card-content {
    padding: 32px 24px;
}

.divider {
    border: none;
    border-top: 1px solid var(--divider);
    margin: 16px 0;
    width: 100%;
}

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

.grid>* {
    grid-column: span 12;
}

@media (min-width: 600px) {
    .grid .sm-6 {
        grid-column: span 6;
    }
}

@media (min-width: 900px) {
    .grid .md-4 {
        grid-column: span 4;
    }

    .grid .md-8 {
        grid-column: span 8;
    }
}

@media (min-width: 1200px) {
    .grid .lg-3 {
        grid-column: span 3;
    }
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Avatar */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    background: #bdbdbd;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    flex: 0 0 auto;
    position: relative;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar.rounded {
    border-radius: 8px;
}

.avatar.bordered {
    border: 1px solid lightgray;
}

.badge-holder {
    position: relative;
    display: inline-flex;
}

.verified-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 20px;
    height: 20px;
    padding: 1px;
    border-radius: 50%;
    background: #ffffff;
    fill: var(--primary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Dashboard layout */

.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    display: none;
    flex-direction: column;
    width: var(--side-nav-width);
    height: 100%;
    background: #000000;
    color: #ffffff;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}

@media (min-width: 1200px) {
    .side-nav {
        display: flex;
    }

    .dashboard-main {
        padding-left: var(--side-nav-width);
        transition: padding-left 0.2s ease;
    }

    .menu-button {
        display: none;
    }

    .top-bar .nav-collapse {
        display: inline-flex;
    }

    .nav-collapsed .dashboard-main {
        padding-left: var(--side-nav-collapsed-width);
    }
}

.side-nav {
    transition: width 0.2s ease;
}

.nav-collapse {
    display: none;
}

.nav-collapsed .side-nav {
    width: var(--side-nav-collapsed-width);
}

.nav-collapsed .side-nav .nav-logo {
    padding: 24px 15px;
}

.nav-collapsed .side-nav .nav-title,
.nav-collapsed .side-nav .nav-list .nav-list {
    display: none;
}

.nav-collapsed .side-nav .nav-item {
    justify-content: center;
    padding: 8px;
}

.nav-flyout {
    width: auto;
    min-width: 200px;
    max-height: calc(100vh - 16px);
    overflow-y: auto;
}

.nav-flyout .menu-item {
    text-decoration: none;
    white-space: nowrap;
}

.nav-flyout .menu-item.active {
    background: var(--hover);
    color: var(--primary);
}

.nav-flyout .nav-flyout-head {
    font-weight: 700;
}


.nav-logo {
    display: inline-flex;
    padding: 24px;
}

.nav-logo img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-root {
    flex: 1 1 auto;
    padding: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 8px;
    color: var(--nav-color);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--nav-hover-background);
    text-decoration: none;
}

.nav-item .icon {
    fill: var(--nav-icon-color);
}

.nav-item.active {
    background: var(--nav-active-background);
    color: #ffffff;
}

.nav-item.active .icon {
    fill: #ffffff;
}

.nav-title {
    flex: 1 1 auto;
    padding-left: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 28px;
}

.mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: var(--overlay);
}

.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1201;
    display: flex;
    flex-direction: column;
    width: var(--mobile-nav-width);
    max-width: 100%;
    height: 100%;
    background: #000000;
    color: #ffffff;
    overflow-y: auto;
    scrollbar-width: none;
}

.mobile-nav .divider {
    border-color: #404040;
    margin: 0;
}

.dashboard {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background: var(--background);
}

.dashboard-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 16px;
    border-bottom: 1px solid var(--divider);
    background: var(--paper);
}

.top-bar .avatar {
    cursor: pointer;
}

/* Stage bar and top bar stay at the top together. */
.top-stack {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.stage-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: var(--stage-bar-height);
    padding: 0 16px;
    border-bottom: 1px solid var(--divider);
    color: var(--text-secondary);
    background: var(--paper);
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
}

.stage-bar .monospace {
    overflow: hidden;
    text-overflow: ellipsis;
}

.stage-chip {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.stage-chip.stage-dev {
    border: 1px solid var(--field-border);
    color: rgba(0, 0, 0, 0.87);
    background: #ffffff;
}

.stage-chip.stage-beta {
    color: rgba(0, 0, 0, 0.87);
    background: #ffb300;
}

.stage-chip.stage-prod {
    color: #ffffff;
    background: #d32f2f;
}

.page-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
}

@media (max-width: 599px) {
    .page-container {
        padding: 24px 16px;
    }
}

/* Popover menu */

.menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
}

.menu-paper {
    position: fixed;
    z-index: 1301;
    width: 240px;
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 5px 22px rgba(0, 0, 0, 0.16);
}

.menu-head {
    padding: 16px 20px;
    overflow-wrap: anywhere;
}

.menu-paper .divider {
    margin: 0;
}

.menu-list {
    margin: 0;
    padding: 8px;
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    min-height: 36px;
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-item:hover {
    background: var(--hover);
}

.menu-item-icon {
    display: inline-flex;
    align-items: center;
    min-width: 36px;
    color: var(--text-secondary);
}

/* Theme switch (legacy MaterialUISwitch, without the images) */

.theme-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 20px;
    margin-right: 8px;
    border-radius: 10px;
    background: #aab4be;
}

.theme-switch::after {
    content: "";
    position: absolute;
    top: -4px;
    left: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #001e3c;
    transition: transform 0.2s;
}

.theme-switch.on {
    background: #8796a5;
}

.theme-switch.on::after {
    background: #003892;
    transform: translateX(24px);
}

/* Dialog */

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: var(--overlay);
}

.dialog {
    width: 100%;
    max-width: 600px;
    border-radius: 8px;
    background: var(--paper);
    color: var(--text);
    box-shadow: 0 11px 15px -7px rgba(0, 0, 0, 0.2), 0 24px 38px 3px rgba(0, 0, 0, 0.14);
}

.dialog.fit {
    width: auto;
}

.dialog.wide {
    max-width: 860px;
}

.dialog-title {
    padding: 16px 24px;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.6;
}

.dialog-content {
    padding: 0 24px 20px 24px;
    color: var(--text-secondary);
}

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

/* The focused action of a dialog (ui/dialog.js: the default, then arrow keys)
   is filled in its own color; while an action has the focus, the other filled
   actions show outlined, so only one button is filled. */
.dialog-actions .button:focus {
    outline: none;
}

.dialog-actions .button.outlined:focus {
    background: var(--primary);
    color: var(--primary-contrast);
}

.dialog-actions .button.outlined.error:focus {
    background: var(--error);
    color: #ffffff;
}

.dialog-actions .button.outlined.success:focus {
    background: var(--success);
    color: #ffffff;
}

.dialog-actions .button.outlined.warning:focus {
    background: var(--warning);
    color: #ffffff;
}

.dialog-actions:focus-within .button.contained:not(:focus) {
    border-color: var(--primary);
    background: none;
    color: var(--primary);
}

.dialog-actions:focus-within .button.contained.error-fill:not(:focus) {
    border-color: var(--error);
    color: var(--error);
}

/* Side-by-side choices of a dialog (Copy from Existing); the one not in use
   is greyed out and wakes up on a click or the focus. */
.dialog-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dialog-choice {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    transition: opacity 0.2s;
}

.dialog-choice.inactive {
    opacity: 0.5;
}

/* The focused start button of a choice: Enter starts it. */
.dialog-choice .button:focus {
    outline: 3px solid var(--primary-dark);
    outline-offset: 2px;
}

/* A dialog holding dropdowns (BaseDialog menus): at the top of the window, its
   option lists reach past its bottom edge. */
.dialog-backdrop.menus {
    align-items: flex-start;
}

.dialog.menus {
    overflow: visible;
}

@media (max-width: 599px) {
    .dialog-choices {
        grid-template-columns: 1fr;
    }
}

/* Toast (notistack look, top right, 5 s) */

.toasts {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 1400;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: calc(100% - 28px);
}

.toast {
    min-width: 288px;
    padding: 6px 16px;
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.875rem;
    line-height: 2.2;
    box-shadow: 0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14);
    overflow-wrap: anywhere;
}

.toast.success {
    background: var(--toast-success);
}

.toast.error {
    background: var(--toast-error);
}

/* Table and pager */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th,
.table td {
    padding: 16px;
    border-bottom: 1px solid var(--divider);
    text-align: left;
}

.table th {
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 1;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr.clickable {
    cursor: pointer;
}

.table tbody tr:hover {
    background: var(--hover);
}

.pager {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 16px;
    min-height: 52px;
    padding: 0 8px 0 16px;
    font-size: 0.875rem;
}

.pager select {
    padding: 4px 8px;
    border: none;
    background: none;
    color: var(--text);
    font: inherit;
}

@media (max-width: 599px) {
    .pager-label {
        display: none;
    }
}

/* Loaders */

.spinner {
    width: 5rem;
    height: 5rem;
    margin: 0 auto;
    animation: spin 2s infinite linear;
}

.spinner svg {
    width: 100%;
    height: 100%;
}

.spinner path {
    fill: none;
    stroke: var(--text-secondary);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2px;
}

.full-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100vh;
}

.circular {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--primary);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s infinite linear;
}

.top-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1301;
    width: 100%;
    height: 4px;
    overflow: hidden;
    background: rgba(25, 118, 210, 0.3);
}

.top-progress::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    background: var(--primary);
    animation: progress 1.6s infinite ease-in-out;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes progress {
    from {
        left: -40%;
    }

    to {
        left: 100%;
    }
}

/* Message boxes (404, logged out) */

.message-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 500px;
    margin: 160px auto 0 auto;
    padding: 16px 24px;
    border-radius: 8px;
    color: rgba(0, 0, 0, 0.87);
}

.message-box.oops {
    width: 500px;
    max-width: calc(100% - 32px);
    background: #f99b9b;
}

.message-box.oops .icon {
    fill: #d32f2f;
}

.message-box.oops .oops-title {
    color: #c51619;
    font-size: 18px;
    font-weight: bold;
}

.message-box.info {
    background: #90caf9;
}

.message-box.info .icon {
    fill: #0288d1;
}

.message-box.info .info-title {
    color: #ffffff;
    font-weight: bold;
}

/* Error states */

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 64px 16px;
    text-align: center;
}

.error-icon {
    display: flex;
    margin-bottom: 32px;
    padding: 24px;
    border: 2px solid;
    border-radius: 50%;
}

.error-icon .icon {
    width: 48px;
    height: 48px;
}

.error-icon.error {
    color: var(--error);
    border-color: color-mix(in srgb, var(--error) 19%, transparent);
    background: color-mix(in srgb, var(--error) 8%, transparent);
}

.error-icon.warning {
    color: var(--warning);
    border-color: color-mix(in srgb, var(--warning) 19%, transparent);
    background: color-mix(in srgb, var(--warning) 8%, transparent);
}

.error-state .card {
    width: 100%;
    border-radius: 24px;
}

.error-state h1 {
    margin-bottom: 16px;
    font-size: 1.5rem;
    font-weight: 600;
}

.error-state .error-message {
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.error-detail {
    margin-bottom: 24px;
    padding: 16px;
    border-radius: 8px;
    background: var(--subtle);
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.875rem;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.error-actions .button {
    font-weight: 600;
}

/* Empty state (legacy EmptyState component and its CSS) */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 4rem 2rem;
    text-align: center;
    color: #6b7280;
}

.empty-animation {
    position: relative;
    margin-bottom: 2rem;
}

.empty-icon {
    position: relative;
    animation: gentleBounce 3s ease-in-out infinite;
}

.box {
    position: relative;
    width: 60px;
    height: 60px;
}

.box-body {
    position: relative;
    width: 60px;
    height: 40px;
    border: 2px solid #9ca3af;
    border-radius: 4px;
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
    animation: boxFloat 2s ease-in-out infinite alternate;
}

.box-top {
    position: absolute;
    top: -20px;
    width: 60px;
    height: 20px;
    border: 2px solid #9ca3af;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    animation: boxTopFloat 2s ease-in-out infinite alternate;
}

.box-flaps {
    position: absolute;
    top: -20px;
    width: 100%;
}

.flap {
    position: absolute;
    width: 25px;
    height: 15px;
    border: 2px solid #9ca3af;
    border-radius: 2px;
    background: #f9fafb;
    animation: flapWave 2s ease-in-out infinite;
}

.flap-1 {
    left: 5px;
    transform-origin: bottom;
    animation-delay: 0.2s;
}

.flap-2 {
    right: 5px;
    transform-origin: bottom;
    animation-delay: 0.4s;
}

.magnifying-glass {
    position: relative;
    width: 60px;
    height: 60px;
}

.glass-circle {
    width: 40px;
    height: 40px;
    border: 4px solid #9ca3af;
    border-radius: 50%;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    animation: searchPulse 2s ease-in-out infinite;
}

.glass-handle {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 20px;
    height: 4px;
    border-radius: 2px;
    background: #9ca3af;
    transform: rotate(45deg);
    animation: handleWiggle 1.5s ease-in-out infinite;
}

.chart-bars {
    display: flex;
    align-items: end;
    gap: 8px;
    height: 60px;
    padding: 10px;
}

.bar {
    width: 10px;
    border-radius: 2px 2px 0 0;
    background: linear-gradient(to top, #3b82f6, #60a5fa);
    animation: barGrow 2s ease-in-out infinite;
}

.bar-1 {
    height: 20px;
    animation-delay: 0.1s;
}

.bar-2 {
    height: 35px;
    animation-delay: 0.2s;
}

.bar-3 {
    height: 15px;
    animation-delay: 0.3s;
}

.bar-4 {
    height: 40px;
    animation-delay: 0.4s;
}

.user-group {
    position: relative;
    width: 80px;
    height: 60px;
}

.user {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid #9ca3af;
    border-radius: 50%;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    animation: userBob 2s ease-in-out infinite;
}

.user::after {
    content: "";
    position: absolute;
    top: 22px;
    left: -5px;
    width: 30px;
    height: 20px;
    border: 2px solid #9ca3af;
    border-top: none;
    border-radius: 15px 15px 0 0;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.user-1 {
    left: 0;
    animation-delay: 0.1s;
}

.user-2 {
    left: 25px;
    animation-delay: 0.2s;
}

.user-3 {
    left: 50px;
    animation-delay: 0.3s;
}

.floating-dots {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translate(-50%);
}

.dot {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a5b4fc;
    animation: dotFloat 3s ease-in-out infinite;
}

.dot-1 {
    left: -15px;
    animation-delay: 0.5s;
}

.dot-2 {
    left: 0;
    animation-delay: 1s;
}

.dot-3 {
    left: 15px;
    animation-delay: 1.5s;
}

.empty-content {
    max-width: 400px;
    animation: contentFadeIn 0.6s ease-out 0.3s both;
}

.empty-title {
    margin-bottom: 0.5rem;
    color: #374151;
    font-size: 1.5rem;
    font-weight: 600;
}

body.dark-theme .empty-title {
    color: #d1d5db;
}

.empty-message {
    margin: 0;
    color: #6b7280;
    font-size: 1rem;
    line-height: 1.5;
}

@keyframes gentleBounce {

    0%,
    to {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes boxFloat {
    0% {
        transform: translateY(0) rotate(0);
    }

    to {
        transform: translateY(-5px) rotate(1deg);
    }
}

@keyframes boxTopFloat {
    0% {
        transform: translateY(0) rotate(0);
    }

    to {
        transform: translateY(-3px) rotate(-1deg);
    }
}

@keyframes flapWave {

    0%,
    to {
        transform: rotateX(0);
    }

    50% {
        transform: rotateX(-20deg);
    }
}

@keyframes searchPulse {

    0%,
    to {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes handleWiggle {

    0%,
    to {
        transform: rotate(45deg);
    }

    50% {
        transform: rotate(50deg);
    }
}

@keyframes barGrow {

    0%,
    to {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(1.3);
    }
}

@keyframes userBob {

    0%,
    to {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes dotFloat {

    0%,
    to {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }

    50% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }
}

@keyframes contentFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    .empty-state {
        padding: 3rem 1rem;
    }

    .empty-title {
        font-size: 1.25rem;
    }

    .empty-message {
        font-size: 0.875rem;
    }
}

/* Copy button */

.copy-value {
    display: flex;
    align-items: center;
}

.code-format {
    padding: 2px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    font-family: monospace;
    font-size: 0.8em;
}

/* Sign-in pages */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100%;
    padding: 32px 16px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 40px 32px;
    border-radius: 8px;
    background: var(--paper);
    box-shadow: var(--card-shadow);
}

.auth-card .logo {
    display: block;
    width: 64px;
    height: 64px;
    margin: 0 auto 16px auto;
}

.auth-card h1 {
    margin-bottom: 4px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 500;
}

.auth-card .auth-subtitle {
    margin-bottom: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-card .button {
    width: 100%;
    margin-bottom: 8px;
}

.auth-or {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 16px 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1;
    border-top: 1px solid var(--divider);
}

.auth-message {
    margin-bottom: 16px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.875rem;
}

.auth-message.error {
    background: color-mix(in srgb, var(--error) 12%, transparent);
    color: var(--error);
}

.auth-message.notice {
    background: color-mix(in srgb, var(--info) 12%, transparent);
    color: var(--info);
}

/* Course view */

.course-view {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
}

.course-view-cover {
    width: 200px;
    max-width: 100%;
    border-radius: 8px;
    object-fit: cover;
}

/* Task view: pre-task and answer pictures. */

.task-view-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.task-view-images img {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
}

.task-view-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
}

/* User details */

.avatar.user-avatar {
    width: 64px;
    height: 64px;
    background: var(--primary);
    font-size: 1.75rem;
}

.user-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.user-tile.clickable {
    cursor: pointer;
}

.user-tile.clickable:hover {
    background: var(--hover);
}

/* A card scrolled to from a tile stops with its top just under the 64px top
   bar; its border flashes the primary color. */
.scroll-target {
    scroll-margin-top: 80px;
}

.card-flash {
    animation: card-flash 1.2s ease-out;
}

.card-flash:focus {
    outline: none;
}

@keyframes card-flash {
    0%,
    40% {
        box-shadow: 0 0 0 2px var(--primary);
    }

    100% {
        box-shadow: 0 0 0 2px transparent;
    }
}

.user-tile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
}

/* Search bars of the user details tables: inside the card's padding. */
.filter-bar.user-filter-bar {
    padding: 0 0 16px 0;
}

/* Two columns of equal height; each block is as tall as its rows, and the last
   block of a column stretches so both columns end on one line. */
.record-blocks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

@media (max-width: 899px) {
    .record-blocks {
        grid-template-columns: minmax(0, 1fr);
    }
}

.record-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.record-column > .record-block:last-child {
    flex: 1 1 auto;
}

.record-block {
    padding: 16px;
    border: 1px solid var(--divider);
    border-radius: 8px;
}

.record-block-title {
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--divider);
    font-weight: 600;
}

.record-list {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 4px 16px;
    margin: 0;
}

.record-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Overview cards */

.stat-card {
    height: 100%;
    cursor: pointer;
}

.stat-card:hover {
    background: var(--hover);
}

.stat-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.stat-text {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    color: #ffffff;
}

.stat-icon .icon {
    fill: #ffffff;
}

/* Profile */

.profile {
    max-width: 1200px;
    margin: 32px auto 64px auto;
}

.profile-title {
    margin-bottom: 32px;
    font-size: 2rem;
    font-weight: 600;
}

.profile-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px;
}

.profile-identity .avatar {
    width: 60px;
    height: 60px;
}

.profile-identity h2 {
    margin: 8px 0 0.35em 0;
    font-size: 1.5rem;
    font-weight: 500;
    text-align: center;
}

.profile-email {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 16px;
    overflow-wrap: anywhere;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 1.125rem;
    font-weight: 500;
}

.section-title .icon {
    fill: var(--primary);
}

.info-label {
    margin-bottom: 0.35em;
}

.info-value {
    padding: 12px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    background: var(--subtle);
    font-size: 0.875rem;
    word-break: break-all;
}

.security-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-radius: 16px;
    background: var(--subtle);
}

.security-row>div {
    display: flex;
    align-items: center;
    gap: 16px;
}

.security-row .icon {
    fill: var(--text-secondary);
}

.security-row .button .icon {
    fill: currentColor;
}

/* Form fields (G2): helper text, textarea, checkbox, switch, multi-select, chip */

.field-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stack > .field {
    margin-bottom: 0;
}

.dialog {
    max-height: 100%;
    overflow-y: auto;
}

.field.invalid .field-label,
.field.invalid .field-helper {
    color: var(--error);
}

.field.invalid input,
.field.invalid select,
.field.invalid textarea {
    border-color: var(--error);
}

.field-helper {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.field textarea {
    padding: 12px 14px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--paper);
    color: var(--text);
    font: inherit;
    resize: vertical;
}

.field textarea.fit {
    overflow: hidden;
    resize: none;
}

.field textarea:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
    color: var(--text-disabled);
}

.check-field,
.switch-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    cursor: pointer;
}

.check-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.switch-field.disabled {
    cursor: default;
    color: var(--text-disabled);
}

.switch {
    position: relative;
    width: 34px;
    height: 14px;
    padding: 0;
    margin: 0 6px;
    border: none;
    border-radius: 7px;
    background: var(--text-disabled);
    cursor: inherit;
}

.switch::after {
    content: "";
    position: absolute;
    top: -3px;
    left: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fafafa;
    box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
    transition: left 0.15s;
}

.switch.on {
    background: var(--primary);
    opacity: 0.6;
}

.switch.on::after {
    left: 20px;
    background: var(--primary);
}

.switch.success.on {
    background: var(--success);
}

.switch.success.on::after {
    background: var(--success);
}

.multi-select {
    position: relative;
}

.multi-select-arrow {
    color: var(--text-secondary);
}

.multi-select-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1301;
    min-width: 100%;
    margin: 4px 0 0 0;
    padding: 8px 0;
    list-style: none;
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14);
}

.multi-select-menu .check-field {
    width: 100%;
    padding: 6px 16px;
}

.multi-select-menu .check-field:hover {
    background: var(--hover);
}

.chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 8px;
    border: 1px solid var(--field-border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.chip.primary {
    border-color: var(--primary);
    color: var(--primary);
}

.chip.success {
    border-color: var(--success);
    color: var(--success);
}

.chip.warning {
    border-color: var(--warning);
    color: var(--warning);
}

.chip.error {
    border-color: var(--error);
    color: var(--error);
}

button.chip {
    background: none;
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}

button.chip:hover {
    background: var(--hover);
}

.collapsible-title {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.collapsible-chevron {
    transition: transform 0.15s;
}

.collapsible-chevron.open {
    transform: rotate(90deg);
}

.circular.small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.button .circular {
    border-color: currentColor;
    border-right-color: transparent;
}

.button.info {
    color: var(--info);
}

.button.success {
    color: var(--success);
}

.button.warning {
    color: var(--warning);
}

.button.contained.info {
    background: var(--info);
    color: #ffffff;
}

.button.contained.error-fill {
    background: var(--error);
    color: #ffffff;
}

.button.contained:disabled.info,
.button.contained:disabled.error-fill {
    background: var(--divider);
    color: var(--text-disabled);
}

.icon-button:disabled {
    color: var(--text-disabled);
    cursor: default;
}

.icon-button.primary {
    color: var(--primary);
}

/* Layout helpers (G2) */

@media (min-width: 900px) {
    .grid .md-5 {
        grid-column: span 5;
    }

    .grid .md-6 {
        grid-column: span 6;
    }

    .grid .md-7 {
        grid-column: span 7;
    }
}

.row-center {
    display: flex;
    align-items: center;
}

.row-start {
    display: flex;
    align-items: flex-start;
}

.bold {
    font-weight: 700;
}

.ellipsis {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-title {
    padding: 4px 0 16px 0;
}

.page-center {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.page-narrow {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.page-header .h4 {
    margin-bottom: 8px;
}

/* The title line of an edit or detail page (title, Back, Save): it stays
   under the stage bar and top bar (.top-stack) while the page scrolls. */
.page-bar {
    position: sticky;
    top: calc(var(--stage-bar-height) + 64px);
    z-index: 900;
    margin-top: -8px;
    margin-bottom: -8px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--divider);
    background: var(--background);
    flex-wrap: nowrap;
    align-items: flex-start;
}

/* Row page bars (title and actions side by side): the title block takes the
   room left; the actions stay whole at the top right. A page bar without a
   row class stacks its children and keeps their own alignment. */
.page-bar:is(.page-header, .row-center) > :first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.page-bar:is(.page-header, .row-center) > :last-child:not(:first-child) {
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

@media (max-width: 599px) {
    .page-bar {
        flex-wrap: wrap;
    }
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 12px 14px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--paper);
    color: var(--text);
    font: inherit;
}

.search-input.small {
    width: auto;
    padding: 8px 14px;
}

.card.overflow-visible {
    overflow: visible;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 16px;
}

.filter-bar .multi-select {
    width: 100px;
    margin-bottom: 0;
}

/* A chip box in a filter bar grows with its chips. */
.filter-bar .multi-select:has(.multi-complete) {
    width: auto;
    min-width: 140px;
}

.form-actions {
    display: flex;
    flex-direction: row-reverse;
    gap: 16px;
    margin-top: 16px;
}

.card-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.card-heading > span {
    opacity: 0.8;
}

.table-wrap.sticky {
    overflow-y: auto;
}

/* A page whose last card fills the screen below the stage bar and the top
   bar, down to the page container's bottom padding; its table scrolls inside
   the card. */
.fill-page {
    height: calc(100dvh - var(--stage-bar-height) - 64px - 48px);
    min-height: 400px;
}

.fill-card {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.fill-table {
    flex: 1 1 auto;
    min-height: 0;
}

.table-wrap.sticky th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--paper);
}

.sort-label {
    display: inline-flex;
    gap: 4px;
    padding: 0;
    border: none;
    background: none;
    color: var(--text);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.drag-handle {
    display: inline-flex;
    color: var(--text-secondary);
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.drag-handle.denied {
    color: var(--text-disabled);
    cursor: default;
}

.drag-ghost {
    background: lightcoral;
    opacity: 0.6;
}

/* Courses (G2) */

.cover-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cover-tile {
    width: 80px;
    height: 80px;
    border: 1px solid lightgrey;
    border-radius: 5px;
    object-fit: cover;
    opacity: 0.4;
    cursor: pointer;
}

.cover-tile.selected {
    border-color: purple;
    opacity: 1;
}

.cover-error {
    margin: 0 3px;
    color: red;
    font-size: 14px;
}

.identity-code {
    padding: 20px;
    border-bottom: 1px solid var(--divider);
    background: rgba(25, 118, 210, 0.05);
}

.identity-code-value {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    background: var(--paper);
}

.identity-code-value .monospace {
    flex: 1;
    overflow-x: auto;
    font-weight: 500;
    white-space: nowrap;
}

.task-scroll {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

/* Course task editing: the task picker and the course list; "Expand" lays
   them over the whole window. */
.search-input.small.course-task-search {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin-top: 12px;
}

.course-task-scroll {
    height: 640px;
    margin-top: 12px;
}

.course-tasks.expanded {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--background);
}

.course-tasks.expanded .course-task-lists {
    flex: 1 1 auto;
    min-height: 0;
}

.course-tasks.expanded .course-task-lists > div {
    min-height: 0;
}

.course-tasks.expanded .course-task-lists .card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.course-tasks.expanded .course-task-scroll {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

@media (max-width: 899px) {
    .course-tasks.expanded {
        overflow-y: auto;
    }

    .course-tasks.expanded .course-task-lists {
        flex: none;
    }

    .course-tasks.expanded .course-task-scroll {
        flex: none;
        height: 70dvh;
    }
}

.task-card {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    padding: 4px 0 4px 6px;
    border: 1px solid lightgray;
    border-radius: 8px;
    background: var(--paper);
}

.task-card.drag-row {
    cursor: grab;
    user-select: none;
}

.task-card.drag-row:active {
    cursor: grabbing;
}

.task-card:hover {
    box-shadow: 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.14);
}

.task-cover {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
}

.task-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.task-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-name {
    font-size: 15px;
    font-weight: bold;
    color: inherit;
    text-decoration: none;
}

a.task-name:hover {
    color: var(--primary);
    text-decoration: underline;
}

.task-key {
    margin-left: 4px;
    color: gray;
    font-size: 12px;
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.task-category {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.8;
}

.level-bars {
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
}

.level-bars span {
    width: 14px;
    height: 6px;
    border-radius: 5px;
}

.task-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    padding: 0 4px;
}

.task-actions .icon-button {
    padding: 4px;
}

/* Categories (G2) */

.mode-options {
    display: flex;
    gap: 8px;
}

.mode-option {
    padding: 8px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: none;
    cursor: pointer;
}

.mode-option.selected {
    border-color: var(--primary);
    background: var(--hover);
}

/* Banners (G2) */

.banner-thumb {
    width: 60px;
    height: 40px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    object-fit: cover;
}

.banner-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    overflow: hidden;
    border: 1px dashed var(--divider);
    border-radius: 4px;
    background: var(--hover);
}

.banner-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* App versions (G2) */

.version-card {
    position: relative;
    height: 100%;
    color: #ffffff;
}

.version-card.android {
    background: linear-gradient(135deg, #3ddc84 0%, #2c9f5d 100%);
}

.version-card.ios {
    background: linear-gradient(135deg, #007aff 0%, #0051d5 100%);
}

.version-link {
    position: absolute;
    top: 8px;
    right: 8px;
    color: #ffffff;
}

.version-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.version-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px 16px;
}

.version-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
}

.version-icon .icon {
    width: 48px;
    height: 48px;
}

/* Task editor (G4): content form, lists, item cards, media preview, point placement, crossword grid, preview */

.content-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.content-form > .field,
.content-form .field {
    margin-bottom: 0;
}

.content-form.inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}

.content-form.inline > .field {
    flex: 1 1 160px;
}

.content-form.inline > .check-field {
    flex: 0 0 auto;
    padding-bottom: 12px;
}

.word-list-field {
    gap: 12px;
}

.list-rows,
.item-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.list-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.list-row input,
.list-row select,
.point-table input,
.point-table select,
.item-card-head select,
.task-editor .row-center > select {
    padding: 8px 10px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--paper);
    color: var(--text);
    font: inherit;
    min-width: 0;
}

.list-index {
    min-width: 24px;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-align: right;
}

.item-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--divider);
    border-radius: 12px;
    background: var(--subtle);
}

.item-card.inline {
    padding: 8px 12px;
}

.item-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.item-card.inline .item-card-head {
    align-items: flex-end;
}

.media-preview {
    max-width: 100%;
    max-height: 240px;
    align-self: flex-start;
    border-radius: 8px;
}

/* Fields side by side in equal columns that never grow past their parent. */
.field-columns {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    gap: 16px;
}

.field-columns .field {
    min-width: 0;
}

.field-columns .field input {
    width: 100%;
    min-width: 0;
}

.point-image {
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 0;
}

.point-image img {
    max-width: 100%;
    border-radius: 8px;
    cursor: crosshair;
}

.point-mark {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--error);
    border-radius: 4px;
    background: rgba(211, 47, 47, 0.15);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 2px #000000;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.point-image.dragging,
.point-image.dragging .point-mark {
    cursor: grabbing;
}

.point-mark.selected {
    border-color: var(--primary);
    background: rgba(25, 118, 210, 0.25);
    box-shadow: 0 0 0 2px var(--primary-contrast);
}

.point-mark.dot.selected {
    background: var(--primary);
}

/* Bottom-right corner of a box mark; drags its Width / Height. */
.point-handle {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 10px;
    height: 10px;
    border: 2px solid #ffffff;
    border-radius: 2px;
    background: var(--error);
    cursor: nwse-resize;
    touch-action: none;
}

.point-mark.selected .point-handle {
    background: var(--primary);
}

.point-mark.dot {
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    transform: translate(-50%, -50%);
    border-radius: 11px;
    background: var(--error);
}

.point-table th,
.point-table td {
    padding: 6px 8px;
}

.point-table input {
    width: 100%;
    max-width: 110px;
}

.point-table tbody tr {
    cursor: pointer;
}

.point-table tr.selected td {
    background: color-mix(in srgb, var(--primary) 14%, transparent);
}

.crossword-grid {
    display: grid;
    gap: 2px;
    max-width: 100%;
    overflow-x: auto;
}

.crossword-cell {
    position: relative;
    width: 32px;
    height: 32px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    background: var(--paper);
    color: var(--text);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.crossword-cell.filled {
    background: var(--hover);
}

.crossword-cell.chosen {
    border-color: var(--primary);
}

.crossword-cell.clash {
    border-color: var(--error);
    color: var(--error);
}

.crossword-number {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 9px;
    font-weight: 400;
    color: var(--text-secondary);
}

.content-refusal {
    margin-bottom: 16px;
    padding: 12px 16px;
    border: 1px solid var(--error);
    border-radius: 8px;
    color: var(--error);
    font-size: 0.875rem;
}

.json-preview {
    max-height: 480px;
    margin: 0;
    padding: 16px;
    overflow: auto;
    border: 1px solid var(--divider);
    border-radius: 8px;
    background: var(--subtle);
    font-size: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Commerce (G5): pickers, filter drawer, chips, cards, order forms */

.caption {
    font-size: 0.75rem;
    line-height: 1.66;
}

.semibold {
    font-weight: 600;
}

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

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

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

@media (min-width: 1200px) {
    .grid .lg-5 {
        grid-column: span 5;
    }

    .grid .lg-7 {
        grid-column: span 7;
    }
}

.picker-input {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 8px 0 14px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--paper);
}

.picker-input:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

.picker-input input {
    flex: 1;
    min-width: 0;
    padding: 12px 0;
    border: none;
    outline: none;
    background: none;
    color: var(--text);
    font: inherit;
}

/* The box shows the focus (:focus-within above); the input inside it does not. */
.picker-input input:focus {
    outline: none;
}

.picker-menu {
    max-height: 360px;
    overflow-y: auto;
}

.picker-option {
    padding: 8px 16px;
    cursor: pointer;
}

.picker-option:hover {
    background: var(--hover);
}

.picker-option.selected {
    background: rgba(25, 118, 210, 0.08);
}

.picker-option.active {
    background: var(--hover);
}

.picker-option.disabled,
.picker-option.denied {
    color: var(--text-disabled);
    cursor: default;
}

.picker-option.disabled:hover,
.picker-option.denied:hover {
    background: none;
}

.picker-empty {
    padding: 8px 16px;
    color: var(--text-secondary);
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: var(--overlay);
}

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1201;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    padding: 16px;
    overflow-y: auto;
    background: var(--paper);
    color: var(--text);
    box-shadow: 0 8px 10px -5px rgba(0, 0, 0, 0.2), 0 16px 24px 2px rgba(0, 0, 0, 0.14);
}

@media (min-width: 600px) {
    .drawer {
        width: 400px;
        padding: 20px;
    }
}

.drawer .field {
    margin-bottom: 0;
}

.drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

@media (min-width: 600px) {
    .drawer-actions {
        flex-direction: row;
    }
}

.chip.secondary {
    border-color: var(--secondary);
    color: var(--secondary);
}

.chip.filled {
    border-color: transparent;
    background: var(--divider);
}

.chip.filled.primary {
    background: var(--primary);
    color: var(--primary-contrast);
}

.chip.filled.success {
    background: var(--success);
    color: #ffffff;
}

.chip.filled.warning {
    background: var(--warning);
    color: #ffffff;
}

.chip.filled.error {
    background: var(--error);
    color: #ffffff;
}

.chip .icon {
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 4px;
}

.bold-chip {
    font-weight: 500;
}

.title-chip {
    height: 28px;
    font-weight: 700;
}

.medium-chip {
    height: 32px;
    padding: 0 12px;
}

.selection-bar {
    justify-content: space-between;
    min-height: 64px;
    padding: 12px;
}

.icon-button.bordered-button {
    border: 1px solid var(--primary);
    border-radius: 4px;
}

.table tbody tr.selected {
    background: rgba(25, 118, 210, 0.08);
}

.page-container-xl {
    max-width: 1536px;
    margin: 0 auto;
}

.generate-header {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 8px 0;
    border-radius: 8px;
    background: var(--paper);
    box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14);
}

.generate-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-contrast);
    box-shadow: 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.14);
}

.card.elevated {
    border-radius: 4px;
    box-shadow: 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 1px 8px 0 rgba(0, 0, 0, 0.12);
}

.card.small-radius {
    border-radius: 8px;
}

.card-title-row {
    padding: 16px;
}

.card-content.compact {
    padding: 24px 16px 16px;
}

.alert {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 2;
}

.alert.warning {
    background: rgba(237, 108, 2, 0.1);
    color: #663c00;
}

.alert.info {
    background: rgba(2, 136, 209, 0.08);
    color: var(--info);
}

body.dark-theme .alert.warning {
    color: #ffe2b7;
}

.code-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    background: var(--background);
}

.code-box.paper {
    margin-bottom: 0;
    background: var(--paper);
}

.dialog-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
}

.dialog-banner.success {
    background: var(--success);
    color: #ffffff;
}

.generate-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--divider);
}

.hash-band {
    padding: 20px;
    border-bottom: 1px solid var(--divider);
    background: rgba(25, 118, 210, 0.05);
}

.purpose-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    border-radius: 4px;
    background: var(--subtle);
}

.course-box {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(25, 118, 210, 0.1);
    border-radius: 4px;
    background: rgba(25, 118, 210, 0.05);
}

.customer-avatar {
    font-size: 1rem;
    font-weight: 400;
}

.skeleton {
    display: block;
    width: 100%;
    height: 24px;
    margin: 2px 0;
    border-radius: 4px;
    background: var(--hover);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton.circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

@keyframes skeleton-pulse {
    50% {
        opacity: 0.4;
    }
}

.sort-arrow {
    opacity: 0;
}

.sort-label:hover .sort-arrow,
.sort-label.active .sort-arrow {
    opacity: 1;
}

.icon-button.tinted-info {
    background: rgba(25, 118, 210, 0.08);
    color: var(--info);
}

.icon-button.tinted-info:hover {
    background: rgba(25, 118, 210, 0.15);
}

.code-picker {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    align-items: center;
}

@media (min-width: 900px) {
    .code-picker {
        grid-template-columns: 7.5fr 2.5fr 1fr;
    }
}

.code-picker .field {
    margin-bottom: 0;
}

.code-picker .code-add {
    width: 100%;
    margin-top: 22px;
}

.item-code {
    margin-bottom: 16px;
    box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 2px 2px 0 rgba(0, 0, 0, 0.14);
}

.radio-list {
    margin: 0;
    padding: 0;
    border: none;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}

.radio-option input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--primary);
}

.order-summary {
    position: sticky;
    top: 16px;
    padding: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.totals-box {
    margin-top: 32px;
    padding: 16px;
    border-radius: 8px;
    background: #f8f9fa;
}

body.dark-theme .totals-box {
    background: var(--subtle);
}

.totals-box .summary-row {
    justify-content: flex-end;
    gap: 24px;
}

.totals-box .summary-row > span:last-child {
    min-width: 30%;
    text-align: right;
}

.primary-amount {
    color: var(--text);
}

.field.invalid .picker-input {
    border-color: var(--error);
}

/* Marketing (G6): post cards and form, image picker, class posts, learning report */

.button.outlined.inherit {
    border-color: var(--field-border);
    color: var(--text);
}

.avatar.rounded {
    border-radius: 4px;
}

.avatar.rounded img,
.small-avatar img,
.chip-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.small-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary);
    font-size: 14px;
}

.chip-avatar {
    width: 18px;
    height: 18px;
    margin: 0 4px 0 -4px;
    font-size: 0.75rem;
}

.posts-title {
    padding: 4px 0;
    font-weight: 500;
}

.grid.post-grid {
    gap: 16px;
}

@media (max-width: 599px) {
    .grid.post-grid {
        justify-items: center;
    }
}

.post-card,
.class-card {
    max-width: 450px;
    width: 100%;
}

.post-card {
    min-height: 235px;
    border-radius: 4px;
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
}

.post-card-author {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.post-card-content {
    padding: 0 16px 24px;
}

.post-card-content .h6 {
    margin-bottom: 0.35em;
}

.post-card-content p {
    margin: 0;
}

.menu-paper.post-menu {
    width: auto;
    min-width: 140px;
}

.lazy-status {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
    text-align: center;
}

@media (min-width: 900px) {
    .grid .md-7 {
        grid-column: span 7;
    }

    .grid .md-5 {
        grid-column: span 5;
    }
}

.grid.post-form-grid {
    gap: 0 24px;
}

.post-media {
    margin-top: 28px;
}

.post-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
}

.post-actions .button {
    min-width: 120px;
}

.post-actions .button[type="submit"] {
    min-width: 140px;
}

@media (max-width: 599px) {
    .post-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
}

.image-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    user-select: none;
}

.image-add,
.image-tile {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
}

.image-add {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--divider);
    cursor: pointer;
}

.image-add:hover {
    background: var(--hover);
}

.image-tile {
    box-shadow: 0 2px 1px -1px rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.14), 0 1px 3px 0 rgba(0, 0, 0, 0.12);
    cursor: pointer;
}

.image-tile img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-tile-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    display: inline-flex;
    padding: 2px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
}

.image-tile:hover .image-tile-remove {
    opacity: 1;
}

.image-tile-remove:hover {
    background: rgba(0, 0, 0, 0.75);
}

/* v-tip (ui/tooltip.js) */
.tooltip {
    position: fixed;
    z-index: 1500;
    display: none;
    max-width: 280px;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(97, 97, 97, 0.92);
    color: #ffffff;
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
}

.image-preview-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: var(--overlay);
}

.image-preview {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1000px;
    max-height: 100%;
    border-radius: 8px;
}

.image-preview-title {
    display: flex;
    align-items: center;
    padding: 12px 12px 12px 24px;
}

.image-preview-title .icon-button {
    margin-left: auto;
}

.image-preview-body {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    justify-content: center;
    padding: 16px 24px;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
    background: var(--subtle);
}

.image-preview-body img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: 4px;
}

.image-preview-details {
    padding: 16px 24px;
    overflow-y: auto;
}

.image-preview-url {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
}

.image-preview-url span {
    overflow-wrap: anywhere;
}

.previewable {
    cursor: zoom-in;
}

.video-preview {
    aspect-ratio: 16 / 9;
}

.video-preview video,
.video-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.class-card-media {
    height: 140px;
    background-position: center;
    background-size: cover;
}

.class-card-content {
    padding: 16px;
}

.class-card-content .h5 {
    margin-bottom: 0.35em;
}

.class-card-content p {
    margin: 0;
}

.class-card-actions {
    display: flex;
    gap: 8px;
    padding: 8px;
}

.stack.class-form {
    gap: 32px;
    padding: 8px 8px 0;
}

.class-form .field {
    margin-bottom: 0;
}

.cover-box {
    position: relative;
    padding: 8px;
    border: 1px solid var(--divider);
    border-radius: 12px;
    background: var(--paper);
    overflow: hidden;
}

.cover-box img {
    display: block;
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.cover-box-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
}

.cover-box-button {
    background: rgba(255, 255, 255, 0.9);
    color: var(--error);
    cursor: pointer;
}

.cover-box-button:hover {
    background: #ffffff;
}

.cover-drop {
    padding: 32px;
    border: 2px dashed var(--divider);
    background: var(--paper);
    text-align: center;
    transition: all 0.3s ease;
}

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

.cover-drop-icon.icon {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.cover-drop .h6 {
    margin-bottom: 0.35em;
}

.cover-drop p {
    margin: 0 0 16px;
}

.button.cover-drop-button {
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: none;
}

.dialog-title.delete-class-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 -24px 8px;
    color: var(--error);
    font-weight: 600;
}

.alert.error {
    background: rgba(211, 47, 47, 0.08);
    color: var(--error);
}

.report-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 0;
}

.card.report-card {
    padding: 24px;
    overflow: visible;
}

.report-card .field {
    margin-bottom: 0;
}

.report-heading {
    margin: 0 0 12px;
    font-weight: 500;
}

.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--divider);
}

.alert.report-info {
    margin-top: 24px;
    line-height: 1.5;
    padding: 8px 16px;
}

.report-info p {
    margin: 0 0 4px;
}

.report-info ul {
    margin: 0;
    padding-left: 20px;
}

.picker-input.multi-complete {
    flex-wrap: wrap;
    padding: 4px 8px 4px 14px;
}

.picker-input.multi-complete input {
    min-width: 30px;
    padding: 8px 0;
}

.picker-input.multi-complete.disabled {
    opacity: 0.6;
}

.chip.multi-chip {
    gap: 4px;
    border: none;
    border-radius: 12px;
    background: var(--hover);
    padding: 0 4px 0 8px;
}

.multi-chip-remove {
    display: inline-flex;
    padding: 0;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
}

.course-option-cover {
    width: 48px;
    height: 32px;
    margin-right: 12px;
    object-fit: cover;
    border-radius: 4px;
}

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

@media (min-width: 600px) {
    .grid .sm-4 {
        grid-column: span 4;
    }

    .grid .sm-8 {
        grid-column: span 8;
    }
}

.wide-dialog .dialog {
    max-width: 900px;
}

.chip.filled.info {
    background: var(--info);
    color: #ffffff;
}

.chip.campaign-chip {
    border-radius: 5px;
}

.chip.danger-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    height: auto;
    padding: 16px 20px;
    border-radius: 8px;
    white-space: normal;
}

.chip.danger-banner .danger-banner-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.chip.danger-banner .danger-banner-title .icon {
    width: 2rem;
    height: 2rem;
}

.chip.danger-banner .danger-banner-text {
    font-size: 1rem;
}

.chip.danger-banner a {
    color: inherit;
    font-weight: 600;
}

.icon.spinning {
    animation: spin 2s linear infinite;
}

.campaign-filters,
.recipient-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
}

.campaign-filters {
    padding: 12px;
}

.recipient-filters {
    gap: 12px;
    margin-bottom: 16px;
}

.search-field {
    display: inline-flex;
    flex: 0 1 280px;
    align-items: center;
    gap: 8px;
    min-width: 280px;
    padding: 0 14px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--paper);
}

.recipient-filters .search-field {
    flex: 1 1 auto;
}

.search-field input {
    flex: 1;
    min-width: 0;
    padding: 8.5px 0;
    border: none;
    background: none;
    color: var(--text);
    font: inherit;
    outline: none;
}

.search-field:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

.campaign-status-select {
    min-width: 160px;
    margin-bottom: 0;
}

.recipient-status {
    min-width: 180px;
    margin-bottom: 0;
}

.recipient-status select {
    padding: 8.5px 14px;
}

.table.compact th,
.table.compact td {
    padding: 6px 16px;
}

.table.striped tbody tr:nth-of-type(odd) {
    background: var(--hover);
}

/* The row under the pointer: a primary tint, stronger than the stripes. */
.table tbody tr:hover,
.table.striped tbody tr:hover {
    background: color-mix(in srgb, var(--primary) 18%, transparent);
}

.progress-chips {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.preview-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 8px;
}

.preview-toggle .switch-field {
    margin: 0;
}

.preview-frame {
    overflow: clip;
    border: 1px solid var(--divider);
    border-radius: 4px;
    background: #f0f0f0;
}

.preview-frame-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #e8e8e8;
}

.preview-frame-lights {
    display: inline-flex;
    gap: 4px;
}

.preview-frame-lights span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.preview-frame-address {
    flex: 1;
    padding: 2px 12px;
    border: 1px solid var(--divider);
    border-radius: 4px;
    background: #ffffff;
}

.preview-frame-body {
    display: flex;
    justify-content: center;
    padding: 16px 0;
}

.preview-frame-body.scroll {
    max-height: 480px;
    overflow-y: auto;
}

.email-preview {
    width: 100%;
    overflow: hidden;
    border-radius: 4px;
    background: #ffffff;
    color: rgba(0, 0, 0, 0.87);
    transition: max-width 0.2s;
}

.email-preview .secondary-text {
    color: rgba(0, 0, 0, 0.6);
}

.email-preview-banner {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
}

.email-preview-content {
    padding: 28px 32px 24px;
}

.email-preview-title {
    margin-bottom: 12px;
    line-height: 1.3;
}

.email-preview-subtitle {
    margin-bottom: 24px;
    line-height: 1.6;
}

.email-preview-button {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 4px;
    background: #111111;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
}

.email-preview-footer {
    padding: 20px 32px;
    background: #fafafa;
}

.email-preview-mail {
    display: block;
    margin-top: 4px;
    color: #1976d2;
    text-decoration: underline;
}

.stepper {
    display: flex;
    margin: 0;
    padding: 0 24px 8px;
    list-style: none;
}

.stepper-step {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.stepper-step + .stepper-step::before {
    content: "";
    position: absolute;
    top: 12px;
    right: calc(50% + 20px);
    left: calc(-50% + 20px);
    border-top: 1px solid var(--field-border);
}

.stepper-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--text-disabled);
    color: #ffffff;
    font-size: 0.75rem;
}

.stepper-step.active .stepper-icon {
    background: var(--primary);
}

.stepper-step.done .stepper-icon {
    background: none;
    color: var(--primary);
}

.stepper-step.done .stepper-icon .icon {
    width: 24px;
    height: 24px;
}

.stepper-label {
    color: var(--text-secondary);
}

.stepper-step.active .stepper-label,
.stepper-step.done .stepper-label {
    color: var(--text);
    font-weight: 500;
}

.campaign-create-page {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 32px;
}

.card.campaign-wizard {
    overflow: visible;
    padding-top: 16px;
}

.wizard-content {
    padding: 16px 24px;
    border-top: 1px solid var(--divider);
    border-bottom: 1px solid var(--divider);
    color: var(--text);
}

.wizard-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px;
}

.stack.wizard-fields {
    gap: 20px;
}

.avatar.recipient-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary);
    font-size: 12px;
}

.campaign-info p {
    margin: 0;
}

.campaign-info.grid {
    gap: 12px;
}

.template-frame {
    width: 100%;
    min-height: 360px;
    border: 1px solid var(--divider);
    border-radius: 4px;
}

.template-text {
    margin: 0;
    white-space: pre-wrap;
}

/* AI demo pages (js/pages/ai-demo): the page fills the window below the
   stage bar and the top bar; the transcript scrolls above the input bar. */

.ai-demo-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - var(--stage-bar-height) - 112px);
    min-height: 480px;
}

.ai-demo-tools {
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.ai-demo-tools .field input,
.ai-demo-tools .field select,
.ai-demo-tools > .button,
.ai-demo-tools > .check-field {
    height: 48px;
}

.ai-demo-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ai-task-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-task-group .field select {
    min-width: 180px;
}

.ai-demo-bar .field select,
.ai-demo-bar .button {
    height: 40px;
}

.field.inline {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.field.inline .field-label {
    margin: 0;
    white-space: nowrap;
}

.field.inline select {
    padding-top: 8px;
    padding-bottom: 8px;
}

.field.inline .picker-input {
    min-height: 0;
}

.field.inline .picker-input input {
    padding: 8px 0;
}

.ai-demo-tools .field {
    min-width: 200px;
    margin-bottom: 0;
}

.ai-lang-group {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ai-lang-group .field select {
    width: 132px;
}

.ai-lookup .field:first-child {
    min-width: 280px;
}

/* Shown for as long as live mode is on: the session, not the moment. The mic
   button's pulse is what tracks capture. */
.ai-live {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    color: #e03131;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.ai-live-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e03131;
    animation: ai-live-dot 1.4s ease-out infinite;
}

@keyframes ai-live-dot {
    0% {
        box-shadow: 0 0 0 0 rgba(224, 49, 49, 0.7);
        opacity: 1;
    }

    70% {
        box-shadow: 0 0 0 8px rgba(224, 49, 49, 0);
        opacity: 0.75;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(224, 49, 49, 0);
        opacity: 1;
    }
}

body.dark-theme .ai-live {
    color: #ff6b6b;
}

body.dark-theme .ai-live-dot {
    background: #ff6b6b;
}

/* The media of a task tried in the AI demo chat (VSTEP Speaking Part 3 AI). */
.ai-task-media {
    flex: 0 0 auto;
    max-width: 100%;
    max-height: 200px;
    align-self: flex-start;
    border-radius: 8px;
    object-fit: contain;
}

/* <dialogue-view>: fills the rest of its flex column page. */
.dialogue-view {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.ai-chat {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

/* The mic button's rings reach 18px beyond it. */
.ai-chat.card {
    overflow: visible;
}

.ai-chat-log {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
}

.ai-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.5;
    word-break: break-word;
}

/* A bubble fades and slides in from its own side when it first appears. */
.ai-message.teacher {
    align-self: flex-start;
    background: var(--hover);
    animation: ai-slide-left 0.5s ease-out;
}

.ai-message.learner {
    align-self: flex-end;
    background: var(--primary);
    color: var(--primary-contrast);
    animation: ai-slide-right 0.5s ease-out;
}

@keyframes ai-slide-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes ai-slide-right {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ai-message.trace {
    max-width: 100%;
    border: 1px dashed var(--divider);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.ai-message-role {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.7;
}

.ai-message-text {
    white-space: pre-wrap;
}

/* <dialogue-view>: one card whose top edge is a row of folder tabs; the
   active tab joins the panel below it. */
/* Beats .ai-chat.card's overflow: visible so the tab bar is clipped to the
   card's rounded corners; 12px corners in proportion to the 8px tab corners. */
.ai-chat.card.dialogue-window {
    overflow: hidden;
    border-radius: 12px;
}

/* A 52px bar rounded like the card's top edge, 16px gutter left and 24px
   right. Folder tabs 44px high rise from its bottom edge 8px below its top;
   their labels sit 8px above their centre, on the bar's mid-line with the Play
   all button. The active tab covers the bar's bottom border to join the
   panel. */
.dialogue-tabs {
    box-sizing: border-box;
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
    gap: 2px;
    height: 52px;
    padding: 8px 24px 0 16px;
    border-bottom: 1px solid var(--divider);
    border-radius: 12px 12px 0 0;
    background: var(--hover);
}

.dialogue-tab {
    display: inline-flex;
    align-items: center;
    margin-bottom: -1px;
    padding: 0 16px 8px;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}

.dialogue-tab:hover:not(:disabled) {
    color: var(--text);
}

.dialogue-tab.active {
    border-color: var(--divider);
    background: var(--paper);
    color: var(--primary);
}

.dialogue-tab:disabled {
    cursor: default;
    opacity: 0.6;
}

.dialogue-tabs-fill {
    flex: 1 1 auto;
}

/* 30px high, centred on the bar's mid-line (the 8px top padding is undone). */
.dialogue-tabs .button {
    align-self: center;
    margin: -8px 0 0;
    padding: 4px 12px;
    line-height: 1.5;
}

.dialogue-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

/* Bubbles scrolled up fade out over the 24px under the tab bar; unscrolled,
   that band is the log's own top padding, so nothing is faded. */
.dialogue-panel .ai-chat-log {
    padding-top: 24px;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24px);
    mask-image: linear-gradient(to bottom, transparent 0, #000 24px);
}

/* The entry "Play all" is playing. */
.ai-message.playing {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Player of a dialogue entry's audio; inherits the bubble's text colour. */
/* Wide enough for a readable waveform under a short text. */
.dialogue-audio {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 480px;
    max-width: 100%;
    margin-top: 4px;
}

.dialogue-audio .icon-button {
    color: inherit;
}

.dialogue-audio .circular {
    width: 18px;
    height: 18px;
    border-color: currentColor;
    border-right-color: transparent;
}

/* Colour the played part of the waveform fills with, left to right; on the
   learner's primary bubble a contrasting one. Read by ui/dialogue-audio.js. */
.dialogue-audio {
    --wave-progress: var(--primary);
}

.ai-message.learner .dialogue-audio {
    --wave-progress: var(--wave-learner-progress);
}

/* wavesurfer.js draws into this box; 36px high (WAVE_HEIGHT). Focused on
   click so Space plays and pauses. */
.dialogue-audio-wave {
    flex: 1 1 auto;
    min-width: 80px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
}

.dialogue-audio-wave:focus,
.dialogue-audio-wave:focus-visible {
    outline: none;
}

/* Under the text of an entry saved without audio. */
.ai-message .dialogue-audio-none {
    margin-top: 2px;
    font-size: 0.6875rem;
    font-style: italic;
    font-weight: 400;
    line-height: 1.4;
    opacity: 0.5;
}

.dialogue-audio-time,
.dialogue-audio-error {
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.8;
}

.ai-json-link {
    align-self: flex-end;
    font-size: 0.8125rem;
}

.ai-typing {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: ai-typing 1.2s infinite ease-in-out;
}

.ai-message.learner .ai-typing span {
    background: var(--primary-contrast);
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ai-typing {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1);
    }
}

.ai-placeholder {
    margin: auto;
    text-align: center;
}

.ai-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--divider);
}

.ai-input {
    flex: 1 1 auto;
    min-height: 40px;
    max-height: 200px;
    padding: 8px 12px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--paper);
    color: var(--text);
    font: inherit;
    resize: vertical;
}

.ai-input:focus {
    outline: 2px solid var(--primary);
    outline-offset: -1px;
}

/* Live microphone switch: dim while off; lit blue while a live session is on
   but not capturing (the agent is thinking or speaking); green with radiating
   rings while audio is being sent. */
.ai-mic {
    border: 1px solid var(--divider);
    background: var(--hover);
    opacity: 0.6;
    transition: opacity 0.2s, background-color 0.2s, border-color 0.2s;
}

.ai-mic:hover {
    opacity: 0.85;
}

.ai-mic.live {
    border-color: #007bff;
    background: #e7f5ff;
    opacity: 1;
}

.ai-mic.live .icon {
    fill: #007bff;
}

.ai-mic.listening {
    border-color: #2f9e44;
    background: #ebfbee;
    animation: ai-mic-pulse 1.3s ease-out infinite;
}

.ai-mic.listening .icon {
    fill: #2f9e44;
}

@keyframes ai-mic-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(47, 158, 68, 0.7), 0 0 0 0 rgba(47, 158, 68, 0.4);
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(47, 158, 68, 0), 0 0 0 18px rgba(47, 158, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(47, 158, 68, 0), 0 0 0 0 rgba(47, 158, 68, 0);
        transform: scale(1);
    }
}

body.dark-theme .ai-mic.live {
    border-color: #4dabf7;
    background: #10324f;
}

body.dark-theme .ai-mic.live .icon {
    fill: #4dabf7;
}

body.dark-theme .ai-mic.listening {
    border-color: #51cf66;
    background: #10331a;
}

body.dark-theme .ai-mic.listening .icon {
    fill: #51cf66;
}

.ai-input.listening {
    border-color: #2f9e44;
}

.ai-input.listening::placeholder {
    color: #2f9e44;
    font-style: italic;
    opacity: 1;
}

body.dark-theme .ai-input.listening {
    border-color: #51cf66;
}

body.dark-theme .ai-input.listening::placeholder {
    color: #69db7c;
}

@media (prefers-reduced-motion: reduce) {
    .ai-live-dot,
    .ai-message.teacher,
    .ai-message.learner {
        animation: none;
    }

    .ai-mic.listening {
        animation: none;
        box-shadow: 0 0 0 4px rgba(47, 158, 68, 0.35);
    }
}

.ai-split {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(280px, 2fr) 3fr;
    gap: 16px;
    min-height: 0;
}

.ai-prompt-pane {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 16px;
}

.ai-prompt-field {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 0;
}

.ai-prompt-field textarea {
    flex: 1 1 auto;
    height: 100%;
    min-height: 240px;
    font-family: monospace;
    resize: none;
}

.ai-json {
    max-height: 60vh;
    margin: 0;
    overflow: auto;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-share-url {
    word-break: break-all;
}

@media (max-width: 899px) {
    .ai-demo-page {
        height: auto;
    }

    .ai-chat {
        min-height: 60vh;
    }

    .ai-split {
        grid-template-columns: 1fr;
    }

    .ai-message {
        max-width: 90%;
    }
}

/* One height for every one-line control on every page: text, number and date
   boxes, selects, typed dropdowns (.picker-input) and search boxes are
   --control-height tall. Last in the file so it wins over each control's own
   padding. A chip box (.multi-complete) grows from that height as its chips
   wrap. */
:is(.field input:not([type=checkbox], [type=radio], [type=file], [type=range]), .field select, .search-input,
    .search-field) {
    height: var(--control-height);
    min-height: var(--control-height);
    padding-top: 0;
    padding-bottom: 0;
}

.field .picker-input {
    min-height: var(--control-height);
    padding-top: 0;
    padding-bottom: 0;
}

.field .picker-input:not(.multi-complete) {
    height: var(--control-height);
}

.field .picker-input.multi-complete {
    padding-top: 2px;
    padding-bottom: 2px;
}

/* The input inside a typed dropdown or a search box fills it; the box draws
   the border and the height. */
.field .picker-input input:not([type=checkbox]),
.search-field input:not([type=checkbox]) {
    height: calc(var(--control-height) - 2px);
    min-height: 0;
    padding: 0;
}

:is(.filter-bar, .toolbar, .campaign-filters, .recipient-filters) .field {
    margin-bottom: 0;
}

/* Data insights tables: a caption naming the table, roomy columns, labels on one line,
   numbers right-aligned in equal-width digits. */
.insights-table caption {
    caption-side: top;
    padding: 12px 16px;
    text-align: left;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.insights-table th,
.insights-table td {
    padding: 10px 24px;
    white-space: nowrap;
}

.insights-table td.label {
    font-weight: 600;
}

.insights-table .number {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Color square of a σ-band before its label (the band's chart color). */
.insights-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 2px;
    vertical-align: baseline;
}

/* Compact forms (data insights parameters, store purchases cards): small fields in as many
   columns as fit, the name field and its Add button on one line. */
.insights-form,
.compact-form {
    padding: 12px 16px;
}

.insights-fields,
.compact-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px 12px;
}

.insights-form .field,
.compact-form .field {
    gap: 2px;
    margin-bottom: 0;
}

.insights-form .field-label,
.compact-form .field-label {
    font-size: 0.75rem;
}

.insights-form .field input,
.insights-form .field select,
.compact-form .field input,
.compact-form .field select {
    padding: 6px 10px;
    font-size: 0.875rem;
}

.insights-form .field select,
.compact-form .field select {
    padding-right: 32px;
}

/* A field of a compact grid that takes two columns (long select options). */
.compact-fields .wide {
    grid-column: span 2;
}

.name-list-add {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
}

.name-list-add .search-field {
    flex: 0 1 240px;
    min-width: 0;
    padding: 0 10px;
}

.name-list-add .search-field input {
    padding: 6px 0;
    font-size: 0.875rem;
}

/* Settings > Route checks: a card per check flow with its title on the
   Eduling primary bar (eduling-client app_colors.dart), its routes in a
   two-column grid (one column below 900px); method chips, paths and status
   chips in colour. */
.route-flow {
    border-left: 4px solid #49c2e4;
}

.route-flow > summary {
    padding: 10px 24px;
    background: #49c2e4;
    color: #0b2a33;
    font-weight: 600;
    cursor: pointer;
}

.route-flow-body {
    padding: 16px 24px 24px 24px;
}

/* Stored values stay under the top bars while the flows scroll; long
   value lists scroll inside the card. The route search sits on the right
   inside the card and goes below the values on phones. */
.route-stored {
    position: sticky;
    top: 64px;
    z-index: 10;
    background: var(--paper);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.dashboard:has(.stage-bar) .route-stored {
    top: calc(var(--stage-bar-height) + 64px);
}

.route-stored-body {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 24px;
}

.route-stored-values {
    flex: 1 1 360px;
    gap: 8px;
    min-width: 0;
}

.route-search {
    display: flex;
    align-self: center;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
}

.route-search .search-field {
    flex: 0 1 490px;
    min-width: 0;
}

.route-matches {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.route-match {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 8px 12px;
    border: 1px solid var(--divider);
    border-radius: 8px;
    background: var(--paper);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.route-match:hover,
.route-match:focus-visible {
    border-color: #49c2e4;
    outline: none;
}

/* A route panel opened from the search, highlighted for a moment. */
.route-panel.route-found {
    border-color: #49c2e4;
    box-shadow: 0 0 0 2px #49c2e4;
    transition: box-shadow 0.3s;
}

.route-stored > .route-flow-body {
    max-height: 35vh;
    padding: 12px 24px 16px 24px;
    overflow-y: auto;
}

.route-steps {
    margin: 0 0 12px 0;
    padding-left: 20px;
}

.route-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

@media (max-width: 899px) {
    .route-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.route-panel {
    min-width: 0;
    padding: 8px 12px;
    border: 1px solid var(--divider);
    border-radius: 8px;
}

.route-panel > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    cursor: pointer;
}

.route-call {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    min-width: 0;
}

.route-method,
.route-status {
    padding: 1px 6px;
    border: 1px solid currentColor;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.route-method-get,
.route-status-ok {
    color: var(--success);
}

.route-method-post {
    color: var(--primary);
}

.route-method-put,
.route-method-patch,
.route-status-refused {
    color: var(--warning);
}

.route-method-delete,
.route-status-failed {
    color: var(--error);
}

.route-status-redirect {
    color: var(--info);
}

.route-path {
    color: var(--info);
    overflow-wrap: anywhere;
}

.route-inputs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.route-input {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.route-input input,
.route-body {
    padding: 6px 10px;
    border: 1px solid var(--field-border);
    border-radius: 8px;
    background: var(--paper);
    color: var(--text);
    font-size: 0.875rem;
}

.route-input input {
    width: 160px;
}

.route-body {
    box-sizing: border-box;
    width: 100%;
    resize: vertical;
    field-sizing: content;
    color: var(--primary);
}

.route-output {
    max-height: 300px;
    padding: 8px;
    color: var(--success);
}
