/* Verified Help & Legal directory. All destinations remain Castlori-owned. */
@layer stitch-help-legal {
  html[data-theme] .help-legal-page {
    --help-paper: #fff;
    --help-soft: #eef0fa;
    --help-line: #d5d9ee;
    --help-text: #0f1326;
    --help-muted: #475073;
    --help-accent: #6d28d9;
    width: min(100%, 52rem);
    margin-inline: auto;
  }

  html[data-theme="dark"] .help-legal-page {
    --help-paper: #141a33;
    --help-soft: #1b2242;
    --help-line: #2b345e;
    --help-text: #f1f5f9;
    --help-muted: #a5b0d6;
    --help-accent: #c4b5fd;
  }

  .help-legal-page > .help-legal-native-owned { display: none !important; }

  .help-legal-view {
    box-sizing: border-box;
    display: grid;
    gap: 22px;
    width: 100%;
    min-width: 0;
    padding: clamp(14px, 3vw, 28px);
    color: var(--help-text);
    font-family: "Commissioner", system-ui, sans-serif;
  }

  .help-legal-back {
    justify-self: start;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid var(--help-line);
    border-radius: 999px;
    background: var(--help-soft);
    color: var(--help-text);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
  }

  .help-legal-header { display: grid; gap: 5px; }
  .help-legal-route { color: var(--help-accent); font: 500 12px/1.4 "Spline Sans Mono", ui-monospace, monospace; }
  .help-legal-header h1 { margin: 0; font: 600 clamp(26px, 4vw, 34px)/1.15 "Crimson Pro", Georgia, serif; }
  .help-legal-header p, .help-legal-section-copy { margin: 0; color: var(--help-muted); font-size: 14px; line-height: 1.5; }

  .help-legal-search { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
  .help-legal-search-box { position: relative; display: flex; align-items: center; }
  .help-legal-search input {
    box-sizing: border-box;
    width: 100%; min-width: 0; min-height: 44px;
    padding: 9px 70px 9px 14px;
    border: 1px solid var(--help-line); border-radius: 999px;
    background: var(--help-paper); color: var(--help-text);
    font: 400 16px/1.4 "Commissioner", system-ui, sans-serif;
  }
  .help-legal-clear { position: absolute; right: 7px; min-height: 32px; padding: 4px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--help-accent); font-weight: 600; }

  .help-legal-section { display: grid; gap: 9px; min-width: 0; }
  .help-legal-section-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .help-legal-section-header h2 { margin: 0; font-size: 18px; line-height: 1.35; }
  .help-legal-count { color: var(--help-muted); font: 400 12px/1.4 "Spline Sans Mono", ui-monospace, monospace; }
  .help-legal-badge { padding: 4px 9px; border-radius: 999px; background: var(--help-soft); color: var(--help-accent); font: 500 11px/1.3 "Spline Sans Mono", ui-monospace, monospace; }

  .help-legal-list { overflow: hidden; border: 1px solid var(--help-line); border-radius: 16px; background: var(--help-paper); }
  .help-legal-row {
    box-sizing: border-box;
    display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 14px;
    min-height: 72px; padding: 13px 17px;
    color: var(--help-text); text-decoration: none;
  }
  .help-legal-row + .help-legal-row { border-top: 1px solid var(--help-line); }
  .help-legal-row:hover { background: var(--help-soft); }
  .help-legal-row:focus-visible, .help-legal-back:focus-visible, .help-legal-search input:focus-visible, .help-legal-clear:focus-visible, .help-legal-empty-clear:focus-visible { outline: 3px solid var(--help-accent); outline-offset: 2px; }
  .help-legal-icon { display: inline-grid; width: 24px; height: 24px; place-items: center; color: var(--help-accent); }
  .help-legal-icon svg { width: 24px; height: 24px; }
  .help-legal-copy { display: grid; gap: 3px; min-width: 0; }
  .help-legal-copy strong { font-size: 15px; line-height: 1.35; }
  .help-legal-copy > span { color: var(--help-muted); font-size: 13px; line-height: 1.45; }
  .help-legal-path { font-family: "Spline Sans Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
  .help-legal-chevron { color: var(--help-muted); font-size: 25px; line-height: 1; }

  .help-legal-empty { padding: 18px; border: 1px solid var(--help-line); border-radius: 16px; background: var(--help-paper); }
  .help-legal-empty h3 { margin: 0 0 5px; font-size: 16px; }
  .help-legal-empty p { margin: 0 0 12px; color: var(--help-muted); font-size: 13px; }
  .help-legal-empty-clear { min-height: 38px; padding: 7px 14px; border: 1px solid var(--help-line); border-radius: 999px; background: var(--help-soft); color: var(--help-text); font-weight: 600; }

  @media (max-width: 480px) {
    .help-legal-view { gap: 17px; padding: 12px 8px 20px; }
    .help-legal-section-header { align-items: flex-start; }
    .help-legal-badge { max-width: 9.5rem; text-align: center; }
    .help-legal-list { border-radius: 14px; }
    .help-legal-row { grid-template-columns: 24px minmax(0, 1fr) auto; gap: 9px; min-height: 68px; padding: 11px 10px; }
    .help-legal-copy strong { font-size: 14px; }
    .help-legal-copy > span { font-size: 12px; }
  }
}
