/* HearthTrades design system, shared by the marketing site (HearthTrades.Blazor) and the app (HearthTrades.Wasm).
   Load it first: <link rel="stylesheet" href="_content/HearthTrades.UI/css/hearthtrades.css" />,
   then the app's own css/app.css (app-only rules), then the app's scoped component CSS bundle.
   Rules: keep orange to primary actions and small selected-state accents; use shared tokens
   for text, surfaces, borders, and spacing across every consuming app.
   Global stylesheet on purpose: Blazor CSS isolation does not reach InputFile's inner <input>. */

/* ---------- Tokens ---------- */
:root {
    --ht-ink: #0B0B0C;
    --ht-white: #FFFFFF;
    --ht-gray-50: #F6F7F8;
    --ht-gray-100: #EEEFF1;
    --ht-gray-200: #E2E4E7;
    --ht-gray-300: #C9CCD1;
    --ht-placeholder: #6B7078;
    /* Secondary text: darker than the placeholder gray so it passes AA on the gray-50 canvas too (5.6:1). */
    --ht-muted: #5E636B;
    /* Dark enough for white button text to pass WCAG AA (4.7:1); hover and press go darker still. */
    --ht-orange: #D23F0A;
    --ht-orange-hover: #B8370A;
    --ht-orange-press: #9F2F08;
    --ht-orange-tint: #FFF3EA;
    --ht-success-tint: #E3F5EC;
    --ht-warning-tint: #FFF6CC;
    --ht-error-tint: #FDE8E6;
    --ht-success: #0A7F4F;
    --ht-error: #C8281C;
    /* Lighter status colors for icons on the dark toast. */
    --ht-success-on-dark: #5DD39E;
    --ht-error-on-dark: #FF8A7A;
    /* Ink hairlines: for lines that sit on either white or gray and must read on both. */
    --ht-hairline: rgba(11, 11, 12, 0.08);
    --ht-hairline-strong: rgba(11, 11, 12, 0.12);
    --ht-hover-overlay: rgba(11, 11, 12, 0.06);
    /* Dims the page behind dialogs, drawers and the photo viewer. */
    --ht-scrim: rgba(11, 11, 12, 0.45);
    --ht-scrim-strong: rgba(11, 11, 12, 0.9);
    /* One family for the whole product, wordmark included. */
    --ht-font-ui: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --ht-space-1: 4px;
    --ht-space-2: 8px;
    --ht-space-3: 12px;
    --ht-space-4: 16px;
    --ht-space-5: 24px;
    --ht-space-6: 32px;
    --ht-space-7: 48px;
    --ht-space-8: 64px;
    --ht-radius-sm: 8px;
    --ht-radius-md: 12px;
    --ht-radius-lg: 16px;
    --ht-radius-xl: 24px;
    --ht-radius-2xl: 32px;
    --ht-radius-pill: 999px;
    --ht-shadow-raised: 0 1px 2px rgba(11, 11, 12, 0.08), 0 2px 8px rgba(11, 11, 12, 0.06);
    --ht-shadow-overlay: 0 8px 24px rgba(11, 11, 12, 0.16);
    /* Cards on the app and the marketing site: a soft, wide shadow under a hairline border. */
    --ht-shadow-card: 0 1px 2px rgba(11, 11, 12, 0.04), 0 12px 32px -8px rgba(11, 11, 12, 0.12);
    --ht-shadow-card-hover: 0 2px 4px rgba(11, 11, 12, 0.04), 0 24px 48px -12px rgba(11, 11, 12, 0.22);
    --ht-shadow-float: 0 32px 64px -20px rgba(11, 11, 12, 0.45);
    --ht-container: 1152px;
    /* Height of the sticky .ht-header; things that stick below it use this as their top. */
    --ht-header-height: 73px;
    --ht-gutter: clamp(16px, 4vw, 32px);
    --ht-focus: 3px solid var(--ht-ink);
}

/* ======================================================
   SEMANTIC TOKENS (aliases of the --ht-* tokens above, used by app component CSS)
====================================================== */
:root {
    /* =========================
     PRIMITIVE COLORS (HSL)
  ========================= */
    /* The design system itself lives in this file (--ht-* tokens).
       Semantic tokens below point at those, so a palette change is made once, there.
       These HSL primitives mirror the same palette for the many hsl(var(--x) / alpha) uses in scoped CSS.
       Keep orange restrained to primary actions and small selected-state accents. */
    --gray-10: 0 0% 100%; /* #FFFFFF */
    --gray-50: 210 11% 97%; /* #F6F7F8 */
    --gray-100: 220 9% 94%; /* #EEEFF1 */
    --gray-200: 216 8% 90%; /* #E2E4E7 */
    --gray-300: 218 7% 80%; /* #C9CCD1 */
    --gray-600: 217 6% 45%; /* #6B7078, placeholder only */
    --gray-900: 240 4% 4%; /* #0B0B0C, ink */
    --orange-300: 26 100% 96%; /* #FFF3EA, faint tint */
    --orange-500: 16 91% 43%; /* #D23F0A, CTA */
    --orange-700: 15 90% 33%; /* #9F2F08, CTA pressed */
    --red-500: 4 76% 45%; /* #C8281C */
    --green-600: 156 85% 27%; /* #0A7F4F */
    --yellow-500: 42 100% 27%; /* #8A6100 */
    /* =========================
     SEMANTIC COLORS
  ========================= */

    /* Surfaces, the same on the app and the marketing site:
       canvas = the page behind cards (app pages, marketing gray bands);
       card = white, with a --color-card-border hairline and --shadow-card;
       bg = plain white page areas (marketing white bands, inputs, menus). */
    --color-bg: var(--ht-white);
    --color-canvas: var(--ht-gray-50);
    --color-card: var(--ht-white);
    --color-card-border: var(--ht-gray-200);
    --color-surface: var(--ht-gray-50);
    --color-surface-soft: var(--ht-gray-100);
    --color-surface-hover: var(--ht-gray-200);
    --color-track: var(--ht-gray-200);
    --color-hover-overlay: var(--ht-hover-overlay);
    --color-hairline: var(--ht-hairline);
    --color-hairline-strong: var(--ht-hairline-strong);
    --color-scrim: var(--ht-scrim);
    --color-scrim-strong: var(--ht-scrim-strong);
    --color-text: var(--ht-ink);
    --color-text-inverse: var(--ht-white);
    --color-text-muted: var(--ht-muted);
    --color-text-faint: var(--ht-placeholder);
    --color-border: var(--ht-gray-200);
    --color-border-strong: var(--ht-gray-300);
    --color-error: var(--ht-error);
    --color-success-on-dark: var(--ht-success-on-dark);
    --color-error-on-dark: var(--ht-error-on-dark);
    /* Orange is reserved for call-to-action buttons and small interaction accents. */
    --color-cta: var(--ht-orange);
    --color-cta-hover: var(--ht-orange-hover);
    --color-cta-active: var(--ht-orange-press);
    --color-tint: var(--ht-orange-tint);
    --color-interaction-accent: var(--ht-orange);
    --color-interaction-accent-tint: var(--ht-orange-tint);
    /* Edge of an orange-tint panel, and the glow around the current step marker. */
    --color-tint-border: color-mix(in srgb, var(--ht-orange) 28%, transparent);
    --color-accent-ring: color-mix(in srgb, var(--ht-orange) 22%, transparent);
    /* Primary actions stay distinct from the small orange selected-state accent. */
    --color-primary: var(--ht-ink);
    --color-primary-soft: var(--ht-gray-100);
    --color-primary-strong: var(--ht-ink);
    --color-primary-accent: var(--ht-ink);
    --color-selected: var(--ht-gray-200);
    --color-accent: hsl(var(--red-500));
    --color-success: var(--ht-success);
    --color-warning: hsl(var(--yellow-500));
    --color-success-tint: var(--ht-success-tint);
    --color-warning-tint: var(--ht-warning-tint);
    --color-error-tint: var(--ht-error-tint);
    --color-note: var(--color-warning-tint);
    --color-highlight: var(--color-warning-tint);
    --color-line: hsl(var(--gray-900) / 0.75);
    --color-line-soft: hsl(var(--gray-900) / 0.35);
    /* =========================
     INTERACTION TOKENS
  ========================= */

    --color-primary-hover: hsl(var(--gray-900) / 0.85);
    --color-primary-active: hsl(var(--gray-900));
    --opacity-hover: 0.9;
    --opacity-disabled: 0.5;
    --scale-active: 0.98;
    /* =========================
     TYPOGRAPHY
  ========================= */
    --font-body: var(--ht-font-ui);
    --font-ui: var(--ht-font-ui);
    --text-xs: 12px;
    --text-sm: 14px;
    --text-md: 16px;
    --text-lg: clamp(16px, 1.2vw, 18px);
    --text-xl: clamp(18px, 1.5vw, 22px);
    --text-2xl: clamp(20px, 2vw, 26px);
    --text-3xl: clamp(24px, 2.5vw, 32px);
    --text-4xl: clamp(28px, 3vw, 40px);
    --text-5xl: clamp(32px, 4vw, 52px);
    --text-6xl: clamp(36px, 5vw, 64px);
    --leading-tight: 1.2;
    --leading-normal: 1.5;
    --leading-relaxed: 1.7;
    --font-regular: 400;
    --font-medium: 500;
    --font-bold: 700;
    /* =========================
     SPACING
  ========================= */

    --space-1: var(--ht-space-1);
    --space-2: var(--ht-space-2);
    --space-3: var(--ht-space-3);
    --space-4: var(--ht-space-4);
    --space-5: var(--ht-space-5);
    --space-6: var(--ht-space-6);
    --space-7: var(--ht-space-7);
    --space-8: var(--ht-space-8);
    /* =========================
     LAYOUT
  ========================= */

    --container-width: var(--ht-container);
    --grid-columns: 12;
    --grid-gap: var(--space-3);
    /* =========================
     RADIUS + SHADOW
  ========================= */

    --radius-sm: var(--ht-radius-sm);
    --radius-md: var(--ht-radius-md);
    --radius-lg: var(--ht-radius-lg);
    --radius-xl: var(--ht-radius-xl);
    --radius-full: var(--ht-radius-pill);
    --shadow-sm: var(--ht-shadow-raised);
    --shadow-md: var(--ht-shadow-overlay);
    --shadow-card: var(--ht-shadow-card);
    --shadow-card-hover: var(--ht-shadow-card-hover);
    --shadow-float: var(--ht-shadow-float);
    /* =========================
     MOTION TOKENS
  ========================= */

    --ease-standard: cubic-bezier(0.2, 0, 0, 1);
    --ease-emphasized: cubic-bezier(0.2, 0, 0, 1.4);
    --duration-fast: 120ms;
    --duration-normal: 200ms;
    --duration-slow: 320ms;
    /* =========================
     Z-INDEX SCALE
  ========================= */

    /* Stacking order: sticky header < side drawer < dialog < photo viewer (can open from a drawer or dialog) < error bar. */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-overlay: 300;
    --z-modal: 400;
    --z-lightbox: 450;
    --z-toast: 500;
}

/* ---------- Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

/* In-page links (#pros, #why) land below the sticky header instead of under it. */
html {
    scroll-padding-top: calc(var(--ht-header-height) + var(--ht-space-4));
}

body {
    margin: 0;
    font-family: var(--ht-font-ui);
    font-size: 16px;
    line-height: 24px;
    color: var(--color-text);
    background: var(--color-bg);
}

a {
    color: var(--color-text);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* A plain link inside running text must look like a link, not like the words around it. */
p a:not([class]) {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

button, input, select, textarea {
    font-family: inherit;
    color: var(--color-text);
}

button {
    cursor: pointer;
}

:focus-visible {
    outline: var(--ht-focus);
    outline-offset: 2px;
}

::placeholder {
    color: var(--color-text-faint);
}

/* Inputs get an inset ring so it doesn't fight the border */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-text);
    outline-offset: 0;
    box-shadow: none;
}

:focus:not(:focus-visible) {
    outline: none;
}

/* ---------- Type ---------- */
/* Bare headings get the same scale as the .ht-h* classes, so both apps render them alike. */
h1, h2, h3, h4 {
    font-weight: 800;
    text-wrap: balance;
}

h1 {
    font-size: clamp(32px, 5vw, 40px);
    line-height: 1.1;
    letter-spacing: -0.03em;
}

h2 {
    font-size: 28px;
    line-height: 34px;
    letter-spacing: -0.02em;
}

h3 {
    font-size: 20px;
    line-height: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h4 {
    font-size: 18px;
    line-height: 24px;
    font-weight: 700;
}

.ht-display {
    font-size: clamp(40px, 8vw, 88px);
    line-height: 1.02;
    font-weight: 800;
    letter-spacing: -0.04em;
    margin: 0;
    text-wrap: balance;
}

.ht-display:focus {
    outline: none;
}

.ht-h1 {
    font-size: clamp(32px, 5vw, 40px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin: 0;
    text-wrap: balance;
}

.ht-h2 {
    font-size: 28px;
    line-height: 34px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

.ht-h3 {
    font-size: 20px;
    line-height: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
}

.ht-body-lg {
    font-size: 18px;
    line-height: 28px;
    margin: 0;
    text-wrap: pretty;
}

.ht-body {
    font-size: 16px;
    line-height: 24px;
    margin: 0;
}

.ht-label-text {
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}

.ht-caption {
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.ht-eyebrow {
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Large figures (stats, step numbers, the service radius): heavy, tight, fixed-width digits. */
.ht-numeral,
.ht-steps__n,
.radius__value {
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

/* ---------- Layout ---------- */
.ht-container {
    max-width: var(--ht-container);
    margin: 0 auto;
    padding-inline: var(--ht-gutter);
}

.ht-section {
    padding-block: clamp(40px, 7vw, 88px);
}

.ht-section--tint {
    background: var(--color-tint);
    border-radius: var(--ht-radius-2xl);
    padding: clamp(24px, 5vw, 64px);
}

.ht-section--gray {
    background: var(--color-canvas);
    border-radius: var(--ht-radius-2xl);
    padding: clamp(24px, 5vw, 64px);
}

.ht-stack {
    display: flex;
    flex-direction: column;
    gap: var(--ht-space-4);
}

.ht-stack--lg {
    gap: var(--ht-space-5);
}

.ht-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ht-space-3);
}

.ht-grid {
    display: grid;
    gap: var(--ht-space-4);
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

/* Four items: one column on phones, 2x2 on tablets, one row on wide screens. Never leaves an orphan. */
.ht-grid--quad {
    grid-template-columns: 1fr;
}

@media (min-width: 600px) {
    .ht-grid--quad { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1080px) {
    .ht-grid--quad { grid-template-columns: repeat(4, 1fr); }
}

.ht-center {
    text-align: center;
    align-items: center;
}

/* ---------- Buttons ---------- */
.ht-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: var(--ht-radius-pill);
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 120ms ease, transform 120ms ease;
}

    .ht-btn:hover {
        text-decoration: none;
    }

    .ht-btn:active {
        transform: scale(0.98);
    }

    .ht-btn:disabled, .ht-btn[aria-disabled="true"] {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
    }

.ht-btn--lg {
    height: 56px;
    padding: 0 28px;
    font-size: 16px;
}

.ht-btn--md {
    height: 48px;
    padding: 0 22px;
    font-size: 16px;
}

.ht-btn--sm {
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
}

.ht-btn--block {
    display: flex;
    width: 100%;
}

/* Call to action: the only orange in the product */
.ht-btn--cta {
    background: var(--color-cta);
    color: var(--color-text-inverse);
}

    .ht-btn--cta:hover {
        background: var(--color-cta-hover);
    }

    .ht-btn--cta:active {
        background: var(--color-cta-active);
    }

/* Everything else is gray */
.ht-btn--secondary {
    background: var(--color-surface-soft);
    color: var(--color-text);
}

    .ht-btn--secondary:hover {
        background: var(--color-surface-hover);
    }

.ht-btn--text {
    background: transparent;
    color: var(--color-text);
    text-decoration: underline;
    padding-inline: var(--ht-space-3);
}

/* Destructive actions: ink text, red outline. Orange stays reserved for the call to action. */
.ht-btn--danger {
    background: var(--color-bg);
    color: var(--color-text);
    box-shadow: inset 0 0 0 2px var(--color-error);
}

    .ht-btn--danger:hover {
        background: var(--color-error-tint);
    }

.ht-btn--icon {
    width: 48px;
    padding: 0;
}

/* ---------- Chips ---------- */
.ht-chip {
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--ht-radius-pill);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
}

a.ht-chip {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.ht-chip:hover {
    background: var(--color-surface);
}

.ht-chip[aria-pressed="true"] {
    background: var(--color-tint);
    border-color: var(--color-interaction-accent);
    color: var(--color-cta-active);
}

.ht-chip--removable {
    display: inline-flex;
    align-items: center;
    gap: var(--ht-space-1);
    padding-right: 0;
    height: 44px;
}

/* 42px inside the chip's 1px border keeps the hit area at the 44px minimum. */
.ht-chip__remove {
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: var(--ht-radius-pill);
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .ht-chip__remove:hover {
        background: var(--color-surface-soft);
    }

/* ---------- Form fields ---------- */
.ht-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ht-label {
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
}

.ht-hint {
    font-size: 12px;
    line-height: 16px;
}

/* Field-level error: red text with a warning mark, so it reads as an error without relying on color alone. */
.ht-error-text {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 6px;
    color: var(--color-error);
    font-size: 13px;
    line-height: 18px;
    font-weight: 600;
}

.ht-field > .ht-error-text {
    margin-top: 0;
}

.ht-error-text::before {
    content: "!";
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 16px;
    height: 16px;
    margin-top: 1px;
    border-radius: 50%;
    background: var(--color-error);
    color: var(--color-text-inverse);
    font-size: 11px;
    line-height: 1;
}

.ht-input, .ht-select, .ht-textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--ht-radius-md);
    background: var(--color-bg);
    font-size: 16px;
    line-height: 24px;
}

.ht-input, .ht-select {
    height: 48px;
    padding: 0 16px;
}

.ht-textarea {
    padding: 12px 16px;
    min-height: 96px;
    resize: vertical;
}

    .ht-input:focus, .ht-select:focus, .ht-textarea:focus {
        outline: var(--ht-focus);
        outline-offset: 0;
        border-color: var(--color-text);
    }

.ht-field--error .ht-input, .ht-field--error .ht-select, .ht-field--error .ht-textarea {
    border-color: var(--color-error);
    background: var(--color-error-tint);
}

.ht-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230B0B0C' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
}

.ht-search {
    position: relative;
    display: flex;
    align-items: center;
}

.ht-search__icon {
    position: absolute;
    left: 20px;
    pointer-events: none;
}

.ht-search .ht-input {
    height: 56px;
    padding-left: 52px;
    border: 0;
    border-radius: var(--ht-radius-pill);
    background: var(--color-surface-soft);
}

/* Compact (44px) search and select, for toolbars and table filters. */
.ht-search--sm .ht-search__icon {
    left: 16px;
}

.ht-search--sm .ht-input {
    height: 44px;
    padding-left: 40px;
    font-size: 14px;
}

.ht-select--sm {
    width: auto;
    height: 44px;
    padding-left: 16px;
    border-radius: var(--ht-radius-pill);
    font-size: 14px;
}

/* ---------- Photo dropzone (invisible-overlay InputFile) ---------- */
.ht-dropzone {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--ht-space-4);
    padding: var(--ht-space-5);
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--ht-radius-lg);
    background: var(--color-surface);
}

    .ht-dropzone:hover {
        background: var(--color-surface-soft);
    }

    .ht-dropzone:focus-within {
        outline: var(--ht-focus);
        outline-offset: 2px;
    }

.ht-dropzone__input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.ht-dropzone__icon {
    flex: 0 0 56px;
    height: 56px;
    border-radius: var(--ht-radius-md);
    background: var(--color-bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ht-dropzone__title {
    font-size: 18px;
    line-height: 24px;
    font-weight: 700;
}

.ht-dropzone__hint {
    font-size: 14px;
    line-height: 20px;
}

.ht-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ht-space-2);
    margin-top: var(--ht-space-3);
}

/* ---------- Cards, badges, banners, avatar ---------- */
.ht-card {
    background: var(--color-card);
    border: 1px solid var(--color-card-border);
    border-radius: var(--ht-radius-lg);
    box-shadow: var(--shadow-card);
    padding: var(--ht-space-4);
}

/* ---------- Job card (JobCard.razor) ----------
   The project/job card in the app's dashboard and in the marketing examples. Brand tokens only. */
.ht-job-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    padding: 18px 20px;
    border: 1px solid var(--color-card-border);
    border-radius: var(--ht-radius-lg);
    background: var(--color-card);
    box-shadow: var(--shadow-card);
    color: var(--color-text);
    font: inherit;
    text-align: left;
}

.ht-job-card--button {
    cursor: pointer;
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

    .ht-job-card--button:hover {
        border-color: var(--color-border-strong);
        box-shadow: var(--shadow-card-hover);
        transform: translateY(-1px);
    }

    .ht-job-card--button:focus-visible {
        outline: 2px solid var(--color-interaction-accent);
        outline-offset: 2px;
    }

/* Waiting on the reader: accent edge and a stronger line. */
.ht-job-card--attention {
    border-left: 4px solid var(--color-interaction-accent);
    padding-left: 17px;
}

.ht-job-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.ht-job-card__heading {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

/* The trade's icon, before the title; the title block then takes the free width. */
.ht-job-card__icon {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: var(--ht-radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-soft);
    color: var(--color-text);
}

    .ht-job-card__icon + .ht-job-card__heading {
        flex: 1;
    }

.ht-job-card__title {
    font-size: 20px;
    line-height: 26px;
    font-weight: 700;
    letter-spacing: -0.2px;
    overflow-wrap: anywhere;
}

.ht-job-card__location {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    line-height: 20px;
    color: var(--color-text-muted);
}

    .ht-job-card__location svg {
        flex: none;
    }

.ht-job-card__steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.ht-job-card__step {
    height: 4px;
    border-radius: var(--ht-radius-pill);
    background: var(--color-track);
}

.ht-job-card__step--done {
    background: var(--color-cta);
}

/* Where the job stands; sits tight under the bar it explains. */
.ht-job-card__note {
    margin-top: -6px;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    color: var(--color-text);
}

.ht-job-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ht-job-card__line {
    min-width: 0;
    font-size: 15px;
    line-height: 21px;
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.ht-job-card--attention .ht-job-card__line {
    color: var(--color-text);
    font-weight: 600;
}

.ht-job-card__chevron {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--color-text-muted);
    transition: transform 120ms ease, color 120ms ease;
}

.ht-job-card--button:hover .ht-job-card__chevron {
    color: var(--color-text);
    transform: translateX(2px);
}

@media (max-width: 640px) {
    .ht-job-card {
        padding: 16px;
    }

    .ht-job-card--attention {
        padding-left: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ht-job-card--button,
    .ht-job-card__chevron {
        transition: none;
    }

        .ht-job-card--button:hover,
        .ht-job-card--button:hover .ht-job-card__chevron {
            transform: none;
        }
}

/* Every card has the shadow now; --raised is kept so existing markup keeps working. */
.ht-card--raised {
    box-shadow: var(--shadow-card);
}

.ht-card--selected {
    border: 2px solid var(--color-interaction-accent);
    background: var(--color-tint);
}

.ht-card--dim {
    opacity: 0.5;
}

.ht-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--ht-radius-pill);
    background: var(--color-surface-soft);
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
}

.ht-badge--success {
    background: var(--color-success-tint);
}

.ht-badge--warning {
    background: var(--color-warning-tint);
}

.ht-badge--error {
    background: var(--color-error-tint);
}

.ht-banner {
    display: flex;
    align-items: flex-start;
    gap: var(--ht-space-3);
    border-radius: var(--ht-radius-md);
    padding: var(--ht-space-3) var(--ht-space-4);
    font-size: 14px;
    line-height: 20px;
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.ht-banner__icon {
    flex: 0 0 auto;
    display: inline-flex;
    margin-top: 0;
}

.ht-banner__content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ht-banner__title {
    font-weight: 700;
}

.ht-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ht-space-2);
    margin-top: var(--ht-space-2);
}

.ht-banner__close {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: -4px -8px -4px 0;
    border: 0;
    border-radius: var(--ht-radius-pill);
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.ht-banner__close:hover {
    background: var(--color-hover-overlay);
}

.ht-banner--error .ht-banner__icon {
    color: var(--color-error);
}

.ht-banner--success .ht-banner__icon {
    color: var(--color-success);
}

.ht-banner--success {
    background: var(--color-success-tint);
}

.ht-banner--warning {
    background: var(--color-warning-tint);
}

.ht-banner--error {
    background: var(--color-error-tint);
}

.ht-avatar {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: var(--ht-radius-pill);
    background: var(--color-surface-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.ht-avatar--sm {
    width: 40px;
    height: 40px;
    font-size: 14px;
}

.ht-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ht-space-1);
}

/* ---------- List header and stat tiles ---------- */
.ht-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--ht-space-3) var(--ht-space-4);
}

.ht-list-header__title,
.ht-list-header__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--ht-space-2);
}

/* ---------- Site header (translucent, sticky) ---------- */
.ht-header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    backdrop-filter: blur(16px) saturate(1.5);
    border-bottom: 1px solid var(--color-hairline);
}

/* Fixed bar height so the marketing and app headers match whatever actions they hold. */
.ht-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--ht-space-3);
    min-height: 72px;
    padding-block: 12px;
}

/* Wordmark: ink text in the headline voice (Figtree 800, tight), orange only in the mark. */
.ht-wordmark {
    font-size: 22px;
    line-height: 28px;
    color: var(--color-text);
    font-weight: 800;
    letter-spacing: -0.035em;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
}

    .ht-wordmark:hover {
        text-decoration: none;
    }

.ht-wordmark__mark {
    flex: 0 0 auto;
    width: 1.3em;
    height: 1.3em;
}

.ht-nav {
    display: flex;
    align-items: center;
    gap: var(--ht-space-1);
}

.ht-nav__login {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--ht-radius-pill);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.ht-nav__login:hover {
    background: var(--color-surface-soft);
    text-decoration: none;
}

.ht-nav__cta-mobile {
    display: none;
}

@media (max-width: 640px) {
    .ht-header__inner {
        gap: 8px;
    }

    .ht-nav {
        gap: 2px;
    }

    .ht-nav__login {
        padding-inline: 8px;
    }

    .ht-nav__cta-desktop,
    .ht-nav__secondary {
        display: none;
    }

    .ht-nav__cta-mobile {
        display: inline;
    }
}

/* ---------- Footer ---------- */
.ht-footer {
    background: var(--color-surface);
}

.ht-footer__grid {
    display: grid;
    gap: var(--ht-space-6);
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    padding-block: clamp(40px, 6vw, 64px);
}

.ht-footer__title {
    font-size: 12px;
    line-height: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: var(--ht-space-3);
}

.ht-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--ht-space-2);
}

.ht-footer__bottom {
    border-top: 1px solid var(--color-border);
    padding-block: var(--ht-space-5);
    font-size: 14px;
}

/* ---------- Steps and FAQ ---------- */
.ht-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

    .ht-steps li {
        display: flex;
        align-items: baseline;
        gap: var(--ht-space-3);
        padding: 14px 0;
        border-top: 1px solid var(--color-hairline-strong);
    }

.ht-steps__n {
    flex: 0 0 40px;
    font-size: 20px;
}

.ht-faq {
    border-top: 1px solid var(--color-border);
}

    .ht-faq:last-of-type {
        border-bottom: 1px solid var(--color-border);
    }

    .ht-faq summary {
        list-style: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: var(--ht-space-4);
        padding: 20px 0;
        font-size: 18px;
        line-height: 24px;
        font-weight: 700;
        cursor: pointer;
    }

        .ht-faq summary::-webkit-details-marker {
            display: none;
        }

        .ht-faq summary::after {
            content: '+';
            font-size: 24px;
            line-height: 24px;
            font-weight: 500;
        }

    .ht-faq[open] summary::after {
        content: '\2212';
    }

.ht-faq__answer {
    padding: 0 0 20px;
    max-width: 720px;
}

/* ---------- Utilities ---------- */
.ht-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ht-hide-sm {
}

@media (max-width: 640px) {
    .ht-hide-sm {
        display: none !important;
    }
}

/* ---------- Hero (marketing pages and the app's Experiment page) ---------- */
.ht-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--ht-space-5);
    padding-block: clamp(40px, 8vw, 88px) clamp(40px, 6vw, 72px);
}

.ht-hero__lead {
    max-width: 640px;
}

.ht-hero__card {
    width: 100%;
    max-width: 760px;
    text-align: left;
    background: var(--color-bg);
    border-radius: var(--ht-radius-xl);
    padding: clamp(16px, 3vw, 24px);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: var(--ht-space-4);
}

.ht-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--ht-space-2);
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 640px) {
    .ht-hero__actions .ht-btn {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .ht-wordmark {
        font-size: 20px;
        line-height: 24px;
    }

    .ht-nav__login {
        padding-inline: 6px;
        font-size: 13px;
    }

    .ht-nav > .ht-btn {
        padding-inline: 12px;
        font-size: 13px;
    }
}

/* ---------- Modal (Modal.razor): centered dialog on desktop, bottom sheet on phones ---------- */
.ht-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ht-space-4);
}

.ht-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--color-scrim);
    animation: ht-modal-fade 160ms ease-out;
}

.ht-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: min(880px, calc(100dvh - 2 * var(--ht-space-4)));
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
    border-radius: var(--ht-radius-xl);
    box-shadow: var(--shadow-md);
    animation: ht-modal-in 200ms cubic-bezier(.2, .8, .2, 1);
}

    .ht-modal__dialog:focus {
        outline: none;
    }

/* Short confirmations stay a centered card on phones too, not a bottom sheet. */
.ht-modal__dialog--narrow {
    max-width: 420px;
}

.ht-modal__header {
    display: flex;
    align-items: center;
    gap: var(--ht-space-3);
    padding: var(--ht-space-4) var(--ht-space-4) var(--ht-space-3);
}

.ht-modal__heading {
    flex: 1 1 auto;
    min-width: 0;
}

    .ht-modal__heading h2 {
        margin: 0;
    }

.ht-modal__subtitle {
    margin: 2px 0 0;
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
}

.ht-modal__close {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--ht-radius-pill);
    background: var(--color-surface-soft);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .ht-modal__close:hover {
        background: var(--color-surface-hover);
    }

.ht-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 var(--ht-space-4) var(--ht-space-4);
    display: flex;
    flex-direction: column;
    gap: var(--ht-space-4);
}

.ht-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--ht-space-2);
    padding: var(--ht-space-3) var(--ht-space-4);
    border-top: 1px solid var(--color-border);
}

@media (max-width: 640px) {
    .ht-modal {
        align-items: flex-end;
        padding: 0;
    }

    .ht-modal__dialog {
        max-height: 92dvh;
        border-radius: var(--ht-radius-xl) var(--ht-radius-xl) 0 0;
        animation-name: ht-modal-sheet;
    }

    .ht-modal__footer > * {
        flex: 1 1 0;
    }

    .ht-modal:has(.ht-modal__dialog--narrow) {
        align-items: center;
        padding: var(--ht-space-4);
    }

    .ht-modal__dialog--narrow {
        border-radius: var(--ht-radius-xl);
        animation-name: ht-modal-in;
    }
}

@keyframes ht-modal-fade {
    from {
        opacity: 0;
    }
}

@keyframes ht-modal-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }
}

@keyframes ht-modal-sheet {
    from {
        transform: translateY(100%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ht-modal__backdrop,
    .ht-modal__dialog {
        animation: none;
    }
}

/* Content inside a Modal */
/* Sections inside a modal: label on top, fields below, a hairline between groups. */
.ht-modal .form-section:first-child {
    padding-top: 0;
    border-top: 0;
}

.ht-modal .form-section__head p {
    margin: 0;
    font-size: 14px;
    line-height: 20px;
}

/* A label plus switch on one line (notification settings). */
.modal-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 12px 0;
    border-top: 1px solid var(--color-border);
}

    .modal-toggle:first-of-type {
        border-top: 0;
    }

.modal-toggle__text {
    display: flex;
    flex-direction: column;
}

.modal-toggle__label {
    font-weight: 700;
}

.modal-toggle__hint {
    font-size: 14px;
    line-height: 20px;
}

/* ---------- Lightbox (Lightbox.razor): full-screen photo or video preview ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: var(--z-lightbox);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ht-space-7) var(--ht-space-5);
    background: var(--color-scrim-strong);
}

    .lightbox:focus {
        outline: none;
    }

.lightbox__media {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--ht-radius-lg);
}

.lightbox__close,
.lightbox__nav {
    position: absolute;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: var(--ht-radius-pill);
    background: var(--color-bg);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox__close {
    top: var(--ht-space-3);
    right: var(--ht-space-3);
}

.lightbox__nav {
    top: 50%;
    translate: 0 -50%;
}

    .lightbox__nav:disabled {
        opacity: 0.3;
        cursor: default;
    }

.lightbox__nav--prev {
    left: var(--ht-space-3);
    rotate: 90deg;
}

.lightbox__nav--next {
    right: var(--ht-space-3);
    rotate: -90deg;
}

.lightbox__counter {
    position: absolute;
    bottom: var(--ht-space-4);
    left: 50%;
    translate: -50% 0;
    padding: 4px 12px;
    border-radius: var(--ht-radius-pill);
    background: var(--color-bg);
    font-size: 14px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ---------- Form patterns: option cards, photo picker, form sections, radius, switch ---------- */
.flow-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flow-option {
    min-height: 64px;
    padding: 12px 20px;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    color: var(--color-text);
    font: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    cursor: pointer;
}

    .flow-option:hover {
        border-color: var(--color-border-strong);
    }

    .flow-option[aria-checked="true"] {
        border-color: var(--color-text);
        background: var(--color-surface);
    }

.flow-option__text {
    display: flex;
    flex-direction: column;
}

.flow-option__label {
    font-size: 16px;
    line-height: 24px;
    font-weight: 700;
}

.flow-option__desc {
    font-size: 14px;
    line-height: 20px;
}

.flow-option__dot {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    border: 2px solid var(--color-border-strong);
    background: var(--color-bg);
}

.flow-option[aria-checked="true"] .flow-option__dot {
    border-color: var(--color-text);
    background: var(--color-text);
    box-shadow: inset 0 0 0 4px var(--color-bg);
}

.flow-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
    gap: var(--space-2);
}

.flow-photos__thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-surface-soft);
}

    .flow-photos__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.flow-photos__remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--color-bg);
    color: var(--color-text);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.flow-photos__add {
    position: relative;
    aspect-ratio: 1;
    border: 2px dashed var(--color-border-strong);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .flow-photos__add:focus-within {
        outline: 3px solid var(--color-text);
        outline-offset: 2px;
    }

.sr-only-file-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}


/* Form sections for long forms (contractor signup, settings) */
.form-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.form-section__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: var(--space-3);
}

.form-grid__span {
    grid-column: 1 / -1;
}

/* Single-value range (service radius) */
.radius {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.radius__value {
    font-size: 40px;
    line-height: 44px;
}

    .radius__value small {
        font-family: var(--font-ui);
        font-size: 16px;
        font-weight: 600;
        margin-left: 6px;
    }

.radius__input {
    width: 100%;
    height: 44px;
    margin: 0;
    accent-color: var(--color-text);
    cursor: pointer;
}

.radius__bounds {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
}

/* On/off switch (Settings notifications, admin Edit user). Use a button with role="switch" and aria-checked. */
.switch {
    position: relative;
    flex: 0 0 auto;
    width: 56px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-full);
    background: var(--color-text-faint);
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-standard);
}

    .switch::after {
        content: '';
        position: absolute;
        top: 4px;
        left: 4px;
        width: 28px;
        height: 28px;
        border-radius: var(--radius-full);
        background: var(--color-bg);
        box-shadow: 0 1px 3px rgba(11, 11, 12, 0.3);
        transition: transform var(--duration-fast) var(--ease-standard);
    }

    .switch[aria-checked="true"] {
        background: var(--color-text);
    }

        .switch[aria-checked="true"]::after {
            transform: translateX(20px);
        }

/* ---------- Segmented tabs, empty state, loading skeleton ---------- */
.segmented {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--color-surface-soft);
    border-radius: var(--radius-full);
    max-width: 100%;
    overflow-x: auto;
}

.segmented__tab {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding: 0 20px;
    border: 0;
    border-radius: var(--radius-full);
    background: transparent;
    color: var(--color-text);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

    .segmented__tab[aria-selected="true"],
    .segmented__tab[aria-checked="true"] {
        background: var(--color-interaction-accent-tint);
        color: var(--color-primary-strong);
        box-shadow: inset 0 0 0 1px var(--color-interaction-accent), 0 1px 3px rgba(11, 11, 12, 0.12);
    }

/* Narrow screens: tighter tabs so three labels and counts fit without clipping. */
@media (max-width: 480px) {
    .segmented__tab {
        padding: 0 12px;
        gap: 6px;
    }
}

.segmented__count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--color-selected);
    font-size: 12px;
    line-height: 22px;
    text-align: center;
}

/* ---------- Empty, error and loading states (EmptyState, ErrorState, LoadingState) ---------- */
.ht-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ht-space-2);
    padding: var(--ht-space-7) var(--ht-space-4);
    text-align: center;
}

.ht-state--bordered {
    padding: var(--ht-space-6) var(--ht-space-4);
    background: var(--color-bg);
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--ht-radius-lg);
}

.ht-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--ht-space-1);
    border-radius: var(--ht-radius-pill);
    background: var(--color-surface-soft);
    color: var(--color-text);
}

.ht-state--error .ht-state__icon {
    background: var(--color-error-tint);
    color: var(--color-error);
}

.ht-state--success .ht-state__icon {
    background: var(--color-success-tint);
    color: var(--color-success);
}

.ht-state--warning .ht-state__icon {
    background: var(--color-warning-tint);
}

.ht-state__title {
    margin: 0;
}

.ht-state__text {
    max-width: 40ch;
    margin: 0;
    color: var(--color-text-muted, var(--color-text-faint));
}

.ht-state__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--ht-space-2);
    margin-top: var(--ht-space-3);
}

.ht-loading {
    display: flex;
    flex-direction: column;
    gap: var(--ht-space-3);
}

.ht-loading--spinner {
    align-items: center;
    justify-content: center;
    padding: var(--ht-space-7) var(--ht-space-4);
}

.ht-loading__label {
    font-size: 14px;
    color: var(--color-text-faint);
}

.skeleton-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: var(--space-4);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.skeleton-bar {
    height: 16px;
    border-radius: var(--radius-full);
    background: var(--color-surface-soft);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-bar--short {
    width: 96px;
}

.skeleton-bar--mid {
    width: 60%;
}

@keyframes skeleton-pulse {
    50% {
        opacity: 0.5;
    }
}

.spinner--sm {
    width: 20px;
    height: 20px;
    border-width: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .skeleton-bar {
        animation: none;
    }
}

/* ---------- Spinner ---------- */
.spinner {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 4px solid var(--color-surface-soft);
    border-top-color: var(--color-text);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 2.4s;
    }
}

/* ---------- Toasts (ToastHost) ---------- */
.ht-toasts {
    position: fixed;
    left: 50%;
    bottom: var(--ht-space-5);
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ht-space-2);
    width: min(480px, calc(100vw - 2 * var(--ht-space-4)));
    pointer-events: none;
}

.ht-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: var(--ht-space-3);
    width: 100%;
    padding: var(--ht-space-3) var(--ht-space-3) var(--ht-space-3) var(--ht-space-4);
    border-radius: var(--ht-radius-md);
    background: var(--color-text);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-md);
    font-size: 14px;
    line-height: 20px;
    animation: ht-toast-in 160ms ease-out;
}

.ht-toast__icon {
    display: inline-flex;
    flex: 0 0 auto;
}

.ht-toast--success .ht-toast__icon {
    color: var(--color-success-on-dark);
}

.ht-toast--error .ht-toast__icon {
    color: var(--color-error-on-dark);
}

.ht-toast__message {
    flex: 1 1 auto;
    min-width: 0;
}

.ht-toast__action,
.ht-toast__close {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.ht-toast__action {
    padding: 6px 10px;
    border-radius: var(--ht-radius-sm);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.ht-toast__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--ht-radius-pill);
    opacity: 0.8;
}

.ht-toast__action:hover,
.ht-toast__close:hover {
    background: rgba(255, 255, 255, 0.12);
    opacity: 1;
}

.ht-toast__action:focus-visible,
.ht-toast__close:focus-visible {
    outline: 2px solid var(--color-bg);
    outline-offset: 1px;
}

@keyframes ht-toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ht-toast {
        animation: none;
    }
}

/* ---------- Blazor error bar (#blazor-error-ui in every app shell) ---------- */
#blazor-error-ui {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -2px 12px rgba(11, 11, 12, 0.06);
    z-index: var(--z-toast);
}

    #blazor-error-ui.show {
        display: flex !important;
    }

    #blazor-error-ui[style*="display: block"],
    #blazor-error-ui.show {
        display: flex !important;
    }

/* KEY FIX */
.blazor-error-message {
    margin: 0;
    min-width: 0;
    font-family: var(--font-ui);
    font-size: var(--text-lg);
    line-height: 1.2;
    color: var(--color-text-muted);
}

.blazor-error-reload {
    color: var(--color-text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.blazor-error-dismiss {
    margin-left: auto;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: var(--radius-full);
    background: transparent;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: var(--text-md);
}
