:root {
    --ink: #14211f;
    --muted: #62706c;
    --paper: #f4f2eb;
    --surface: #fffdf8;
    --line: #d9ddd6;
    --accent: #0d685d;
    --accent-dark: #084a43;
    --warm: #d9965b;
    --shadow: 0 18px 50px rgba(20, 33, 31, 0.08);

    /* The sidebar sits a shade deeper than the page so the active item, filled
       with --paper, reads as a tab pulled forward out of the binder. */
    --rail: #e8e5db;
    --rail-line: #d5d1c4;

    --sidebar-width: 16rem;
    --danger: #a33232;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

/* Figures must line up column to column; this is a ledger. */
table,
.stat-value,
.money,
.summary-card strong {
    font-variant-numeric: tabular-nums;
}

.money-negative {
    color: var(--danger);
}

.icon {
    flex: none;
    width: 1.15rem;
    height: 1.15rem;
}

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

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 60;
    padding: 0.6rem 0.9rem;
    border-radius: 0.5rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: none;
}

/* --- shell ---------------------------------------------------------------- */

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1.5rem 0 1.25rem;
    background: var(--rail);
    border-right: 1px solid var(--rail-line);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1.25rem 1.5rem;
}

.brand-logo-link {
    display: block;
    min-width: 0;
    max-width: 12rem;
    text-decoration: none;
}

.brand-logo {
    display: block;
    width: 100%;
    height: auto;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 1rem;
}

.nav-section + .nav-section {
    margin-top: 1.75rem;
}

.nav-section-label {
    margin: 0 0 0.5rem;
    padding: 0 1.25rem;
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.sidebar-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.62rem 1.25rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 620;
    text-decoration: none;
    transition: color 140ms ease, background-color 140ms ease;
}

.nav-item:hover {
    color: var(--ink);
    background: rgba(20, 33, 31, 0.04);
}

/* The signature: the current page's tab, filled with the content background
   and joined to it along the sidebar's right edge. */
.nav-item.is-active {
    position: relative;
    margin-left: 0.6rem;
    border-radius: 0.65rem 0 0 0.65rem;
    background: var(--paper);
    color: var(--accent);
    font-weight: 750;
}

.nav-item.is-active::before {
    content: "";
    position: absolute;
    top: 0.62rem;
    bottom: 0.62rem;
    left: 0;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
}

.nav-item-quiet {
    font-size: 0.85rem;
    font-weight: 600;
}

.sidebar-footer {
    padding-top: 0.75rem;
    border-top: 1px solid var(--rail-line);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0.5rem 0.85rem 0;
    padding: 0.6rem 0.7rem;
    border-radius: 0.7rem;
    background: rgba(255, 253, 248, 0.7);
}

.user-avatar {
    display: grid;
    place-items: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 750;
    text-transform: uppercase;
}

.user-details {
    display: grid;
    min-width: 0;
    line-height: 1.3;
}

.user-name,
.user-role {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.user-role {
    color: var(--muted);
    font-size: 0.72rem;
}

.icon-button {
    display: grid;
    place-items: center;
    flex: none;
    margin: 0;
    padding: 0.4rem;
    border: 0;
    border-radius: 0.5rem;
    background: none;
    color: var(--muted);
    cursor: pointer;
}

.icon-button:hover {
    background: rgba(20, 33, 31, 0.07);
    color: var(--ink);
}

.shell-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* --- topbar --------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.4rem 2.5rem;
    background: rgba(244, 242, 235, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}

.topbar-heading {
    flex: 1;
    min-width: 0;
}

.topbar-heading h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.75rem;
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.15;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-toggle {
    display: none;
}

.content {
    padding: 2.25rem 2.5rem 4rem;
}

.eyebrow {
    margin: 0 0 0.15rem;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.lede {
    max-width: 62ch;
    margin: 0 0 2rem;
    color: var(--muted);
}

/* --- panels, cards, stats ------------------------------------------------- */

.panel,
.summary-card,
.stat-card {
    border: 1px solid rgba(20, 33, 31, 0.09);
    border-radius: 1rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel {
    padding: 1.5rem;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    padding: 1.25rem 1.4rem;
}

.stat-label {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-note {
    margin: 0.3rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1rem;
}

.shortcut {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1.25rem 1.4rem;
    border: 1px solid rgba(20, 33, 31, 0.09);
    border-radius: 1rem;
    background: var(--surface);
    text-decoration: none;
    transition: border-color 150ms ease, transform 150ms ease;
}

.shortcut:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.shortcut .icon {
    width: 1.35rem;
    height: 1.35rem;
    margin-top: 0.15rem;
    color: var(--accent);
}

.shortcut h2 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
}

.shortcut p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

/* --- forms ---------------------------------------------------------------- */

.calculator-layout {
    display: grid;
    grid-template-columns: minmax(280px, 24rem) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.form-panel {
    display: grid;
    gap: 1rem;
}

.field {
    display: grid;
    gap: 0.4rem;
}

.field label {
    font-size: 0.82rem;
    font-weight: 750;
}

.form-control {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    outline: none;
    background: #fff;
    padding: 0.75rem 0.85rem;
    color: var(--ink);
    font: inherit;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13, 104, 93, 0.12);
}

button {
    border: 0;
    border-radius: 0.6rem;
    padding: 0.85rem 1rem;
    color: white;
    background: var(--accent);
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

button:hover {
    background: var(--accent-dark);
}

.field-error {
    margin: 0;
    color: var(--danger);
    font-size: 0.8rem;
}

.alert {
    margin: 0;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    font-size: 0.9rem;
}

.alert-error {
    color: #7d2020;
    background: rgba(163, 50, 50, 0.1);
    border: 1px solid rgba(163, 50, 50, 0.25);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1rem;
}

.summary-card {
    padding: 1.4rem;
}

.summary-card span {
    display: block;
    margin-bottom: 0.7rem;
    color: var(--muted);
    font-size: 0.8rem;
}

.summary-card strong {
    font-size: 1.35rem;
}

.result-placeholder {
    display: grid;
    place-items: center;
    min-height: 12rem;
    border-style: dashed;
    background: transparent;
    box-shadow: none;
}

.result-placeholder p {
    max-width: 32ch;
    margin: 0;
    color: var(--muted);
    text-align: center;
}

/* --- tables --------------------------------------------------------------- */

.table-panel {
    margin-top: 1.5rem;
}

.table-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.table-heading h2 {
    margin: 0;
}

.table-heading span {
    color: var(--muted);
    font-size: 0.85rem;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: clamp(0.35rem, 0.75vw, 0.8rem) clamp(0.2rem, 0.65vw, 0.7rem);
    overflow-wrap: anywhere;
    text-align: right;
    vertical-align: top;
}

th {
    color: var(--accent-dark);
    background: rgba(13, 104, 93, 0.075);
    font-size: clamp(0.7rem, 0.75vw, 0.8rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.25;
    hyphens: auto;
    overflow-wrap: break-word;
    text-transform: none;
    vertical-align: middle;
    word-break: normal;
}

thead tr:first-child th {
    border-top: 1px solid rgba(13, 104, 93, 0.16);
}

thead tr + tr th {
    background: rgba(13, 104, 93, 0.045);
    color: var(--muted);
    font-size: 0.68rem;
}

.col-text {
    text-align: left;
}

.table-scroll button {
    max-width: 100%;
    padding: 0.35rem;
    white-space: normal;
}

/* The payment ledger deliberately mirrors a wide spreadsheet. Explicit
   percentages keep all thirteen columns inside the panel instead of creating
   a horizontal viewport. Names and notes receive the space that numbers do
   not need. */
.ledger-table {
    font-size: clamp(0.62rem, 0.72vw, 0.8rem);
}

.ledger-table th,
.ledger-table td {
    padding-inline: clamp(0.1rem, 0.3vw, 0.35rem);
}

.ledger-table th {
    letter-spacing: 0;
    overflow-wrap: anywhere;
    text-align: center;
}

tbody tr:hover {
    background: rgba(13, 104, 93, 0.035);
}

.ledger-total-row {
    background: rgba(20, 33, 31, 0.045);
    font-weight: 700;
}

.ledger-month-row {
    background: rgba(13, 104, 93, 0.12);
    color: var(--accent-dark);
    font-weight: 800;
}

/* --- due-date control matrix -------------------------------------------- */

.due-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1rem;
    margin: 1rem 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.due-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.due-swatch {
    width: 0.75rem;
    height: 0.75rem;
    border: 1px solid rgba(20, 33, 31, 0.12);
    border-radius: 0.2rem;
}

.due-matrix-table {
    font-size: clamp(0.56rem, 0.67vw, 0.76rem);
    line-height: 1.2;
}

.due-matrix-table th,
.due-matrix-table td {
    padding: clamp(0.18rem, 0.35vw, 0.4rem) clamp(0.08rem, 0.2vw, 0.22rem);
}

.due-matrix-table th {
    text-align: center;
}

.due-matrix-table th.col-text {
    text-align: left;
}

.due-matrix-table th small,
.due-matrix-table td small {
    display: block;
    margin-top: 0.12rem;
    color: inherit;
    font-size: 0.85em;
    font-weight: 600;
}

.due-day {
    color: var(--accent-dark);
    font-size: 1.05em;
    font-weight: 850;
    text-align: center;
}

.due-cell {
    border-left: 1px solid rgba(20, 33, 31, 0.05);
    text-align: center;
    vertical-align: middle;
}

.due-cell strong,
.due-cell span {
    display: block;
}

.due-paid,
.due-cell.due-paid {
    background: rgba(76, 154, 121, 0.18);
    color: #14543d;
}

.due-paid-late,
.due-cell.due-paid-late {
    background: rgba(74, 128, 170, 0.17);
    color: #285776;
}

.due-partial,
.due-cell.due-partial {
    background: rgba(217, 150, 91, 0.2);
    color: #714410;
}

.due-cell.due-partial-overdue {
    background: rgba(196, 85, 65, 0.2);
    color: #7d2020;
}

.due-overdue,
.due-cell.due-overdue {
    background: rgba(196, 85, 65, 0.22);
    color: #7d2020;
}

.due-current,
.due-cell.due-due {
    background: rgba(230, 190, 64, 0.24);
    color: #654f08;
}

.due-cell.due-upcoming,
.due-cell.due-empty {
    color: var(--muted);
    background: rgba(20, 33, 31, 0.025);
}

/* --- civil liability and vehicle costs ---------------------------------- */

.insurance-entry-panel {
    margin-top: 1.5rem;
}

.insurance-entry-panel > summary {
    color: var(--accent-dark);
    font-weight: 800;
    cursor: pointer;
}

.insurance-entry-panel[open] > summary {
    margin-bottom: 1.25rem;
}

.insurance-entry-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
}

.insurance-entry-form .alert,
.insurance-wide-field {
    grid-column: span 2;
}

.insurance-entry-form button {
    align-self: end;
}

.insurance-table td[rowspan] {
    vertical-align: middle;
}

.insurance-table td small {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.78em;
}

.insurance-table td small a {
    color: var(--accent);
    text-decoration: none;
}

.bank-table td small {
    display: block;
    margin-top: 0.25rem;
}

.insurance-group-0 {
    background: rgba(217, 150, 91, 0.08);
}

.insurance-group-1 {
    background: rgba(13, 104, 93, 0.05);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(13, 104, 93, 0.1);
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.badge-quiet {
    background: rgba(20, 33, 31, 0.07);
    color: var(--muted);
}

.badge-warn {
    background: rgba(217, 150, 91, 0.22);
    color: #7c4a16;
}

.row-link {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.row-link:hover {
    text-decoration: underline;
}

.payment-entry {
    display: grid;
    grid-template-columns: minmax(280px, 24rem) 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

.payment-entry h2 {
    margin: 0;
    font-size: 1.15rem;
}

.preview-note {
    margin: 1rem 0 0;
    padding: 0.75rem 1rem;
    border-radius: 0.6rem;
    background: rgba(13, 104, 93, 0.08);
    color: var(--accent-dark);
    font-size: 0.9rem;
}

.confirm-form {
    margin-top: 1.25rem;
}

/* --- administration -------------------------------------------------------- */

.admin-layout {
    display: grid;
    grid-template-columns: minmax(280px, 30rem) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.admin-layout h2 {
    margin: 0;
    font-size: 1.15rem;
}

.button-link {
    display: inline-block;
    padding: 0.6rem 0.95rem;
    border-radius: 0.6rem;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 750;
    text-decoration: none;
}

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

.field-hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.checkbox-group {
    margin: 0;
    padding: 0;
    border: 0;
}

.checkbox-group legend {
    padding: 0;
    margin-bottom: 0.5rem;
    font-size: 0.82rem;
    font-weight: 750;
}

.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.3rem 0;
    font-size: 0.9rem;
}

.checkbox input {
    margin: 0.25rem 0 0;
    accent-color: var(--accent);
}

.checkbox em {
    color: var(--muted);
    font-style: normal;
}

.checkbox code {
    color: var(--muted);
    font-size: 0.78rem;
}

.permission-grid .checkbox {
    break-inside: avoid;
}

.permission-grid {
    columns: 2;
    column-gap: 2rem;
}

.role-panel + .role-panel {
    margin-top: 1.25rem;
}

.role-panel .field {
    margin-bottom: 1rem;
}

.role-actions {
    margin-top: 1.25rem;
}

.role-delete {
    margin-top: 0.75rem;
}

.alert-ok {
    color: #0b5c4f;
    background: rgba(13, 104, 93, 0.1);
    border: 1px solid rgba(13, 104, 93, 0.25);
}

.detail-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.5rem 1.5rem;
    margin: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.detail-list dd {
    margin: 0;
    font-size: 0.92rem;
}

.detail-list dd a {
    color: var(--accent);
    text-decoration: none;
}

.detail-list dd a:hover {
    text-decoration: underline;
}

.detail-notes {
    white-space: pre-wrap;
}

a.user-avatar,
a.user-name {
    text-decoration: none;
}

a.user-name:hover {
    color: var(--accent);
}

.logout-form {
    margin-left: auto;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.link-reset {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 650;
    text-decoration: none;
}

.link-reset:hover {
    color: var(--accent);
}

select.form-control {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 1.1rem) 1.15rem, calc(100% - 0.75rem) 1.15rem;
    background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
    background-repeat: no-repeat;
    padding-right: 2.25rem;
}

.event-detail {
    margin-top: 0.35rem;
}

.event-detail summary {
    color: var(--muted);
    font-size: 0.78rem;
    cursor: pointer;
}

.event-detail pre {
    max-width: 32rem;
    margin: 0.4rem 0 0;
    padding: 0.6rem 0.75rem;
    overflow-x: auto;
    border-radius: 0.5rem;
    background: rgba(20, 33, 31, 0.05);
    font-size: 0.75rem;
    white-space: pre-wrap;
}

.pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-top: 1.25rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.pager a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: none;
}

.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state h2 {
    margin: 0 0 0.4rem;
    font-size: 1.15rem;
}

.empty-state p {
    max-width: 46ch;
    margin: 0 auto;
    color: var(--muted);
}

/* --- bare shell (sign in) -------------------------------------------------- */

.bare-shell {
    background:
        radial-gradient(circle at top right, rgba(217, 150, 91, 0.18), transparent 30rem),
        var(--paper);
}

.bare-main {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 2rem 1.5rem;
}

.auth-panel {
    display: grid;
    gap: 1.25rem;
    width: min(26rem, 100%);
    padding: 2rem;
}

.auth-heading h1 {
    margin: 0.25rem 0 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.9rem;
    font-weight: 500;
    letter-spacing: -0.035em;
}

.auth-logo {
    display: block;
    width: min(100%, 18.375rem);
    height: auto;
    margin-bottom: 1rem;
}

/* --- responsive ------------------------------------------------------------ */

.sidebar-backdrop,
.sidebar-close {
    display: none;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 50;
        width: var(--sidebar-width);
        transform: translateX(-100%);
        transition: transform 200ms ease;
    }

    .nav-open .sidebar {
        transform: none;
        box-shadow: 0 0 60px rgba(20, 33, 31, 0.25);
    }

    .sidebar-close {
        display: grid;
        margin-left: auto;
    }

    .nav-open .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 40;
        display: block;
        background: rgba(20, 33, 31, 0.35);
    }

    .nav-toggle {
        display: grid;
    }

    .topbar {
        padding: 1rem 1.25rem;
    }

    .topbar-heading h1 {
        font-size: 1.35rem;
    }

    .content {
        padding: 1.5rem 1.25rem 3rem;
    }

    .calculator-layout,
    .payment-entry,
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .permission-grid {
        columns: 1;
    }

    table {
        font-size: 0.72rem;
    }

    th {
        font-size: 0.66rem;
        letter-spacing: 0;
    }

    .badge {
        padding: 0.12rem 0.25rem;
        font-size: 0.62rem;
        white-space: normal;
    }

    .ledger-panel {
        padding: 0.65rem;
    }

    .ledger-table {
        font-size: clamp(0.48rem, 1.55vw, 0.66rem);
        line-height: 1.25;
    }

    .ledger-table th {
        font-size: inherit;
    }

    .due-matrix-panel {
        padding: 0.65rem;
    }

    .due-matrix-table {
        font-size: clamp(0.44rem, 1.4vw, 0.62rem);
    }

    .insurance-entry-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .insurance-entry-form {
        grid-template-columns: 1fr;
    }

    .insurance-entry-form .alert,
    .insurance-wide-field {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
