/* Permanent owner: Runtime failure banners and route-level recovery surfaces. */

/* ─── Runtime boot-failure banner (audit RES-03) ───────────────────────────
   Surfaces a swallowed loadHomes / loadCredentials failure that would
   otherwise leave a silent empty shell. Calm amber strip (the app isn't
   broken, the data just didn't load) with an explicit retry. */
.runtime-error-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid rgba(var(--color-warning-rgb), 0.30);
    border-radius: var(--radius-xl);
    background: rgba(var(--color-warning-rgb), 0.10);
    color: var(--color-warning-text);
    font-size: 0.9rem;
    line-height: 1.45;
}

.runtime-error-banner-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.runtime-error-banner-btn {
    padding: 6px 14px;
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-warning-text);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}

.runtime-error-banner-btn:hover {
    background: var(--color-warning);
    color: var(--color-on-accent);
}

.runtime-error-banner-btn:focus-visible {
    outline: 2px solid var(--color-warning);
    outline-offset: 2px;
}

.runtime-error-banner-dismiss {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-warning-text);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.runtime-error-banner-dismiss:hover {
    background: rgba(var(--color-warning-rgb), 0.16);
}

.runtime-error-banner-dismiss:focus-visible {
    outline: 2px solid var(--color-warning);
    outline-offset: 2px;
}

/* ─── Route-level error boundary card (audit RES-01) ───────────────────────
   Shown by ErrorBoundary.js when a route component throws during render, in
   place of a blank screen. Centered, calm, recoverable. */
.route-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 24px;
}

.route-error-card {
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 32px 28px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-2xl);
    background: var(--color-surface);
    box-shadow: var(--shadow-card);
}

.route-error-icon {
    color: var(--color-warning);
}

.route-error-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: var(--fs-2xl);
    color: var(--color-text);
}

.route-error-text {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    line-height: 1.5;
}

.route-error-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.route-error-btn {
    padding: 8px 18px;
    border: 1px solid var(--color-solar);
    border-radius: var(--radius-pill);
    background: var(--color-solar);
    color: var(--color-on-accent);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}

.route-error-btn--ghost {
    background: transparent;
    color: var(--color-solar-text);
}

.route-error-btn:hover {
    background: var(--color-solar-text);
    color: var(--color-on-accent);
}

.route-error-btn:focus-visible {
    outline: 2px solid var(--color-focus-outline);
    outline-offset: 2px;
}

/* Collapsed diagnostic disclosure — the app ships unminified, so the captured
   stack names the real file.js:line. Hidden by default to keep the card calm. */
.route-error-details {
    width: 100%;
    margin-top: 6px;
    text-align: left;
}

.route-error-summary {
    cursor: pointer;
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    user-select: none;
}

.route-error-summary:focus-visible {
    outline: 2px solid var(--color-focus-outline);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.route-error-trace {
    margin-top: 10px;
    max-height: 180px;
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    background: var(--color-bg-soft);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    font-size: var(--fs-2xs);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.route-error-copy {
    margin-top: 8px;
    padding: 5px 12px;
    border: 1px solid var(--color-line);
    border-radius: var(--radius-pill);
    background: transparent;
    color: var(--color-solar-text);
    font: inherit;
    font-size: var(--fs-2xs);
    font-weight: 500;
    cursor: pointer;
}

.route-error-copy:hover {
    background: var(--color-solar-soft);
}

.route-error-copy:focus-visible {
    outline: 2px solid var(--color-focus-outline);
    outline-offset: 2px;
}

