/* ==========================================================================
   Nawaz Estates: global component classes (layer "components").
   Every class here is documented with markup in docs/design-system.md.
   Isolated .razor.css styles are unlayered, so they always override these.
   ========================================================================== */

@layer components {

  /* ===================== Typography ===================== */

  .display-xl, .display-l, .display-m {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--text);
    letter-spacing: -.01em;
    text-wrap: balance;
    font-optical-sizing: auto;
  }
  .display-xl { font-size: var(--fs-display-xl); line-height: var(--lh-display-xl); letter-spacing: -.02em; }
  .display-l { font-size: var(--fs-display-l); line-height: var(--lh-display-l); letter-spacing: -.015em; }
  .display-m { font-size: var(--fs-display-m); line-height: var(--lh-display-m); }
  :is(.display-xl, .display-l, .display-m) em { font-style: italic; color: var(--accent-text); }

  .title-l, .title-m, .title-s { font-family: var(--font-ui); font-weight: 600; color: var(--text); }
  .title-l { font-size: var(--fs-title-l); line-height: var(--lh-title-l); letter-spacing: -.01em; }
  .title-m { font-size: var(--fs-title-m); line-height: var(--lh-title-m); letter-spacing: -.005em; }
  .title-s { font-size: var(--fs-title-s); line-height: var(--lh-title-s); }

  .body-l { font-size: var(--fs-body-l); line-height: var(--lh-body-l); }
  .label { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 500; }
  .caption { font-size: var(--fs-caption); line-height: var(--lh-caption); }
  .micro { font-size: var(--fs-micro); line-height: var(--lh-micro); font-weight: 600; letter-spacing: .02em; }
  .lead { font-size: var(--fs-body-l); line-height: var(--lh-body-l); color: var(--text-2); max-width: 62ch; }

  /* Spaced caps echoing "GROUP OF COMPANIES" on the Nawaz logo. Max 3-4 words. */
  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .75em;
    font-family: var(--font-display);
    font-size: var(--fs-caption);
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent-text);
    font-optical-sizing: auto;
  }
  .eyebrow--muted { color: var(--text-2); }
  .eyebrow--ui { font-family: var(--font-ui); font-size: var(--fs-micro); font-weight: 700; letter-spacing: .12em; }
  .eyebrow--rule::before { content: ""; flex: none; width: 28px; height: 1px; background: currentColor; }

  /* Long-form copy (info pages, guides, policies). */
  .prose { max-width: var(--prose); color: var(--text); font-size: var(--fs-body-l); line-height: var(--lh-body-l); }
  /* Direct children, and children of <section>s (long documents group each heading with its text), get rhythm. */
  .prose > * + *,
  .prose > section > * + * { margin-top: 1em; }
  .prose > section:first-child > :first-child { margin-top: 0; }
  /* :root already pads scrolling by the sticky header height (base.css); this only adds breathing room. */
  .prose :is(h2, h3, h4) { scroll-margin-top: var(--s-4); }
  .prose h2 { font-family: var(--font-display); font-size: var(--fs-display-m); line-height: var(--lh-display-m); font-weight: 500; letter-spacing: -.005em; margin-top: 2em; }
  .prose h3 { font-size: var(--fs-title-m); line-height: var(--lh-title-m); margin-top: 1.7em; }
  .prose h4 { font-size: var(--fs-title-s); line-height: var(--lh-title-s); margin-top: 1.4em; }
  .prose :is(h2, h3, h4) + * { margin-top: .6em; }
  .prose > :first-child { margin-top: 0; }
  .prose :is(ul, ol) { padding-inline-start: 1.35em; }
  .prose li + li { margin-top: .45em; }
  .prose li::marker { color: var(--accent-text); }
  .prose blockquote {
    padding-inline-start: 1.1em;
    border-inline-start: 2px solid var(--accent);
    font-family: var(--font-display);
    font-size: var(--fs-title-l);
    line-height: 1.35;
    font-style: italic;
    color: var(--text);
  }
  .prose hr { height: 9px; border: 0; margin-block: 2.2em; background:
      linear-gradient(var(--accent), var(--accent)) 0 0 / 100% 1px no-repeat,
      linear-gradient(color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, var(--accent) 55%, transparent)) 0 4px / 100% 1px no-repeat,
      linear-gradient(color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--accent) 25%, transparent)) 0 8px / 100% 1px no-repeat; }
  .prose dt { font-weight: 600; }
  .prose dd { margin: .2em 0 0; color: var(--text-2); }
  .prose small { color: var(--text-3); }
  .prose--sm { font-size: var(--fs-body); line-height: var(--lh-body); }

  /* ===================== Icons ===================== */

  .icon { display: inline-block; flex-shrink: 0; vertical-align: -.125em; fill: currentColor; overflow: visible; }
  /* Category plot tiles (#i-cat-*): tile face, tile edge, gold hairlines. Override the three tokens to restyle. */
  .icon--tile { fill: var(--tile-face); stroke: var(--tile-edge); color: var(--tile-line); vertical-align: middle; }
  /* Stroke-draw (400ms) for tiles: add .icon--draw when a tile becomes selected. Static under reduced motion. */
  .icon--draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: ne-draw 400ms var(--ease-standard) forwards; }
  @media (prefers-reduced-motion: reduce) { .icon--draw { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; } }

  /* ===================== Buttons ===================== */

  .btn {
    --btn-bg: var(--surface);
    --btn-fg: var(--text);
    --btn-border: var(--border-strong);
    --btn-bg-hover: var(--surface-2);
    --btn-border-hover: var(--text-3);
    --btn-h: 44px;
    --btn-px: 18px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    min-height: var(--btn-h);
    padding: 0 var(--btn-px);
    border: 1px solid var(--btn-border);
    border-radius: var(--r-sm);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-family: var(--font-ui);
    font-size: var(--fs-label);
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    cursor: pointer;
    transition:
      background-color var(--m-quick) var(--ease-standard),
      border-color var(--m-quick) var(--ease-standard),
      color var(--m-quick) var(--ease-standard),
      box-shadow var(--m-quick) var(--ease-standard),
      transform var(--m-instant) linear;
  }
  .btn:hover { background: var(--btn-bg-hover); border-color: var(--btn-border-hover); color: var(--btn-fg); text-decoration: none; }
  .btn:active { transform: translateY(1px); }
  .btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

  .btn--primary {
    --btn-bg: var(--accent); --btn-fg: var(--on-accent); --btn-border: var(--accent-border);
    --btn-bg-hover: var(--accent-hover); --btn-border-hover: var(--accent-border);
  }
  .btn--secondary {
    --btn-bg: var(--inverse); --btn-fg: var(--on-inverse); --btn-border: var(--inverse);
    --btn-bg-hover: var(--inverse-hover); --btn-border-hover: var(--inverse-hover);
  }
  .btn--ghost {
    --btn-bg: transparent; --btn-fg: var(--text); --btn-border: transparent;
    --btn-bg-hover: var(--surface-3); --btn-border-hover: transparent;
  }
  .btn--outline {
    --btn-bg: transparent; --btn-fg: var(--text); --btn-border: var(--border-strong);
    --btn-bg-hover: var(--surface-2); --btn-border-hover: var(--text);
  }
  .btn--danger {
    --btn-bg: var(--danger); --btn-fg: var(--on-danger); --btn-border: var(--danger);
    --btn-bg-hover: var(--danger-hover); --btn-border-hover: var(--danger-hover);
  }
  .btn--link {
    --btn-bg: transparent; --btn-fg: var(--link); --btn-border: transparent;
    --btn-bg-hover: transparent; --btn-border-hover: transparent;
    --btn-h: auto; --btn-px: 0;
    border-radius: 2px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: .18em;
  }
  .btn--link:hover { color: var(--link-hover); text-decoration: underline; text-decoration-thickness: 2px; }
  .btn--link:active { transform: none; }

  .btn--sm { --btn-h: 36px; --btn-px: 12px; gap: 6px; }
  .btn--lg { --btn-h: 52px; --btn-px: 24px; font-size: var(--fs-body); }
  .btn--icon { --btn-px: 0; width: var(--btn-h); border-radius: var(--r-pill); }
  .btn--pill { border-radius: var(--r-pill); }
  .btn--block { display: flex; width: 100%; }

  .btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
  .btn:disabled:hover, .btn[aria-disabled="true"]:hover { background: var(--btn-bg); border-color: var(--btn-border); }

  .btn.is-loading { color: transparent; pointer-events: none; }
  .btn.is-loading > * { visibility: hidden; }
  .btn.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--btn-fg);
    border-right-color: transparent;
    animation: ne-spin 700ms linear infinite;
  }
  @media (prefers-reduced-motion: reduce) {
    .btn:active { transform: none; }
    .btn.is-loading::after { animation-duration: 1.6s; }
  }

  /* ===================== Chips ===================== */

  .chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-pill);
    background: var(--chip-bg, var(--surface));
    color: var(--text);
    font-size: var(--fs-label);
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: border-color var(--m-quick) var(--ease-standard), background-color var(--m-quick) var(--ease-standard), box-shadow var(--m-quick) var(--ease-standard);
  }
  .chip:hover { border-color: var(--text); color: var(--text); text-decoration: none; }
  .chip.is-selected,
  .chip[aria-pressed="true"],
  .chip[aria-checked="true"],
  .chip[aria-selected="true"],
  .chip:has(> input:checked) {
    background: var(--gold-bg);
    border-color: var(--accent-text);
    box-shadow: inset 0 0 0 1px var(--accent-text);
  }
  .chip > input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
  .chip:has(> input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
  .chip__count { color: var(--text-3); font-variant-numeric: tabular-nums; }
  .chip--sm { min-height: 30px; padding: 0 10px; font-size: var(--fs-caption); }
  .chip--static { cursor: default; }
  .chip--static:hover { border-color: var(--border-strong); }
  .chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
  .chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-block: 2px; }
  .chips--scroll::-webkit-scrollbar { display: none; }

  /* ===================== Badges, pills, counts ===================== */

  .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 22px;
    padding: 2px 8px;
    border-radius: var(--r-xs);
    background: var(--surface-3);
    color: var(--text-2);
    font-size: var(--fs-micro);
    font-weight: 600;
    line-height: var(--lh-micro);
    letter-spacing: .02em;
    white-space: nowrap;
    vertical-align: middle;
  }
  .badge .icon { width: 14px; height: 14px; }
  .badge--verified, .badge--success { background: var(--success-bg); color: var(--success-ink); }
  .badge--auction { background: var(--auction-bg); color: var(--auction-ink); }
  .badge--pool, .badge--info { background: var(--pool-bg); color: var(--pool-ink); }
  .badge--info { background: var(--info-bg); color: var(--info-ink); }
  .badge--featured { background: var(--surface-3); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
  .badge--first-party { background: var(--first-party-bg); color: var(--first-party-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold-500) 45%, transparent); }
  .badge--warning { background: var(--warning-bg); color: var(--warning-ink); }
  .badge--danger { background: var(--danger-bg); color: var(--danger-ink); }
  .badge--neutral { background: var(--surface-3); color: var(--text-2); }
  .badge--solid { background: var(--inverse); color: var(--on-inverse); }

  .pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
    padding: 2px 10px;
    border-radius: var(--r-pill);
    background: var(--surface-3);
    color: var(--text-2);
    font-size: var(--fs-caption);
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    vertical-align: middle;
  }
  .pill--dot::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
  .pill--gold { background: var(--gold-bg); color: var(--gold-ink); }
  .pill--kashi, .pill--pool, .pill--info { background: var(--pool-bg); color: var(--pool-ink); }
  .pill--field, .pill--success { background: var(--success-bg); color: var(--success-ink); }
  .pill--clay, .pill--auction { background: var(--auction-bg); color: var(--auction-ink); }
  .pill--amber, .pill--warning { background: var(--warning-bg); color: var(--warning-ink); }
  .pill--danger { background: var(--danger-bg); color: var(--danger-ink); }
  .pill--neutral { background: var(--surface-3); color: var(--text-2); }
  .pill--solid { background: var(--inverse); color: var(--on-inverse); }

  .count-badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--r-pill);
    background: var(--auction);
    color: var(--on-auction);
    font-size: var(--fs-micro);
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 2px var(--surface);
    pointer-events: none;
  }
  .count-badge:empty { display: none; }
  .count-badge--neutral { background: var(--surface-3); color: var(--text); box-shadow: none; }

  .dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentColor; vertical-align: middle; }

  .kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--surface);
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
  }

  /* ===================== Cards & surfaces ===================== */

  .card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--e1);
  }
  .card--flat { box-shadow: none; }
  .card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: calc(var(--r-md) - 1px) calc(var(--r-md) - 1px) 0 0;
    background: var(--surface-3);
  }
  .card__media > :is(img, svg, picture) { width: 100%; height: 100%; object-fit: cover; }
  .card__header { padding: var(--s-5) var(--s-5) 0; display: grid; gap: var(--s-1); }
  .card__body { padding: var(--s-5); display: grid; gap: var(--s-2); align-content: start; }
  .card__footer { margin-top: auto; padding: var(--s-4) var(--s-5); border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
  .card__title { font-size: var(--fs-title-s); line-height: var(--lh-title-s); font-weight: 600; color: var(--text); }
  .card--interactive {
    cursor: pointer;
    transition: box-shadow var(--m-quick) var(--ease-standard), transform var(--m-quick) var(--ease-standard), border-color var(--m-quick) var(--ease-standard);
  }
  .card--interactive:hover { box-shadow: var(--e2); transform: translateY(-2px); border-color: var(--border-strong); }
  /* Whole-card link: <a class="card__link"> stretches over the card; real controls inside use .card__action. */
  .card__link { color: inherit; text-decoration: none; }
  .card__link:hover { color: inherit; }
  .card__link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
  .card__link:focus-visible { outline: none; }
  .card:has(.card__link:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
  .card__action { position: relative; z-index: 2; }
  @media (prefers-reduced-motion: reduce) { .card--interactive:hover { transform: none; } }

  .surface { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-6); }
  @media (max-width: 743.98px) { .surface { padding: var(--s-5); } }
  .surface--muted { background: var(--surface-2); }
  .surface--sunken { background: var(--surface-3); border-color: transparent; }
  .surface--raised { box-shadow: var(--e2); }
  .surface--tight { padding: var(--s-4); }
  .surface--flush { padding: 0; overflow: hidden; }

  /* Inline message box (plot-file warning, tips, errors on a page). */
  .callout {
    --callout-accent: var(--info);
    --callout-bg: var(--info-bg);
    --callout-ink: var(--info-ink);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: var(--s-1) var(--s-3);
    padding: var(--s-4) var(--s-5);
    border-radius: var(--r-md);
    background: var(--callout-bg);
    color: var(--text);
    border: 1px solid color-mix(in srgb, var(--callout-accent) 28%, transparent);
    font-size: var(--fs-label);
    line-height: var(--lh-label);
  }
  .callout > .icon:first-child { grid-row: span 2; color: var(--callout-ink); margin-top: 1px; }
  .callout > :not(.icon:first-child) { grid-column: 2; }
  .callout__title { font-weight: 600; color: var(--callout-ink); font-size: var(--fs-label); }
  .callout--success { --callout-accent: var(--success); --callout-bg: var(--success-bg); --callout-ink: var(--success-ink); }
  .callout--warning { --callout-accent: var(--warning); --callout-bg: var(--warning-bg); --callout-ink: var(--warning-ink); }
  .callout--danger { --callout-accent: var(--danger); --callout-bg: var(--danger-bg); --callout-ink: var(--danger-ink); }
  .callout--gold { --callout-accent: var(--accent); --callout-bg: var(--gold-bg); --callout-ink: var(--gold-ink); }
  .callout--auction { --callout-accent: var(--auction); --callout-bg: var(--auction-bg); --callout-ink: var(--auction-ink); }

  /* ===================== Forms ===================== */

  .field { display: grid; gap: 6px; min-width: 0; align-content: start; }
  .field__label { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 600; color: var(--text); }
  .field__label .optional { font-weight: 400; color: var(--text-3); }
  .field__req { color: var(--danger); margin-inline-start: 2px; }
  .field__help { font-size: var(--fs-caption); line-height: var(--lh-caption); color: var(--text-2); }
  .field__error, .validation-message {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: var(--fs-caption);
    line-height: var(--lh-caption);
    font-weight: 500;
    color: var(--danger);
  }
  .validation-errors { margin: 0; padding: var(--s-3) var(--s-4) var(--s-3) var(--s-8); border-radius: var(--r-sm); background: var(--danger-bg); color: var(--danger-ink); font-size: var(--fs-label); }
  .validation-errors .validation-message { display: list-item; color: inherit; }

  .input, .select, .textarea {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--border-input);
    border-radius: var(--r-sm);
    background-color: var(--surface);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--fs-input);
    line-height: 1.4;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--m-quick) var(--ease-standard), background-color var(--m-quick) var(--ease-standard);
  }
  .input:hover, .select:hover, .textarea:hover { border-color: var(--text-2); }
  .input:focus, .select:focus, .textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
  .input:disabled, .select:disabled, .textarea:disabled { background-color: var(--surface-2); color: var(--text-3); border-color: var(--border); cursor: not-allowed; }
  .input[readonly], .textarea[readonly] { background-color: var(--surface-2); }
  :is(.input, .select, .textarea):is([aria-invalid="true"], .invalid, .is-invalid) { border-color: var(--danger); }
  :is(.input, .select, .textarea):is([aria-invalid="true"], .invalid, .is-invalid):focus { outline-color: var(--danger); }
  .input--sm, .select--sm { min-height: 40px; padding-block: 8px; }
  .input.num { text-align: end; }
  .textarea { min-height: 120px; resize: vertical; line-height: var(--lh-body); }
  .select {
    padding-inline-end: 42px;
    cursor: pointer;
    background-image:
      linear-gradient(45deg, transparent 50%, var(--text-2) 50%),
      linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
    background-position: calc(100% - 21px) 50%, calc(100% - 16px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
  }
  .select[multiple], .select[size] { background-image: none; padding-inline-end: 14px; min-height: 120px; }

  .input-group {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--border-input);
    border-radius: var(--r-sm);
    background: var(--surface);
    overflow: hidden;
    transition: border-color var(--m-quick) var(--ease-standard);
  }
  .input-group:hover { border-color: var(--text-2); }
  .input-group:focus-within { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
  .input-group:has(:is([aria-invalid="true"], .invalid, .is-invalid)) { border-color: var(--danger); }
  .input-group > .input { flex: 1 1 auto; min-width: 0; min-height: 0; border: 0; border-radius: 0; background: transparent; }
  .input-group > .input:focus { outline: none; }
  .input-group__prefix, .input-group__suffix {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: var(--fs-label);
    font-weight: 600;
    white-space: nowrap;
  }
  .input-group__prefix { border-inline-end: 1px solid var(--border); }
  .input-group__suffix { border-inline-start: 1px solid var(--border); }
  .input-group > .btn { border: 0; border-radius: 0; border-inline-start: 1px solid var(--border); min-height: 0; }

  .checkbox, .radio {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 24px;
    font-size: var(--fs-body);
    line-height: 1.4;
    color: var(--text);
    cursor: pointer;
  }
  .checkbox > input[type="checkbox"], .radio > input[type="radio"] {
    flex: none;
    display: inline-grid;
    place-content: center;
    width: 20px;
    height: 20px;
    margin: 1px 0 0;
    border: 1.5px solid var(--border-input);
    background-color: var(--surface);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: background-color var(--m-quick) var(--ease-standard), border-color var(--m-quick) var(--ease-standard);
  }
  .checkbox > input[type="checkbox"] { border-radius: 5px; }
  .radio > input[type="radio"] { border-radius: 50%; }
  .checkbox > input[type="checkbox"]:hover, .radio > input[type="radio"]:hover { border-color: var(--text-2); }
  .checkbox > input[type="checkbox"]:checked {
    border-color: var(--accent-text);
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.4 6.6 11.4 12.6 4.8' fill='none' stroke='%2312110E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  }
  .checkbox > input[type="checkbox"]:indeterminate {
    border-color: var(--accent-text);
    background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8h8' stroke='%2312110E' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 14px no-repeat;
  }
  .radio > input[type="radio"]:checked {
    border-color: var(--accent-text);
    background: radial-gradient(circle, var(--on-accent) 0 3.5px, var(--accent) 4px);
  }
  :is(.checkbox, .radio) > input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  :is(.checkbox, .radio) > input:disabled { opacity: .5; cursor: not-allowed; }
  :is(.checkbox, .radio):has(> input:disabled) { color: var(--text-3); cursor: not-allowed; }
  :is(.checkbox, .radio) small { display: block; color: var(--text-2); font-size: var(--fs-caption); }

  .switch { display: inline-flex; align-items: center; gap: 12px; min-height: 32px; font-size: var(--fs-body); color: var(--text); cursor: pointer; }
  .switch > input[type="checkbox"] {
    flex: none;
    width: 44px;
    height: 26px;
    margin: 0;
    border-radius: var(--r-pill);
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background: var(--border-input) radial-gradient(circle, #FFFFFF 0 9px, transparent 9.5px) no-repeat left 3px center / 20px 20px;
    transition: background-color var(--m-quick) var(--ease-standard), background-position var(--m-quick) var(--ease-standard);
  }
  .switch > input[type="checkbox"]:checked {
    background-color: var(--accent);
    background-position: right 3px center;
    box-shadow: inset 0 0 0 1px var(--accent-text);
  }
  .switch > input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  .switch > input:disabled { opacity: .5; cursor: not-allowed; }

  .fieldset { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); display: grid; gap: var(--s-4); }
  .fieldset > legend { padding: 0 var(--s-2); margin-inline-start: calc(-1 * var(--s-2)); font-weight: 600; font-size: var(--fs-label); }
  .form-grid { display: grid; gap: var(--s-5); }
  @media (min-width: 744px) { .form-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .span-2 { grid-column: 1 / -1; } }
  .form-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); justify-content: flex-end; }

  /* ===================== Tables ===================== */

  .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
  .table-wrap:focus-visible { outline-offset: 2px; }
  .table { width: 100%; border-collapse: collapse; font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text); }
  .table caption { caption-side: top; text-align: start; padding: var(--s-3) var(--s-4); font-weight: 600; }
  .table :is(th, td) { padding: 12px 16px; text-align: start; vertical-align: middle; border-bottom: 1px solid var(--border); }
  .table thead th { background: var(--surface-2); color: var(--text-2); font-size: var(--fs-caption); font-weight: 600; white-space: nowrap; }
  .table tbody tr:last-child > * { border-bottom: 0; }
  .table tbody tr:hover > * { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
  .table :is(th, td).num, .table .num { text-align: end; font-variant-numeric: tabular-nums; }
  .table--compact :is(th, td) { padding: 8px 12px; }
  .table--sticky thead th { position: sticky; top: 0; z-index: 1; }
  @media (max-width: 743.98px) {
    .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .table--stack tr { display: block; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
    .table--stack tbody tr:last-child { border-bottom: 0; }
    .table--stack :is(th, td) { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); padding: 5px 0; border: 0; text-align: end; }
    .table--stack :is(th, td)::before { content: attr(data-label); flex: none; max-width: 50%; color: var(--text-2); font-weight: 600; font-size: var(--fs-caption); text-align: start; }
    .table--stack :is(th, td):not([data-label])::before { content: none; }
    .table--stack tbody tr:hover > * { background: none; }
  }

  /* ===================== Tabs & segmented ===================== */

  /* The baseline is an inset shadow (not a border) so the selected tab's 2px underline is never clipped by the
     scrolling tab strip; the tab's own border paints over it. */
  .tabs { display: flex; gap: var(--s-6); box-shadow: inset 0 -1px 0 var(--border); overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    flex: none;
    min-height: 48px;
    padding: 0 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-2);
    font-size: var(--fs-label);
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: color var(--m-quick) var(--ease-standard), border-color var(--m-quick) var(--ease-standard);
  }
  .tab:hover { color: var(--text); border-bottom-color: var(--border-strong); text-decoration: none; }
  .tab[aria-selected="true"], .tab.is-active, .tab.active, .tab[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent-text); }
  .tab:focus-visible { outline-offset: -2px; border-radius: var(--r-xs) var(--r-xs) 0 0; }
  .tab__badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-3); color: var(--text); font-size: var(--fs-micro); font-variant-numeric: tabular-nums; }
  .tab-panel { padding-top: var(--s-6); }
  .tab-panel:focus-visible { outline-offset: 4px; border-radius: var(--r-xs); }
  .tabs--pill { display: inline-flex; gap: 2px; padding: 4px; border: 0; box-shadow: none; border-radius: var(--r-pill); background: var(--surface-3); max-width: 100%; }
  .tabs--pill .tab { min-height: 36px; padding: 0 16px; margin: 0; border: 0; border-radius: var(--r-pill); }
  .tabs--pill .tab:hover { background: color-mix(in srgb, var(--surface) 50%, transparent); }
  .tabs--pill .tab:is([aria-selected="true"], .is-active, .active, [aria-current="page"]) { background: var(--surface); color: var(--text); box-shadow: var(--e1); }
  .tabs--pill .tab:focus-visible { outline-offset: 2px; border-radius: var(--r-pill); }

  .segmented { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--surface-3); }
  .segmented__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    min-width: 32px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--r-pill);
    background: transparent;
    color: var(--text-2);
    font-size: var(--fs-caption);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--m-quick) var(--ease-standard), color var(--m-quick) var(--ease-standard);
  }
  .segmented__option:hover { color: var(--text); }
  .segmented__option:is([aria-pressed="true"], [aria-checked="true"], .is-selected) { background: var(--surface); color: var(--text); box-shadow: var(--e1); }
  .segmented--icons .segmented__option { padding: 0; width: 32px; }

  /* Theme toggle state is mirrored from <html data-theme-pref> so it is correct before scripts run. */
  html[data-theme-pref="light"] [data-theme-choice="light"],
  html[data-theme-pref="dark"] [data-theme-choice="dark"],
  html[data-theme-pref="system"] [data-theme-choice="system"] { background: var(--surface); color: var(--text); box-shadow: var(--e1); }

  /* ===================== Menus (dropdown panels) ===================== */

  .menu {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--e3);
    padding: var(--s-2);
  }
  .menu__header { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); margin-bottom: var(--s-1); }
  .menu__header-text { display: grid; min-width: 0; line-height: 1.3; }
  .menu__header-text strong { font-size: var(--fs-label); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu__header-text span { font-size: var(--fs-caption); color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu__label { display: block; padding: var(--s-2) 12px var(--s-1); color: var(--text-3); font-size: var(--fs-micro); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
  .menu__list { display: grid; gap: 1px; }
  .menu__item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 0;
    border-radius: var(--r-sm);
    background: none;
    color: var(--text);
    font-size: var(--fs-label);
    font-weight: 500;
    line-height: 1.3;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
  }
  .menu__item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
  .menu__item:focus-visible { outline-offset: -2px; }
  .menu__item .icon { color: var(--text-2); }
  .menu__item:is(.active, [aria-current="page"]) { background: var(--gold-bg); font-weight: 600; }
  .menu__item:is(.active, [aria-current="page"]) .icon { color: var(--accent-text); }
  .menu__item--danger, .menu__item--danger .icon { color: var(--danger); }
  .menu__item .count-badge, .menu__item .menu__meta { margin-inline-start: auto; }
  .menu__meta { color: var(--text-3); font-size: var(--fs-caption); }
  .menu__sep { height: 1px; margin: var(--s-2) 0; background: var(--border); border: 0; }
  .menu__row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 6px 12px; font-size: var(--fs-label); color: var(--text-2); }

  /* ===================== Dividers & brand motifs ===================== */

  .divider { display: block; height: 1px; border: 0; margin-block: var(--s-6); background: var(--border); }
  /* Parallel-line motif from the monogram: three hairlines fading out. */
  .divider--lines {
    height: 9px;
    background:
      linear-gradient(var(--accent), var(--accent)) 0 0 / 100% 1px no-repeat,
      linear-gradient(color-mix(in srgb, var(--accent) 55%, transparent), color-mix(in srgb, var(--accent) 55%, transparent)) 0 4px / 100% 1px no-repeat,
      linear-gradient(color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--accent) 25%, transparent)) 0 8px / 100% 1px no-repeat;
  }
  .divider--short { width: 72px; }
  .divider--center { margin-inline: auto; }
  /* Centred ornament: hairline — three parallel gold strokes — hairline. */
  .divider--mark {
    display: flex;
    align-items: center;
    gap: 64px;
    height: 16px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 16'%3E%3Cg fill='none' stroke='%23C9A646' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M6 14 16 2M15 14 25 2M24 14 34 2'/%3E%3C/g%3E%3C/svg%3E") center / 40px 16px no-repeat;
  }
  .divider--mark::before, .divider--mark::after { content: ""; flex: 1; height: 1px; background: var(--border-strong); }

  .gold-hairline { display: block; width: 100%; height: 1px; border: 0; margin: 0; background: var(--accent); }
  .gold-hairline--short { width: 48px; }
  .gold-hairline--center { margin-inline: auto; }
  /* Double gold frame, like the OG card. */
  .gold-frame { position: relative; isolation: isolate; }
  .gold-frame::before { content: ""; position: absolute; inset: 10px; z-index: -1; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: inherit; pointer-events: none; }

  /* Multani kashi tile: a decorative frieze band (empty element) or pattern background. */
  .kashi-band {
    display: block;
    background-color: var(--kashi-cobalt);
    background-image: url("../img/patterns/kashi-tile.svg");
    background-size: var(--kashi-size, 24px) var(--kashi-size, 24px);
    background-repeat: repeat;
  }
  .kashi-band:empty { height: var(--kashi-size, 24px); }
  .kashi-band--thin { --kashi-size: 14px; }
  /* Faint gold kashi lattice behind content (text stays readable). */
  .kashi-band--subtle { position: relative; isolation: isolate; background: none; }
  .kashi-band--subtle::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("../img/patterns/kashi-line.svg") 0 0 / var(--kashi-size, 48px) var(--kashi-size, 48px) repeat;
    opacity: var(--kashi-opacity, .09);
    pointer-events: none;
  }

  /* Dark "night market" surface (live auctions, heroes, footer). Tokens switch to dark inside. */
  .night {
    background-color: var(--bg);
    color: var(--text);
    background-image: radial-gradient(110% 70% at 12% 0%, rgb(201 166 70 / .10), transparent 62%);
  }

  /* ===================== Feedback ===================== */

  .skeleton {
    position: relative;
    display: block;
    overflow: hidden;
    background: var(--surface-3);
    border-radius: var(--r-xs);
    color: transparent;
  }
  .skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 55%, transparent), transparent);
    animation: ne-shimmer 1.4s ease-in-out infinite;
  }
  .skeleton--text { height: .9em; margin-block: .3em; border-radius: 4px; }
  .skeleton--text + .skeleton--text:last-child { width: 68%; }
  .skeleton--title { height: 1.4em; width: 60%; border-radius: 6px; }
  .skeleton--circle { border-radius: 50%; aspect-ratio: 1; }
  .skeleton--rect { border-radius: var(--r-md); }
  .skeleton--media { aspect-ratio: 4 / 3; border-radius: var(--r-md); }
  @media (prefers-reduced-motion: reduce) { .skeleton::after { animation: none; display: none; } }

  .spinner {
    display: inline-block;
    flex: none;
    width: var(--spinner-size, 20px);
    height: var(--spinner-size, 20px);
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, currentColor 22%, transparent);
    border-top-color: currentColor;
    animation: ne-spin 700ms linear infinite;
    vertical-align: middle;
  }
  @media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }

  .progress { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
  .progress__bar { height: 100%; width: var(--value, 0%); border-radius: inherit; background: var(--accent); transition: width var(--m-standard) var(--ease-standard); }

  .empty-state {
    display: grid;
    justify-items: center;
    gap: var(--s-3);
    max-width: 560px;
    margin-inline: auto;
    padding: var(--s-12) var(--s-6);
    text-align: center;
  }
  .empty-state__art {
    position: relative;
    display: grid;
    place-items: center;
    width: 88px;
    height: 88px;
    margin: var(--s-4) 0 var(--s-4);
    border-radius: 50%;
    background: var(--gold-bg);
    color: var(--accent-text);
  }
  .empty-state__art::before, .empty-state__art::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
  .empty-state__art::before { inset: -9px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
  .empty-state__art::after { inset: -18px; border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); }
  .empty-state__title { font-size: var(--fs-title-m); line-height: var(--lh-title-m); font-weight: 600; color: var(--text); }
  .empty-state__text { color: var(--text-2); max-width: 46ch; }
  .empty-state__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s-3); margin-top: var(--s-3); }
  .empty-state--compact { padding: var(--s-8) var(--s-4); }

  .stat { display: grid; gap: var(--s-1); align-content: start; padding: var(--s-5); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); min-width: 0; }
  .stat__label { font-size: var(--fs-caption); line-height: var(--lh-caption); font-weight: 500; color: var(--text-2); }
  .stat__value { font-size: var(--fs-title-l); line-height: var(--lh-title-l); font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); }
  .stat__value--display { font-family: var(--font-display); font-size: var(--fs-display-m); line-height: var(--lh-display-m); font-weight: 500; }
  .stat__delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-caption); font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
  .stat__delta.is-up { color: var(--success); }
  .stat__delta.is-down { color: var(--danger); }
  .stat__delta.is-up::before { content: "\25B2" / ""; font-size: .75em; }
  .stat__delta.is-down::before { content: "\25BC" / ""; font-size: .75em; }
  .stat__meta { font-size: var(--fs-caption); color: var(--text-3); }

  .avatar {
    --avatar-size: 40px;
    position: relative;
    display: inline-grid;
    place-items: center;
    flex: none;
    width: var(--avatar-size);
    height: var(--avatar-size);
    border-radius: 50%;
    background: var(--gold-bg);
    color: var(--gold-ink);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
    font-size: calc(var(--avatar-size) * .38);
    font-weight: 600;
    line-height: 1;
    letter-spacing: .02em;
    text-transform: uppercase;
    overflow: hidden;
    user-select: none;
  }
  .avatar > img { width: 100%; height: 100%; object-fit: cover; }
  .avatar--xs { --avatar-size: 24px; }
  .avatar--sm { --avatar-size: 32px; }
  .avatar--lg { --avatar-size: 56px; }
  .avatar--xl { --avatar-size: 80px; }
  .avatar--ink { background: var(--inverse); color: var(--on-inverse-accent); box-shadow: none; }

  /* Toasts (rendered by ToastHost; use IToastService, never markup by hand). */
  .toast {
    --toast-accent: var(--info);
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: var(--s-3);
    align-items: start;
    padding: var(--s-4) var(--s-3) var(--s-4) var(--s-5);
    overflow: hidden;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--e4);
    animation: ne-toast-in var(--m-standard) var(--ease-emphasis) both;
  }
  .toast::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--toast-accent); }
  .toast__icon { color: var(--toast-accent); margin-top: 1px; }
  .toast__content { display: grid; gap: 2px; padding-top: 1px; }
  .toast__title { font-size: var(--fs-label); line-height: var(--lh-label); font-weight: 600; color: var(--text); }
  .toast__message { font-size: var(--fs-label); line-height: var(--lh-label); color: var(--text-2); overflow-wrap: anywhere; }
  .toast__content > :is(.visually-hidden, .sr-only) + .toast__message { color: var(--text); }
  .toast__close { margin: -8px -4px -8px 0; }
  .toast__timer {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 2px;
    background: var(--toast-accent);
    opacity: .45;
    transform-origin: left center;
    animation: ne-toast-timer var(--toast-duration, 5s) linear forwards;
  }
  .toast-host:is(:hover, :focus-within) .toast__timer { animation-play-state: paused; }
  .toast--success { --toast-accent: var(--success); }
  .toast--error { --toast-accent: var(--danger); }
  .toast--warning { --toast-accent: var(--warning); }
  .toast--info { --toast-accent: var(--info); }
  @media (prefers-reduced-motion: reduce) {
    .toast { animation-name: ne-fade-in; }
    .toast__timer { display: none; }
  }

  /* ===================== Overlays: backdrop, modal, sheet, tooltip ===================== */

  .backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: var(--overlay);
    animation: ne-fade-in var(--m-standard) var(--ease-standard) both;
  }
  .backdrop--sheet { z-index: var(--z-sheet); }

  .modal {
    position: fixed;
    z-index: calc(var(--z-modal) + 1);
    inset: 0;
    margin: auto;
    display: flex;
    flex-direction: column;
    width: min(var(--modal-w, 560px), calc(100% - 2 * var(--s-4)));
    height: fit-content;
    max-height: min(86dvh, 880px);
    padding: 0;
    border: 0;
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--e3);
    overflow: hidden;
    animation: ne-modal-in var(--m-standard) var(--ease-emphasis) both;
  }
  dialog.modal::backdrop { background: rgb(18 17 14 / .56); }
  .modal--sm { --modal-w: 420px; }
  .modal--lg { --modal-w: 820px; }
  .modal--full { --modal-w: 1200px; height: calc(100dvh - 2 * var(--s-6)); max-height: none; }
  .modal__header, .sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-4) var(--s-4) var(--s-6);
    border-bottom: 1px solid var(--border);
  }
  .modal__title, .sheet__title { font-size: var(--fs-title-m); line-height: var(--lh-title-m); font-weight: 600; color: var(--text); }
  .modal__body, .sheet__body { flex: 1 1 auto; min-height: 0; padding: var(--s-6); overflow-y: auto; overscroll-behavior: contain; }
  .modal__footer, .sheet__footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--s-3);
    padding: var(--s-4) var(--s-6);
    border-top: 1px solid var(--border);
    background: var(--surface);
  }
  @media (max-width: 743.98px) {
    .modal:not(.modal--center) {
      inset: auto 0 0 0;
      margin: 0;
      width: 100%;
      max-height: 92dvh;
      border-radius: var(--r-lg) var(--r-lg) 0 0;
      animation-name: ne-sheet-up;
    }
    .modal--full:not(.modal--center) { height: 100dvh; max-height: none; border-radius: 0; }
    .modal__footer, .sheet__footer { padding-bottom: calc(var(--s-4) + env(safe-area-inset-bottom, 0px)); }
    .modal__footer > .btn, .sheet__footer > .btn { flex: 1 1 auto; }
  }

  .sheet {
    position: fixed;
    z-index: calc(var(--z-sheet) + 1);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--e3);
    overflow: hidden;
  }
  .sheet--bottom { inset: auto 0 0 0; max-height: 92dvh; border-radius: var(--r-lg) var(--r-lg) 0 0; animation: ne-sheet-up var(--m-standard) var(--ease-emphasis) both; }
  .sheet--right { inset: 0 0 0 auto; width: min(440px, 100%); animation: ne-sheet-left var(--m-standard) var(--ease-emphasis) both; }
  .sheet__handle { flex: none; width: 40px; height: 4px; margin: 10px auto 2px; border-radius: 2px; background: var(--border-strong); }
  @media (prefers-reduced-motion: reduce) {
    .modal, .modal:not(.modal--center), .sheet--bottom, .sheet--right { animation-name: ne-fade-in; }
  }
  html.ne-scroll-lock, html.ne-scroll-lock body { overflow: hidden; }

  .tooltip-wrap { position: relative; display: inline-flex; }
  .tooltip {
    position: absolute;
    z-index: var(--z-dropdown);
    bottom: calc(100% + 8px);
    left: 50%;
    width: max-content;
    max-width: min(260px, 80vw);
    padding: 6px 10px;
    border-radius: var(--r-xs);
    background: var(--inverse);
    color: var(--on-inverse);
    box-shadow: var(--e2);
    font-size: var(--fs-caption);
    line-height: var(--lh-caption);
    font-weight: 500;
    text-align: start;
    white-space: normal;
    translate: -50% 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--m-quick) var(--ease-standard), visibility var(--m-quick);
  }
  .tooltip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--inverse); }
  .tooltip::before { content: ""; position: absolute; inset-inline: 0; top: 100%; height: 10px; } /* hover bridge (WCAG 1.4.13) */
  .tooltip--bottom { bottom: auto; top: calc(100% + 8px); }
  .tooltip--bottom::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: var(--inverse); }
  .tooltip--bottom::before { top: auto; bottom: 100%; }
  .tooltip--start { left: 0; translate: 0 0; }
  .tooltip--start::after { left: 16px; }
  .tooltip--end { left: auto; right: 0; translate: 0 0; }
  .tooltip--end::after { left: auto; right: 11px; }
  .tooltip-wrap:is(:hover, :focus-within) > .tooltip { opacity: 1; visibility: visible; pointer-events: auto; }
  html.tooltips-dismissed .tooltip-wrap > .tooltip { opacity: 0; visibility: hidden; }

  /* ===================== Editorial lists ===================== */

  .steps { list-style: none; padding: 0; margin: 0; counter-reset: ne-step; display: grid; gap: var(--s-8); }
  .steps > li { position: relative; counter-increment: ne-step; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--s-1) var(--s-4); }
  .steps > li::before {
    content: counter(ne-step, decimal-leading-zero);
    grid-row: span 3;
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 500;
    color: var(--accent-text);
    font-variant-numeric: lining-nums;
  }
  .steps > li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 16px;
    top: 40px;
    bottom: calc(-1 * var(--s-8) + 8px);
    width: 1px;
    background: linear-gradient(var(--border-strong), transparent);
  }
  .steps__title { font-size: var(--fs-title-s); line-height: var(--lh-title-s); font-weight: 600; color: var(--text); }
  .steps__text { color: var(--text-2); }

  .checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
  .checklist > li { position: relative; padding-inline-start: 32px; min-height: 22px; }
  .checklist > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: .15em;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success-bg);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 40%, transparent);
  }
  .checklist > li::after {
    content: "";
    position: absolute;
    left: 8px;
    top: calc(.15em + 5px);
    width: 6px;
    height: 10px;
    border: solid var(--success);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .checklist--flag > li::before { background: var(--warning-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warning) 45%, transparent); }
  .checklist--flag > li::after { content: "!"; left: 0; top: .15em; width: 22px; height: 22px; border: 0; transform: none; color: var(--warning-ink); font-weight: 800; font-size: 13px; line-height: 22px; text-align: center; }

  .icon-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-4); }
  .icon-list > li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-1) var(--s-3); align-items: start; }
  .icon-list > li > .icon:first-child { grid-row: span 2; color: var(--accent-text); margin-top: 2px; }

  /* Feature grid: icon tile + title + text (values, benefits, how-it-works highlights). */
  .feature-grid { display: grid; gap: var(--s-6); grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
  .feature { display: grid; gap: var(--s-2); align-content: start; }
  .feature__icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--s-2);
    border-radius: var(--r-sm);
    background: var(--gold-bg);
    color: var(--accent-text);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  }
  .feature__title { font-size: var(--fs-title-s); line-height: var(--lh-title-s); font-weight: 600; color: var(--text); }
  .feature__text { color: var(--text-2); }
  .feature--card { padding: var(--s-6); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }

  /* Closing call-to-action band (dark). */
  .cta-band { position: relative; overflow: hidden; }
  .cta-band__inner {
    display: grid;
    gap: var(--s-6);
    align-items: center;
    padding-block: clamp(48px, 7vw, 88px);
  }
  @media (min-width: 1128px) { .cta-band__inner { grid-template-columns: minmax(0, 1.4fr) auto; gap: var(--s-12); } }
  .cta-band__copy { display: grid; gap: var(--s-3); max-width: 60ch; }
  .cta-band::after {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    width: min(420px, 40%);
    background: url("../img/patterns/kashi-line.svg") 0 0 / 48px 48px repeat;
    opacity: .08;
    mask-image: linear-gradient(to left, #000, transparent);
    pointer-events: none;
  }

  /* On-page table of contents (policies, guides). Sticky in a .split aside. */
  .toc { display: grid; gap: var(--s-2); font-size: var(--fs-label); }
  .toc__title { margin-bottom: var(--s-1); }
  .toc ol, .toc ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; counter-reset: ne-toc; }
  .toc a {
    display: flex;
    gap: var(--s-2);
    padding: 6px 10px;
    border-radius: var(--r-xs);
    color: var(--text-2);
    text-decoration: none;
    line-height: 1.35;
  }
  .toc ol > li { counter-increment: ne-toc; }
  .toc ol a::before { content: counter(ne-toc) "."; min-width: 1.5em; color: var(--text-3); font-variant-numeric: tabular-nums; }
  .toc a:hover { background: var(--surface-3); color: var(--text); }

  /* Horizontal journey (stages with a hairline connector); vertical below 744px. */
  .journey { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-6); counter-reset: ne-journey; }
  .journey__stage { position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--s-1) var(--s-4); align-content: start; }
  .journey__dot {
    grid-row: span 3;
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--journey-tone, var(--accent-text));
    box-shadow: inset 0 0 0 1.5px currentColor, 0 0 0 6px var(--bg);
  }
  .journey__stage:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 23px;
    top: 52px;
    bottom: calc(-1 * var(--s-6) + 4px);
    width: 2px;
    background: repeating-linear-gradient(to bottom, var(--border-strong) 0 6px, transparent 6px 11px);
  }
  .journey__title { font-weight: 600; font-size: var(--fs-title-s); line-height: var(--lh-title-s); color: var(--text); }
  .journey__meta { font-size: var(--fs-caption); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--journey-tone, var(--accent-text)); }
  .journey__text { color: var(--text-2); font-size: var(--fs-label); line-height: var(--lh-label); }
  .journey__stage--kashi { --journey-tone: var(--pool); }
  .journey__stage--field { --journey-tone: var(--success); }
  .journey__stage--clay { --journey-tone: var(--auction); }
  .journey__stage--optional .journey__dot { box-shadow: inset 0 0 0 1.5px currentColor, 0 0 0 6px var(--bg); background: var(--pool-bg); }
  @media (min-width: 744px) {
    .journey { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: var(--s-6); }
    .journey__stage { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
    .journey__dot { grid-row: auto; margin-bottom: var(--s-2); }
    .journey__stage:not(:last-child)::after {
      left: 56px;
      right: calc(-1 * var(--s-6) + 4px);
      top: 23px;
      bottom: auto;
      width: auto;
      height: 2px;
      background: repeating-linear-gradient(to right, var(--border-strong) 0 6px, transparent 6px 11px);
    }
  }

  .link-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--link); text-decoration: none; }
  .link-more:hover { text-decoration: underline; }
  .link-more .icon { transition: transform var(--m-quick) var(--ease-standard); }
  .link-more:hover .icon { transform: translateX(3px); }
  @media (prefers-reduced-motion: reduce) { .link-more:hover .icon { transform: none; } }

  /* ===================== Logo (Components/UI/Logo.razor) ===================== */

  .logo {
    --logo-h: 36px;
    display: inline-flex;
    align-items: center;
    gap: calc(var(--logo-h) * .3);
    color: var(--logo-ink, var(--text));
    line-height: 1;
    white-space: nowrap;
  }
  .logo__mark { flex: none; width: auto; height: var(--logo-h); }
  .logo__type { display: grid; justify-items: start; gap: calc(var(--logo-h) * .09); }
  .logo__word {
    font-family: var(--font-display);
    font-size: calc(var(--logo-h) * .62);
    font-weight: 400;
    line-height: .9;
    letter-spacing: .015em;
    color: var(--logo-ink, var(--text));
    font-optical-sizing: auto;
  }
  .logo__rule { display: block; width: 100%; height: 1px; background: var(--accent); }
  .logo__sub {
    font-family: var(--font-ui);
    font-size: max(9px, calc(var(--logo-h) * .235));
    font-weight: 600;
    line-height: 1;
    letter-spacing: .42em;
    margin-inline-end: -.42em;
    text-transform: uppercase;
    color: var(--logo-sub, var(--accent-text));
  }
  .logo--on-dark { --logo-ink: #F3EFE6; --logo-sub: var(--gold-300); }
  .logo--stacked { flex-direction: column; gap: calc(var(--logo-h) * .16); text-align: center; }
  .logo--stacked .logo__type { justify-items: center; gap: calc(var(--logo-h) * .07); }
  .logo--stacked .logo__mark { height: var(--logo-h); }
  .logo--stacked .logo__word { font-size: calc(var(--logo-h) * .46); }
  .logo--stacked .logo__sub { font-size: max(9px, calc(var(--logo-h) * .13)); }
  .logo__tag {
    font-family: var(--font-display);
    font-size: max(9px, calc(var(--logo-h) * .1));
    font-weight: 500;
    letter-spacing: .2em;
    margin-inline-end: -.2em;
    text-transform: uppercase;
    color: var(--logo-ink, var(--text));
    opacity: .8;
  }

  /* ===================== Keyframes ===================== */
  @keyframes ne-spin { to { transform: rotate(360deg); } }
  @keyframes ne-fade-in { from { opacity: 0; } }
  @keyframes ne-drop-in { from { opacity: 0; transform: translateY(-6px); } }
  @keyframes ne-modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
  @keyframes ne-sheet-up { from { transform: translateY(100%); } }
  @keyframes ne-sheet-left { from { transform: translateX(100%); } }
  @keyframes ne-toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
  @keyframes ne-toast-timer { to { transform: scaleX(0); } }
  @keyframes ne-shimmer { to { transform: translateX(100%); } }
  @keyframes ne-draw { to { stroke-dashoffset: 0; } }
  @media (prefers-reduced-motion: reduce) {
    @keyframes ne-drop-in { from { opacity: 0; } }
  }
}
