* { box-sizing: border-box; }

:root {
    /* Authoritative FonoMono UI tokens. */
    --fm-color-page: #fbf7ee;
    --fm-color-page-deep: #f4eddf;
    --fm-color-surface: #ffffff;
    --fm-color-text: #2d241d;
    --fm-color-text-secondary: #675b50;
    --fm-color-text-muted: #82776d;
    --fm-color-shell: #231a15;
    --fm-color-border: #e6ddcf;
    --fm-color-border-strong: #d8cdbd;
    --fm-color-primary: #efb914;
    --fm-color-primary-hover: #dca70a;
    --fm-color-primary-soft: #fff6d7;
    --fm-color-danger: #b91c1c;
    --fm-color-danger-soft: #fef2f2;
    --fm-color-warning: #b45309;
    --fm-color-warning-soft: #fff7ed;
    --fm-color-success: #15803d;
    --fm-color-success-soft: #ecfdf3;
    --fm-color-info: #2f5f86;
    --fm-color-info-soft: #eff6ff;

    --fm-border: 1px solid var(--fm-color-border);
    --fm-border-strong: 1px solid var(--fm-color-border-strong);
    --fm-radius-control: 8px;
    --fm-radius-card: 12px;
    --fm-radius-pill: 999px;
    --fm-shadow-card: 0 1px 2px rgba(55, 39, 26, 0.05);
    --fm-shadow-menu: 0 10px 32px rgba(52, 37, 23, 0.12);
    --fm-focus-ring: 0 0 0 3px rgba(239, 185, 20, 0.28);

    --fm-control-height: 40px;
    --fm-compact-control-height: 32px;
    --fm-control-padding-x: 12px;
    --fm-search-field-width: 240px;
    --fm-toolbar-gap: 9px;
    --fm-toolbar-padding-y: 11px;
    --fm-toolbar-padding-x: 16px;
    --fm-kpi-item-height: 56px;
    --fm-kpi-item-min-width: 114px;
    --fm-kpi-gap: 8px;
    --fm-kpi-padding-y: 7px;
    --fm-kpi-padding-x: 10px;
    --fm-table-row-height: 52px;
    --fm-table-heading-height: 39px;
    --fm-table-cell-padding-y: 9px;
    --fm-table-cell-padding-x: 14px;
    --fm-card-padding: 16px;
    --fm-card-gap: 16px;
    --fm-status-height: 24px;
    --fm-status-padding-x: 9px;
    --fm-empty-state-height: 112px;
    --fm-tab-nav-height: 54px;
    --fm-tab-nav-gap: 2px;
    --fm-tab-nav-padding-x: 16px;
    --fm-tab-nav-padding-x-compact: 9px;
    --fm-tab-gap: 7px;
    --fm-tab-padding-x: 13px;
    --fm-tab-underline-height: 2px;
    --fm-tab-underline-inset: 11px;
    --fm-tab-badge-height: 19px;
    --fm-tab-badge-min-width: 23px;
    --fm-tab-badge-padding-x: 5px;
    --fm-row-action-wide-width: 84px;

    --fm-type-page-title: clamp(24px, 2.4vw, 32px);
    --fm-type-section-title: 16px;
    --fm-type-subsection-title: 14px;
    --fm-type-body: 14px;
    --fm-type-control: 13px;
    --fm-type-meta: 12px;
    --fm-type-table-heading: 11px;
    --fm-type-status: 11px;
    --fm-type-tab: var(--fm-type-control);
    --fm-weight-tab: 680;
    --fm-line-body: 1.5;
    --fm-line-control: 1.3;
    --fm-line-meta: 1.4;
    --fm-line-tab: var(--fm-line-control);

    /* Compatibility aliases for existing non-transitioned pages. */
    --page: var(--fm-color-page);
    --page-deep: var(--fm-color-page-deep);
    --card: var(--fm-color-surface);
    --text: var(--fm-color-text);
    --muted: var(--fm-color-text-secondary);
    --border: var(--fm-color-border);
    --border-strong: var(--fm-color-border-strong);
    --yellow: var(--fm-color-primary);
    --yellow-deep: var(--fm-color-primary-hover);
    --yellow-soft: var(--fm-color-primary-soft);
    --amber: #b45309;
    --amber-soft: #fff7ed;
    --green: #15803d;
    --green-soft: #ecfdf3;
    --red: #b91c1c;
    --red-soft: #fef2f2;
    --blue: #2f5f86;
    --blue-soft: #eff6ff;
    --shadow: 0 8px 24px rgba(36, 27, 19, 0.06);
    --rail: var(--fm-color-shell);
    --rail-muted: #bdb2a2;
    --rail-text: #fffaf0;
    --shell-ink: var(--fm-color-text);
    --shell-ink-soft: var(--fm-color-text-secondary);
    --shell-ink-faint: var(--fm-color-text-muted);
    --shell-brown: var(--fm-color-shell);
    --shell-cream: var(--fm-color-page);
    --shell-cream-deep: var(--fm-color-page-deep);
    --shell-line: var(--fm-color-border);
    --shell-line-strong: var(--fm-color-border-strong);
    --shell-yellow: var(--fm-color-primary);
    --shell-yellow-hover: var(--fm-color-primary-hover);
    --shell-yellow-soft: var(--fm-color-primary-soft);
    --shell-focus: var(--fm-focus-ring);
    --shell-sidebar-width: 232px;
    --shell-topbar-height: 64px;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0;
    color: var(--text);
    background: var(--page);
    font-size: var(--fm-type-body);
    line-height: var(--fm-line-body);
}

a { color: #3a2d10; }

.admin-shell {
    width: min(100% - 1.5rem, 1280px);
    margin: 0 auto;
    padding: 0.65rem 0 2rem;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.45rem;
    padding: 0.45rem 0 0.25rem;
}

.admin-brand-area {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    text-decoration: none;
    flex: 0 0 auto;
}

.brand-logo {
    width: 104px;
    height: auto;
    max-height: 34px;
    object-fit: contain;
}

.brand-wordmark {
    font-weight: 900;
    font-size: 1.1rem;
}

.brand-subtitle {
    border-left: 1px solid var(--border);
    padding-left: 0.55rem;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.page-title-block {
    min-width: 0;
    padding-left: 0.2rem;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.28rem;
    line-height: 1.18;
    font-weight: 750;
}

.admin-kicker {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 650;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.75rem;
    padding: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
}

.admin-nav a {
    color: var(--muted);
    text-decoration: none;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    border-radius: 0;
    padding: 0.48rem 0.22rem 0.42rem;
    font-weight: 650;
}

.admin-nav a:hover {
    color: var(--text);
    border-bottom-color: #eadfcb;
}

.admin-nav a.current {
    color: var(--text);
    background: transparent;
    border-color: var(--yellow-deep);
    box-shadow: none;
}

.admin-nav a.advanced-nav {
    color: #86796a;
    font-weight: 600;
    margin-left: auto;
}

.notice-row { margin: 0 0 1rem; }

main { display: block; }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.78rem 0.88rem;
    margin: 0.72rem 0;
    box-shadow: none;
}

.card h2,
.card h3 {
    margin-top: 0;
    color: var(--text);
}

.card p:last-child { margin-bottom: 0; }

.compact-panel {
    padding: 0.62rem 0.72rem;
    margin: 0.55rem 0;
}

.compact-panel h2,
.compact-panel h3 {
    margin-bottom: 0.35rem;
}

.card.readonly,
.card.info {
    border-left: 5px solid var(--blue);
    background: #fff;
}

.card.ok,
.card.good,
.lifecycle-panel.good,
.reservation-status {
    border-left: 4px solid var(--green);
    background: var(--green-soft);
}

.card.warn,
.lifecycle-panel.warn,
.email-test-panel,
.approve-send-panel {
    border-left: 4px solid var(--amber);
    background: #fff;
}

.card.bad,
.card.danger,
.danger-panel {
    border-left: 4px solid var(--red);
    background: var(--red-soft);
}

.lifecycle-panel,
.main-actions {
    border-left: 4px solid var(--yellow-deep);
}

.hero-card,
.primary-workflow-card {
    border-color: var(--border);
    background: #fff;
    box-shadow: 0 1px 6px rgba(36, 27, 19, 0.04);
}

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

.dashboard-launchpad {
    display: grid;
    gap: 0.55rem;
}

.dashboard-primary {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.75fr);
    gap: 0.65rem;
    align-items: stretch;
}

.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 0.65rem;
}

.compact-dashboard-cards {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.summary-card {
    margin: 0;
    min-height: 100%;
}

.summary-value {
    display: block;
    font-size: 1.45rem;
    line-height: 1.1;
    font-weight: 900;
    margin: 0.15rem 0;
}

.metric-label {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 0.45rem;
    margin: 0.55rem 0;
}

.workflow-step {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.48rem 0.55rem;
    background: #fff;
}

.workflow-step.active {
    border-color: #eadca8;
    background: var(--yellow-soft);
}

.workflow-step.muted-step {
    opacity: 0.72;
}

.step-number {
    display: inline-grid;
    place-items: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #eadca8;
    font-weight: 800;
    margin-right: 0.35rem;
}

.status-summary,
.recommended-action {
    display: grid;
    gap: 0.45rem;
}

.status-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.42rem;
}

.status-pill {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.42rem 0.52rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
}

a.status-pill {
    color: var(--text);
    text-decoration: none;
}

a.status-pill:hover {
    background: var(--yellow-soft);
}

.status-pill span {
    color: var(--muted);
    font-size: 0.8rem;
}

.status-line {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.45rem 0;
    border-bottom: 1px solid #eee5d7;
}

.status-line:last-child { border-bottom: 0; }

.filter-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(150px, 1fr)) auto;
    gap: 0.55rem;
    align-items: end;
}

.filter-grid label {
    display: block;
}

.filter-grid label input,
.filter-grid label select,
.filter-grid .compact-field select {
    width: 100%;
    margin-top: 0.25rem;
}

.compact-filters {
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.compact-filters label:first-child {
    grid-column: span 2;
}

.form-actions,
.button-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.compact-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: baseline;
}

.action-list {
    display: grid;
    gap: 0.6rem;
}

.action-link {
    display: block;
    padding: 0.58rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: var(--text);
    font-weight: 720;
}

.action-link.primary,
.button-link.primary,
button.primary {
    background: var(--yellow);
    border-color: var(--yellow-deep);
    color: var(--text);
    box-shadow: inset 0 -2px 0 rgba(42, 33, 24, 0.12);
}

.button-link,
.button-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 6px;
    padding: 0.32rem 0.5rem;
    font-weight: 650;
    font-size: 0.9rem;
    margin: 0 0.22rem 0.25rem 0;
}

.button-actions .inline-advanced {
    margin: 0 0 0.25rem;
}

.button-link.secondary,
.secondary,
button.secondary {
    background: #fff;
    color: var(--text);
}

.action-link span {
    display: block;
    color: var(--muted);
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: 0.18rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

th, td {
    text-align: left;
    border-bottom: 1px solid var(--border);
    padding: 0.48rem 0.55rem;
    vertical-align: top;
}

th {
    background: #faf7ef;
    color: var(--text);
    font-size: 0.83rem;
    font-weight: 650;
}

table.compact-table th,
table.compact-table td {
    padding: 0.42rem 0.48rem;
}

tr.released, .released { background: #faf5ea; }

.ledger-list {
    display: grid;
    gap: 0.42rem;
}

.ledger-row {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.52rem 0.62rem;
    box-shadow: none;
}

.ledger-row.released {
    opacity: 0.82;
    border-color: var(--border);
}

.ledger-main {
    display: grid;
    grid-template-columns: minmax(240px, 1.45fr) minmax(155px, 0.85fr) minmax(135px, 0.7fr);
    gap: 0.65rem;
    align-items: start;
}

.ledger-status-title {
    font-size: 0.95rem;
    font-weight: 650;
}

.decision-list {
    display: grid;
    gap: 0.5rem;
}

.decision-list.compact-decisions {
    gap: 0.38rem;
}

.decision-card {
    border: 1px solid var(--border);
    border-left: 4px solid var(--blue);
    border-radius: 6px;
    background: #fff;
    padding: 0.5rem 0.62rem;
}

.decision-card.good {
    border-left-color: var(--green);
    background: #fff;
}

.decision-card.warn {
    border-left-color: var(--amber);
    background: #fff;
}

.decision-card.bad {
    border-left-color: var(--red);
    background: var(--red-soft);
}

.decision-card h3 {
    margin: 0 0 0.18rem;
    font-size: 0.98rem;
}

.decision-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: start;
}

.compact-decision-main {
    align-items: center;
}

.decision-actions {
    justify-content: flex-end;
}

.fix-list {
    margin: 0.42rem 0;
    padding-left: 1.35rem;
}

.fix-list li {
    margin: 0.25rem 0;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.18rem;
    margin-top: 0.22rem;
}

.row-details {
    margin-top: 0.38rem;
}

.row-details > summary {
    cursor: pointer;
    font-weight: 650;
    font-size: 0.9rem;
    color: var(--muted);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.45rem 0.75rem;
    margin: 0.48rem 0 0;
}

.detail-grid dt {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 750;
}

.detail-grid dd {
    margin: 0.15rem 0 0;
}

.detail-grid .wide { grid-column: 1 / -1; }

.ok { color: var(--green); font-weight: 750; }
.bad { color: var(--red); font-weight: 750; }
.warn, .warn-text { color: var(--amber); font-weight: 750; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.money, .money-value { white-space: nowrap; }
.money-value { cursor: help; }

.help {
    cursor: help;
    color: var(--muted);
    font-size: 0.85rem;
    margin-left: 0.2rem;
}

.tag {
    display: inline-block;
    padding: 0.08rem 0.32rem;
    border-radius: 999px;
    background: #f3eee3;
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    margin: 0 0.12rem 0.16rem 0;
    white-space: nowrap;
}

.tag.good { background: #dcfce7; color: #166534; }
.tag.warn { background: var(--amber-soft); color: #6f4700; }
.tag.bad { background: #fee2e2; color: #991b1b; }
.tag.info { background: var(--blue-soft); color: #224c6b; }

input, button, select, textarea {
    font: inherit;
    padding: 0.34rem 0.48rem;
}

button {
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-weight: 650;
    box-shadow: none;
}

button:hover,
.action-link:hover,
.button-link:hover,
.period-shortcuts a:hover {
    background: var(--yellow-soft);
}

.action-link.primary:hover,
.button-link.primary:hover,
button.primary:hover {
    background: var(--yellow-deep);
}

button.guarded:hover,
.button-link.guarded:hover {
    background: #ffedd5;
}

button.guarded,
.button-link.guarded {
    background: var(--amber-soft);
    border-color: var(--amber);
    color: #4a2f00;
}

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

label { font-weight: 700; }
label { font-size: 0.92rem; }

label.field {
    display: block;
    margin: 0 0 1rem;
}

label.compact-field {
    display: inline-block;
    min-width: min(100%, 24rem);
    margin-right: 0.75rem;
}

label.checkbox-line {
    display: block;
    margin: 0.8rem 0;
    font-weight: 750;
}

label.field input[type="text"],
label.field textarea,
.card label input[type="text"],
.card label input[type="number"],
label.field select {
    display: block;
    width: min(100%, 42rem);
    margin-top: 0.25rem;
}

textarea {
    display: block;
    width: min(100%, 48rem);
    min-height: 6rem;
    margin-top: 0.25rem;
}

input[type="text"], input[type="number"], input[type="date"], select {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--text);
}

code {
    background: #f3eee3;
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
}

pre.payload-preview {
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    white-space: pre;
}

details.advanced {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.58rem 0.72rem;
    margin: 0.65rem 0;
}

details.advanced > summary,
details.inline-advanced > summary {
    cursor: pointer;
    font-weight: 650;
    color: var(--text);
}

details.inline-advanced {
    display: inline-block;
    margin: 0 0.35rem 0.25rem 0;
}

details.inline-advanced > summary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    padding: 0.32rem 0.5rem;
    min-height: 1.9rem;
    font-size: 0.9rem;
}

details.inline-advanced[open] > summary,
details.inline-advanced > summary:hover {
    background: var(--yellow-soft);
}

details.inline-advanced .button-actions {
    margin-top: 0.35rem;
    padding: 0.42rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(36, 27, 19, 0.06);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.5rem 0;
    padding: 0.38rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.pagination-summary,
.pagination-links {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.pagination .button-link {
    margin-bottom: 0;
}

.period-shortcuts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.period-shortcuts a {
    color: var(--text);
    text-decoration: none;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 0.22rem 0.5rem;
    font-weight: 650;
    font-size: 0.9rem;
}

.actions a {
    display: inline-block;
    margin: 0 0.22rem 0.25rem 0;
    line-height: 1.35;
}

.inline-form {
    display: inline-block;
    margin: 0 0.22rem 0.25rem 0;
}

.inline-form button { padding: 0.32rem 0.5rem; }

.statement-document {
    overflow-x: auto;
    background: #fff;
}

.statement-document header { border-bottom: 2px solid #111; }
.statement-document table { margin: 0.75rem 0; }
.statement-document h1,
.statement-document h2 { color: #111; }

ul.compact {
    margin: 0.25rem 0 0 1.1rem;
    padding: 0;
}

.service-block { margin-bottom: 0.55rem; }
.service-heading { font-weight: 800; margin-bottom: 0.15rem; }

.auto-send {
    border: 1px solid var(--border);
    background: #fff;
    padding: 0.75rem;
    margin: 1rem 0;
    border-radius: 8px;
}

hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 1.2rem 0;
}

@media (max-width: 800px) {
    .admin-shell { width: min(100% - 1rem, 1180px); padding-top: 1rem; }
    .admin-header { display: block; }
    .admin-brand-area { display: block; }
    .brand-lockup { margin-bottom: 0.75rem; }
    .admin-nav a { flex: 1 1 auto; text-align: center; }
    .admin-nav a.advanced-nav { margin-left: 0; }
    .dashboard-primary,
    .filter-grid,
    .ledger-main,
    .decision-main,
    .workflow-steps {
        grid-template-columns: 1fr;
    }
    label.compact-field { display: block; min-width: 0; }
    table { display: block; overflow-x: auto; }
}

/* Phase 1 shared application shell */
html,
body {
    min-height: 100%;
}

.admin-shell {
    display: grid;
    grid-template-columns: 204px minmax(0, 1fr);
    width: 100%;
    min-height: 100vh;
    max-width: none;
    margin: 0;
    padding: 0;
}

.app-rail {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    padding: 1.2rem 0.8rem;
    overflow-y: auto;
    color: var(--rail-text);
    background: var(--rail);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.app-rail .brand-lockup {
    display: grid;
    justify-items: start;
    gap: 0.45rem;
    min-height: 80px;
    margin: 0 0.25rem 1.2rem;
    padding: 0.25rem 0.35rem 0.9rem;
    color: var(--rail-text);
}

.app-rail .brand-logo {
    width: 86px;
    max-height: 48px;
}

.app-rail .brand-subtitle {
    padding: 0;
    border: 0;
    color: var(--rail-text);
    font-size: 0.98rem;
    letter-spacing: 0.01em;
}

.app-rail .admin-nav,
.mobile-navigation-panel {
    display: grid;
    gap: 1.05rem;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.nav-group-label {
    margin: 0 0 0.35rem;
    padding: 0 0.65rem;
    color: var(--rail-muted);
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-group-links {
    display: grid;
    gap: 0.14rem;
}

.app-rail .admin-nav a,
.mobile-navigation-panel a {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 0.48rem 0.65rem;
    color: #e9e1d6;
    text-align: left;
    text-decoration: none;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 5px;
    background: transparent;
    font-weight: 650;
}

.app-rail .admin-nav a:hover,
.mobile-navigation-panel a:hover {
    color: #fff;
    border-left-color: rgba(247, 201, 72, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

.app-rail .admin-nav a.current,
.mobile-navigation-panel a.current {
    color: #fff;
    border-left-color: var(--yellow);
    background: rgba(247, 201, 72, 0.13);
    box-shadow: none;
}

.app-workspace {
    min-width: 0;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-height: 58px;
    margin: 0;
    padding: 0.65rem 1.5rem;
    background: rgba(255, 255, 255, 0.78);
    border-bottom: 1px solid var(--border);
}

.admin-header form {
    margin: 0;
}

.admin-header button,
.mobile-navigation > summary,
.button-link,
button,
input:not([type="hidden"]),
select {
    min-height: 36px;
}

.app-page {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.35rem 1.5rem 2rem;
}

.page-header {
    margin: 0 0 1rem;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(1.55rem, 2.2vw, 2rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
}

.page-header p {
    max-width: 72ch;
    margin: 0.28rem 0 0;
    line-height: 1.4;
}

.notice-row {
    margin: -0.25rem 0 1rem;
}

.mobile-utility,
.mobile-brand,
.mobile-navigation {
    display: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(229, 174, 18, 0.72);
    outline-offset: 2px;
}

@media (max-width: 1080px) {
    .admin-shell {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        padding: 0;
    }

    .app-rail {
        display: none;
    }

    .admin-header {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        padding: 0.6rem 1.5rem;
    }

    .mobile-utility {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        min-width: 0;
    }

    .mobile-brand {
        display: inline-flex;
        align-items: center;
        gap: 0.45rem;
        color: var(--text);
        text-decoration: none;
        font-weight: 800;
        white-space: nowrap;
    }

    .mobile-brand .brand-logo {
        width: 54px;
        max-height: 32px;
    }

    .mobile-navigation {
        position: relative;
        display: block;
    }

    .mobile-navigation > summary {
        display: inline-flex;
        align-items: center;
        cursor: pointer;
        list-style: none;
        padding: 0.42rem 0.65rem;
        border: 1px solid var(--border);
        border-radius: 6px;
        background: #fff;
        font-weight: 700;
    }

    .mobile-navigation > summary::-webkit-details-marker {
        display: none;
    }

    .mobile-navigation-panel {
        position: absolute;
        z-index: 30;
        top: calc(100% + 0.5rem);
        left: 0;
        width: min(300px, calc(100vw - 2rem));
        max-height: calc(100vh - 90px);
        overflow-y: auto;
        padding: 0.85rem;
        color: var(--rail-text);
        background: var(--rail);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        box-shadow: 0 14px 34px rgba(36, 27, 19, 0.24);
    }

    .app-page {
        padding-top: 1.15rem;
    }
}

@media (max-width: 640px) {
    .admin-header {
        padding: 0.55rem 1rem;
    }

    .mobile-brand span {
        display: none;
    }

    .app-page {
        padding: 1rem 1rem 1.5rem;
    }

    .page-header {
        margin-bottom: 0.8rem;
    }
}

/* Phase 1 Dashboard */
.dashboard-overview {
    display: grid;
    gap: 1rem;
}

.dashboard-monthly-summary {
    display: grid;
    grid-template-columns: minmax(190px, 1.15fr) minmax(250px, 0.95fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--yellow-deep);
    border-radius: 8px;
}

.dashboard-month-copy h2,
.dashboard-panel h2 {
    margin: 0;
}

.dashboard-month-heading {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
    margin-top: 0.12rem;
}

.dashboard-month-heading h2 {
    font-size: 1.45rem;
    line-height: 1.15;
}

.dashboard-period-state {
    padding: 0.12rem 0.38rem;
    color: #24533a;
    background: var(--green-soft);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 750;
}

.dashboard-period-dates {
    margin: 0.38rem 0 0;
}

.dashboard-month-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(72px, 1fr));
    overflow: hidden;
    background: #fbf8f1;
    border: 1px solid var(--border);
    border-radius: 7px;
}

.dashboard-month-metrics a {
    display: grid;
    gap: 0.05rem;
    min-height: 58px;
    padding: 0.48rem 0.65rem;
    color: var(--text);
    text-decoration: none;
    border-right: 1px solid var(--border);
}

.dashboard-month-metrics a:last-child {
    border-right: 0;
}

.dashboard-month-metrics a:hover {
    background: var(--yellow-soft);
}

.dashboard-month-metrics span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 650;
}

.dashboard-month-metrics strong {
    font-size: 1.1rem;
    line-height: 1.2;
}

.dashboard-month-action {
    justify-self: end;
}

.dashboard-month-action .button-link {
    margin: 0;
    white-space: nowrap;
}

.dashboard-panel {
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid var(--border);
}

.dashboard-panel-header h2 {
    font-size: 1.15rem;
    line-height: 1.2;
}

.dashboard-panel-header p {
    margin: 0.18rem 0 0;
    font-size: 0.86rem;
}

.dashboard-panel-header .button-link {
    flex: 0 0 auto;
    margin: 0;
}

.dashboard-table-wrap {
    overflow-x: auto;
}

.dashboard-action-table,
.dashboard-activity-table {
    border-radius: 0;
}

.dashboard-action-table th,
.dashboard-action-table td,
.dashboard-activity-table th,
.dashboard-activity-table td {
    padding: 0.58rem 0.72rem;
    vertical-align: middle;
}

.dashboard-action-table tbody tr:last-child td,
.dashboard-activity-table tbody tr:last-child td {
    border-bottom: 0;
}

.dashboard-action-table .dashboard-customer-column { width: 18%; }
.dashboard-action-table .dashboard-problem-column { width: 24%; }
.dashboard-action-table .dashboard-action-column { width: 200px; }

.dashboard-attention-row.warn-row td:first-child {
    box-shadow: inset 3px 0 0 var(--amber);
}

.dashboard-attention-row.bad-row td:first-child {
    box-shadow: inset 3px 0 0 var(--red);
}

.dashboard-row-action {
    width: auto;
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

.dashboard-cell-note {
    display: block;
    margin-top: 0.1rem;
    color: var(--muted);
    font-size: 0.76rem;
}

.dashboard-cell-stack {
    display: block;
}

.dashboard-panel-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.6rem 0.85rem;
    border-top: 1px solid var(--border);
}

.dashboard-panel-footer .button-link {
    margin: 0;
}

.dashboard-panel-message,
.dashboard-empty-state {
    padding: 0.9rem;
}

.dashboard-panel-message p {
    margin-top: 0;
}

.dashboard-empty-state {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.7rem;
    align-items: baseline;
}

.dashboard-system-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 1.15rem;
    align-items: center;
    padding: 0.62rem 0.78rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.55);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

.dashboard-system-strip > strong {
    color: var(--text);
}

.dashboard-system-strip span {
    display: inline-flex;
    gap: 0.3rem;
    align-items: baseline;
}

.dashboard-system-strip b {
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .dashboard-monthly-summary {
        grid-template-columns: 1fr;
    }

    .dashboard-month-metrics {
        width: min(100%, 430px);
    }

    .dashboard-month-action {
        justify-self: start;
    }
}

@media (max-width: 820px) {
    .dashboard-action-table thead,
    .dashboard-activity-table thead {
        display: none;
    }

    .dashboard-action-table,
    .dashboard-action-table tbody,
    .dashboard-action-table tr,
    .dashboard-action-table td,
    .dashboard-activity-table,
    .dashboard-activity-table tbody,
    .dashboard-activity-table tr,
    .dashboard-activity-table td {
        display: block;
        width: 100%;
    }

    .dashboard-action-table tr,
    .dashboard-activity-table tr {
        padding: 0.48rem 0.65rem;
        border-bottom: 1px solid var(--border);
    }

    .dashboard-action-table td,
    .dashboard-activity-table td {
        display: grid;
        grid-template-columns: 115px minmax(0, 1fr);
        gap: 0.65rem;
        padding: 0.32rem 0;
        border: 0;
        box-shadow: none;
    }

    .dashboard-action-table td::before,
    .dashboard-activity-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 750;
    }

    .dashboard-row-action {
        width: auto;
        justify-self: start;
    }

    .dashboard-activity-table td > .tag {
        justify-self: start;
    }
}

@media (max-width: 520px) {
    .dashboard-month-metrics {
        grid-template-columns: 1fr;
    }

    .dashboard-month-metrics a {
        grid-template-columns: 1fr auto;
        min-height: 42px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .dashboard-month-metrics a:last-child {
        border-bottom: 0;
    }

    .dashboard-action-table td,
    .dashboard-activity-table td {
        grid-template-columns: 1fr;
        gap: 0.16rem;
    }
}

/* Change B authentication and shared product shell */
html {
    background: var(--shell-cream);
}

body {
    min-height: 100vh;
    color: var(--shell-ink);
    background: var(--shell-cream);
    -webkit-font-smoothing: antialiased;
}

.admin-shell {
    display: grid;
    grid-template-columns: var(--shell-sidebar-width) minmax(0, 1fr);
    width: 100%;
    min-height: 100vh;
    max-width: none;
    margin: 0;
    padding: 0;
}

.app-rail {
    position: sticky;
    z-index: 40;
    top: 0;
    display: flex;
    width: var(--shell-sidebar-width);
    height: 100vh;
    align-self: start;
    flex-direction: column;
    padding: 0;
    overflow-y: auto;
    color: #f8f0e5;
    background: var(--shell-brown);
    border-right: 0;
}

.shell-brand {
    display: flex;
    min-height: 88px;
    align-items: center;
    gap: 12px;
    padding: 14px 17px 14px 14px;
    color: #fff9ed;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.shell-brand-mark {
    display: grid;
    width: 49px;
    height: 56px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.shell-brand-mark img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.shell-brand-copy {
    min-width: 0;
}

.shell-brand-copy strong,
.shell-brand-copy span {
    display: block;
}

.shell-brand-copy strong {
    color: #fff9ed;
    font-size: 15px;
    letter-spacing: -0.01em;
}

.shell-brand-copy span {
    margin-top: 1px;
    color: #c9bba9;
}

.shell-nav {
    display: block;
    flex: 1;
    margin: 0;
    padding: 18px 12px;
    border: 0;
    background: transparent;
}

.shell-nav-label {
    display: block;
    padding: 0 10px 8px;
    color: #88796b;
    font-weight: 750;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.shell-nav-link {
    position: relative;
    display: flex;
    height: 43px;
    align-items: center;
    gap: 12px;
    margin: 0 0 3px;
    padding: 0 11px;
    color: #d6cbbf;
    text-align: left;
    text-decoration: none;
    border: 0;
    border-radius: 8px;
    background: transparent;
    font-size: 13px;
    font-weight: 650;
    transition: background 0.16s ease, color 0.16s ease;
}

.shell-nav-link svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.shell-nav-link:hover {
    color: #fff9ed;
    background: rgba(255, 255, 255, 0.06);
}

.shell-nav-link.current {
    color: #ffcf36;
    background: rgba(239, 185, 20, 0.13);
}

.shell-nav-link.current::before {
    content: "";
    position: absolute;
    left: -12px;
    width: 3px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--shell-yellow);
}

.shell-nav-bottom {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 21px 22px;
    color: #a99b8e;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.shell-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #3ba46a;
    box-shadow: 0 0 0 4px rgba(76, 176, 116, 0.1);
}

.shell-status-dot.warning {
    background: #d59b22;
    box-shadow: 0 0 0 4px rgba(213, 155, 34, 0.12);
}

.app-workspace {
    min-width: 0;
}

.admin-header.shell-topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    height: var(--shell-topbar-height);
    min-height: var(--shell-topbar-height);
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0 28px;
    border-bottom: 1px solid var(--shell-line);
    background: rgba(255, 253, 248, 0.94);
    box-shadow: none;
    backdrop-filter: blur(12px);
}

.shell-topbar-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.shell-topbar-title strong {
    font-size: 14px;
    letter-spacing: -0.01em;
}

.shell-topbar-title > span {
    color: var(--shell-ink-faint);
}

.mobile-menu-button {
    display: none;
    width: var(--fm-control-height);
    height: var(--fm-control-height);
    min-height: var(--fm-control-height);
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--shell-ink);
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: #fff;
}

.mobile-menu-button svg {
    width: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.account-wrap {
    position: relative;
}

.account-button {
    display: flex;
    min-height: var(--fm-control-height);
    align-items: center;
    gap: 9px;
    padding: 5px 7px 5px 5px;
    color: var(--shell-ink);
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
}

.account-button:hover,
.account-button[aria-expanded="true"] {
    border-color: var(--shell-line);
    background: #fff;
}

.user-avatar {
    display: inline-grid;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: var(--shell-yellow-soft);
    color: #765306;
    font-style: normal;
    font-weight: 800;
}

.account-name {
    font-size: 13px;
    font-weight: 650;
}

.account-chevron {
    color: var(--shell-ink-faint);
}

.account-menu {
    position: absolute;
    z-index: 60;
    top: calc(100% + 8px);
    right: 0;
    width: 204px;
    padding: 6px;
    border: 1px solid var(--shell-line);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(52, 37, 23, 0.12);
}

.account-menu-identity {
    padding: 7px 9px 9px;
    border-bottom: 1px solid var(--shell-line);
}

.account-menu-identity strong,
.account-menu-identity span {
    display: block;
}

.account-menu-identity strong {
    color: var(--shell-ink);
}

.account-menu-identity span {
    margin-top: 1px;
    color: var(--shell-ink-faint);
}

.account-menu a,
.account-menu form button {
    display: flex;
    width: 100%;
    min-height: 35px;
    align-items: center;
    padding: 9px;
    color: var(--shell-ink-soft);
    text-align: left;
    text-decoration: none;
    border: 0;
    border-radius: 7px;
    background: transparent;
    font-weight: 600;
}

.account-menu a:hover,
.account-menu form button:hover {
    color: var(--shell-ink);
    background: var(--shell-cream);
}

.account-menu form {
    margin: 3px 0 0;
    padding-top: 3px;
    border-top: 1px solid var(--shell-line);
}

.nav-scrim {
    display: none;
}

.app-page {
    width: min(1420px, 100%);
    max-width: 1420px;
    margin: 0 auto;
    padding: 30px 32px 42px;
}

.page-header {
    margin: 0 0 22px;
}

.page-header h1 {
    margin: 0;
    font-size: clamp(24px, 2.4vw, 32px);
    line-height: 1.18;
    letter-spacing: -0.035em;
}

.page-header p {
    max-width: 680px;
    margin: 5px 0 0;
    color: var(--shell-ink-soft);
}

.admin-shell a:focus-visible,
.admin-shell button:focus-visible,
.admin-shell input:focus-visible,
.admin-shell select:focus-visible,
.admin-shell textarea:focus-visible,
.auth-page button:focus-visible,
.auth-page input:focus-visible {
    outline: none;
    box-shadow: var(--shell-focus);
}

/* Approved sign-in treatment */
.auth-page {
    margin: 0;
    background: var(--shell-cream);
}

.auth-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(390px, 0.9fr) minmax(460px, 1.1fr);
}

.auth-brand {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 52px;
    color: #fff7e9;
    background: var(--shell-brown);
}

.auth-brand::before {
    content: "";
    position: absolute;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(239, 185, 20, 0.13);
    border-radius: 50%;
    transform: translate(-42%, -49%);
}

.auth-brand::after {
    content: "";
    position: absolute;
    right: -180px;
    bottom: -170px;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: rgba(239, 185, 20, 0.07);
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    width: min(420px, 100%);
}

.auth-logo {
    width: 170px;
    margin: -22px 0 14px -18px;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.22));
}

.auth-kicker {
    margin: 0 0 12px;
    color: var(--shell-yellow);
    font-weight: 780;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.auth-brand h1 {
    max-width: 440px;
    margin: 0 0 14px;
    color: #fff8ec;
    font-size: clamp(30px, 3.7vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.auth-brand h1 + p {
    max-width: 410px;
    color: #cfc0b0;
    font-size: 14px;
    line-height: 1.7;
}

.auth-proof {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 30px;
    color: #d9cdbf;
    font-weight: 650;
}

.auth-proof-icon {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    border-radius: 50%;
    color: var(--shell-yellow);
    background: rgba(239, 185, 20, 0.16);
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 46px;
    background: var(--shell-cream);
}

.sign-in-card {
    width: min(380px, 100%);
    padding: 30px;
    border: 1px solid var(--shell-line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 18px 55px rgba(56, 39, 24, 0.09);
}

.auth-heading {
    margin-bottom: 22px;
}

.auth-eyebrow {
    display: block;
    margin: 0 0 5px;
    color: #88670b;
    font-weight: 750;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.auth-heading h2 {
    margin: 0 0 4px;
    color: var(--shell-ink);
    font-size: 25px;
    letter-spacing: -0.03em;
}

.auth-heading p {
    margin: 0;
    color: var(--shell-ink-soft);
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
    color: var(--shell-ink);
    font-weight: 680;
}

.auth-submit {
    display: inline-flex;
    width: 100%;
    margin-top: 5px;
    font-weight: 750;
}

.auth-submit:hover {
    background: var(--shell-yellow-hover);
}

.form-alert {
    margin-bottom: 14px;
    padding: 9px 11px;
    color: #b43b35;
    border: 1px solid #efc0bc;
    border-radius: 8px;
    background: #fcebea;
}

.auth-help {
    margin: 17px 0 0;
    color: var(--shell-ink-faint);
    text-align: center;
}

.mobile-auth-brand {
    display: none;
}

/* Account password */
.account-password-layout {
    display: grid;
    grid-template-columns: minmax(0, 620px) 260px;
    align-items: start;
    gap: 18px;
}

.account-password-card,
.account-security-card {
    margin-top: 0;
    padding: 20px;
    border-radius: 12px;
}

.account-password-form {
    display: grid;
    gap: 16px;
}

.account-password-form label {
    display: grid;
    gap: 6px;
    margin: 0;
    font-weight: 700;
}

.field-help {
    color: var(--shell-ink-faint);
    font-weight: 500;
}

.account-password-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding-top: 4px;
}

.account-mode-note {
    padding: 16px;
    color: #735407;
    border: 1px solid #e5ce8a;
    border-radius: 10px;
    background: #fff9e7;
}

.account-mode-note p {
    margin: 5px 0 0;
    color: #8c7742;
}

.account-security-card {
    text-align: center;
}

.account-security-avatar {
    width: 48px;
    height: 48px;
    margin: 0 auto 9px;
    font-size: 16px;
}

.account-security-card h2,
.account-security-card p {
    margin: 0;
}

.account-security-card ul {
    margin: 17px 0 0;
    padding: 13px 0 0 20px;
    color: var(--shell-ink-soft);
    border-top: 1px solid var(--shell-line);
    text-align: left;
}

.account-security-card li + li {
    margin-top: 7px;
}

@media (max-width: 1040px) {
    :root {
        --shell-sidebar-width: 214px;
    }

    .app-page {
        padding-inline: 22px;
    }
}

.fm-sort-link {
    display: inline-flex;
    align-items: center;
    color: inherit;
    font: inherit;
    text-decoration: none;
}

.fm-sort-link:hover,
.fm-sort-link:focus-visible {
    color: #795900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.fm-usage-table th:nth-child(1) { width: 31%; }
.fm-usage-table th:nth-child(2) { width: 13%; }
.fm-usage-table th:nth-child(3) { width: 17%; }
.fm-usage-table th:nth-child(4) { width: 20%; }
.fm-usage-table th:nth-child(5) { width: 14%; }
.fm-usage-table th:nth-child(6) { width: 82px; }

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

    .app-rail {
        position: fixed;
        inset: 0 auto 0 0;
        display: flex;
        transform: translateX(-100%);
        box-shadow: 12px 0 38px rgba(25, 17, 11, 0.24);
        transition: transform 0.2s ease;
    }

    body.nav-open .app-rail {
        transform: translateX(0);
    }

    .nav-scrim {
        position: fixed;
        z-index: 35;
        inset: 0;
        display: block;
        padding: 0;
        border: 0;
        background: rgba(24, 17, 12, 0.43);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s;
    }

    body.nav-open .nav-scrim {
        opacity: 1;
        pointer-events: auto;
    }

    .admin-header.shell-topbar {
        padding-inline: 16px;
    }

    .mobile-menu-button {
        display: inline-flex;
    }

    .shell-topbar-title > span {
        display: none;
    }

    .app-page {
        padding: 24px 18px 36px;
    }

    .auth-layout {
        grid-template-columns: 360px minmax(400px, 1fr);
    }

    .auth-brand {
        padding: 34px;
    }

    .auth-panel {
        padding: 30px;
    }
}

@media (max-width: 680px) {
    .account-name {
        display: none;
    }

    .auth-layout {
        display: block;
    }

    .auth-brand {
        display: none;
    }

    .auth-panel {
        min-height: 100vh;
        padding: 24px;
    }

    .mobile-auth-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 23px;
        color: var(--shell-ink);
        font-weight: 750;
    }

    .mobile-auth-brand img {
        width: 55px;
        height: 55px;
        object-fit: contain;
    }

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

    .account-password-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .account-password-actions .button-link,
    .account-password-actions button {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 430px) {
    .admin-header.shell-topbar {
        padding-inline: 10px;
    }

    .app-page {
        padding-inline: 12px;
    }

    .shell-topbar-title strong {
    }

    .sign-in-card {
        padding: 23px 20px;
    }
}

/* Prototype conformity correction pass: operator workflow surfaces only. */
.account-menu-identity {
    display: block;
    min-width: 0;
    color: #493b2f;
    font-weight: 700;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-limitation-note {
    margin: -3px 0 14px;
    padding: 9px 12px;
    border: 1px solid #e6dccb;
    border-radius: 8px;
    background: #fffdf8;
    color: #6b5c4e;
}

.fm-customer-table {
    min-width: 820px;
    table-layout: fixed;
}

.fm-customer-table th:nth-child(1) { width: 31%; }
.fm-customer-table th:nth-child(2) { width: 16%; }
.fm-customer-table th:nth-child(3) { width: 24%; }
.fm-customer-table th:nth-child(4) { width: 16%; }
.fm-customer-table th:nth-child(5) { width: 150px; }

.fm-customer-table td {
    height: 52px;
    padding-block: 9px;
    vertical-align: middle;
}

.fm-match-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.fm-match-compact i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.fm-match-compact i.linked { background: #3c9c68; }
.fm-match-compact i.missing { background: #c28328; }

.fm-heading-more {
    position: relative;
    flex: 0 0 auto;
}

.fm-heading-more > summary {
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid #d9cebd;
    border-radius: 8px;
    background: #fff;
    color: #514438;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.fm-heading-more > summary::-webkit-details-marker { display: none; }
.fm-heading-more > summary::after { content: "\25BE"; margin-left: 7px; }
.fm-heading-more[open] > summary::after { content: "\25B4"; }

.fm-heading-more > div {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    display: grid;
    min-width: 170px;
    padding: 6px;
    border: 1px solid #ddd2c2;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(47, 36, 25, 0.16);
}

.fm-heading-more > div a {
    padding: 8px 9px;
    border-radius: 6px;
    color: #4a3c30;
    font-weight: 650;
    text-decoration: none;
}

.fm-heading-more > div a:hover { background: #fff6cf; }

.fm-setup-aside {
    align-self: start;
}

.fm-technical-customer-view {
    max-width: 760px;
}

.fm-technical-fallback-panel {
    padding: 22px;
}

.fm-technical-fallback-panel > p {
    margin: 0 0 18px;
    color: #6a5b4e;
}

.fm-technical-fallback-panel form {
    display: grid;
    gap: 18px;
}

.fm-billing-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.fm-heading-month {
    display: grid;
    gap: 5px;
    flex: 0 0 176px;
    color: #6b5c4e;
    font-weight: 750;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.fm-upcoming-filters {
    min-height: 62px;
    flex-wrap: nowrap;
}

.fm-upcoming-filters .fm-search-field { flex: 0 1 280px; }
.fm-upcoming-filters .fm-control-field { flex: 0 1 190px; }

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

.fm-upcoming-table {
    min-width: 760px;
    table-layout: fixed;
}

.fm-upcoming-table th:nth-child(1) { width: 28%; }
.fm-upcoming-table th:nth-child(2) { width: 21%; }
.fm-upcoming-table th:nth-child(3) { width: 10%; }
.fm-upcoming-table th:nth-child(4) { width: 18%; }
.fm-upcoming-table th:nth-child(5) { width: 15%; }
.fm-upcoming-table th:nth-child(6) { width: 82px; }

.fm-upcoming-table td {
    height: 52px;
    padding-block: 9px;
    vertical-align: middle;
}

.fm-estimate-note {
    color: #7d7166;
    white-space: nowrap;
}

.fm-disabled-link {
    color: #a0978e;
    cursor: not-allowed;
    font-weight: 700;
}

.fm-dashboard-run-list {
    display: grid;
}

.fm-dashboard-run-list > a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px 58px 42px;
    align-items: center;
    gap: 8px;
    min-height: 62px;
    padding: 9px 17px;
    border-top: 1px solid var(--shell-line);
    color: #3f342b;
    text-decoration: none;
}

.fm-dashboard-run-list > a:hover { background: #fffdf7; }
.fm-dashboard-run-list > a > span { display: grid; gap: 2px; }
.fm-dashboard-run-list > a > span:not(:first-child) { text-align: right; }
.fm-dashboard-run-list small { color: #81766c; }
.fm-dashboard-run-list .fm-run-sent strong { color: #347a52; }
.fm-dashboard-run-list .fm-run-attention strong { color: #9a680d; }
.fm-dashboard-run-list .fm-run-failed strong { color: #a33e39; }
.fm-dot-success { background: #3c9c68; }

@media (max-width: 1040px) {
    .fm-upcoming-filters { flex-wrap: wrap; }
    .fm-upcoming-filters .fm-search-field { flex: 1 1 250px; }
    .fm-upcoming-filters .fm-control-field { flex: 1 1 170px; }
}

@media (max-width: 840px) {
    .fm-customer-table { min-width: 720px; }
    .fm-customer-table th:last-child,
    .fm-customer-table td:last-child,
    .fm-upcoming-table th:last-child,
    .fm-upcoming-table td:last-child {
        position: sticky;
        right: 0;
        z-index: 2;
        background: #fff;
        box-shadow: -8px 0 14px -14px rgba(45, 33, 22, 0.65);
    }
    .fm-customer-table th:last-child,
    .fm-upcoming-table th:last-child {
        z-index: 3;
        background: #fcfaf6;
    }
    .fm-billing-heading { align-items: flex-start; }
}

@media (max-width: 680px) {
    .fm-billing-heading { display: grid; }
    .fm-heading-month { width: 176px; }
    .fm-upcoming-filters .fm-search-field,
    .fm-upcoming-filters .fm-control-field { flex-basis: 100%; }
}

/* Absolute final authority for the prototype run-summary geometry. */
.fm-upcoming-summary {
    grid-template-columns: minmax(280px, 1fr) auto auto;
    align-items: center;
    gap: 20px;
}

.fm-upcoming-exception-action {
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
    justify-content: flex-end;
}

@media (max-width: 1040px) {
    .fm-upcoming-summary {
        grid-template-columns: minmax(270px, 1fr) auto;
    }

    .fm-upcoming-exception-action {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
        justify-content: flex-start;
    }
}

@media (max-width: 430px) {
    .fm-upcoming-summary {
        grid-template-columns: 1fr;
    }

    .fm-upcoming-exception-action {
        grid-column: auto;
        grid-row: auto;
    }
}

/* Final Billing authority: prototype heading, compact charges period and fixed action slot. */
.fm-billing-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.fm-billing-heading-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.fm-billing-heading-copy > * {
    margin: 0;
}

.fm-heading-period {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
    padding: 0 13px;
    color: #6b5c4e;
    border: 1px solid #d9cebd;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(47, 36, 25, 0.06);
    font-weight: 750;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.fm-heading-period strong {
    color: #342a23;
    font-weight: 700;
    letter-spacing: normal;
    text-transform: none;
}

.fm-upcoming-summary {
    grid-template-columns: minmax(280px, 1fr) auto auto;
    gap: 20px;
    align-items: center;
}

.fm-upcoming-period-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.fm-no-exceptions {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    color: #24533a;
    border: 1px solid #bed7c6;
    border-radius: 7px;
    background: #f0f8f2;
    font-weight: 750;
    white-space: nowrap;
}

.fm-building-state {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 6px 11px;
    color: #73520d;
    border: 1px solid #e2c67f;
    border-radius: 7px;
    background: #fff8df;
    font-weight: 750;
    white-space: nowrap;
}

.fm-upcoming-period,
.fm-upcoming-period-copy {
    min-width: 0;
}

.fm-workspace-notice.information {
    color: #5f4d26;
    background: #fffaf0;
    border-color: #ead7a1;
}

@media (max-width: 1040px) {
    .fm-upcoming-summary {
        grid-template-columns: minmax(270px, 1fr) auto;
    }

    .fm-upcoming-exception-action {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        justify-content: flex-start;
    }
}

@media (max-width: 680px) {
    .fm-billing-heading {
        display: grid;
        align-items: start;
    }

    .fm-heading-period {
        justify-self: start;
    }

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

    .fm-upcoming-exception-action {
        grid-column: auto;
        grid-row: auto;
        justify-content: flex-start;
    }
}

/* Billing interaction layout must remain last in the cascade. */
.fm-billing-heading { display: block; }

.fm-upcoming-summary {
    grid-template-columns: minmax(230px, 1fr) auto auto auto;
    gap: 20px;
}

@media (max-width: 1040px) {
    .fm-upcoming-summary {
        grid-template-columns: minmax(220px, 1fr) auto;
    }
    .fm-upcoming-generation {
        grid-column: 1;
        min-height: 0;
        padding: 11px 0 0;
        border-top: 1px solid var(--shell-line);
        border-left: 0;
    }
    .fm-upcoming-exception-action {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 680px) {
    .fm-upcoming-summary { grid-template-columns: 1fr; }
    .fm-upcoming-generation,
    .fm-upcoming-exception-action {
        grid-column: auto;
        grid-row: auto;
        justify-content: flex-start;
    }
}

/* Billing month and local filters use compact, immediate controls. */
.fm-billing-heading {
    display: block;
}

.fm-upcoming-summary {
    grid-template-columns: minmax(230px, 1fr) auto auto auto;
    gap: 20px;
}

.fm-upcoming-period-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.fm-month-picker {
    position: relative;
    width: max-content;
    margin-top: 2px;
}

.fm-month-picker > summary {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 3px 8px;
    border: 1px solid #d9cebd;
    border-radius: 7px;
    background: #fff;
    color: #796a5d;
    cursor: pointer;
    font-style: normal;
    font-weight: 700;
    list-style: none;
    text-decoration: none;
}

.fm-month-picker > summary::-webkit-details-marker { display: none; }
.fm-month-picker > summary::after { content: "\25BE"; margin-left: 5px; }
.fm-month-picker[open] > summary::after { content: "\25B4"; }

.fm-month-picker > div {
    position: absolute;
    z-index: 20;
    top: calc(100% + 7px);
    left: 0;
    width: 190px;
    padding: 10px;
    border: 1px solid #d9cebd;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(47, 36, 25, 0.16);
}

.fm-month-picker label {
    display: grid;
    gap: 5px;
    color: #6b5c4e;
    font-weight: 750;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.fm-month-picker input {
    width: 100%;
    height: 36px;
    padding: 0 9px;
    border: 1px solid #d9cebd;
    border-radius: 7px;
    background: #fff;
    color: #342a23;
    font: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.fm-upcoming-exception-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.fm-upcoming-exception-action .fm-button {
    white-space: nowrap;
}

.fm-no-exceptions {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 5px 9px;
    border: 1px solid #cbe6d4;
    border-radius: 8px;
    background: #f1faf4;
    color: #3c7655;
    font-weight: 750;
    white-space: nowrap;
}

.fm-no-exceptions i {
    display: grid;
    place-items: center;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    background: #e5f5eb;
    font-style: normal;
}

@media (max-width: 1040px) {
    .fm-upcoming-summary {
        grid-template-columns: minmax(220px, 1fr) auto;
    }
    .fm-upcoming-generation {
        grid-column: 1;
        min-height: 0;
        padding: 11px 0 0;
        border-top: 1px solid var(--shell-line);
        border-left: 0;
    }
    .fm-upcoming-exception-action {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (max-width: 680px) {
    .fm-billing-heading { display: block; }
    .fm-upcoming-summary { grid-template-columns: 1fr; }
    .fm-upcoming-generation,
    .fm-upcoming-exception-action {
        grid-column: auto;
        grid-row: auto;
        justify-content: flex-start;
    }
}

/* Customer directory and setup layout (shared components are defined below). */
/* Accessibility utility deliberately wins over component geometry. */
.fm-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.fm-customer-page {
    width: 100%;
    color: var(--shell-ink);
}

.fm-customer-page *,
.fm-customer-page *::before,
.fm-customer-page *::after {
    box-sizing: border-box;
}

.fm-page-heading,
.fm-setup-heading {
    margin: 0 0 22px;
}

.fm-page-heading h1,
.fm-setup-heading h1 {
    margin: 0 0 5px;
    letter-spacing: -0.035em;
}

.fm-page-heading > p:last-child,
.fm-setup-heading-row > div > p:last-child {
    max-width: 680px;
    margin: 0;
    color: var(--shell-ink-soft);
}

.fm-eyebrow {
    display: block;
    margin: 0 0 5px;
    color: #88670b;
    font-weight: 750;
    letter-spacing: 0.075em;
    text-transform: uppercase;
}

.fm-table-panel,
.fm-setup-form-panel {
    overflow: hidden;
}

.fm-directory-filters > .fm-control-field select {
    min-width: 165px;
}

.fm-filter-spacer {
    flex: 1;
}

.fm-page-size select {
    width: 72px;
}

.fm-more-filters {
    position: relative;
    flex: 0 0 auto;
}

.fm-more-filters > summary {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    padding: 0 13px;
    list-style: none;
    color: var(--shell-ink-soft);
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
}

.fm-more-filters > summary::-webkit-details-marker {
    display: none;
}

.fm-more-filters > summary::after {
    content: "⌄";
    margin-left: 8px;
    color: var(--shell-ink-faint);
}

.fm-more-filters[open] > summary {
    border-color: #c49200;
    background: var(--shell-yellow-soft);
}

.fm-more-filters > div {
    position: absolute;
    z-index: 20;
    top: calc(100% + 7px);
    left: 0;
    display: grid;
    width: 590px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--shell-line-strong);
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(52, 37, 23, 0.12);
}

.fm-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    outline: none;
    scrollbar-color: #9a7b20 #eee8df;
    scrollbar-gutter: stable;
}

.fm-table-wrap:focus-visible {
    box-shadow: inset var(--shell-focus);
}

.fm-customer-table {
    min-width: 940px;
}

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

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

.fm-customer-table th:first-child {
    width: 24%;
}

.fm-customer-table th:nth-child(2) {
    width: 16%;
}

.fm-customer-table th:nth-child(3) {
    width: 19%;
}

.fm-customer-table th:nth-child(4) {
    width: 19%;
}

.fm-subtext,
.fm-match small {
    display: block;
    margin-top: 2px;
    color: var(--shell-ink-faint);
    font-weight: 500;
    line-height: 1.35;
}

.fm-muted {
    color: var(--shell-ink-faint);
}

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

.fm-align-right {
    text-align: right;
}

.fm-match {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fm-match > i {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.fm-match > i.linked {
    background: #3c9c68;
}

.fm-match > i.missing {
    background: #bd5a53;
}

.fm-status-success {
    color: #267a50;
    background: #e8f5ed;
}

.fm-status-warning {
    color: #9a6109;
    background: #fff2d2;
}

.fm-status-danger {
    color: #b43b35;
    background: #fcebea;
}

.fm-status-neutral {
    color: #6f655d;
    background: #f0ede8;
}

.fm-action-cell {
    min-width: 142px;
    white-space: nowrap;
}

.fm-row-action,
.fm-row-more > summary,
.fm-row-more-trigger {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: var(--shell-ink);
    text-decoration: none;
    border: 1px solid var(--shell-line);
    border-radius: 7px;
    background: #fff;
    font-weight: 720;
    white-space: nowrap;
}

.fm-row-action {
    width: 66px;
    min-width: 66px;
}

.fm-row-action.primary {
    border-color: #e0ae15;
    background: var(--shell-yellow-soft);
}

.fm-row-action:hover,
.fm-row-more > summary:hover,
.fm-row-more-trigger:hover {
    border-color: #c9bda9;
    background: var(--shell-cream);
}

.fm-row-more {
    position: relative;
    display: inline-block;
    margin-left: 4px;
    text-align: left;
}

.fm-row-more > summary {
    list-style: none;
    cursor: pointer;
}

.fm-row-more-trigger {
    cursor: pointer;
    font: inherit;
}

.fm-row-more > summary::-webkit-details-marker {
    display: none;
}

.fm-row-more > div {
    position: absolute;
    z-index: 15;
    top: 36px;
    right: 0;
    display: grid;
    width: 160px;
    padding: 6px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(52, 37, 23, 0.12);
}

.fm-row-more > div a {
    padding: 8px;
    color: var(--shell-ink-soft);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 650;
}

.fm-row-more > div a:hover {
    color: var(--shell-ink);
    background: var(--shell-cream);
}

.fm-row-more-menu[popover] {
    position: fixed;
    inset: auto;
    z-index: 100;
    display: none;
    width: 160px;
    margin: 0;
    padding: 6px;
    text-align: left;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(52, 37, 23, 0.18);
}

.fm-row-more-menu[popover]:popover-open {
    display: grid;
}

.fm-row-more-menu[popover] a {
    padding: 8px;
    color: var(--shell-ink-soft);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 650;
}

.fm-row-more-menu[popover] a:hover,
.fm-row-more-menu[popover] a:focus-visible {
    color: var(--shell-ink);
    background: var(--shell-cream);
}

.fm-empty-state strong,
.fm-empty-state span {
    display: block;
}

.fm-empty-state span {
    margin-top: 4px;
    color: var(--shell-ink-faint);
}

.fm-table-footer {
    display: flex;
    min-height: 59px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--shell-line);
    background: #fefcf8;
}

.fm-table-footer p {
    margin: 0;
    color: var(--shell-ink-faint);
}

.fm-pagination > span:not(.current) {
    opacity: 0.4;
}

.fm-pagination > span.current {
    color: #684c00;
    border-color: #c99400;
    background: var(--shell-yellow-soft);
    font-weight: 800;
}

.fm-pagination small {
    padding: 0 4px;
    color: var(--shell-ink-faint);
}

.fm-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 11px 14px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fff;
}

.fm-alert strong {
    flex: 0 0 auto;
}

.fm-alert-success {
    color: #267a50;
    border-color: #bfe1cc;
    background: #e8f5ed;
}

.fm-alert-danger {
    color: #b43b35;
    border-color: #efc4c0;
    background: #fcebea;
}

.fm-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
    color: var(--shell-ink-soft);
    text-decoration: none;
    font-weight: 680;
}

.fm-back-link:hover {
    color: var(--shell-ink);
}

.fm-customer-setup {
    width: min(1160px, 100%);
    margin: 0 auto;
}

.fm-setup-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.fm-heading-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 9px;
}

.fm-setup-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 285px;
    align-items: start;
    gap: 18px;
}

.fm-state-banner {
    display: flex;
    min-height: 55px;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    border-bottom: 1px solid #bfe1cc;
    color: #267a50;
    background: #e8f5ed;
}

.fm-state-warning {
    color: #9a6109;
    border-color: #ead08a;
    background: #fff2d2;
}

.fm-state-danger {
    color: #b43b35;
    border-color: #efc4c0;
    background: #fcebea;
}

.fm-state-neutral {
    color: var(--shell-ink-soft);
    border-color: var(--shell-line);
    background: #f5f2ee;
}

.fm-state-icon {
    display: grid;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-weight: 850;
}

.fm-state-banner strong,
.fm-state-banner small {
    display: block;
}

.fm-state-banner strong {
}

.fm-state-banner small {
    margin-top: 1px;
    color: currentColor;
    opacity: 0.82;
}

.fm-form-section {
    padding: 20px;
    border-bottom: 1px solid var(--shell-line);
}

.fm-section-heading {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 16px;
}

.fm-section-heading h2 {
    margin: 0 0 2px;
}

.fm-section-heading p {
    margin: 0;
    color: var(--shell-ink-soft);
}

.fm-step-number {
    display: grid;
    width: 25px;
    height: 25px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    color: var(--shell-yellow);
    background: var(--shell-brown);
    font-weight: 800;
}

.fm-identity-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fcfaf6;
}

.fm-company-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 8px;
    color: var(--shell-yellow);
    background: #2d211a;
    font-weight: 800;
}

.fm-identity-row small,
.fm-identity-row strong,
.fm-identity-row em {
    display: block;
}

.fm-identity-row small,
.fm-read-only {
    color: var(--shell-ink-faint);
}

.fm-identity-row strong {
}

.fm-identity-row em {
    margin-top: 1px;
    color: var(--shell-ink-soft);
    font-style: normal;
}

.fm-match-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 13px;
    padding: 11px 12px;
    border: 1px solid #bfe0cb;
    border-radius: 9px;
    background: #f5fcf7;
}

.fm-match-card.warning {
    border-color: #e7ce8d;
    background: #fffbef;
}

.fm-match-card > div > span,
.fm-match-card strong,
.fm-match-card small {
    display: block;
}

.fm-match-card > div > span {
    color: var(--shell-ink-faint);
}

.fm-match-card strong {
}

.fm-match-card small {
    margin-top: 1px;
    color: var(--shell-ink-soft);
}

.fm-xero-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "field action"
        "help help";
    align-items: end;
    column-gap: 9px;
    row-gap: 5px;
}

.fm-xero-search-form > .fm-control-field {
    grid-area: field;
}

.fm-xero-search-form > .fm-button {
    grid-area: action;
    align-self: end;
}

.fm-xero-search-help {
    grid-area: help;
    margin: 0;
    color: var(--shell-ink-faint);
    font-weight: 500;
    line-height: 1.45;
}

.fm-inline-message {
    margin-top: 9px;
    padding: 9px 11px;
    color: var(--shell-ink-soft);
    border: 1px solid var(--shell-line);
    border-radius: 8px;
    background: #fcfaf6;
}

.fm-inline-message.danger {
    color: #b43b35;
    border-color: #efc4c0;
    background: #fcebea;
}

.fm-inline-message.warning {
    color: #8c5e08;
    border-color: #ead08a;
    background: #fff9e9;
}

.fm-contact-results {
    display: grid;
    gap: 3px;
    margin-top: 7px;
    padding: 5px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 10px 32px rgba(52, 37, 23, 0.09);
}

.fm-contact-results form {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px;
    border-radius: 7px;
}

.fm-contact-results form:hover {
    background: var(--shell-cream);
}

.fm-contact-results strong,
.fm-contact-results small {
    display: block;
}

.fm-contact-results strong {
}

.fm-contact-results small {
    color: var(--shell-ink-faint);
}

.fm-contact-results button {
    padding: 5px 9px;
    color: #765706;
    border: 0;
    background: transparent;
    font-weight: 720;
}

.fm-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 3px 1px;
    cursor: pointer;
}

.fm-switch-row strong,
.fm-switch-row small {
    display: block;
}

.fm-switch-row strong {
}

.fm-switch-row small {
    margin-top: 2px;
    color: var(--shell-ink-faint);
    font-weight: 500;
}

.fm-switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.fm-switch {
    position: relative;
    width: 38px;
    height: 22px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #c8bfb5;
}

.fm-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform 0.18s;
}

.fm-switch-row input:checked + .fm-switch {
    background: #267a50;
}

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

.fm-switch-row input:focus-visible + .fm-switch {
    box-shadow: var(--shell-focus);
}

.fm-automation-options {
    display: grid;
    gap: 8px;
}

.fm-choice-card {
    position: relative;
    display: grid;
    min-height: 60px;
    grid-template-columns: minmax(0, 1fr) auto 18px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    cursor: pointer;
}

.fm-choice-card:hover {
    border-color: #cbbda9;
    background: #fffdf8;
}

.fm-choice-card:has(input:checked) {
    border-color: #d09a00;
    background: var(--shell-yellow-soft);
}

.fm-choice-card.unavailable {
    cursor: not-allowed;
    opacity: 0.72;
    background: #f5f2ee;
}

.fm-choice-card input {
    position: absolute;
    opacity: 0;
}

.fm-choice-card strong,
.fm-choice-card small {
    display: block;
}

.fm-choice-card strong {
}

.fm-choice-card small {
    margin-top: 2px;
    color: var(--shell-ink-faint);
    font-weight: 500;
}

.fm-choice-card em {
    padding: 3px 7px;
    color: #6f655d;
    border-radius: 999px;
    background: #e7e2dc;
    font-style: normal;
    font-weight: 800;
    text-transform: uppercase;
}

.fm-choice-card i {
    display: grid;
    width: 17px;
    height: 17px;
    place-items: center;
    border: 1.5px solid #aaa097;
    border-radius: 50%;
}

.fm-choice-card:has(input:checked) i {
    border: 5px solid #b98500;
    background: #fff;
}

.fm-choice-card input:focus-visible ~ i {
    box-shadow: var(--shell-focus);
}

.fm-advanced-details,
.fm-advanced-xero {
    border-bottom: 1px solid var(--shell-line);
}

.fm-advanced-details > summary,
.fm-advanced-xero > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    list-style: none;
    cursor: pointer;
    font-weight: 700;
}

.fm-advanced-details > summary::-webkit-details-marker,
.fm-advanced-xero > summary::-webkit-details-marker {
    display: none;
}

.fm-advanced-details > summary small {
    color: var(--shell-ink-faint);
    font-weight: 500;
}

.fm-advanced-details > summary::after,
.fm-advanced-xero > summary::after {
    content: "+";
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--shell-ink-soft);
    border: 1px solid var(--shell-line);
    border-radius: 6px;
}

.fm-advanced-details[open] > summary::after,
.fm-advanced-xero[open] > summary::after {
    content: "–";
}

.fm-advanced-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 0 20px 20px;
}

.fm-full-field {
    grid-column: 1 / -1;
}

.fm-technical-note {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    color: var(--shell-ink-faint);
    border-radius: 8px;
    background: #f4f1ed;
}

.fm-technical-note strong {
    color: var(--shell-ink-soft);
}

.fm-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 15px 20px;
    background: #fefcf8;
}

.fm-advanced-xero {
    border-bottom: 0;
    background: #fcfaf6;
}

.fm-advanced-xero > div {
    padding: 0 20px 18px;
}

.fm-advanced-xero p {
    margin: 0 0 10px;
    color: var(--shell-ink-soft);
}

.fm-advanced-xero form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 9px;
}

.fm-setup-aside {
    display: grid;
    gap: 12px;
}

.fm-readiness-card,
.fm-customer-facts,
.fm-cache-card {
    overflow: hidden;
}

.fm-readiness-card > header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px;
    border-bottom: 1px solid var(--shell-line);
}

.fm-readiness-score {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    color: #267a50;
    border-radius: 50%;
    background: #e8f5ed;
    font-weight: 800;
}

.fm-score-warning {
    color: #9a6109;
    background: #fff2d2;
}

.fm-score-danger {
    color: #b43b35;
    background: #fcebea;
}

.fm-score-neutral {
    color: #6f655d;
    background: #f0ede8;
}

.fm-readiness-card h2,
.fm-readiness-card p {
    margin: 0;
}

.fm-readiness-card p {
    margin-top: 1px;
    color: var(--shell-ink-soft);
}

.fm-readiness-card ol {
    margin: 0;
    padding: 7px 14px 12px;
    list-style: none;
}

.fm-readiness-card li {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 0;
    border-bottom: 1px solid #eee7dc;
}

.fm-readiness-card li:last-child {
    border-bottom: 0;
}

.fm-readiness-card li > span {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    color: #267a50;
    border-radius: 50%;
    background: #e8f5ed;
    font-weight: 800;
}

.fm-readiness-card li.incomplete > span {
    color: #9a6109;
    background: #fff2d2;
}

.fm-readiness-card li strong,
.fm-readiness-card li small {
    display: block;
}

.fm-readiness-card li strong {
}

.fm-readiness-card li small {
    color: var(--shell-ink-faint);
}

.fm-customer-facts > header,
.fm-cache-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px;
    border-bottom: 1px solid var(--shell-line);
    background: #fefcf8;
}

.fm-customer-facts h2,
.fm-cache-card h2,
.fm-cache-card p {
    margin: 0;
}

.fm-customer-facts h2,
.fm-cache-card h2 {
}

.fm-cache-card p {
    margin-top: 2px;
    color: var(--shell-ink-faint);
}

.fm-customer-facts dl {
    margin: 0;
    padding: 8px 14px 12px;
}

.fm-customer-facts dl > div {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #eee7dc;
}

.fm-customer-facts dl > div:last-child {
    border-bottom: 0;
}

.fm-customer-facts dt {
    color: var(--shell-ink-faint);
}

.fm-customer-facts dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--shell-ink-soft);
    text-align: right;
}

.fm-cache-group {
    padding: 12px 14px;
    border-bottom: 1px solid #eee7dc;
}

.fm-cache-group:last-child {
    border-bottom: 0;
}

.fm-cache-group > strong {
    display: block;
    margin-bottom: 7px;
}

.fm-cache-group > small {
    display: block;
    margin-top: 6px;
    color: var(--shell-ink-faint);
}

.fm-cache-group ul {
    max-height: 190px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.fm-cache-group li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #f1ece4;
    color: var(--shell-ink-soft);
}

.fm-cache-group li:last-child {
    border-bottom: 0;
}

.fm-cache-group li small {
    color: var(--shell-ink-faint);
    text-align: right;
}

.fm-decision-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 13px;
    border: 1px solid #e5d09a;
    border-radius: 10px;
    background: #fff9e9;
}

.fm-decision-note > span {
    display: grid;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    place-items: center;
    color: #876000;
    border: 1px solid #a77a0a;
    border-radius: 50%;
    font-weight: 800;
}

.fm-decision-note strong {
}

.fm-decision-note p {
    margin: 3px 0 0;
    color: var(--shell-ink-soft);
    line-height: 1.45;
}

@media (max-width: 1120px) {
    .fm-directory-filters {
        flex-wrap: wrap;
    }

    .fm-filter-spacer {
        min-width: 20px;
    }

    .fm-setup-grid {
        grid-template-columns: minmax(0, 1fr) 260px;
    }
}

@media (max-width: 840px) {
    .fm-setup-grid {
        grid-template-columns: 1fr;
    }

    .fm-setup-aside {
        grid-template-columns: 1fr 1fr;
    }

    .fm-cache-card,
    .fm-decision-note {
        grid-column: 1 / -1;
    }

    .fm-customer-table th:last-child,
    .fm-customer-table td:last-child {
        position: sticky;
        right: 0;
        background: #fff;
        box-shadow: -8px 0 14px -14px rgba(45, 33, 22, 0.65);
    }

    .fm-customer-table th:last-child {
        background: #fcfaf6;
    }
}

@media (max-width: 680px) {
    .fm-setup-heading-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 13px;
    }

    .fm-heading-actions {
        width: 100%;
    }

    .fm-heading-actions .fm-button {
        flex: 1 1 0;
    }

    .fm-directory-filters {
        align-items: stretch;
        padding: 10px;
    }

    .fm-search-field {
        width: 100%;
        flex-basis: 100%;
    }

    .fm-directory-filters > .fm-control-field {
        flex: 1 1 150px;
    }

    .fm-filter-spacer {
        display: none;
    }

    .fm-more-filters {
        position: static;
        flex: 1 1 135px;
    }

    .fm-more-filters > summary {
        width: 100%;
        justify-content: center;
    }

    .fm-more-filters > div {
        top: auto;
        right: 10px;
        left: 10px;
        width: auto;
        grid-template-columns: 1fr;
    }

    .fm-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .fm-setup-aside {
        grid-template-columns: 1fr;
    }

    .fm-cache-card,
    .fm-decision-note {
        grid-column: auto;
    }

    .fm-form-section {
        padding: 16px;
    }

    .fm-xero-search-form {
        grid-template-columns: 1fr;
        grid-template-areas:
            "field"
            "help"
            "action";
    }

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

    .fm-xero-search-form .fm-button,
    .fm-advanced-xero .fm-button {
        width: 100%;
    }

    .fm-advanced-details > summary,
    .fm-advanced-xero > summary {
        padding-inline: 16px;
    }

    .fm-advanced-details > summary small {
        display: none;
    }

    .fm-advanced-fields {
        grid-template-columns: 1fr;
        padding-inline: 16px;
    }

    .fm-full-field {
        grid-column: auto;
    }

    .fm-form-actions {
        padding-inline: 16px;
    }

    .fm-choice-card {
        grid-template-columns: minmax(0, 1fr) 17px;
    }

    .fm-choice-card em {
        display: none;
    }
}

@media (max-width: 430px) {
    .fm-heading-actions,
    .fm-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .fm-identity-row {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .fm-read-only {
        grid-column: 2;
    }

    .fm-match-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .fm-form-actions {
        flex-direction: column-reverse;
    }

    .fm-form-actions .fm-button {
        width: 100%;
    }
}

/* Dashboard and local Upcoming Billing phase */
.fm-dashboard-page,
.fm-billing-page {
    display: grid;
    gap: 18px;
    color: var(--shell-ink);
}

.fm-dashboard-heading,
.fm-billing-heading {
    margin-bottom: 2px;
}

.fm-billing-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 22px;
}

.fm-dashboard-summary,
.fm-billing-workspace {
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--shell-line);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(45, 36, 29, 0.045);
}

.fm-dashboard-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 20px 22px 17px;
}

.fm-dashboard-summary-head h2 {
    margin: 2px 0 5px;
    font-size: clamp(24px, 2.5vw, 32px);
    line-height: 1.05;
}

.fm-dashboard-summary-head p:last-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--shell-ink-soft);
}

.fm-dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    border-top: 1px solid var(--shell-line);
    border-bottom: 1px solid var(--shell-line);
}

.fm-dashboard-metrics a {
    display: grid;
    gap: 7px;
    min-height: 92px;
    padding: 15px 17px;
    color: var(--shell-ink-soft);
    text-decoration: none;
    border-right: 1px solid var(--shell-line);
    transition: background 140ms ease;
}

.fm-dashboard-metrics a:last-child {
    border-right: 0;
}

.fm-dashboard-metrics a:hover {
    background: #fffaf0;
}

.fm-dashboard-metrics span {
    font-weight: 720;
}

.fm-dashboard-metrics strong {
    align-self: end;
    color: var(--shell-ink);
    font-size: 28px;
    line-height: 1;
}

.fm-dashboard-metrics .fm-metric-success { color: #147a45; }
.fm-dashboard-metrics .fm-metric-warning { color: #a66305; }
.fm-dashboard-metrics .fm-metric-danger { color: #af3434; }
.fm-dashboard-metrics .fm-metric-info { color: #315f82; }
.fm-dashboard-metrics .fm-metric-neutral { color: #6f665f; }

.fm-dashboard-summary-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    padding: 13px 22px 14px;
    color: var(--shell-ink-soft);
    background: #fffdf8;
}

.fm-dashboard-summary-foot span {
    position: relative;
}

.fm-dashboard-summary-foot span + span::before {
    position: absolute;
    left: -12px;
    color: #c4b9ac;
    content: "·";
}

.fm-dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.92fr);
    gap: 18px;
    align-items: stretch;
}

.fm-dashboard-columns > .fm-panel {
    margin: 0;
    overflow: hidden;
}

.fm-dashboard-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--shell-line);
}

.fm-dashboard-panel-head h2 {
    margin: 0 0 3px;
}

.fm-dashboard-panel-head p {
    margin: 0;
    color: var(--shell-ink-soft);
}

.fm-dashboard-panel-head > a {
    flex: 0 0 auto;
    color: #6d5200;
    font-weight: 800;
    text-decoration: none;
}

.fm-dashboard-attention-table {
    min-width: 720px;
}

.fm-dashboard-attention-table th:nth-child(1) { width: 23%; }
.fm-dashboard-attention-table th:nth-child(2) { width: 19%; }
.fm-dashboard-attention-table th:nth-child(4) { width: 86px; }

.fm-dashboard-attention-table td:nth-child(3) {
    color: var(--shell-ink-soft);
    line-height: 1.4;
}

.fm-dashboard-activity-list {
    display: grid;
}

.fm-dashboard-activity-list > a {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
    min-height: 64px;
    padding: 11px 16px;
    color: var(--shell-ink);
    text-decoration: none;
    border-bottom: 1px solid var(--shell-line);
}

.fm-dashboard-activity-list > a:last-child {
    border-bottom: 0;
}

.fm-dashboard-activity-list > a:hover {
    background: #fffdf8;
}

.fm-dashboard-activity-list > a > span:nth-child(2) {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.fm-dashboard-activity-list small {
    color: var(--shell-ink-faint);
}

.fm-activity-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 900;
}

.fm-activity-success { color: #147a45; background: #edf8f1; }
.fm-activity-warning { color: #a66305; background: #fff6dc; }
.fm-activity-danger { color: #af3434; background: #fff0ef; }

.fm-dashboard-empty {
    display: grid;
    gap: 4px;
    padding: 24px 20px;
    color: var(--shell-ink-soft);
}

.fm-dashboard-empty strong {
    color: var(--shell-ink);
}

.fm-dashboard-system {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px 20px;
    min-height: 44px;
    padding: 10px 15px;
    color: var(--shell-ink-soft);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--shell-line);
    border-radius: 10px;
}

.fm-dashboard-system > strong {
    color: var(--shell-ink);
}

.fm-dashboard-system span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.fm-dashboard-system > a {
    margin-left: auto;
    color: #6d5200;
    font-weight: 800;
    text-decoration: none;
}

.fm-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #a39a91;
}

.fm-dot-warning { background: #d39418; }
.fm-dot-neutral { background: #958b82; }
.fm-dot-danger { background: #bd4c47; }

.fm-alert-warning {
    color: #74480a;
    background: #fff8e8;
    border-color: #efd595;
}

.fm-status-info {
    color: #315f82;
    background: #eef5fb;
}

.fm-billing-workspace {
    margin: 0;
    padding: 0;
}

.fm-upcoming-summary {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) minmax(220px, 0.9fr) minmax(230px, 0.92fr);
    gap: 18px;
    align-items: center;
    padding: 18px 20px;
    background: #fffdf8;
    border-bottom: 1px solid var(--shell-line);
}

.fm-upcoming-period {
    display: flex;
    align-items: center;
    gap: 12px;
}

.fm-month-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    color: #f5c522;
    background: var(--shell-brown);
    border-radius: 10px;
    font-weight: 900;
}

.fm-upcoming-period > span:last-child,
.fm-upcoming-generation,
.fm-upcoming-summary-copy {
    display: grid;
    gap: 3px;
}

.fm-upcoming-period small,
.fm-upcoming-period em,
.fm-upcoming-generation small,
.fm-upcoming-generation span,
.fm-upcoming-summary-copy span {
    color: var(--shell-ink-faint);
    font-style: normal;
}

.fm-upcoming-summary-copy,
.fm-upcoming-generation {
    min-height: 42px;
    padding-left: 18px;
    border-left: 1px solid var(--shell-line);
}

.fm-workspace-notice {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    padding: 11px 20px;
    border-bottom: 1px solid var(--shell-line);
}

.fm-workspace-notice.warning {
    color: #74480a;
    background: #fff8e8;
}

.fm-upcoming-filters {
    display: grid;
    grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.5fr) minmax(150px, 0.9fr) auto auto auto;
    gap: 10px;
    align-items: end;
    padding: 14px 16px;
    border-bottom: 1px solid var(--shell-line);
}

.fm-upcoming-filters .fm-search-field,
.fm-upcoming-filters .fm-control-field,
.fm-upcoming-filters .fm-page-size,
.fm-upcoming-filters .fm-button {
    margin: 0;
}

.fm-upcoming-filters .fm-search-field {
    width: 100%;
}

.fm-upcoming-filters .fm-page-size {
    align-self: end;
}

.fm-upcoming-table-cue {
    display: none;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 16px;
    color: var(--shell-ink-soft);
    background: #fffdf8;
    border-bottom: 1px solid var(--shell-line);
}

.fm-upcoming-table-wrap {
    max-width: 100%;
    border: 0;
    border-radius: 0;
}

.fm-upcoming-table {
    min-width: 1240px;
}

.fm-upcoming-table th:nth-child(1) { width: 185px; }
.fm-upcoming-table th:nth-child(2) { width: 140px; }
.fm-upcoming-table th:nth-child(3) { width: 280px; }
.fm-upcoming-table th:nth-child(4) { width: 140px; }
.fm-upcoming-table th:nth-child(5) { width: 170px; }
.fm-upcoming-table th:nth-child(6) { width: 210px; }
.fm-upcoming-table th:nth-child(7) { width: 205px; }
.fm-upcoming-table th:nth-child(8) { width: 88px; }

.fm-upcoming-table td {
    vertical-align: middle;
}

.fm-upcoming-table td:nth-child(3) > strong {
    font-weight: 600;
    line-height: 1.42;
}

.fm-billing-page .fm-subtext,
.fm-billing-page .fm-match small {
    line-height: 1.4;
}

.fm-upcoming-table .fm-match {
    align-items: center;
}

.fm-billing-workspace > .fm-table-footer {
    border-top: 1px solid var(--shell-line);
}

.fm-billing-state-strip {
    margin-top: -2px;
}

@media (max-width: 1180px) {
    .fm-dashboard-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .fm-dashboard-metrics a:nth-child(3) {
        border-right: 0;
    }

    .fm-dashboard-metrics a:nth-child(-n + 3) {
        border-bottom: 1px solid var(--shell-line);
    }

    .fm-upcoming-filters {
        grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.3fr) minmax(150px, 0.9fr) auto;
    }

    .fm-upcoming-filters .fm-button {
        grid-row: 2;
    }
}

@media (max-width: 1020px) {
    .fm-dashboard-columns {
        grid-template-columns: 1fr;
    }

    .fm-upcoming-summary {
        grid-template-columns: minmax(250px, 1fr) minmax(220px, 1fr);
    }

    .fm-upcoming-generation {
        grid-column: 1 / -1;
        padding: 11px 0 0;
        border-top: 1px solid var(--shell-line);
        border-left: 0;
    }

    .fm-upcoming-table-cue {
        display: flex;
    }
}

@media (max-width: 840px) {
    .fm-billing-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .fm-dashboard-summary-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .fm-dashboard-summary-head .fm-button {
        width: 100%;
    }

    .fm-upcoming-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fm-upcoming-filters .fm-search-field {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .fm-upcoming-filters .fm-control-field:first-child {
        grid-row: 2;
    }

    .fm-upcoming-filters .fm-button {
        grid-row: auto;
    }

    .fm-dashboard-system > a {
        margin-left: 0;
    }
}

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

    .fm-dashboard-metrics a,
    .fm-dashboard-metrics a:nth-child(3) {
        border-right: 1px solid var(--shell-line);
        border-bottom: 1px solid var(--shell-line);
    }

    .fm-dashboard-metrics a:nth-child(even) {
        border-right: 0;
    }

    .fm-dashboard-metrics a:nth-last-child(-n + 2) {
        border-bottom: 0;
    }

    .fm-dashboard-summary-foot {
        display: grid;
    }

    .fm-dashboard-summary-foot span + span::before {
        content: none;
    }

    .fm-dashboard-panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

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

    .fm-upcoming-summary-copy,
    .fm-upcoming-generation {
        grid-column: auto;
        padding: 11px 0 0;
        border-top: 1px solid var(--shell-line);
        border-left: 0;
    }

    .fm-upcoming-filters {
        grid-template-columns: 1fr;
    }

    .fm-upcoming-filters .fm-search-field,
    .fm-upcoming-filters .fm-control-field:first-child {
        grid-column: auto;
        grid-row: auto;
    }

    .fm-upcoming-filters .fm-page-size {
        justify-content: flex-start;
    }

    .fm-upcoming-filters .fm-button {
        width: 100%;
    }
}

/* Dashboard and Upcoming Billing: approved prototype fidelity */
.fm-dashboard-page,
.fm-billing-page {
    display: block;
    color: var(--shell-ink);
}

.fm-dashboard-heading,
.fm-billing-heading {
    display: block;
    margin: 0 0 22px;
}

.fm-dashboard-queues {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.fm-queue-card {
    position: relative;
    display: flex;
    min-height: 155px;
    flex-direction: column;
    padding: 16px;
    overflow: hidden;
    color: var(--shell-ink);
    text-decoration: none;
    border: 1px solid var(--shell-line);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(55, 39, 26, 0.05);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.fm-queue-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: #9a8c80;
    content: "";
}

.fm-queue-card:hover {
    border-color: #d8cbb8;
    box-shadow: 0 7px 22px rgba(55, 39, 25, 0.08);
    transform: translateY(-2px);
}

.fm-queue-card.tone-amber::before { background: #d28a09; }
.fm-queue-card.tone-green::before { background: #3d9a67; }
.fm-queue-card.tone-red::before { background: #c94c43; }
.fm-queue-card.tone-blue::before { background: #5685a3; }

.fm-queue-label {
    max-width: 170px;
    color: var(--shell-ink-soft);
    font-weight: 680;
    line-height: 1.35;
}

.fm-queue-value {
    display: block;
    margin: 9px 0 1px;
    color: var(--shell-ink);
    font-size: 29px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: -0.04em;
}

.fm-queue-value.date { font-size: 24px; }

.fm-queue-detail {
    color: var(--shell-ink-faint);
    line-height: 1.35;
}

.fm-queue-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    color: #765706;
    font-weight: 740;
}

.fm-dashboard-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(310px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.fm-dashboard-columns > .fm-panel {
    margin: 0;
    overflow: hidden;
}

.fm-dashboard-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 14px;
    border-bottom: 0;
}

.fm-dashboard-panel-head h2 {
    margin: 0 0 2px;
}

.fm-dashboard-panel-head p {
    margin: 0;
    color: var(--shell-ink-soft);
}

.fm-dashboard-panel-head > a {
    flex: 0 0 auto;
    color: #765706;
    font-weight: 720;
    text-decoration: none;
}

.fm-dashboard-attention-table {
    min-width: 680px;
}

.fm-dashboard-attention-table th { height: 35px; }
.fm-dashboard-attention-table td { height: 48px; }
.fm-dashboard-attention-table th:nth-child(1) { width: 27%; }
.fm-dashboard-attention-table th:nth-child(2) { width: 22%; }
.fm-dashboard-attention-table th:nth-child(4) { width: 86px; }

.fm-dashboard-attention-table td:nth-child(3) {
    color: var(--shell-ink-soft);
    line-height: 1.35;
}

.fm-dashboard-activity-list {
    display: grid;
    padding: 0 14px 13px;
}

.fm-dashboard-activity-list > a {
    display: grid;
    grid-template-columns: 29px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 8px 5px;
    color: var(--shell-ink);
    text-decoration: none;
    border-top: 1px solid #eee7dc;
    border-bottom: 0;
}

.fm-dashboard-activity-list > a:hover { background: transparent; }
.fm-dashboard-activity-list > a:hover strong { color: #765706; }

.fm-dashboard-activity-list small {
    margin-top: 1px;
    color: var(--shell-ink-faint);
}

.fm-activity-icon {
    width: 25px;
    height: 25px;
}

.fm-dashboard-empty {
    display: grid;
    gap: 4px;
    min-height: 78px;
    padding: 17px 20px 19px;
    color: var(--shell-ink-soft);
    border-top: 1px solid #eee7dc;
}

.fm-dashboard-empty strong { color: var(--shell-ink); }

.fm-dashboard-system {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 23px;
    min-height: 0;
    margin-top: 18px;
    padding: 11px 14px;
    color: var(--shell-ink-faint);
    border: 1px solid var(--shell-line);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.55);
}

.fm-dashboard-system > strong { color: var(--shell-ink-soft); }
.fm-dashboard-system > a { margin-left: auto; color: #765706; font-weight: 700; }

.fm-billing-workspace {
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(55, 39, 26, 0.05);
}

.fm-upcoming-summary {
    display: grid;
    grid-template-columns: minmax(230px, 1fr) auto auto;
    gap: 26px;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid var(--shell-line);
    background: #fffdf7;
}

.fm-upcoming-period {
    display: flex;
    align-items: center;
    gap: 11px;
}

.fm-month-icon {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 9px;
}

.fm-upcoming-period > span:last-child,
.fm-upcoming-generation {
    display: grid;
    gap: 1px;
}

.fm-upcoming-period small,
.fm-upcoming-period em,
.fm-upcoming-generation small,
.fm-upcoming-generation span,
.fm-upcoming-period strong,
.fm-upcoming-generation strong {
    margin-top: 1px;
}

.fm-upcoming-generation {
    min-height: 38px;
    padding-left: 20px;
    border-left: 1px solid var(--shell-line);
}

.fm-workspace-notice {
    padding: 10px 16px;
}

.fm-upcoming-filters {
    display: flex;
    min-height: 78px;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 9px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--shell-line);
}

.fm-upcoming-filters .fm-search-field,
.fm-upcoming-filters .fm-control-field,
.fm-upcoming-filters .fm-page-size,
.fm-upcoming-filters .fm-button {
    margin: 0;
}

.fm-upcoming-filters .fm-search-field {
    width: min(280px, 100%);
    flex: 0 1 280px;
    align-self: flex-end;
}

.fm-upcoming-filters .fm-month-field { flex: 0 1 156px; }
.fm-upcoming-filters .fm-decision-field { flex: 0 1 166px; }
.fm-upcoming-filters .fm-filter-spacer { flex: 1 1 8px; }

.fm-upcoming-filters .fm-control-field { gap: 6px; }

.fm-upcoming-filters .fm-control-field > span {
    color: var(--shell-ink);
    font-weight: 680;
    line-height: 1.25;
}

.fm-upcoming-filters .fm-page-size {
    min-height: 38px;
    align-self: flex-end;
}

.fm-upcoming-filters .fm-page-size select {
    width: 72px;
}

.fm-upcoming-table-wrap {
    max-width: 100%;
    border: 0;
    border-radius: 0;
}

.fm-upcoming-table {
    width: 100%;
    min-width: 830px;
    table-layout: fixed;
}

.fm-upcoming-table th:nth-child(1) { width: 18%; }
.fm-upcoming-table th:nth-child(2) { width: 19%; }
.fm-upcoming-table th:nth-child(3) { width: 16%; }
.fm-upcoming-table th:nth-child(4) { width: 23%; }
.fm-upcoming-table th:nth-child(5) { width: 14%; }
.fm-upcoming-table th:nth-child(6) { width: 84px; }

.fm-upcoming-table td {
    height: 58px;
    vertical-align: middle;
}

.fm-billing-page .fm-subtext {
    margin-top: 2px;
    color: var(--shell-ink-faint);
    font-weight: 500;
    line-height: 1.4;
}

.fm-setup-state {
    position: relative;
    padding-left: 12px;
}

.fm-setup-state i {
    position: absolute;
    top: 0.45em;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.fm-setup-state i.linked { background: #3c9c68; }
.fm-setup-state i.missing { background: #bd5a53; }

.fm-billing-workspace > .fm-table-footer {
    border-top: 1px solid var(--shell-line);
}

@media (max-width: 1220px) {
    .fm-dashboard-queues { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .fm-queue-card { min-height: 142px; }
    .fm-dashboard-columns { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr); }
}

@media (max-width: 1040px) {
    .fm-dashboard-columns { grid-template-columns: 1fr; }
    .fm-upcoming-filters .fm-filter-spacer { display: none; }
    .fm-upcoming-filters .fm-search-field { flex: 1 1 250px; }
    .fm-upcoming-filters .fm-month-field,
    .fm-upcoming-filters .fm-decision-field { flex: 1 1 150px; }
}

@media (max-width: 840px) {
    .fm-dashboard-queues { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fm-upcoming-summary {
        grid-template-columns: minmax(220px, 1fr) auto;
        gap: 15px;
    }
    .fm-upcoming-generation {
        grid-column: 1 / -1;
        min-height: 0;
        padding: 11px 0 0;
        border-top: 1px solid var(--shell-line);
        border-left: 0;
    }
    .fm-upcoming-table th:last-child,
    .fm-upcoming-table td:last-child {
        position: sticky;
        right: 0;
        background: #fff;
        box-shadow: -8px 0 14px -14px rgba(45, 33, 22, 0.65);
    }
    .fm-upcoming-table th:last-child { background: #fcfaf6; }
}

@media (max-width: 680px) {
    .fm-dashboard-queues { grid-template-columns: 1fr; }
    .fm-queue-card { min-height: 128px; }
    .fm-queue-label { max-width: none; }
    .fm-queue-value { font-size: 26px; }
    .fm-dashboard-columns { gap: 12px; }
    .fm-dashboard-panel-head {
        align-items: flex-start;
        flex-direction: column;
        padding: 15px 14px 12px;
    }
    .fm-dashboard-system {
        align-items: flex-start;
        flex-direction: column;
    }
    .fm-dashboard-system > a { margin-left: 0; }
    .fm-upcoming-filters { padding: 10px; }
    .fm-upcoming-filters .fm-search-field { flex-basis: 100%; }
    .fm-upcoming-filters .fm-month-field,
    .fm-upcoming-filters .fm-decision-field { flex: 1 1 145px; }
}

@media (max-width: 430px) {
    .fm-upcoming-summary { grid-template-columns: 1fr; }
    .fm-upcoming-generation { grid-column: auto; }
    .fm-upcoming-filters .fm-search-field,
    .fm-upcoming-filters .fm-month-field,
    .fm-upcoming-filters .fm-decision-field { flex-basis: 100%; }
    .fm-upcoming-filters .fm-page-size { width: 100%; }
    .fm-upcoming-filters .fm-button { width: 100%; }
}

/* Final cascade authority for the prototype-conformity workflow tables. */
.fm-upcoming-summary {
    grid-template-columns: minmax(280px, 1fr) auto auto;
    align-items: center;
    gap: 20px;
}

.fm-upcoming-exception-action {
    grid-column: auto;
    grid-row: auto;
    justify-self: end;
    justify-content: flex-end;
}

@media (max-width: 1040px) {
    .fm-upcoming-summary {
        grid-template-columns: minmax(270px, 1fr) auto;
    }

    .fm-upcoming-exception-action {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
        justify-content: flex-start;
    }
}

@media (max-width: 430px) {
    .fm-upcoming-summary {
        grid-template-columns: 1fr;
    }

    .fm-upcoming-exception-action {
        grid-column: auto;
        grid-row: auto;
    }
}

.fm-billing-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.fm-heading-month {
    width: auto;
    flex: 0 0 176px;
}

.fm-customer-table {
    min-width: 820px;
    table-layout: fixed;
}

.fm-customer-table th:nth-child(1) { width: 31%; }
.fm-customer-table th:nth-child(2) { width: 16%; }
.fm-customer-table th:nth-child(3) { width: 24%; }
.fm-customer-table th:nth-child(4) { width: 16%; }
.fm-customer-table th:nth-child(5) { width: 150px; }

.fm-customer-table td,
.fm-upcoming-table td {
    height: 52px;
    padding-block: 9px;
    vertical-align: middle;
}

.fm-upcoming-filters {
    min-height: 62px;
    flex-wrap: nowrap;
    gap: 8px;
}

.fm-upcoming-filters .fm-search-field { flex: 0 1 260px; }
.fm-upcoming-filters .fm-control-field { flex: 0 1 175px; }

.fm-upcoming-table {
    min-width: 760px;
    table-layout: fixed;
}

.fm-upcoming-table th:nth-child(1) { width: 28%; }
.fm-upcoming-table th:nth-child(2) { width: 21%; }
.fm-upcoming-table th:nth-child(3) { width: 10%; }
.fm-upcoming-table th:nth-child(4) { width: 18%; }
.fm-upcoming-table th:nth-child(5) { width: 15%; }
.fm-upcoming-table th:nth-child(6) { width: 82px; }

@media (max-width: 1040px) {
    .fm-upcoming-filters { flex-wrap: wrap; }
    .fm-upcoming-filters .fm-search-field { flex: 1 1 250px; }
    .fm-upcoming-filters .fm-control-field { flex: 1 1 170px; }
}

@media (max-width: 840px) {
    .fm-customer-table { min-width: 720px; }
    .fm-customer-table th:last-child,
    .fm-customer-table td:last-child,
    .fm-upcoming-table th:last-child,
    .fm-upcoming-table td:last-child {
        position: sticky;
        right: 0;
        z-index: 2;
        background: #fff;
        box-shadow: -8px 0 14px -14px rgba(45, 33, 22, 0.65);
    }
    .fm-customer-table th:last-child,
    .fm-upcoming-table th:last-child {
        z-index: 3;
        background: #fcfaf6;
    }
    .fm-billing-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 680px) {
    .fm-billing-heading { display: grid; }
    .fm-heading-month { width: 176px; }
    .fm-upcoming-filters .fm-search-field,
    .fm-upcoming-filters .fm-control-field { flex-basis: 100%; }
}

/* Current-month readiness stays visible instead of colliding with period copy. */
@media (max-width: 1040px) {
    .fm-upcoming-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .fm-upcoming-exception-action {
        grid-column: auto;
        grid-row: auto;
        justify-self: start;
    }
}

/* Usage-led Upcoming table keeps its sortable measures readable. */
.fm-upcoming-table.fm-usage-table th:nth-child(1) { width: 31%; }
.fm-upcoming-table.fm-usage-table th:nth-child(2) { width: 13%; }
.fm-upcoming-table.fm-usage-table th:nth-child(3) { width: 17%; }
.fm-upcoming-table.fm-usage-table th:nth-child(4) { width: 20%; }
.fm-upcoming-table.fm-usage-table th:nth-child(5) { width: 14%; }
.fm-upcoming-table.fm-usage-table th:nth-child(6) { width: 82px; }

/* Billing Exceptions: approved compact exception hierarchy. */
.fm-tab-badge.danger-count {
    color: #a33e39;
    background: #fcebea;
}

.fm-heading-period {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 0 12px;
    color: var(--shell-ink-soft);
    border: 1px solid var(--shell-line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    font-weight: 650;
    white-space: nowrap;
}

.fm-exception-filters {
    display: flex;
    min-height: 62px;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--shell-line);
}

.fm-exception-filters .fm-search-field { width: min(230px, 100%); flex: 0 1 230px; }
.fm-exception-filters .fm-control-field { flex: 0 1 170px; }
.fm-exception-filters .fm-control-field select { width: 100%; min-width: 0; }
.fm-exception-filters .fm-filter-spacer { flex: 1 1 8px; }
.fm-exception-filters .fm-page-size,
.fm-exception-filters .fm-button { margin: 0; }

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

.fm-exception-table {
    width: 100%;
    min-width: 830px;
    table-layout: fixed;
}

.fm-exception-table th:nth-child(1) { width: 20%; }
.fm-exception-table th:nth-child(2) { width: 20%; }
.fm-exception-table th:nth-child(3) { width: 37%; }
.fm-exception-table th:nth-child(4) { width: 14%; }
.fm-exception-table th:nth-child(5) { width: 96px; }

.fm-exception-table td {
    height: 58px;
    vertical-align: middle;
}

.fm-exception-table td:nth-child(3) {
    color: var(--shell-ink-soft);
}

.fm-exception-table td:nth-child(4) > strong {
    display: block;
    color: var(--shell-ink);
}

.fm-exception-table .fm-row-action {
    width: 84px;
    min-width: 84px;
}

@media (max-width: 1040px) {
    .fm-exception-filters { flex-wrap: wrap; }
    .fm-exception-filters .fm-search-field { flex: 1 1 230px; }
    .fm-exception-filters .fm-control-field { flex: 1 1 155px; }
    .fm-exception-filters .fm-filter-spacer { display: none; }
}

@media (max-width: 1100px) {
    .fm-exception-table th:last-child,
    .fm-exception-table td:last-child {
        position: sticky;
        right: 0;
        z-index: 2;
        background: #fff;
        box-shadow: -8px 0 14px -14px rgba(45, 33, 22, 0.65);
    }
    .fm-exception-table th:last-child { z-index: 3; background: #fcfaf6; }
}

@media (max-width: 680px) {
    .fm-exception-filters { align-items: stretch; padding: 10px; }
    .fm-exception-filters .fm-search-field,
    .fm-exception-filters .fm-control-field { flex-basis: 100%; }
    .fm-exception-filters .fm-page-size { width: 100%; justify-content: flex-start; }
    .fm-exception-filters .fm-button { width: 100%; }
}

/* Billing Recent runs: layout only; shared controls, status pills and table geometry remain authoritative. */
.fm-run-history-intro,
.fm-run-detail-head {
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--shell-line);
    background: #fff;
}

.fm-run-history-intro h2,
.fm-run-history-intro p,
.fm-run-detail-head h2,
.fm-run-detail-head p {
    margin: 0;
}

.fm-run-history-intro > div,
.fm-run-detail-head > div {
    display: grid;
    gap: 4px;
}

.fm-run-detail-head .fm-quiet-action {
    width: max-content;
    margin-bottom: 3px;
}

.fm-run-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(110px, 1fr));
    border-bottom: 1px solid var(--shell-line);
    background: #fffdf8;
}

.fm-run-summary > span {
    display: grid;
    gap: 2px;
    padding: 12px 16px;
    border-right: 1px solid var(--shell-line);
}

.fm-run-summary > span:last-child {
    border-right: 0;
}

.fm-run-filters {
    flex-wrap: nowrap;
}

.fm-run-filters .fm-search-field {
    width: min(260px, 100%);
    flex: 0 1 260px;
}

.fm-run-filters .fm-control-field {
    flex: 0 1 170px;
}

.fm-run-filters .fm-control-field select {
    width: 100%;
    min-width: 0;
}

.fm-run-filters .fm-filter-spacer {
    flex: 1 1 8px;
}

.fm-run-table-wrap,
.fm-run-detail-table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.fm-run-table,
.fm-run-detail-table {
    width: 100%;
    table-layout: fixed;
}

.fm-run-table {
    min-width: 860px;
}

.fm-run-table th:nth-child(1) { width: 14%; }
.fm-run-table th:nth-child(2) { width: 14%; }
.fm-run-table th:nth-child(3) { width: 15%; }
.fm-run-table th:nth-child(4) { width: 11%; }
.fm-run-table th:nth-child(5) { width: 13%; }
.fm-run-table th:nth-child(6) { width: 11%; }
.fm-run-table th:nth-child(7) { width: 12%; }
.fm-run-table th:nth-child(8) { width: 92px; }

.fm-run-detail-table {
    min-width: 700px;
}

.fm-run-detail-table th:nth-child(1) { width: 25%; }
.fm-run-detail-table th:nth-child(2) { width: 22%; }
.fm-run-detail-table th:nth-child(3) { width: 24%; }
.fm-run-detail-table th:nth-child(4) { width: 15%; }
.fm-run-detail-table th:nth-child(5) { width: 14%; }

@media (max-width: 1340px) {
    .fm-run-filters {
        flex-wrap: wrap;
    }

    .fm-run-filters .fm-search-field {
        flex: 1 1 240px;
    }

    .fm-run-filters .fm-control-field {
        flex: 1 1 150px;
    }

    .fm-run-filters .fm-filter-spacer {
        display: none;
    }

    .fm-run-table th:last-child,
    .fm-run-table td:last-child {
        position: sticky;
        right: 0;
        z-index: 2;
        background: #fff;
        box-shadow: -8px 0 14px -14px rgba(45, 33, 22, 0.65);
    }

    .fm-run-table th:last-child {
        z-index: 3;
        background: #fcfaf6;
    }
}

@media (max-width: 680px) {
    .fm-run-history-intro,
    .fm-run-detail-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .fm-run-summary {
        grid-template-columns: repeat(2, minmax(110px, 1fr));
    }

    .fm-run-summary > span {
        border-bottom: 1px solid var(--shell-line);
    }

    .fm-run-filters {
        align-items: stretch;
        padding: 10px;
    }

    .fm-run-filters .fm-search-field,
    .fm-run-filters .fm-control-field {
        flex-basis: 100%;
    }

    .fm-run-filters .fm-page-size,
    .fm-run-filters .fm-button {
        width: 100%;
    }
}

.fm-upcoming-context {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: var(--fm-card-gap);
}

.fm-upcoming-context > .fm-workspace-notice {
    grid-column: 1 / -1;
}

/* Billing Invoices: layout only; shared workspace, table, status and detail components remain authoritative. */
.fm-invoice-filters {
    flex-wrap: wrap;
}

.fm-invoice-filters .fm-search-field {
    flex: 1 1 220px;
}

.fm-invoice-filters .fm-control-field {
    flex: 1 1 150px;
}

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

.fm-invoice-table {
    min-width: 820px;
    table-layout: fixed;
}

.fm-invoice-table th:nth-child(1) { width: 20%; }
.fm-invoice-table th:nth-child(2) { width: 19%; }
.fm-invoice-table th:nth-child(3) { width: 18%; }
.fm-invoice-table th:nth-child(4) { width: 15%; }
.fm-invoice-table th:nth-child(5) { width: 18%; }
.fm-invoice-table th:nth-child(6) { width: 10%; }

@media (max-width: 1040px) {
    .fm-invoice-table th:last-child,
    .fm-invoice-table td:last-child {
        position: sticky;
        right: 0;
        z-index: 2;
        background: #fff;
        box-shadow: -8px 0 14px -14px rgba(45, 33, 22, 0.65);
    }

    .fm-invoice-table th:last-child {
        z-index: 3;
        background: #fcfaf6;
    }
}

@media (max-width: 680px) {
    .fm-upcoming-context {
        grid-template-columns: minmax(0, 1fr);
    }

    .fm-upcoming-context .fm-upcoming-exception-action {
        justify-self: start;
    }

}

/* UI_STYLE_CONTRACT_START
 * Final cascade authority for shared product typography and component geometry.
 * Page rules may position these components, but must not redefine them.
 */
html,
body {
    color: var(--fm-color-text);
    background: var(--fm-color-page);
}

body,
input,
select,
textarea,
button {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    font-size: var(--fm-type-body);
    line-height: var(--fm-line-body);
}

label,
legend,
input,
select,
textarea,
button {
    font-size: var(--fm-type-control);
    line-height: var(--fm-line-control);
}

:where(.fm-dashboard-page, .fm-billing-page, .fm-customer-page, .fm-account-page, .auth-page) {
    font-size: var(--fm-type-body);
    line-height: var(--fm-line-body);
}

.fm-page-heading h1,
.fm-setup-heading h1,
.page-header h1 {
    font-size: var(--fm-type-page-title);
    line-height: 1.18;
}

:where(.fm-dashboard-page, .fm-billing-page, .fm-customer-page, .fm-account-page) h2 {
    font-size: var(--fm-type-section-title);
    line-height: 1.35;
}

:where(.fm-dashboard-page, .fm-billing-page, .fm-customer-page, .fm-account-page) h3 {
    font-size: var(--fm-type-subsection-title);
    line-height: 1.35;
}

.fm-readiness-card h2,
.fm-upcoming-period strong,
.fm-upcoming-generation strong,
.fm-upcoming-summary-copy strong {
    font-size: var(--fm-type-subsection-title);
    line-height: 1.35;
}

.fm-eyebrow,
.auth-eyebrow,
.shell-nav-label,
.nav-group-label,
.fm-table-heading th,
.fm-data-table th {
    font-size: var(--fm-type-table-heading);
    line-height: 1.2;
}

.fm-metadata,
.fm-subtext,
.fm-muted,
.field-help,
.auth-help,
.auth-proof,
.auth-heading p,
.shell-brand-copy span,
.shell-nav-bottom,
.shell-topbar-title > span,
.account-menu-identity,
.fm-control-field > small,
.fm-page-size,
.fm-table-footer p,
.fm-pagination small,
.fm-empty-state span,
.fm-dashboard-panel-head p,
.fm-dashboard-activity-list small,
.fm-dashboard-run-list small,
.fm-queue-label,
.fm-queue-detail,
.fm-upcoming-period small,
.fm-upcoming-period em,
.fm-upcoming-generation small,
.fm-upcoming-generation span,
.fm-customer-setup small {
    font-size: var(--fm-type-meta);
    line-height: var(--fm-line-meta);
}

.fm-card,
.fm-panel {
    max-width: 100%;
    color: var(--fm-color-text);
    border: var(--fm-border);
    border-radius: var(--fm-radius-card);
    background: var(--fm-color-surface);
    box-shadow: var(--fm-shadow-card);
}

.fm-tab-nav {
    display: flex;
    min-height: var(--fm-tab-nav-height);
    gap: var(--fm-tab-nav-gap);
    margin: 0;
    padding: 0 var(--fm-tab-nav-padding-x);
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: var(--fm-border);
    background: #fefcf8;
    scrollbar-width: thin;
}

.fm-tab-nav > .fm-tab,
.fm-tab-nav > .fm-disabled-tab {
    position: relative;
    display: inline-flex;
    min-height: var(--fm-tab-nav-height);
    flex: 0 0 auto;
    align-items: center;
    gap: var(--fm-tab-gap);
    padding: 0 var(--fm-tab-padding-x);
    color: var(--fm-color-text-secondary);
    font-size: var(--fm-type-tab);
    font-weight: var(--fm-weight-tab);
    line-height: var(--fm-line-tab);
    text-decoration: none;
    white-space: nowrap;
}

.fm-tab-nav > .fm-tab::after {
    position: absolute;
    right: var(--fm-tab-underline-inset);
    bottom: -1px;
    left: var(--fm-tab-underline-inset);
    height: var(--fm-tab-underline-height);
    border-radius: var(--fm-radius-pill) var(--fm-radius-pill) 0 0;
    background: transparent;
    content: "";
}

.fm-tab-nav > .fm-tab:hover,
.fm-tab-nav > .fm-tab.current,
.fm-tab-nav > .fm-tab[aria-current="page"] {
    color: #674a00;
}

.fm-tab-nav > .fm-tab.current::after,
.fm-tab-nav > .fm-tab[aria-current="page"]::after {
    background: var(--fm-color-primary);
}

.fm-tab-nav > .fm-disabled-tab {
    color: #9a9086;
    cursor: not-allowed;
}

.fm-tab-badge {
    display: inline-grid;
    min-width: var(--fm-tab-badge-min-width);
    min-height: var(--fm-tab-badge-height);
    place-items: center;
    padding: 0 var(--fm-tab-badge-padding-x);
    color: var(--fm-color-text-muted);
    border-radius: var(--fm-radius-pill);
    background: #eee8df;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
}

.fm-tab-nav > .fm-tab.current .fm-tab-badge,
.fm-tab-nav > .fm-tab[aria-current="page"] .fm-tab-badge {
    color: #765706;
    background: var(--fm-color-primary-soft);
}

.fm-workspace-tabs,
.fm-workspace-context,
.fm-workspace-metrics,
.fm-workspace-toolbar,
.fm-workspace-results,
.fm-workspace-pagination {
    min-width: 0;
    max-width: 100%;
}

.fm-workspace-context,
.fm-workspace-metrics {
    padding: var(--fm-toolbar-padding-y) var(--fm-toolbar-padding-x);
    border-bottom: var(--fm-border);
}

.fm-workspace-context {
    color: var(--fm-color-text-secondary);
    background: var(--fm-color-surface);
}

.fm-workspace-context-copy {
    display: grid;
    gap: 3px;
}

.fm-workspace-context h2,
.fm-workspace-context p {
    margin: 0;
}

.fm-workspace-context h2 {
    color: var(--fm-color-text);
    font-size: var(--fm-type-section-title);
    line-height: 1.35;
}

.fm-workspace-context p {
    font-size: var(--fm-type-body);
    line-height: var(--fm-line-body);
}

.fm-workspace-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: var(--fm-toolbar-gap);
    border-top: 0;
    background: #fffdf8;
}

.fm-workspace-metrics > .fm-workspace-metric {
    display: grid;
    min-width: 0;
    min-height: calc(var(--fm-control-height) + (2 * var(--fm-toolbar-padding-y)));
    align-content: center;
    gap: 3px;
    padding: var(--fm-toolbar-padding-y) var(--fm-control-padding-x);
    color: var(--fm-color-text);
    border: var(--fm-border);
    border-radius: var(--fm-radius-control);
    background: var(--fm-color-surface);
    text-align: left;
    text-decoration: none;
}

.fm-workspace-metrics > .fm-workspace-metric strong {
    display: block;
    margin: 0;
    color: var(--fm-color-text);
    font-size: var(--fm-type-section-title);
    line-height: 1.35;
}

.fm-workspace-metrics > .fm-workspace-metric small,
.fm-workspace-metrics > .fm-workspace-metric em,
.fm-workspace-metrics > .fm-workspace-metric span {
    display: block;
    margin: 0;
    color: var(--fm-color-text-muted);
    font-size: var(--fm-type-meta);
    font-style: normal;
    line-height: var(--fm-line-meta);
}

.fm-workspace-metrics > a.fm-workspace-metric:hover {
    border-color: var(--fm-color-border-strong);
    background: var(--fm-color-primary-soft);
}

.fm-workspace-metrics > .fm-workspace-metric[aria-current="page"] {
    border-color: #d49c00;
    background: var(--fm-color-primary-soft);
}

.fm-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(var(--fm-kpi-item-min-width), 100%), 1fr));
    align-items: stretch;
    gap: var(--fm-kpi-gap);
    padding: var(--fm-kpi-padding-y) var(--fm-toolbar-padding-x);
    overflow: visible;
}

.fm-kpi-strip > .fm-kpi-item {
    display: grid;
    min-height: var(--fm-kpi-item-height);
    grid-template-columns: auto minmax(0, 1fr);
    align-content: center;
    align-items: center;
    gap: var(--fm-kpi-gap);
    padding: var(--fm-kpi-padding-y) var(--fm-kpi-padding-x);
}

.fm-kpi-strip > .fm-kpi-item.is-zero {
    color: var(--fm-color-text-muted);
    background: #fbfaf8;
}

.fm-kpi-strip > .fm-kpi-item.is-zero strong,
.fm-kpi-strip > .fm-kpi-item.is-zero span {
    color: var(--fm-color-text-muted);
}

.fm-workspace-results {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}

.fm-upcoming-context > .fm-workspace-notice {
    margin: 0;
    padding: var(--fm-toolbar-padding-y) 0 0;
    border-top: var(--fm-border);
    border-bottom: 0;
    background: transparent;
}

.fm-filter-toolbar {
    position: relative;
    display: flex;
    min-height: calc(var(--fm-control-height) + (2 * var(--fm-toolbar-padding-y)));
    align-items: center;
    gap: var(--fm-toolbar-gap);
    padding: var(--fm-toolbar-padding-y) var(--fm-toolbar-padding-x);
    border-bottom: var(--fm-border);
}

.fm-control-field,
.auth-field,
.account-password-form label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    color: var(--fm-color-text);
    font-size: var(--fm-type-control);
    font-weight: 680;
    line-height: var(--fm-line-control);
}

.fm-control-field > span,
.auth-field > span {
    font-size: inherit;
    line-height: inherit;
}

.fm-heading-more > summary,
.fm-heading-more > div a,
.fm-more-filters > summary,
.fm-month-picker > summary {
    font-size: var(--fm-type-control);
    line-height: var(--fm-line-control);
}

input.fm-text-input,
input.fm-search-input,
select.fm-select,
textarea.fm-textarea {
    width: 100%;
    min-width: 0;
    height: var(--fm-control-height);
    min-height: var(--fm-control-height);
    padding: 0 var(--fm-control-padding-x);
    color: var(--fm-color-text);
    border: var(--fm-border-strong);
    border-radius: var(--fm-radius-control);
    background: var(--fm-color-surface);
    font-size: var(--fm-type-control);
    font-weight: 400;
    line-height: var(--fm-line-control);
    outline: none;
}

textarea.fm-textarea {
    height: auto;
    min-height: 96px;
    padding-block: 10px;
    resize: vertical;
}

.fm-search-field {
    position: relative;
    display: block;
    width: min(350px, 100%);
    min-width: 0;
    flex: 1 1 270px;
    margin: 0;
}

.fm-filter-toolbar > .fm-search-field {
    width: min(var(--fm-search-field-width), 100%);
    flex: 0 0 var(--fm-search-field-width);
}

.fm-control-field > .fm-search-field {
    width: 100%;
    flex: 0 0 auto;
}

input.fm-search-input {
    padding-left: 36px;
}

.fm-search-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 12px;
    transform: translateY(-50%) rotate(-20deg);
    color: var(--fm-color-text-muted);
    pointer-events: none;
}

.fm-page-size {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    color: var(--fm-color-text-muted);
    font-weight: 500;
    white-space: nowrap;
}

input.fm-text-input:focus,
input.fm-search-input:focus,
select.fm-select:focus,
textarea.fm-textarea:focus {
    border-color: #c49200;
    box-shadow: var(--fm-focus-ring);
}

.fm-button,
button.fm-button,
a.fm-button {
    display: inline-flex;
    min-height: var(--fm-control-height);
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 var(--fm-control-padding-x);
    color: var(--fm-color-text);
    text-decoration: none;
    border: var(--fm-border);
    border-radius: var(--fm-radius-control);
    background: var(--fm-color-surface);
    cursor: pointer;
    font-size: var(--fm-type-control);
    font-weight: 720;
    line-height: var(--fm-line-control);
    white-space: nowrap;
}

.fm-button-primary,
button.fm-button-primary,
a.fm-button-primary {
    color: #2a2116;
    border-color: #d6a207;
    background: var(--fm-color-primary);
    box-shadow: 0 2px 0 rgba(106, 76, 0, 0.12);
}

.fm-button-primary:hover,
button.fm-button-primary:hover,
a.fm-button-primary:hover {
    background: var(--fm-color-primary-hover);
}

.fm-button-secondary,
button.fm-button-secondary,
a.fm-button-secondary {
    border-color: var(--fm-color-border);
    background: var(--fm-color-surface);
}

.fm-button-quiet,
.fm-quiet-action {
    color: var(--fm-color-text-secondary);
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.fm-button-secondary:hover,
.fm-button-quiet:hover,
.fm-quiet-action:hover {
    color: var(--fm-color-text);
    border-color: var(--fm-color-border-strong);
    background: var(--fm-color-surface);
}

.fm-table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    border-radius: 0;
    background: var(--fm-color-surface);
    font-size: var(--fm-type-body);
    line-height: var(--fm-line-body);
}

.fm-table .fm-table-heading th,
.fm-table th {
    height: var(--fm-table-heading-height);
    padding: 0 var(--fm-table-cell-padding-x);
    color: var(--fm-color-text-muted);
    border-bottom: var(--fm-border);
    background: #fcfaf6;
    font-size: var(--fm-type-table-heading);
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    vertical-align: middle;
}

.fm-table .fm-align-right {
    text-align: right;
}

.fm-table td {
    height: var(--fm-table-row-height);
    padding: var(--fm-table-cell-padding-y) var(--fm-table-cell-padding-x);
    color: var(--fm-color-text-secondary);
    border-bottom: 1px solid #eee7dc;
    font-size: var(--fm-type-body);
    line-height: var(--fm-line-body);
    vertical-align: middle;
}

.fm-table td strong {
    display: block;
    color: var(--fm-color-text);
    font-size: inherit;
    line-height: inherit;
}

.fm-status-pill,
.fm-status.fm-status-pill {
    display: inline-flex;
    min-height: var(--fm-status-height);
    align-items: center;
    padding: 0 var(--fm-status-padding-x);
    border-radius: var(--fm-radius-pill);
    font-size: var(--fm-type-status);
    font-weight: 750;
    line-height: 1.2;
    white-space: nowrap;
}

.fm-row-action,
.fm-row-more-trigger,
.fm-row-more > summary {
    min-height: var(--fm-compact-control-height);
    font-size: var(--fm-type-control);
    line-height: var(--fm-line-control);
}

.fm-row-action.wide {
    width: var(--fm-row-action-wide-width);
    min-width: var(--fm-row-action-wide-width);
}

td.fm-empty-state {
    height: var(--fm-empty-state-height);
    padding: var(--fm-card-padding);
    text-align: center;
}

.fm-workspace-detail-head {
    display: flex;
    min-height: 88px;
    align-items: center;
    justify-content: space-between;
    gap: var(--fm-card-gap);
    padding: var(--fm-card-padding);
    border-bottom: var(--fm-border);
    background: var(--fm-color-surface);
}

.fm-workspace-detail-title {
    display: grid;
    min-width: 0;
    gap: 4px;
}

.fm-workspace-detail-title h2,
.fm-workspace-detail-title p,
.fm-workspace-detail-section h3,
.fm-workspace-detail-section p {
    margin: 0;
}

.fm-workspace-detail-title .fm-quiet-action {
    width: max-content;
    margin-bottom: 3px;
}

.fm-workspace-detail-title p,
.fm-workspace-detail-section > header p,
.fm-workspace-detail-note,
.fm-workspace-detail-empty,
.fm-workspace-timeline span {
    color: var(--fm-color-text-muted);
    font-size: var(--fm-type-meta);
    line-height: var(--fm-line-meta);
}

.fm-workspace-detail-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: var(--fm-toolbar-gap);
}

.fm-workspace-detail-metrics {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.fm-workspace-issue-guidance {
    margin: var(--fm-card-padding);
}

.fm-workspace-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--fm-card-gap);
    padding: var(--fm-card-padding);
    background: #fffdf8;
}

.fm-workspace-detail-section {
    min-width: 0;
    overflow: hidden;
    border: var(--fm-border);
    border-radius: var(--fm-radius-control);
    background: var(--fm-color-surface);
}

.fm-workspace-detail-section > header {
    display: grid;
    gap: 3px;
    padding: var(--fm-card-padding);
    border-bottom: var(--fm-border);
    background: #fcfaf6;
}

.fm-workspace-detail-wide {
    grid-column: 1 / -1;
}

.fm-workspace-detail-list {
    margin: 0;
}

.fm-workspace-detail-list > div {
    display: grid;
    grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.2fr);
    gap: var(--fm-card-gap);
    padding: 10px var(--fm-card-padding);
    border-bottom: 1px solid #eee7dc;
}

.fm-workspace-detail-list > div:last-child {
    border-bottom: 0;
}

.fm-workspace-detail-list dt {
    color: var(--fm-color-text-muted);
    font-size: var(--fm-type-meta);
    line-height: var(--fm-line-meta);
}

.fm-workspace-detail-list dd {
    min-width: 0;
    margin: 0;
    color: var(--fm-color-text);
    font-size: var(--fm-type-body);
    line-height: var(--fm-line-body);
    overflow-wrap: anywhere;
}

.fm-workspace-detail-list dd small {
    display: block;
    margin-top: 2px;
    color: var(--fm-color-text-muted);
    font-size: var(--fm-type-meta);
    line-height: var(--fm-line-meta);
}

.fm-workspace-detail-note,
.fm-workspace-detail-empty {
    padding: var(--fm-card-padding);
}

.fm-workspace-timeline {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fm-workspace-timeline li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 6px var(--fm-card-gap);
    padding: 12px var(--fm-card-padding);
    border-bottom: 1px solid #eee7dc;
}

.fm-workspace-timeline li:last-child {
    border-bottom: 0;
}

.fm-workspace-timeline li > div {
    display: grid;
    gap: 2px;
}

.fm-workspace-timeline strong {
    color: var(--fm-color-text);
    font-size: var(--fm-type-body);
    line-height: var(--fm-line-body);
}

.fm-workspace-timeline p {
    grid-column: 1 / -1;
    color: var(--fm-color-text-secondary);
    font-size: var(--fm-type-body);
    line-height: var(--fm-line-body);
}

.fm-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.fm-pagination a,
.fm-pagination > span {
    display: grid;
    min-width: var(--fm-compact-control-height);
    height: var(--fm-compact-control-height);
    place-items: center;
    padding: 0 8px;
    color: var(--fm-color-text-secondary);
    text-decoration: none;
    border: var(--fm-border);
    border-radius: var(--fm-radius-control);
    background: var(--fm-color-surface);
    font-size: var(--fm-type-control);
    line-height: 1;
}

.fm-pagination > span.current {
    font-size: var(--fm-type-status);
}

.account-menu {
    border: var(--fm-border);
    border-radius: var(--fm-radius-card);
    box-shadow: var(--fm-shadow-menu);
}

.account-menu a,
.account-menu form button {
    min-height: var(--fm-control-height);
    font-size: var(--fm-type-control);
    line-height: var(--fm-line-control);
}

@media (max-width: 680px) {
    .fm-tab-nav {
        padding-inline: var(--fm-tab-nav-padding-x-compact);
    }

    .fm-filter-toolbar {
        align-items: stretch;
        flex-wrap: wrap;
        padding: 10px;
    }

    .fm-filter-toolbar .fm-search-field {
        width: 100%;
        flex-basis: 100%;
    }

    .fm-workspace-detail-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .fm-workspace-detail-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .fm-workspace-detail-actions .fm-button {
        width: 100%;
    }

    .fm-workspace-detail-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 10px;
    }

    .fm-workspace-detail-wide {
        grid-column: auto;
    }

    .fm-workspace-detail-list > div {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
    }
}

@media (max-width: 800px) {
    .fm-filter-toolbar > .fm-search-field {
        width: 100%;
        flex: 1 1 100%;
    }

    .fm-kpi-strip {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .fm-kpi-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* UI_STYLE_CONTRACT_END */
