:root {
    color-scheme: light;
    --ink: #202925;
    --muted: #69736f;
    --line: #dfe5e1;
    --surface: #ffffff;
    --canvas: #f5f7f6;
    --primary: #28745a;
    --primary-hover: #205f49;
    --danger: #a64040;
    --danger-hover: #8c3434;
    font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-synthesis: none;
    letter-spacing: 0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    min-width: 320px;
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    background: var(--canvas);
    letter-spacing: 0;
}

button,
input,
select,
textarea {
    color: inherit;
    font: inherit;
    letter-spacing: 0;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
select:not(:disabled) {
    cursor: pointer;
}

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

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

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1:focus {
    outline: none;
}

code {
    color: #394641;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: .82rem;
}

.lucide-icon {
    display: block;
    flex: 0 0 auto;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.page-header h1 {
    margin-bottom: 3px;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.25;
}

.page-header p,
.section-header p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .83rem;
}

.page-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.section-header h2,
.settings-copy h2 {
    margin-bottom: 2px;
    font-size: 1rem;
    font-weight: 700;
}

.content-section {
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 6px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 14px;
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: 5px;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.button.small {
    min-height: 34px;
    padding: 6px 11px;
    font-size: .78rem;
}

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

.button.primary:hover:not(:disabled) {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.button.secondary {
    color: #3b4843;
    background: #fff;
    border-color: #cad3ce;
}

.button.secondary:hover:not(:disabled) {
    background: #f2f5f3;
    border-color: #aebbb5;
}

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

.button.danger:hover:not(:disabled) {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
}

.icon-button {
    display: inline-grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    color: #55625d;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
}

.icon-button:hover:not(:disabled),
.icon-button:focus-visible {
    color: #27332e;
    background: #edf1ef;
}

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

.icon-button.danger:hover:not(:disabled) {
    color: #fff;
    background: var(--danger);
}

.button:focus-visible,
.icon-button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(48, 135, 101, .22);
    outline-offset: 1px;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: var(--primary);
    font-size: .8rem;
    font-weight: 650;
    text-decoration: none;
    white-space: nowrap;
}

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

.toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    min-height: 54px;
    margin-bottom: 14px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.search-box {
    display: flex;
    align-items: center;
    width: min(100%, 360px);
    height: 36px;
    padding: 0 10px;
    color: #7a8581;
    background: #f7f9f8;
    border: 1px solid #d9e0dc;
    border-radius: 5px;
}

.search-box input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 0 0 8px;
    color: var(--ink);
    background: transparent;
    border: 0;
    outline: 0;
}

.search-box:focus-within {
    border-color: #5a9c82;
    box-shadow: 0 0 0 3px rgba(48, 135, 101, .12);
}

.filter-field {
    display: grid;
    gap: 3px;
    min-width: 250px;
}

.filter-field.compact {
    min-width: 190px;
}

.filter-field label {
    color: var(--muted);
    font-size: .67rem;
    font-weight: 650;
}

.filter-field select {
    height: 34px;
    padding: 0 30px 0 9px;
    background: #fff;
    border: 1px solid #ced7d2;
    border-radius: 4px;
}

.result-count {
    margin-left: auto;
    padding-bottom: 8px;
    color: var(--muted);
    font-size: .75rem;
    white-space: nowrap;
}

.data-table-wrap {
    max-width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.content-section .data-table-wrap {
    border: 0;
    border-radius: 0;
}

.data-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: .79rem;
}

.wide-table .data-table {
    min-width: 1100px;
}

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

.users-table {
    min-width: 1120px;
}

.personal-usage-table .data-table {
    min-width: 900px;
}

.data-table th {
    padding: 10px 14px;
    color: #64716c;
    font-size: .68rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    background: #f7f9f8;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table td {
    max-width: 320px;
    padding: 12px 14px;
    color: #3d4944;
    vertical-align: middle;
    border-bottom: 1px solid #edf0ee;
}

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

.data-table tbody tr:hover {
    background: #fafcfb;
}

.data-table .primary-cell,
.data-table td > small {
    display: block;
}

.data-table .primary-cell {
    overflow-wrap: anywhere;
    color: #24302b;
    font-weight: 650;
}

.data-table td > small {
    margin-top: 2px;
    overflow-wrap: anywhere;
    color: #7a8581;
    font-size: .7rem;
}

.numeric-cell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.actions-column {
    width: 124px;
    text-align: right !important;
}

.actions-cell {
    text-align: right;
    white-space: nowrap;
}

.truncate-cell {
    display: block;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.key-prefix,
.request-id {
    display: inline-block;
    max-width: 180px;
    padding: 3px 6px;
    overflow: hidden;
    color: #43504a;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: #f1f4f2;
    border-radius: 3px;
}

.status-badge,
.provider-badge {
    display: inline-flex;
    align-items: center;
    min-height: 23px;
    padding: 2px 8px;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    border-radius: 999px;
}

.status-badge.success {
    color: #216448;
    background: #e4f4ec;
}

.status-badge.neutral {
    color: #65706c;
    background: #edf0ef;
}

.status-badge.danger {
    color: #963c3c;
    background: #fae8e8;
}

.status-badge.warning {
    color: #745312;
    background: #fff3cf;
}

.schedule-switch {
    position: relative;
    display: inline-flex;
    width: 38px;
    height: 22px;
    align-items: center;
    cursor: pointer;
}

.schedule-switch input {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.schedule-switch input:disabled { cursor: wait; }

.schedule-switch > span {
    position: relative;
    width: 38px;
    height: 22px;
    background: #b6c0bc;
    border-radius: 999px;
    transition: background-color .16s ease;
}

.schedule-switch > span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    content: "";
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(22, 34, 28, .24);
    transition: transform .16s ease;
}

.schedule-switch input:checked + span {
    background: #2f7c5e;
}

.schedule-switch input:checked + span::after {
    transform: translateX(16px);
}

.schedule-switch input:focus-visible + span {
    outline: 2px solid #377b62;
    outline-offset: 2px;
}

.schedule-switch input:disabled + span {
    opacity: .55;
    cursor: wait;
}

.usage-window-cell {
    min-width: 245px;
}

.usage-windows {
    display: grid;
    min-width: 220px;
    gap: 7px;
}

.usage-window-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.usage-window-label {
    display: inline-grid;
    width: 32px;
    height: 20px;
    place-items: center;
    color: #385d50;
    font-size: .65rem;
    font-weight: 750;
    background: #e5f1ec;
    border-radius: 4px;
}

.usage-window-label.short { color: #4e4f89; background: #ececfa; }
.usage-window-label.long { color: #1f694f; background: #e2f3eb; }
.usage-window-label.sonnet { color: #7a571c; background: #f8edcf; }

.usage-window-meter {
    display: grid;
    min-width: 0;
    grid-template-columns: 76px minmax(86px, 1fr);
    align-items: center;
    gap: 7px;
}

.usage-window-track {
    display: block;
    width: 76px;
    height: 6px;
    overflow: hidden;
    background: #e4e9e6;
    border-radius: 999px;
}

.usage-window-track > span {
    display: block;
    height: 100%;
    background: #318063;
    border-radius: inherit;
}

.usage-window-meter small {
    overflow: hidden;
    color: #66736d;
    font-size: .66rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.usage-window-empty {
    color: #89938f;
    font-size: .7rem;
    white-space: nowrap;
}

.model-sync-controls {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.model-sync-controls .form-field {
    flex: 1 1 360px;
    margin-bottom: 0;
}

.model-sync-summary {
    display: flex;
    min-height: 38px;
    margin-bottom: 12px;
    padding: 8px 10px;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: var(--muted);
    font-size: .75rem;
    background: #f7f9f8;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.model-sync-summary strong {
    color: var(--ink);
    font-size: .88rem;
}

.model-sync-toolbar {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
    gap: 8px;
}

.model-sync-toolbar .search-box {
    width: min(100%, 320px);
}

.model-sync-toolbar .result-count {
    padding-bottom: 0;
}

.model-sync-list {
    max-height: min(50vh, 520px);
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 5px;
}

.model-sync-row {
    display: grid;
    min-width: 1040px;
    min-height: 52px;
    padding: 8px 10px;
    grid-template-columns: 28px minmax(230px, 2fr) 82px repeat(5, 112px);
    align-items: center;
    gap: 10px;
    color: #3d4944;
    font-size: .74rem;
    border-bottom: 1px solid #edf0ee;
}

label.model-sync-row {
    cursor: pointer;
}

label.model-sync-row:hover {
    background: #fafcfb;
}

.model-sync-row:last-child {
    border-bottom: 0;
}

.model-sync-row-header {
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: 36px;
    color: #64716c;
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #f7f9f8;
}

.model-sync-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--primary);
}

.model-sync-name {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.model-sync-name strong,
.model-sync-name code {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.model-sync-name strong {
    color: #27332e;
    font-size: .76rem;
}

.model-sync-row > span > small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: .65rem;
}

.provider-badge.openai {
    color: #205f49;
    background: #e2f2eb;
}

.provider-badge.claude {
    color: #775518;
    background: #f8edcf;
}

.state-panel {
    display: flex;
    min-height: 260px;
    padding: 32px 20px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--muted);
    text-align: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.state-panel strong {
    color: #35413c;
    font-size: .9rem;
}

.state-panel > span:not(.state-icon):not(.spinner) {
    max-width: 440px;
    font-size: .78rem;
}

.state-panel.compact-state {
    min-height: 180px;
    flex-direction: row;
    font-size: .8rem;
}

.state-icon {
    display: grid;
    width: 44px;
    height: 44px;
    margin-bottom: 4px;
    place-items: center;
    color: #65736d;
    background: #edf2ef;
    border-radius: 50%;
}

.error-state .state-icon {
    color: #a64040;
    background: #f9eaea;
}

.state-action {
    margin-top: 8px;
}

.spinner {
    display: inline-block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    border: 2px solid #c9d2ce;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.spinner.light {
    width: 15px;
    height: 15px;
    border-color: rgba(255, 255, 255, .45);
    border-top-color: #fff;
}

.spinner.compact {
    width: 16px;
    height: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.app-boot {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--muted);
    font-size: .8rem;
    background: var(--canvas);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.metric-card {
    display: grid;
    min-width: 0;
    padding: 16px;
    grid-template-columns: 38px minmax(0, 1fr);
    column-gap: 11px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.metric-icon {
    display: grid;
    width: 38px;
    height: 38px;
    grid-row: 1 / 3;
    place-items: center;
    border-radius: 5px;
}

.metric-icon.green { color: #24694f; background: #e0f1e9; }
.metric-icon.blue { color: #316897; background: #e5eff7; }
.metric-icon.amber { color: #87601b; background: #f8edcf; }
.metric-icon.red { color: #9b4141; background: #f8e7e7; }

.metric-label {
    overflow: hidden;
    color: var(--muted);
    font-size: .7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric-card strong {
    min-width: 0;
    overflow: hidden;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 22px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.summary-strip > div {
    display: flex;
    min-width: 0;
    min-height: 60px;
    padding: 12px 18px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-right: 1px solid var(--line);
}

.summary-strip > div:last-child {
    border-right: 0;
}

.summary-strip span {
    color: var(--muted);
    font-size: .75rem;
}

.summary-strip strong {
    overflow: hidden;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    width: auto;
    height: auto;
    padding: 24px;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    background: rgba(17, 24, 21, .5);
    opacity: 1;
}

.modal-dialog {
    position: relative;
    width: 100%;
    max-height: calc(100vh - 48px);
    margin: auto;
    overflow: hidden;
    background: #fff;
    border: 1px solid #d8dfdb;
    border-radius: 7px;
    box-shadow: 0 24px 60px rgba(16, 23, 20, .2);
    pointer-events: auto;
}

.modal-header,
.modal-footer {
    display: flex;
    align-items: center;
    padding: 14px 18px;
}

.modal-header {
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}

.modal-header h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.modal-body {
    max-height: calc(100vh - 190px);
    padding: 18px;
    overflow-y: auto;
}

.modal-footer {
    justify-content: flex-end;
    gap: 9px;
    background: #fafbfa;
    border-top: 1px solid var(--line);
}

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

.form-field {
    display: grid;
    min-width: 0;
    gap: 5px;
    margin-bottom: 15px;
}

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

.form-field.full,
.toggle-row.full {
    grid-column: 1 / -1;
}

.form-field label {
    color: #3e4a45;
    font-size: .76rem;
    font-weight: 650;
}

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

.form-field input,
.form-field select {
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 7px 10px;
    color: #27322e;
    background: #fff;
    border: 1px solid #cad4cf;
    border-radius: 5px;
}

.form-field input::placeholder {
    color: #a0aaa6;
}

.form-field input:focus,
.form-field select:focus {
    border-color: #5a9c82;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(48, 135, 101, .12);
}

.password-input {
    position: relative;
}

.password-input input {
    padding-right: 44px;
}

.password-input .icon-button {
    position: absolute;
    top: 3px;
    right: 3px;
}

.toggle-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px;
    background: #f7f9f8;
    border: 1px solid #e1e6e3;
    border-radius: 5px;
    cursor: pointer;
}

.toggle-row input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    accent-color: var(--primary);
}

.toggle-row span {
    display: grid;
}

.toggle-row strong {
    font-size: .78rem;
}

.toggle-row small {
    color: var(--muted);
    font-size: .7rem;
}

.validation-message {
    color: var(--danger);
    font-size: .7rem;
}

.invalid:not([type="checkbox"]) {
    border-color: #b74a4a !important;
}

.valid.modified:not([type="checkbox"]) {
    border-color: #66a58c;
}

.inline-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-bottom: 15px;
    padding: 10px 11px;
    font-size: .76rem;
    border: 1px solid;
    border-radius: 5px;
}

.inline-alert.danger {
    color: #873838;
    background: #fceeee;
    border-color: #edcaca;
}

.inline-alert.success {
    color: #255f47;
    background: #edf7f2;
    border-color: #c4e4d5;
}

.inline-alert.warning {
    color: #745312;
    background: #fff8e5;
    border-color: #ebd99d;
}

.confirm-copy {
    margin-bottom: 0;
    color: #46524d;
    font-size: .83rem;
}

.secret-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f2f5f3;
    border: 1px solid #dbe2de;
    border-radius: 5px;
}

.secret-box code {
    min-width: 0;
    flex: 1;
    overflow-wrap: anywhere;
    user-select: all;
}

.toast-host {
    position: fixed;
    top: 76px;
    right: 18px;
    z-index: 200;
    display: grid;
    width: min(360px, calc(100vw - 32px));
    gap: 8px;
    pointer-events: none;
}

.toast-item {
    display: grid;
    min-height: 48px;
    padding: 10px 8px 10px 12px;
    grid-template-columns: 20px minmax(0, 1fr) 30px;
    align-items: center;
    gap: 9px;
    color: #34403b;
    font-size: .78rem;
    background: #fff;
    border: 1px solid var(--line);
    border-left-width: 4px;
    border-radius: 5px;
    box-shadow: 0 12px 28px rgba(24, 35, 30, .14);
    pointer-events: auto;
}

.toast-success { border-left-color: #378063; }
.toast-success > .lucide-icon { color: #28745a; }
.toast-error { border-left-color: #ad4545; }
.toast-error > .lucide-icon { color: #a64040; }
.toast-info { border-left-color: #3b75a2; }
.toast-info > .lucide-icon { color: #316897; }
.toast-close { width: 30px; height: 30px; }

.login-page {
    display: grid;
    width: min(100%, 430px);
    min-height: 100vh;
    margin: 0 auto;
    padding: 54px 20px;
    align-content: center;
    gap: 22px;
}

.login-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-brand .brand-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #fff;
    font-size: .75rem;
    font-weight: 800;
    background: var(--primary);
    border-radius: 6px;
}

.login-brand > span:last-child {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.login-brand strong {
    font-size: 1.05rem;
}

.login-brand small {
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
}

.login-panel {
    padding: 26px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
    box-shadow: 0 14px 38px rgba(26, 38, 32, .08);
}

.login-panel header {
    margin-bottom: 22px;
}

.login-panel h1 {
    margin-bottom: 4px;
    font-size: 1.25rem;
}

.login-panel header p {
    margin-bottom: 0;
    color: var(--muted);
    font-size: .8rem;
}

.login-button {
    width: 100%;
    margin-top: 4px;
}

.auth-footer {
    margin-top: 18px;
    color: var(--muted);
    font-size: .76rem;
    text-align: center;
}

.auth-footer a {
    margin-left: 5px;
    color: var(--primary-strong);
    font-weight: 650;
}

.settings-section {
    display: grid;
    padding: 24px 0;
    grid-template-columns: minmax(220px, 340px) minmax(320px, 520px);
    gap: 50px;
    border-top: 1px solid var(--line);
}

.settings-copy p {
    max-width: 300px;
    color: var(--muted);
    font-size: .78rem;
}

.settings-form {
    min-width: 0;
}

.account-facts {
    display: grid;
    margin: 0;
    overflow: hidden;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 5px;
}

.account-facts > div {
    min-width: 0;
    padding: 12px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.account-facts dt {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 650;
}

.account-facts dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: .8rem;
    font-weight: 600;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
    color: var(--muted);
    font-size: .75rem;
}

.pagination .icon-button {
    background: #fff;
    border-color: var(--line);
}

.not-found-page {
    display: flex;
    min-height: 60vh;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.not-found-page h1 {
    margin: 8px 0 4px;
    font-size: 1.25rem;
}

.not-found-page p {
    color: var(--muted);
    font-size: .8rem;
}

#blazor-error-ui {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
    display: none;
    padding: 12px 44px 12px 14px;
    color: #772f2f;
    background: #fff0f0;
    border: 1px solid #e4bcbc;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(30, 20, 20, .12);
}

#blazor-error-ui .dismiss {
    position: absolute;
    top: 8px;
    right: 12px;
    cursor: pointer;
}

.blazor-error-boundary {
    padding: 14px;
    color: #fff;
    background: var(--danger);
    border-radius: 5px;
}

@media (max-width: 1120px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-header {
        align-items: center;
    }

    .toolbar {
        flex-wrap: wrap;
        align-items: flex-end;
    }

    .search-box {
        width: 100%;
    }

    .filter-field,
    .filter-field.compact {
        min-width: min(100%, 220px);
        flex: 1;
    }

    .summary-strip {
        grid-template-columns: 1fr;
    }

    .summary-strip > div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .summary-strip > div:last-child {
        border-bottom: 0;
    }

    .settings-section {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .data-table-wrap,
    .wide-table.data-table-wrap {
        overflow: visible;
        background: transparent;
        border: 0;
    }

    .data-table,
    .wide-table .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .data-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .data-table tbody {
        display: grid;
        gap: 10px;
    }

    .data-table tr {
        overflow: hidden;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 6px;
    }

    .data-table tbody tr:hover {
        background: #fff;
    }

    .data-table td {
        display: grid;
        max-width: none;
        min-height: 42px;
        padding: 9px 12px;
        grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
        align-items: center;
        gap: 10px;
        text-align: right;
    }

    .data-table td::before {
        content: attr(data-label);
        color: #75807c;
        font-size: .68rem;
        font-weight: 650;
        text-align: left;
    }

    .data-table td > * {
        justify-self: end;
    }

    .data-table .primary-cell,
    .data-table td > small {
        text-align: right;
    }

    .data-table td > small {
        grid-column: 2;
    }

    .data-table .truncate-cell {
        max-width: 100%;
    }

    .providers-table {
        min-width: 0;
    }

    .usage-window-cell .usage-windows {
        width: min(100%, 280px);
        min-width: 0;
        justify-self: end;
    }

    .content-section {
        overflow: visible;
        background: transparent;
        border: 0;
    }

    .content-section .section-header {
        margin-bottom: 10px;
        padding: 0;
        border-bottom: 0;
    }

    .content-section .data-table-wrap {
        border: 0;
    }
}

@media (max-width: 560px) {
    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header > .button,
    .page-header-actions,
    .page-header-actions > .button {
        width: 100%;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-field.full,
    .toggle-row.full {
        grid-column: auto;
    }

    .account-facts {
        grid-template-columns: 1fr;
    }

    .modal-backdrop {
        padding: 12px;
        align-items: flex-end;
    }

    .modal-dialog {
        max-height: calc(100vh - 24px);
    }

    .modal-body {
        max-height: calc(100vh - 166px);
        padding: 16px;
    }

    .modal-footer {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-footer .button:only-child {
        grid-column: 1 / -1;
    }

    .model-sync-controls,
    .model-sync-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .model-sync-controls .form-field,
    .model-sync-toolbar .search-box {
        width: 100%;
        flex-basis: auto;
    }

    .model-sync-toolbar .result-count {
        margin-left: 0;
    }

    .login-page {
        padding: 30px 16px;
    }

    .login-panel {
        padding: 22px 18px;
    }

    .toast-host {
        top: 72px;
        right: 16px;
    }
}
