/* Global styles shared by every host. Colours come from IndexedTheme via MudBlazor's --mud-palette-* variables. */

/* Nanum Myeongjo Bold, Latin subset (SIL OFL 1.1, see fonts/OFL.txt). Used for the wordmark only. */
@font-face {
    font-family: 'Nanum Myeongjo';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('fonts/nanum-myeongjo-700-latin.woff2') format('woff2');
}

:root {
    --idx-accent: var(--mud-palette-primary); /* Gold in the dark theme, black in the light theme. */
    --idx-wordmark: #8EC9F0; /* The app bar is dark in both themes, so the wordmark keeps one blue. */
    --idx-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Browser surfaces */

::selection {
    background: rgba(201, 165, 75, 0.35);
    color: inherit;
}

html {
    scrollbar-color: var(--mud-palette-lines-inputs) transparent;
    caret-color: var(--idx-accent);
}

:focus-visible {
    outline: 2px solid var(--idx-accent);
    outline-offset: 2px;
}

.idx-numeric {
    font-variant-numeric: tabular-nums;
}

/* App frame */

.idx-appbar.mud-appbar {
    /* The collar band: a gold hairline where the black coat meets the page. */
    border-bottom: 1px solid var(--idx-accent);
}

.idx-wordmark {
    font-family: 'Nanum Myeongjo', 'Segoe UI', serif;
    font-weight: 700;
    /* 1.75rem (28px), up from 1.375rem with the taller top bar (the developer's request, 12 November 2026). */
    font-size: 1.75rem;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--idx-wordmark);
    text-decoration: none;
    padding: 0.25rem 0.375rem;
    border-radius: 4px;
}

.idx-wordmark:hover {
    color: #B5DCF6;
}

/* Content spans the whole window, so the home screen's columns can sit against the left and right edges
   (the developer's choice on 31 October 2026). Pages that need a narrower measure set their own max-width. */
.idx-main.mud-container {
    max-width: none;
    padding: 2rem clamp(1rem, 3vw, 4rem) 3rem;
}

/* Light theme: the dark ceiling casts a soft shadow onto the room instead of a gold seam. */
.idx-light .idx-appbar.mud-appbar {
    border-bottom: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.28);
}

.idx-light ::selection {
    background: rgba(22, 22, 22, 0.18);
}

/* Deck list */

.deck-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.deck-skeleton {
    border-radius: 12px;
}

/* A deck tile: the collar band along the top, the clasp (due count) hanging from it, and a gold glow
   like the light around The Index's emblem. The glow brightens on hover and keyboard focus. */
.deck-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 184px;
    padding: 2rem 1.25rem 0.75rem;
    background: var(--mud-palette-surface);
    border: 1px solid rgba(201, 165, 75, 0.55);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(201, 165, 75, 0.18), inset 0 0 12px rgba(201, 165, 75, 0.05);
    transition: border-color 200ms var(--idx-ease-out), box-shadow 200ms var(--idx-ease-out);
}

/* The collar band: a double gold trim set just below the top edge, like the uniforms' collar. */
.deck-card::before,
.deck-empty::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 3px;
    border-top: 1px solid var(--idx-accent);
    border-bottom: 1px solid var(--idx-accent);
    opacity: 0.85;
}

.deck-card:hover,
.deck-card:focus-within {
    border-color: var(--idx-accent);
    box-shadow: 0 0 18px rgba(201, 165, 75, 0.38), inset 0 0 16px rgba(201, 165, 75, 0.08);
}

/* The clasp: a small gold plate fastened over the collar band, shown only when cards are due. */
.deck-clasp {
    position: absolute;
    top: 1.5px; /* Centred on the band, which runs from 10px to 13px. */
    right: 1.25rem;
    height: 20px;
    padding: 0 0.5rem;
    border-radius: 4px;
    background: var(--idx-accent);
    color: var(--mud-palette-primary-text);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 20px;
    white-space: nowrap;
}

.deck-card-body {
    flex: 1;
    min-width: 0;
}

.deck-name {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    overflow-wrap: anywhere;
}

.deck-name:hover {
    color: var(--idx-accent);
}

.deck-description {
    margin: 0.375rem 0 0;
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.deck-counts {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.deck-new {
    color: var(--mud-palette-info);
}

.deck-card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-left: -0.25rem;
}

/* In the light theme the glow is black: a soft dark halo, like the shadows pooling in the archive room. */
.idx-light .deck-card {
    border-color: var(--idx-accent);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.20), inset 0 0 12px rgba(0, 0, 0, 0.04);
}

/* Light theme: every container on the white ground gets a solid black outline. */
.idx-light .deck-empty,
.idx-light .deck-panel,
.idx-light .study-root .study-card { /* .study-root outranks StudyPage's scoped rule, which loads later. */
    border-color: var(--idx-accent);
}

.idx-light .deck-card:hover,
.idx-light .deck-card:focus-within {
    border-color: var(--idx-accent);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.34), inset 0 0 16px rgba(0, 0, 0, 0.06);
}

/* First run: one tile that explains what a deck is. */
.deck-empty {
    position: relative;
    max-width: 560px;
    padding: 2.5rem 1.75rem 1.75rem;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    overflow: hidden;
}


@media (prefers-reduced-motion: reduce) {
    .deck-card {
        transition: none;
    }
}

/* Home screen (docs/redesign-plan.md): greeting, decks on the left, exams and the review calendar on the right. */

/* Both classes in the selector: .idx-page-title (further down) sets margin: 0 and would otherwise win. */
.home-greeting.idx-page-title {
    margin-bottom: 1.25rem; /* 20px, the developer's choice */
}

/* Light blue in the dark theme, a darker blue in the light theme so it stays readable on white. */
.home-name {
    color: var(--mud-palette-info);
}

/* The columns keep to their own widths and hold to the left and right edges: the wider the window, the more space
   between them, not wider columns. */
.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 40rem) minmax(0, 54rem);
    justify-content: space-between;
    column-gap: 3rem;
    align-items: start;
}

.home-decks-title,
.home-section-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--mud-palette-text-primary);
}

/* Home's decks: a window onto the list, two tiles across and three rows tall (the developer's request, 18 November
   2026); more decks scroll inside it. Every tile has the same height, so the window shows whole rows. Its padding
   keeps the tiles' glow from being cut off at the edges; the negative margin keeps the tiles lined up with the
   heading. A swipe at either end of the list carries on to the page (no overscroll-behavior), so the list never traps
   a thumb on a phone. */
.home-decks {
    container-type: inline-size;
    --deck-tile-h: 232px;
    --deck-gap: 1.25rem;
    --deck-rows: 3;
}

.home-decks .deck-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: var(--deck-tile-h);
    max-height: calc(var(--deck-rows) * var(--deck-tile-h) + (var(--deck-rows) - 1) * var(--deck-gap) + 1.5rem);
    margin: -0.75rem;
    padding: 0.75rem;
    overflow-y: auto;
    scroll-snap-type: y proximity;
    scroll-padding-block: 0.75rem;
    scrollbar-width: thin;
    /* The accent at 55%: gold by night, black by day, like the tiles' borders. */
    scrollbar-color: color-mix(in srgb, var(--idx-accent) 55%, transparent) transparent;
}

.home-decks .deck-card {
    min-height: 0;
    scroll-snap-align: start;
}

/* Long deck names wrap to two lines at most, so every tile fits its row (the full name is in the link's tooltip and
   on the deck page). */
.home-decks .deck-name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Touch screens' 44px buttons make the tiles a little taller. */
@media (pointer: coarse) {
    .home-decks {
        --deck-tile-h: 240px;
    }
}

/* Phones: two tiles across leave each about 160px, too narrow for the description and two buttons. Those tiles keep
   the name (a link to the deck, where its cards are edited), the counts and Study; "Edit cards" goes the same place
   as the name. Three rows when the screen is tall enough for them. */
@container (max-width: 459.98px) {
    .home-decks .deck-grid {
        --deck-tile-h: 176px;
        gap: var(--deck-gap) 0.75rem;
    }

    .home-decks .deck-card {
        padding-inline: 0.875rem;
    }

    .home-decks .deck-description,
    .home-decks .deck-edit {
        display: none;
    }

    .home-decks .deck-name {
        font-size: 1rem;
    }

    @media (pointer: coarse) {
        .home-decks .deck-grid {
            --deck-tile-h: 184px;
        }
    }

    /* Small phones (screens under 740px tall): one tile at a time, one across and one tall (the developer's choice,
       18 November 2026); more decks scroll inside the box. The tile has the whole width, so it shows everything a
       wide tile does: the description, a full-size name and "Edit cards". */
    @media (max-height: 739.98px) {
        .home-decks .deck-grid {
            --deck-rows: 1;
            --deck-tile-h: 232px;
            grid-template-columns: minmax(0, 1fr);
        }

        .home-decks .deck-card {
            padding-inline: 1.25rem;
        }

        .home-decks .deck-description {
            display: -webkit-box;
        }

        .home-decks .deck-edit {
            display: inline-flex;
        }

        .home-decks .deck-name {
            font-size: 1.125rem;
        }

        @media (pointer: coarse) {
            .home-decks .deck-grid {
                --deck-tile-h: 240px;
            }
        }
    }
}

.home-side {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

/* The right-hand headings sit centred over their boxes, as in the mockup; the action keeps to the right. */
.home-section-head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.875rem;
}

.home-section-title {
    grid-column: 2;
    text-align: center;
}

.home-section-action {
    grid-column: 3;
    justify-self: end;
    white-space: nowrap;
}

/* Narrow windows (phones, tablets, small PC windows): one column, with generous space between the stacked
   sections, in the order Upcoming Exams, Decks, then the calendar (the developer's choice, 17 November 2026). The
   side column's wrapper steps aside (display: contents) so its two sections can sit either side of the decks. */
@media (max-width: 1100px) {
    .home-grid {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 4rem;
    }

    .home-side {
        display: contents;
    }

    .home-side > :first-child {
        order: -1;
    }

    .home-side > :last-child {
        order: 1;
    }
}

/* A framed box in the deck-tile style: accent border, collar band and a soft glow (the developer asked for the exam
   box to look like the decks). Unlike deck tiles it is not a link, so the glow doesn't react to hover. */
.idx-frame {
    position: relative;
    padding-top: 1.75rem;
    background: var(--mud-palette-surface);
    border: 1px solid rgba(201, 165, 75, 0.55);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 10px rgba(201, 165, 75, 0.18), inset 0 0 12px rgba(201, 165, 75, 0.05);
}

.idx-frame::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 3px;
    border-top: 1px solid var(--idx-accent);
    border-bottom: 1px solid var(--idx-accent);
    opacity: 0.85;
}

.idx-light .idx-frame {
    border-color: var(--idx-accent);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.20), inset 0 0 12px rgba(0, 0, 0, 0.04);
}

/* Upcoming Exams: one row per exam, soonest first, split by an accent hairline. The box is at most three rows tall
   (ExamsPanel.VisibleRows) and shrinks to fit fewer; more exams scroll inside it. Rows have a fixed height for that,
   so a long name is cut short with an ellipsis (the full name is in its tooltip and the edit dialog). */
.exam-box {
    padding-bottom: 0.5rem;
    container-type: inline-size;
}

.exam-list {
    --exam-row-h: 3.75rem;
    max-height: calc(3 * var(--exam-row-h));
    margin: 0;
    padding: 0 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    list-style: none;
}

.exam-list > li {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: var(--exam-row-h);
}

.exam-list > li + li {
    border-top: 1px solid color-mix(in srgb, var(--idx-accent) 55%, transparent);
}

.exam-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(3.5rem, auto);
    align-items: baseline;
    gap: 1.5rem;
    width: 100%;
    padding: 0.5rem;
    border: 0;
    border-radius: 6px;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 150ms var(--idx-ease-out);
}

.exam-row:hover {
    background: var(--mud-palette-table-hover);
}

.exam-name {
    display: flex;
    align-items: center;
    min-width: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
}

.exam-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.exam-more {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    text-align: center;
    color: var(--mud-palette-text-secondary);
}

.exam-notes-icon {
    flex: none;
    margin-left: 0.375rem;
    vertical-align: -2px;
    color: var(--mud-palette-text-secondary);
}

.exam-when {
    font-size: 1.125rem;
    white-space: nowrap;
}

.exam-time {
    margin-left: 0.5rem;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

/* Days left in blue, hours or minutes in red. The unit carries the same meaning as the colour. */
.exam-left {
    font-size: 1.375rem;
    font-weight: 600;
    text-align: right;
    color: var(--mud-palette-info);
}

.exam-left-soon {
    color: var(--mud-palette-error);
}

.exam-empty {
    margin: 0;
    padding: 0.5rem 1.5rem 1.5rem;
    color: var(--mud-palette-text-secondary);
}

/* A narrow box (a phone, or the PC's right-hand column): the date moves under the name, so the name keeps its room.
   Keyed on the box's own width, not the window's, since the box can be narrow in a wide window. */
@container (max-width: 520px) {
    .exam-list {
        --exam-row-h: 5rem; /* the date moves to a second line */
    }

    .exam-row {
        grid-template-columns: minmax(0, 1fr) auto;
        row-gap: 0.25rem;
    }

    .exam-when {
        grid-row: 2;
        font-size: 1rem;
    }
}

/* Your record this month: a calendar ruled in the accent colour (gold lines on dark cells by night, black on white by
   day). Days with reviews are shaded in four steps, and the count is always written in the cell. */
.record-box {
    padding: 1.75rem 1rem 1rem;
}

.record-head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.record-month {
    min-width: 11rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.record-grid {
    border-top: 1px solid color-mix(in srgb, var(--idx-accent) 45%, transparent);
    border-left: 1px solid color-mix(in srgb, var(--idx-accent) 45%, transparent);
}

.record-row {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.record-weekday,
.record-day {
    border-right: 1px solid color-mix(in srgb, var(--idx-accent) 45%, transparent);
    border-bottom: 1px solid color-mix(in srgb, var(--idx-accent) 45%, transparent);
}

.record-weekday {
    padding: 0.375rem 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-align: center;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.record-day {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 3.75rem;
    padding: 0.3125rem 0.4375rem;
}

.record-date {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.record-count {
    align-self: flex-end;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

/* Shaded in the theme's Success green, not the accent (the developer's choice, 31 October 2026): light green by night
   (#7FB77E) and a deeper green by day (#276835), so both themes keep their contrast. */
.record-level-1 { background: color-mix(in srgb, var(--mud-palette-success) 12%, transparent); }
.record-level-2 { background: color-mix(in srgb, var(--mud-palette-success) 24%, transparent); }
.record-level-3 { background: color-mix(in srgb, var(--mud-palette-success) 36%, transparent); }
.record-level-4 { background: color-mix(in srgb, var(--mud-palette-success) 48%, transparent); }

/* On the two darkest shades the muted date colour loses contrast, so it uses the main text colour. */
.record-level-3 .record-date,
.record-level-4 .record-date {
    color: var(--mud-palette-text-primary);
}

.record-today {
    outline: 2px solid var(--idx-accent);
    outline-offset: -2px;
}

.record-today .record-date {
    font-weight: 700;
    color: var(--mud-palette-text-primary);
}

/* Study screen: the line between a card's question and answer is an accent hairline, like the exam list's. */
.study-card .mud-divider {
    border-color: color-mix(in srgb, var(--idx-accent) 55%, transparent);
}

/* Dialogs (card, deck, exam, scheduler and confirmations) wear the same frame as .idx-frame: accent border, collar
   band and glow. MudDialogProvider renders outside MudLayout, so the .idx-light class can't reach them; the colours
   come from --idx-accent instead, which is gold or black with the theme. */
.mud-dialog {
    position: relative;
    border: 1px solid color-mix(in srgb, var(--idx-accent) 60%, transparent);
    border-radius: 12px;
    box-shadow: 0 0 18px color-mix(in srgb, var(--idx-accent) 22%, transparent), 0 16px 40px rgba(0, 0, 0, 0.45);
}

.mud-dialog::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 0;
    right: 0;
    height: 3px;
    border-top: 1px solid var(--idx-accent);
    border-bottom: 1px solid var(--idx-accent);
    opacity: 0.85;
    pointer-events: none;
}

.mud-dialog .mud-dialog-title {
    padding-top: 1.75rem;
}

/* Menus and pickers: a quiet accent outline, so they read as part of the same set without the full frame. */
.mud-popover:not(.mud-tooltip) { /* tooltips are popovers too; they stay plain */
    border: 1px solid color-mix(in srgb, var(--idx-accent) 35%, transparent);
}

/* Utilities */

/* A page's main heading: the home greeting, a deck's name. Pages focus it on load for screen readers, so no outline. */
.idx-page-title {
    margin: 0;
    font-size: clamp(2rem, 1.4rem + 1.5vw, 2.75rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.015em;
    color: var(--mud-palette-text-primary);
}

.idx-page-title:focus {
    outline: none;
}

/* Account pages (phase 3): Sign in, Create an account, Reset your password, Account. Forms are short, so they keep to
   a narrow column at the left, like the deck page's heading, instead of spanning the window. */
.account-column {
    max-width: 30rem;
}

.account-column-wide {
    max-width: 40rem;
}

.account-lead {
    margin: 0.5rem 0 1.25rem;
    color: var(--mud-palette-text-secondary);
    line-height: 1.5;
}

.account-box {
    padding: 1.75rem 1.75rem 1.5rem;
    margin-bottom: 1.5rem;
}

.account-section-title {
    margin: 0.25rem 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--mud-palette-text-primary);
}

.account-name-field {
    flex: 1 1 16rem;
}

.account-email {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    margin-top: 1.25rem;
}

.account-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--mud-palette-text-secondary);
}

/* Confirmed or not, said in words with an icon, never colour alone. */
.account-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    color: var(--mud-palette-warning);
}

.account-status-ok {
    color: var(--mud-palette-success);
}

.account-help {
    margin: 0.5rem 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--mud-palette-text-secondary);
}

/* Deleting the account sits apart, outside the framed boxes, so it isn't mistaken for an everyday setting. */
.account-danger {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid color-mix(in srgb, var(--mud-palette-error) 45%, transparent);
}

.account-switch {
    color: var(--mud-palette-text-secondary);
}

.account-switch a {
    color: var(--idx-accent);
    font-weight: 600;
}

/* Shared decks (phase 3): two tabs, Browse and Your published decks, each in framed boxes. The list spans the window
   like the deck page's table. */
.shared-title.idx-page-title {
    margin-bottom: 1rem;
}

.shared-tabs .mud-tabs-tabbar {
    background: transparent;
    border-bottom: 1px solid color-mix(in srgb, var(--idx-accent) 35%, transparent);
}

.shared-tabs .mud-tab.mud-tab-active {
    color: var(--idx-accent);
}

.shared-tabs .mud-tab-slider {
    background: var(--idx-accent);
}

.shared-lead {
    max-width: 70ch;
}

.shared-panel {
    padding: 1.75rem 1.5rem 0.5rem;
}

.shared-empty {
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
}

.shared-skeleton {
    border-radius: 12px;
}

.shared-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.shared-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    padding: 0.875rem 0;
}

.shared-row + .shared-row {
    border-top: 1px solid color-mix(in srgb, var(--idx-accent) 35%, transparent);
}

.shared-row-main {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1 1 20rem;
    min-width: 0;
}

.shared-name {
    font-size: 1.125rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.shared-meta {
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

/* Said in words with an icon, not by colour alone. */
.shared-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--mud-palette-warning);
}

.shared-row-actions {
    display: flex;
    gap: 0.5rem;
}

/* Browse: search and filters on one line (they wrap on narrow windows), then the results in the shared list style. */
.browse-search {
    flex: 1 1 18rem;
    max-width: 32rem;
}

.browse-filter {
    flex: 0 0 13rem;
}

.shared-link {
    color: var(--mud-palette-text-primary);
    text-decoration: none;
}

.shared-link:hover {
    color: var(--idx-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.shared-description {
    color: var(--mud-palette-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A shared deck's first cards: the deck table's look, in one line each. */
.shared-samples {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-bottom: 0.5rem;
}

.shared-samples th {
    padding: 0 0.5rem 0.5rem 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
    color: var(--mud-palette-text-secondary);
}

.shared-samples td {
    padding: 0.625rem 0.5rem 0.625rem 0;
    border-top: 1px solid color-mix(in srgb, var(--idx-accent) 30%, transparent);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The report dialog's reasons, like the Scheduler dialog's options: a name, then a sentence. */
.report-content .report-option {
    align-items: flex-start;
    margin-top: 4px;
}

.report-option-name {
    display: block;
    font-weight: 600;
}

.report-option-description {
    display: block;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.server-wait {
    margin: 0.75rem 0 0;
    font-size: 0.875rem;
    color: var(--mud-palette-text-secondary);
}

.deck-published-link {
    color: var(--idx-accent);
}

.publish-busy {
    padding: 8px 0 4px;
}

/* A key named in text (the Help screen), drawn like the key hints inside the study buttons. */
.idx-key {
    display: inline-block;
    min-width: 1.5rem;
    padding: 0 0.375rem;
    border: 1px solid color-mix(in srgb, var(--mud-palette-text-primary) 45%, transparent);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
    text-align: center;
    color: var(--mud-palette-text-primary);
}

.idx-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Links in the accent colour; the current page (MudBlazor's disabled crumb) is plain text so it doesn't look clickable. */
.idx-breadcrumbs .mud-breadcrumb-item:not(.mud-disabled) > a {
    color: var(--idx-accent);
    text-underline-offset: 3px;
}

.idx-breadcrumbs .mud-breadcrumb-item:not(.mud-disabled) > a:hover {
    text-decoration: underline;
}

.idx-breadcrumbs .mud-breadcrumb-item.mud-disabled > a {
    color: var(--mud-palette-text-primary);
    font-weight: 600;
}

/* Deck page */

/* The heading takes the width up to the deck's buttons, so the counts and the exam line stay on one line where
   they fit. Only the deck's description keeps a reading measure. */
.deck-heading {
    flex: 1 1 320px;
    min-width: 0;
}

.deck-description {
    max-width: 70ch;
}

.deck-title {
    overflow-wrap: anywhere;
}

.deck-due {
    color: var(--idx-accent);
    font-weight: 600;
}

.deck-later {
    color: var(--mud-palette-text-secondary);
}

/* The card list sits in the same framed box as the home screen's exams (.idx-frame), ruled like the exam list. */
.deck-panel {
    padding-top: 1.25rem;
}

.deck-table .mud-table-cell {
    border-bottom-color: color-mix(in srgb, var(--idx-accent) 30%, transparent);
}

.deck-table.mud-table {
    background: transparent;
}

.deck-table .mud-table-head .mud-table-cell {
    color: var(--mud-palette-text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.deck-table .mud-table-body .mud-table-row {
    cursor: pointer;
}

.deck-table .cell-preview {
    max-width: min(32vw, 560px); /* the page spans the window, so previews may use more of it */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deck-search {
    max-width: 280px;
}

/* The deck's buttons: a row that wraps on narrow windows, each label kept whole. */
.deck-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.deck-actions .mud-button-label,
.deck-tools .mud-button-label {
    white-space: nowrap;
}

.deck-tools {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.deck-count {
    white-space: nowrap;
}

/* The Type column (only in decks with several card types): a quiet label that never wraps. */
.deck-table .deck-type {
    white-space: nowrap;
    color: var(--mud-palette-text-secondary);
}

/* Wide enough for "All types" and a type name with its count, e.g. "Multiple Choice · 12". */
.deck-type-filter {
    width: 200px;
    flex: 0 0 auto;
}

.deck-delete:hover {
    color: var(--mud-palette-error);
}

/* Select mode: ticked rows carry an accent tint (gold by night, ink by day) so the selection reads at a glance. */
.deck-table.is-selecting .mud-table-row.is-selected > td {
    background-color: rgba(201, 165, 75, 0.12);
}

.idx-light .deck-table.is-selecting .mud-table-row.is-selected > td {
    background-color: rgba(22, 22, 22, 0.07);
}

.deck-table.is-selecting .mud-table-body .mud-checkbox svg,
.deck-table.is-selecting .mud-table-head .mud-checkbox svg {
    color: var(--idx-accent);
}

/* A card image (FieldText): on its own line, never wider than the card or taller than half the window. Global, because
   it is drawn inside MudText components that scoped CSS can't reach without ::deep. */
.idx-card-image {
    display: block;
    max-width: 100%;
    max-height: min(50vh, 420px);
    margin: 12px auto;
    border-radius: 6px;
}

/* What a failed page shows instead (ProblemPanel): the account pages' column, a little lower so it doesn't read as the
   top of a page that loaded. */
.problem-panel {
    padding-top: 1rem;
}

/* Website only (Indexed.Web): a request that's taking a while says so at the bottom of the window, as the account
   pages' ServerWaitNote does under their forms. A note, not a framed box: one line, the menu outline, no glow. */
.server-wait-banner {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    z-index: 1500;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: calc(100vw - 2rem);
    padding: 0.625rem 1rem;
    background: var(--mud-palette-surface);
    border: 1px solid color-mix(in srgb, var(--idx-accent) 35%, transparent);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* Phones (phase 4, step 6). The website opens on phones, so every screen is checked at 375px. */

/* The top bar: on phones, the items marked idx-bar-wide move into the "More" menu (idx-bar-narrow). */
.idx-bar-narrow {
    display: none;
}

@media (max-width: 599.98px) {
    .idx-bar-wide {
        display: none;
    }

    .idx-bar-narrow {
        display: inline-flex;
    }

    /* A section heading and its action share one line, the heading at the left. */
    .home-section-head {
        display: flex;
        justify-content: space-between;
    }
}

/* Touch screens: buttons and icon buttons at least 44px, so a thumb hits them. */
@media (pointer: coarse) {
    .mud-button-root.mud-button {
        min-height: 44px;
    }

    .mud-icon-button {
        min-width: 44px;
        min-height: 44px;
    }
}

/* The deck's card list on a phone, where MudBlazor stacks each row as a card: each field on its own line, its label
   in a column at the left, the text wrapping to three lines at most instead of a few letters. MudBlazor puts
   .mud-xs-table on the table at every width and stacks only under 600px (its own media query), so these rules sit
   in the same query: wider windows keep the plain table. */
@media (max-width: 599.98px) {
    .deck-table.mud-xs-table .mud-table-cell {
        display: grid;
        grid-template-columns: 5.5rem minmax(0, 1fr);
        align-items: baseline;
        text-align: left;
    }

    .deck-table.mud-xs-table .mud-table-cell::before {
        color: var(--mud-palette-text-secondary);
        font-size: 0.6875rem;
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .deck-table.mud-xs-table .cell-preview {
        max-width: none;
        white-space: normal;
    }

    .deck-table.mud-xs-table .cell-text {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        overflow-wrap: anywhere;
    }

    .deck-table.mud-xs-table .deck-row-actions {
        display: flex;
        justify-content: flex-end;
    }

    /* Its toolbar: the count on one line, then search across the whole width, then the type filter and Select. */
    .deck-table.mud-xs-table .mud-table-toolbar {
        height: auto;
        flex-wrap: wrap;
        row-gap: 0.75rem;
        padding-block: 0.75rem;
    }

    .deck-table.mud-xs-table .deck-tools {
        width: 100%;
    }

    .deck-table.mud-xs-table .deck-search {
        order: -1;
        flex: 1 1 100%;
        max-width: none;
    }

    .deck-table.mud-xs-table .deck-type-filter {
        flex: 1 1 auto;
        width: auto;
    }
}

/* Phones: every window keeps the same 32px from the screen edges. The app's own dialogs get it from FullWidth; the
   confirmation boxes (ShowMessageBoxAsync) size to their text and would otherwise run nearly to the edges. */
@media (max-width: 599.98px) {
    .mud-dialog {
        max-width: calc(100% - 4rem);
    }
}

/* Shared decks' two tabs fit a phone's width without scrolling. */
@media (max-width: 599.98px) {
    .shared-tabs .mud-tab {
        /* MudTabs sets 160px on each tab as an inline style (MinimumTabWidth), which would push the second tab off
           the screen; only !important outweighs an inline style. Wider windows keep the 160px. */
        min-width: 0 !important;
        padding-inline: 0.75rem;
    }
}
