/* RubyHQ — built on the Rubymaze design tokens (css/rubymaze-tokens.css, --rm-*). */

@font-face { font-family: "Outfit"; font-weight: 500; font-display: swap; src: url("fonts/Outfit-Medium.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; font-display: swap; src: url("fonts/Outfit-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 700; font-display: swap; src: url("fonts/Outfit-Bold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("fonts/Inter-Regular.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("fonts/Inter-Medium.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("fonts/Inter-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("fonts/Inter-Bold.woff2") format("woff2"); }

html, body {
    margin: 0;
    background: var(--rm-color-background);
    color: var(--rm-color-text);
    font-family: var(--rm-font-body);
}

h1, h2, h3 { font-family: var(--rm-font-display); font-weight: 600; letter-spacing: -0.01em; }

a { color: var(--rm-color-link); }
:focus-visible { outline: 2px solid var(--rm-color-focus-ring); outline-offset: 2px; }

/* ── signed-in shell ───────────────────────────────────────────────────────── */
.rh-appbar { border-bottom: 1px solid var(--rm-color-border); }
.rh-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-left: 4px; }
.rh-brand span { font-family: var(--rm-font-display); font-weight: 600; font-size: 1.2rem; letter-spacing: -0.01em; }
.rh-inline-form { display: inline-flex; margin: 0; }
.rh-mono { font-family: var(--rm-font-mono); font-size: 0.85em; }
.rh-muted { color: var(--rm-color-text-muted); }
.rh-json { font-family: var(--rm-font-mono); font-size: 0.8rem; white-space: pre-wrap; word-break: break-word; margin: 0;
    background: var(--rm-color-surface-subtle); border-radius: var(--rm-radius-sm); padding: 8px 10px; }
.rh-secret { font-family: var(--rm-font-mono); font-size: 1.15rem; letter-spacing: 0.04em; user-select: all; word-break: break-all; }

/* ── signed-out pages: sign-in, MFA, setup, password ───────────────────────── */
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: var(--rm-space-5) var(--rm-space-4); gap: var(--rm-space-4); }
.auth-card { width: 100%; max-width: 420px; background: var(--rm-color-surface); border: 1px solid var(--rm-color-border);
    border-radius: var(--rm-radius-lg); box-shadow: var(--rm-shadow-md); padding: var(--rm-space-6) var(--rm-space-5); box-sizing: border-box; }
.auth-header { display: flex; align-items: center; gap: 12px; margin-bottom: var(--rm-space-5); }
.auth-brand { font-family: var(--rm-font-display); font-weight: 600; font-size: 1.6rem; letter-spacing: -0.01em; }
.auth-card h1 { font-size: 1.4rem; margin: 0 0 var(--rm-space-2); }
.auth-card p { margin: 0 0 var(--rm-space-4); color: var(--rm-color-text-muted); line-height: 1.5; }
.auth-foot { margin: 0; font-size: 0.8rem; color: var(--rm-color-text-subtle); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--rm-space-4); }
.field label { font-weight: 500; font-size: 0.9rem; }
.field input { font: inherit; padding: 10px 12px; border-radius: var(--rm-radius-md); border: 1px solid var(--rm-color-border-strong);
    background: var(--rm-color-surface); color: var(--rm-color-text); width: 100%; box-sizing: border-box; }
.field input:focus { border-color: var(--rm-color-focus-ring); }
.field .hint { font-size: 0.8rem; color: var(--rm-color-text-subtle); }
.validation-message { color: var(--rm-color-error); font-size: 0.85rem; }

.btn { font: inherit; font-weight: 600; cursor: pointer; padding: 11px 16px; border-radius: var(--rm-radius-md); border: 1px solid transparent; width: 100%; text-decoration: none; text-align: center; display: inline-block; box-sizing: border-box; }
.btn-primary { background: var(--rm-color-primary); color: var(--rm-color-on-primary); }
.btn-primary:hover { background: var(--rm-color-primary-hover); }
.btn-quiet { background: transparent; color: var(--rm-color-link); border-color: var(--rm-color-border); margin-top: var(--rm-space-3); }
.link-row { margin-top: var(--rm-space-4); font-size: 0.9rem; display: flex; flex-direction: column; gap: 6px; }

.alert { border-radius: var(--rm-radius-md); padding: 10px 12px; margin-bottom: var(--rm-space-4); font-size: 0.9rem; border: 1px solid; }
.alert-error { background: var(--rm-color-error-subtle); border-color: var(--rm-color-error); color: var(--rm-color-text); }
.alert-ok { background: var(--rm-color-success-subtle); border-color: var(--rm-color-success); color: var(--rm-color-text); }
.alert-warn { background: var(--rm-color-warning-subtle); border-color: var(--rm-color-warning); color: var(--rm-color-text); }

.qr { display: flex; justify-content: center; margin: var(--rm-space-3) 0; }
.qr svg { width: 200px; height: 200px; border-radius: var(--rm-radius-sm); background: #fff; padding: 6px; box-sizing: content-box; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-family: var(--rm-font-mono); font-size: 1rem;
    background: var(--rm-color-surface-subtle); padding: 12px 14px; border-radius: var(--rm-radius-md); margin-bottom: var(--rm-space-4); }

#blazor-error-ui { color-scheme: light only; background: #FFF3DC; color: #14191C; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); box-sizing: border-box;
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem 1.25rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

/* ── status chips: words + a symbol + colour, never colour alone ────────────── */
.rh-status { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px 2px 6px; border-radius: var(--rm-radius-pill);
    font-size: 0.78rem; font-weight: 600; line-height: 1.5; white-space: nowrap; border: 1px solid currentColor; vertical-align: middle; }
.rh-status-icon { width: 16px; height: 16px; }
.rh-status-ok { color: var(--rm-color-success); background: var(--rm-color-success-subtle); }
.rh-status-warn { color: var(--rm-color-warning-text); background: var(--rm-color-warning-subtle); }
.rh-status-bad { color: var(--rm-color-error); background: var(--rm-color-error-subtle); }
.rh-status-neutral { color: var(--rm-color-text-muted); background: var(--rm-color-surface-subtle); }

/* ── fleet dashboard ───────────────────────────────────────────────────────── */
.rh-tile { padding: var(--rm-space-4); height: 100%; border-radius: var(--rm-radius-md); border: 1px solid var(--rm-color-border); background: var(--rm-color-surface); }
.rh-tile-value { font-family: var(--rm-font-body); font-size: 2rem; font-weight: 600; line-height: 1.15; color: var(--rm-color-text); }
.rh-tile-label { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--rm-color-text-muted); font-size: 0.85rem; }
.rh-tile-link { text-decoration: none; color: inherit; display: block; height: 100%; }
.rh-tile-link:hover .rh-tile { border-color: var(--rm-color-border-strong); }
.rh-tile-ok .rh-tile-label svg { color: var(--rm-color-success); }
.rh-tile-bad .rh-tile-label svg { color: var(--rm-color-error); }

.rh-alerts { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rm-color-border); border-radius: var(--rm-radius-md); background: var(--rm-color-surface); }
.rh-alert { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--rm-space-3); padding: var(--rm-space-3) var(--rm-space-4); align-items: start; }
.rh-alert + .rh-alert { border-top: 1px solid var(--rm-color-border); }
.rh-alert-title { font-weight: 600; }
.rh-alert-who { color: var(--rm-color-text-muted); font-size: 0.85rem; }
.rh-alert-detail { color: var(--rm-color-text-muted); font-size: 0.88rem; margin-top: 2px; overflow-wrap: anywhere; }
.rh-tile-hint { color: var(--rm-color-text-muted); font-size: 0.78rem; margin-top: 2px; }
.rh-clear { display: flex; align-items: center; gap: 10px; padding: var(--rm-space-4); border: 1px solid var(--rm-color-border); border-radius: var(--rm-radius-md);
    background: var(--rm-color-surface); color: var(--rm-color-text); }
.rh-clear svg { color: var(--rm-color-success); }
@media (max-width: 600px) { .rh-alert { grid-template-columns: 1fr; gap: 4px; } }

/* ── usage chart ───────────────────────────────────────────────────────────── */
.rh-chart { margin: 0 0 var(--rm-space-5); }
.rh-chart figcaption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: var(--rm-space-2); }
.rh-chart-title { font-weight: 600; }
.rh-chart-sub { font-size: 0.8rem; }
.rh-chart-empty { padding: var(--rm-space-4); border: 1px dashed var(--rm-color-border-strong); border-radius: var(--rm-radius-md); }
.rh-chart-frame { position: relative; }
.rh-chart-svg { display: block; width: 100%; height: auto; overflow: visible; border-radius: var(--rm-radius-md); }
.rh-chart-svg:focus-visible { outline: 2px solid var(--rm-color-focus-ring); outline-offset: 4px; }
.rh-chart .rh-grid { stroke: var(--rm-color-border); stroke-width: 1; }
.rh-chart .rh-axis { fill: var(--rm-color-text-muted); font-size: 11px; font-family: var(--rm-font-body); }
.rh-chart .rh-line { fill: none; stroke: var(--rm-color-link); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.rh-chart .rh-area { fill: var(--rm-color-link); fill-opacity: 0.1; stroke: none; }
.rh-chart .rh-limit { stroke: var(--rm-color-text-muted); stroke-width: 1.5; stroke-dasharray: 6 4; }
.rh-chart .rh-dot { fill: var(--rm-color-link); stroke: var(--rm-color-surface); stroke-width: 2; }
.rh-chart .rh-over { fill: var(--rm-color-error); stroke: var(--rm-color-surface); stroke-width: 2; }
.rh-chart .rh-value { fill: var(--rm-color-text); font-size: 12px; font-weight: 600; font-family: var(--rm-font-body); }
.rh-chart .rh-chart-cross { stroke: var(--rm-color-text-muted); stroke-width: 1; }
.rh-chart-tip { position: absolute; top: -4px; transform: translateY(-100%); pointer-events: none; z-index: 2; min-width: 160px; max-width: 280px;
    background: var(--rm-color-surface-inverse); color: var(--rm-color-text-inverse); border-radius: var(--rm-radius-sm); padding: 6px 10px;
    font-size: 0.8rem; box-shadow: var(--rm-shadow-md); }
.rh-chart-tip[hidden] { display: none; }
.rh-chart-tip strong { display: block; font-size: 0.85rem; }
.rh-chart-table summary { cursor: pointer; font-size: 0.85rem; color: var(--rm-color-link); margin-top: var(--rm-space-2); }
.rh-chart-table-scroll { max-height: 260px; overflow: auto; margin-top: var(--rm-space-2); border: 1px solid var(--rm-color-border); border-radius: var(--rm-radius-sm); }
.rh-chart-table table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.rh-chart-table th, .rh-chart-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--rm-color-border); font-variant-numeric: tabular-nums; }
.rh-chart-table th { position: sticky; top: 0; background: var(--rm-color-surface-subtle); color: var(--rm-color-text); }

/* The billing history on a client: a list, because the card is narrow. */
.rh-billing-event + .rh-billing-event { margin-top: 2px; }

/* MudBlazor draws text-style primary controls in the fill ruby, which is 3.7:1 on the dark surface; the link role is the readable one
   (in the light theme the two are the same colour). */
.mud-primary-text, .mud-nav-link.active:not(.mud-nav-link-disabled), .mud-nav-link.active:not(.mud-nav-link-disabled) .mud-nav-link-icon { color: var(--rm-color-link) !important; }
.mud-button-text.mud-button-text-primary, .mud-button-outlined.mud-button-outlined-primary { color: var(--rm-color-link) !important; }

/* The breadcrumb for the page you are on is not a disabled control, so it must stay readable. */
.mud-breadcrumb-item.mud-disabled, .mud-breadcrumb-item.mud-disabled > a { color: var(--rm-color-text-muted) !important; opacity: 1; }
