/* Global shell: Design Library 3.0 (tops-tokens) only — no Blazor template Helvetica stack. */
html,
body {
    font-family: var(--tops-body-font);
    font-size: var(--tops-body-size);
    line-height: var(--tops-body-line);
    color: var(--tops-text-primary);
    background: var(--tops-background);
}

h1:focus {
    outline: none;
}

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

a:hover {
    color: var(--tops-cta-400);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--tops-valid-border);
}

.invalid {
    outline: 1px solid var(--tops-error);
}

.validation-message {
    color: var(--tops-error);
}

#blazor-error-ui {
    color-scheme: light only;
    background: var(--tops-blazor-error-notice-bg);
    bottom: 0;
    box-shadow: 0 -1px 2px var(--tops-overlay-bg);
    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;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5M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Gw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, var(--tops-blazor-error-bg);
    padding: 1rem 1rem 1rem 3.7rem;
    color: var(--tops-white);
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Adams Tax loading screen: logo with fade-in until Blazor loads */
.app-loading {
    align-items: center;
    background-color: var(--tops-cta-300);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.app-loading-logo {
    animation: app-loading-fade-in 0.5s ease-out forwards;
    max-width: 280px;
    opacity: 0;
    width: 100%;
}

@keyframes app-loading-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

code {
    color: var(--tops-code-color);
}

.l10n-highlight {
    background-color: var(--tops-alert-bg);
    outline: 2px solid var(--tops-sunglow);
    outline-offset: 2px;
    border-radius: var(--tops-input-radius);
    transition: background-color 0.2s, outline-color 0.2s;
}

/* ── String Inspector Panel ── */

.helper-appbar {
    transition: width 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
    .helper-appbar,
    .helper-main {
        transition: none;
    }
}

.helper-layout {
    --helper-appbar-height: 5rem;
}

/* H0-1385 AC4: pre-Blazor stamp so the first drawer paint matches stored + viewport. */
html[data-helper-nav="mini"] .helper-layout .mud-drawer,
html[data-helper-nav="mini"] .helper-layout .mud-drawer .mud-drawer-content {
    max-width: 72px !important;
    min-width: 72px !important;
    width: 72px !important;
}

html[data-helper-nav="expanded"] .helper-layout .mud-drawer,
html[data-helper-nav="expanded"] .helper-layout .mud-drawer .mud-drawer-content {
    max-width: 222px !important;
    min-width: 222px !important;
    width: 222px !important;
}

/* Purchases receipt slides in from the right. The nav width above would otherwise clamp it. */
html[data-helper-nav] .helper-layout .orders-receipt-drawer.mud-drawer,
html[data-helper-nav] .helper-layout .orders-receipt-drawer.mud-drawer .mud-drawer-content {
    max-width: min(547px, 100vw) !important;
    min-width: 0 !important;
    width: min(547px, 100vw) !important;
}

@media (max-width: 720px) {
    html[data-helper-nav] .helper-layout .orders-receipt-drawer.mud-drawer,
    html[data-helper-nav] .helper-layout .orders-receipt-drawer.mud-drawer .mud-drawer-content {
        max-width: 100vw !important;
        width: 100vw !important;
    }
}

/* The TIN Check report's details panel is a MudDrawer too, so the two sidebar rules above and the navy
   .mud-drawer theme in tops-mud-overrides.css would catch it. It is a light right-hand panel, not the nav. */
html[data-helper-nav] .helper-layout .mud-drawer.tc-drawer,
html[data-helper-nav] .helper-layout .mud-drawer.tc-drawer .mud-drawer-content {
    max-width: min(440px, 100vw) !important;
    min-width: min(440px, 100vw) !important;
    width: min(440px, 100vw) !important;
}

.helper-layout .mud-drawer.tc-drawer {
    background-color: var(--tops-surface) !important;
    color: var(--tops-text-primary);
    border-left: 1px solid var(--color-stormy-grey-200);
}

/* Add Issuer flyout close — global fallback (scoped styles + fixed panel layout). */
.add-issuer-flyout-root .add-issuer-flyout-close {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: #0f2c52 !important;
    color: #ffffff !important;
}

.helper-main {
    transition: margin-right 0.25s ease;
}

.mud-popover.mud-popover-open {
    z-index: 10001 !important;
}

.string-inspector-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 450px;
    background: var(--tops-surface);
    border-left: 1px solid var(--tops-card-border);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 16px var(--tops-overlay-bg);
    overflow: hidden;
}

.string-inspector-resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    cursor: col-resize;
    background: transparent;
    z-index: 1;
}

.string-inspector-resize-handle:hover {
    background: var(--tops-primary);
    opacity: 0.5;
}

.string-inspector-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--tops-card-border);
    gap: 8px;
    flex-shrink: 0;
}

.string-inspector-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-bottom: 1px solid var(--tops-card-border);
    gap: 4px;
    flex-shrink: 0;
}

.string-inspector-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
    min-height: 0;
}

.string-inspector-row {
    padding: 8px 12px;
    border-bottom: 1px solid var(--tops-card-border);
    cursor: pointer;
    transition: background-color 0.15s;
}

.string-inspector-row:hover {
    background: var(--tops-helper-shell-hover-bg);
}

.string-inspector-row-header {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.string-inspector-key {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    color: var(--tops-text-secondary);
    word-break: break-all;
}

.string-inspector-value {
    margin-top: 2px;
}

.string-inspector-spanish {
    margin-top: 2px;
    font-style: italic;
}

.string-inspector-edit-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10002;
    padding: 24px;
    min-width: 480px;
    max-width: 640px;
    width: 90vw;
}

.string-inspector-flag-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10002;
    padding: 24px;
    min-width: 360px;
    max-width: 480px;
}

/* ── Credit balance: L-shaped tree connector (federal e-file parent → corrections child) ── */
.helper-credit-branch {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.helper-credit-branch__child {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.0625rem;
}

.helper-credit-branch__child-grow {
    flex: 1 1 auto;
    min-width: 0;
}

.helper-credit-branch__l {
    display: block;
    width: 0.875rem;
    min-height: 1.75rem;
    flex-shrink: 0;
    position: relative;
    align-self: stretch;
}

.helper-credit-branch__l::before {
    content: "";
    position: absolute;
    left: 50%;
    margin-left: -1px;
    top: -0.5rem;
    bottom: 50%;
    border-left: 2px solid var(--tops-brand-300);
}

.helper-credit-branch__l::after {
    content: "";
    position: absolute;
    left: 50%;
    margin-left: -1px;
    top: calc(50% - 1px);
    width: 0.5rem;
    border-top: 2px solid var(--tops-brand-300);
}

.helper-credit-branch__l--compact {
    width: 0.75rem;
    min-height: 1.375rem;
}

.helper-credit-branch__l--compact::before {
    top: -0.3125rem;
}
/* ---------------------------------------------------------------------------
   Print: application chrome never belongs on paper. Report pages (and any other
   page a user prints) keep their content; the app bar, the navigation drawer,
   the floating overlays and the drawer-driven content offset are screen
   furniture. Scoped-CSS files cannot reach the layout chrome, so this lives in
   the global sheet.
   --------------------------------------------------------------------------- */
@media print {
    .account-settings-chrome,
    .orders-card,
    .orders-receipt-drawer {
        display: none !important;
    }

    .orders-print {
        display: block !important;
        color: #0f2c52;
        font-family: Georgia, "Times New Roman", serif;
        font-size: 12pt;
        line-height: 1.45;
    }

    @page {
        size: letter;
        margin: 0.7in;
    }

    /* The app bar and the drawer, in every state they render in. The MudBlazor
       classes are matched alongside the layout's own data-cy hooks: the hooks are
       ours and survive a MudBlazor class rename, which the class names alone do
       not. Belt and braces on purpose — a printed page that leaks the navigation
       is the defect this block exists to prevent. The layout footer joins them:
       its Terms/Legal links are site furniture, and it sits below the content in
       flow, so it prints as a trailing line on the last sheet. */
    .mud-appbar,
    .mud-drawer,
    [data-cy="dashboard-appbar"],
    [data-cy="dashboard-side-navigation"],
    [data-cy="dashboard-footer"] {
        display: none !important;
    }

    /* Floating, fixed-position furniture. Every one of these is anchored to the
       viewport and sits OUTSIDE the main content element, so no content rule can
       reach it: a fixed element prints wherever it floats, once, on top of the
       page. The string-inspector FAB is the one that reached QA's printout — it
       renders as a layout-level sibling with an inline `position: fixed`, which
       only `display: none` can remove. Its PANEL is named alongside it: with the
       FAB hidden the panel can still be OPEN when the user reaches for print,
       and it is a fixed sibling of exactly the same kind. */
    .mud-fab,
    .mud-popover,
    .mud-overlay,
    .mud-snackbar,
    .string-inspector-panel,
    [data-cy="string-inspector-toggle"] {
        display: none !important;
    }

    /* The drawer's left offset is a MARGIN on the main content, driven by a class
       on the layout above it; the app bar's is PADDING on the same element. With
       the chrome gone, both are space reserved for something that is not there. */
    .mud-main-content {
        padding: 0 !important;
        margin: 0 !important;
    }

    /* The shell sizes itself to the viewport so the screen never shows a white
       band below short content. On paper `100vh` is a full sheet of reserved
       height, which pushed a blank trailing page out of every printout. */
    .helper-layout.tops-shell,
    .helper-layout.tops-shell .mud-main-content,
    .admin-layout.tops-shell,
    .admin-layout.tops-shell .mud-main-content {
        min-height: 0 !important;
    }

    /* The page gutter and the shell's tinted background are screen framing. On
       paper the printer's own margin is the gutter, and a tinted block is ink
       spent on nothing — the content starts at the page margin instead. */
    .adamstax-page-container {
        padding: 0 !important;
        max-width: none !important;
    }

    .helper-layout.tops-shell,
    .admin-layout.tops-shell,
    .tops-shell .mud-main-content,
    .tops-shell .adamstax-page-container {
        background-color: transparent !important;
    }
}
