:root {
    /* Joshua Tree Homeschool Hub website palette. */
    --hub-brand-teal: #347686;
    --hub-brand-mint: #a8d5ce;
    --hub-brand-coral: #e46650;
    --hub-brand-taupe: #897f7d;
    --hub-brand-ink: #272626;
    --hub-brand-white: #ffffff;

    --hub-color-text: var(--hub-brand-ink);
    --hub-color-muted: #5f5553;
    --hub-color-canvas: #f5f3f2;
    --hub-color-surface: var(--hub-brand-white);
    --hub-color-border: #ded8d6;
    --hub-color-control-border: var(--hub-brand-taupe);
    --hub-color-primary: var(--hub-brand-teal);
    --hub-color-primary-hover: #285b68;
    --hub-color-on-primary: var(--hub-brand-white);
    --hub-color-highlight: var(--hub-brand-mint);
    --hub-color-accent: var(--hub-brand-coral);
    --hub-color-focus: var(--hub-color-primary-hover);
    --hub-color-danger: #9c2f25;
    --hub-color-danger-surface: #fff1ed;

    color-scheme: light;
    font: 1rem/1.5 system-ui, sans-serif;
    color: var(--hub-color-text);
    background: var(--hub-color-canvas);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--hub-color-primary); text-underline-offset: .18em; }
a:hover { color: var(--hub-color-primary-hover); }
:focus-visible { outline: 3px solid var(--hub-color-focus); outline-offset: 3px; }
h1 { margin: 0 0 .4rem; font-size: clamp(1.75rem, 3vw, 2.45rem); line-height: 1.15; }
p { margin: 0 0 1rem; }
.site-header { background: var(--hub-color-primary); color: var(--hub-color-on-primary); }
.site-header :focus-visible { outline-color: var(--hub-color-highlight); }
.site-bar { width: calc(100% - 2rem); margin-inline: auto; }
.site-content { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.site-bar, .site-bar nav, .page-heading, .pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem 1.25rem;
}
.site-bar, .page-heading { justify-content: space-between; }
.site-bar { min-height: 4.25rem; padding-block: .75rem; }
.site-bar a { color: inherit; }
.brand { display: block; width: min(19rem, 100%); background: var(--hub-color-surface); border-radius: .4rem; padding: .35rem .5rem; }
.brand img { display: block; width: 100%; height: auto; }
.site-bar a.active { font-weight: 750; }
.account-menu { position: relative; }
.account-menu summary { cursor: pointer; border: 1px solid currentColor; border-radius: .4rem; padding: .35rem .65rem; overflow-wrap: anywhere; }
.account-menu-panel { position: absolute; z-index: 2; right: 0; top: calc(100% + .4rem); min-width: 13rem; max-width: min(20rem, 90vw); padding: .4rem; background: var(--hub-color-surface); color: var(--hub-color-text); border: 1px solid var(--hub-color-border); border-radius: .4rem; box-shadow: 0 .25rem .75rem #0003; }
.account-menu-panel a, .account-menu-panel button.quiet-button { display: block; width: 100%; padding: .5rem .65rem; color: var(--hub-color-text); text-align: left; text-decoration: none; }
.account-menu-panel button.quiet-button { border: 0; }
.account-menu-panel a:hover, .account-menu-panel button.quiet-button:hover { background: var(--hub-color-highlight); }
.account-menu-panel :focus-visible { outline-color: var(--hub-color-focus); outline-offset: -3px; }
.site-content { padding-block: clamp(1.25rem, 5vw, 3.5rem); }
.skip-link { position: absolute; transform: translateY(-150%); padding: .5rem; background: var(--hub-color-surface); z-index: 1; }
.skip-link:focus { transform: translateY(0); }
.eyebrow { color: var(--hub-color-primary-hover); font-size: .82rem; font-weight: 750; text-transform: uppercase; letter-spacing: .12em; margin-bottom: .35rem; }
.page-heading { margin-bottom: 1.25rem; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.multiline { white-space: pre-wrap; overflow-wrap: anywhere; }
.page-heading p:last-child, .panel p:last-child { margin-bottom: 0; }
.panel { background: var(--hub-color-surface); border: 1px solid var(--hub-color-border); border-radius: .85rem; padding: clamp(1rem, 3vw, 2rem); }
.consignor-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 28rem), 1fr)); gap: 1rem; align-items: start; }
.payout-list { list-style: none; margin: 0; padding: 0; }
.payout-list li + li { border-top: 1px solid var(--hub-color-border); }
.payout-list li { padding-block: .75rem; }
.payout-status-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-block: .5rem 1rem; }
.payout-status-form label { font-weight: 650; }
.payout-print-identity { display: none; }
.login-card { max-width: 29rem; margin-inline: auto; border-block-start: .25rem solid var(--hub-color-accent); }
.edit-panel { max-width: 44rem; margin-top: 1rem; }
.inventory-search { max-width: 70rem; margin-bottom: 1.25rem; }
.inventory-search .hint { margin-bottom: 0; }
.inventory-search-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
.select-inventory-item[aria-pressed="true"] { background: var(--hub-color-primary-hover); outline: 2px solid var(--hub-color-primary-hover); outline-offset: 2px; }
.sale-summary { margin-top: 1.25rem; }
[hidden] { display: none !important; }
.field .inventory-search-controls input { flex: 1 1 12rem; width: auto; }
.inventory-page { width: calc(100vw - 2rem); margin-left: calc(50% - 50vw + 1rem); }
.inventory-table { table-layout: fixed; width: 100%; min-width: 1500px; }
.inventory-table th { position: relative; }
.inventory-table th[scope="col"] { padding-right: 1.5rem; }
.column-resize { position: absolute; top: 0; right: 0; width: .9rem; height: 100%; cursor: col-resize; touch-action: none; }
.column-resize::after { content: ""; position: absolute; right: .35rem; top: 20%; height: 60%; border-right: 2px solid var(--hub-color-control-border); }
.column-resize:focus-visible { outline-offset: -3px; }
.field { display: grid; gap: .3rem; margin: 0 0 1rem; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 0 1rem; }
.field label, .form-label { font-weight: 650; }
.field input, .field select, .field textarea, .form-control {
    width: 100%; min-width: 0; background: var(--hub-color-surface); color: inherit;
    border: 1px solid var(--hub-color-control-border); border-radius: .4rem; padding: .55rem .65rem; font: inherit;
}
.hint { color: var(--hub-color-muted); font-size: .9rem; }
.button, button:not(.quiet-button) {
    display: inline-block; border: 1px solid transparent; border-radius: .4rem;
    background: var(--hub-color-primary); color: var(--hub-color-on-primary); padding: .55rem .95rem;
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button:hover, button:not(.quiet-button):hover { background: var(--hub-color-primary-hover); color: var(--hub-color-on-primary); }
.quiet-button { background: transparent; color: inherit; border: 1px solid currentColor; border-radius: .4rem; padding: .35rem .65rem; font: inherit; cursor: pointer; }
.alert-error, .validation-message, .validation-errors, .text-danger { color: var(--hub-color-danger); }
.table-panel { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem 1rem; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
tr + tr > *, tbody tr:first-child > * { border-top: 1px solid var(--hub-color-border); }
thead { background: var(--hub-color-highlight); }
.money { text-align: right; white-space: nowrap; }
.pagination { margin-top: 1rem; }
.form-floating { display: flex; flex-direction: column-reverse; gap: .25rem; }
.mb-3 { margin-bottom: 1rem; }
.mobile-inventory-sort, .mobile-table-heading, .mobile-inventory-details { display: none; }

@media (max-width: 700px) {
    .site-bar { align-items: flex-start; }
    .site-bar nav { width: 100%; justify-content: space-between; align-items: flex-start; }
    .account-menu { max-width: 65%; }
    .account-menu-panel { max-width: calc(100vw - 2rem); }
    .page-heading > div, .page-actions, .panel, dd { min-width: 0; overflow-wrap: anywhere; }
    dd { margin-left: 1rem; }
    .field-row { grid-template-columns: minmax(0, 1fr); }
    .field .inventory-search-controls input { flex-basis: 8rem; }
    .inventory-page { width: 100%; margin-left: 0; }
    .desktop-inventory-hint { display: none; }
    .mobile-inventory-sort { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; }
    .mobile-inventory-sort a, .pagination a { padding-block: .4rem; }
    .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td, .responsive-table th[scope="row"] { display: block; }
    .responsive-table.inventory-table { width: 100% !important; min-width: 0 !important; }
    .responsive-table colgroup, .responsive-table .column-resize, .desktop-sort-link { display: none; }
    .mobile-table-heading { display: inline; }
    .responsive-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
    .responsive-table tr { padding: .75rem 1rem; }
    .responsive-table tr + tr { border-top: 1px solid var(--hub-color-border); }
    .responsive-table tbody tr > * { border: 0; padding: .3rem 0; text-align: left; white-space: normal; }
    .responsive-table tbody tr > *::before { content: attr(data-label); display: block; color: var(--hub-color-muted); font-size: .8rem; font-weight: 650; }
    @supports selector(tr:has(details[open])) {
        .inventory-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .15rem .65rem; padding: .65rem .75rem; }
        .inventory-table tbody tr > * { min-width: 0; padding: 0; }
        .inventory-table tbody tr > [data-label="Selection"] { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
        .inventory-table tbody tr > [data-label="Selection"]::before { content: none; }
        .inventory-table tbody tr > [data-label="Subject"] { grid-column: 2; grid-row: 1; }
        .inventory-table tbody tr > [data-label="Title"] { grid-column: 2 / 4; grid-row: 2; }
        .inventory-table tbody tr > [data-label="JTHH Price"] { grid-column: 3; grid-row: 1; text-align: right; }
        .inventory-table tbody tr > [data-label="Subject"]::before, .inventory-table tbody tr > [data-label="Title"]::before, .inventory-table tbody tr > [data-label="JTHH Price"]::before { content: none; }
        .inventory-table tbody tr > [id] { grid-column: 1 / -1; }
        .inventory-table tbody tr:not(:has(.mobile-inventory-details[open])) > [id] { display: none; }
        .mobile-inventory-details { display: inline-block; margin-left: .5rem; font-weight: normal; }
        .mobile-inventory-details summary { color: var(--hub-color-primary); cursor: pointer; }
        .inventory-table tbody tr:not(:has([data-label="Selection"])) > [data-label="Subject"] { grid-column: 1 / 3; }
        .inventory-table tbody tr:not(:has([data-label="Selection"])) > [data-label="Title"] { grid-column: 1 / 4; }
    }
}

@media print {
    body.print-payout-summary .site-header, body.print-payout-summary .skip-link,
    body.print-payout-summary .site-content > :not(.consignor-overview),
    body.print-payout-summary .consignor-overview > :not(.payout-summary),
    body.print-payout-summary .payout-status-form, body.print-payout-summary .print-payout-summary,
    body.print-payout-summary #blazor-error-ui,
    body:has(.payout-report) .site-header, body:has(.payout-report) .skip-link,
    body:has(.payout-report) #blazor-error-ui, .payout-report-controls { display: none !important; }
    body.print-payout-summary .consignor-overview { display: block; }
    body.print-payout-summary .payout-summary, .payout-report .table-panel { border: 0; padding: 0; overflow: visible; }
    body.print-payout-summary .payout-print-identity, .payout-report .payout-print-identity { display: block; }
    body.print-payout-summary .site-content, body:has(.payout-report) .site-content { width: 100%; padding: 0; }
    .payout-report table, .payout-report tbody { display: table; }
    .payout-report tbody { display: table-row-group; }
    .payout-report thead { display: table-header-group; position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }
    .payout-report tr { display: table-row; break-inside: avoid; }
    .payout-report td, .payout-report th[scope="row"] { display: table-cell; }
    .payout-report tbody tr > *::before { content: none; }
}
