/*!
 * hawk.css — structural styles only. No hardcoded colors: every color is a --hawk-* custom
 * property with a neutral fallback, so hawk is usable unstyled and a theme (e.g.
 * hawk-theme-typeflow.css) only needs to redefine the tokens, never these rules.
 * Ported from typeflow's docs.css .search-* rules (docs/static/assets/docs.css:287-956),
 * generalized: fixed layout constants become --hawk-scale/--hawk-offset-*, the single hardcoded
 * 768px breakpoint becomes JS-driven [data-hawk-compact], and the two-column grid becomes
 * [data-hawk-columns].
 */

.hawk-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  padding: var(--hawk-offset-y, 6vh) var(--hawk-offset-x, 1rem) 1rem;
}

.hawk-modal[hidden] {
  display: none !important;
}

.hawk-modal[data-hawk-position='top-center'] {
  align-items: flex-start;
  justify-content: center;
}
.hawk-modal[data-hawk-position='center'] {
  align-items: center;
  justify-content: center;
}
.hawk-modal[data-hawk-position='top-left'] {
  align-items: flex-start;
  justify-content: flex-start;
}
.hawk-modal[data-hawk-position='top-right'] {
  align-items: flex-start;
  justify-content: flex-end;
}

.hawk-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--hawk-backdrop-gradient, var(--hawk-backdrop, rgba(9, 13, 22, 0.8)));
  opacity: var(--hawk-backdrop-opacity, 1);
  backdrop-filter: blur(var(--hawk-backdrop-blur, 14px));
}

.hawk-modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: calc(860px * var(--hawk-scale, 1));
  max-height: min(calc(720px * var(--hawk-scale, 1)), 86vh);
  border-radius: var(--hawk-radius, 14px);
  border: 1px solid var(--hawk-border-default, #253347);
  background: var(--hawk-bg-surface, #0f172a);
  color: var(--hawk-text-primary, #f1f5f9);
  box-shadow: var(--hawk-shadow, 0 24px 64px rgba(0, 0, 0, 0.45));
  overflow: hidden;
  font-family: var(--hawk-font-family, inherit);
  font-size: var(--hawk-font-size-base, 1rem);
  container-type: inline-size;
  /* Unset ("none") by default — no theme needs it, so it costs nothing until one sets
     --hawk-dialog-blur (e.g. a glass-style theme with a translucent --hawk-bg-surface that wants
     the dialog itself to keep reading page content behind it, distinct from the backdrop). */
  backdrop-filter: var(--hawk-dialog-blur, none);
  -webkit-backdrop-filter: var(--hawk-dialog-blur, none);
}

/* Chromium-only "squircle" corner interpolation (CSS Shapes Level 4's corner-shape property —
   experimental, Chromium-exclusive as of 2026). @supports scopes this to browsers that actually
   implement it instead of UA-sniffing: it costs nothing elsewhere, and picks up any other engine
   that ships support later for free. --hawk-corner-shape stays themeable/overridable like every
   other visual token, same pattern as --hawk-dialog-blur above. */
@supports (corner-shape: squircle) {
  .hawk-modal-dialog {
    corner-shape: var(--hawk-corner-shape, squircle);
  }
}

/* ── Modal reveal animations ──────────────────────────────────────────────────────────────
   config.revealAnimation picks one of the 5 named reveals below via [data-hawk-reveal], applied
   to .hawk-modal-backdrop/.hawk-modal-dialog only while [data-hawk-anim-state] is 'opening' or
   'closing' (see hawk.js's open()/close()) — the resting state both sides of that window is just
   the plain rules above, unanimated. --hawk-reveal-duration is written inline by hawk.js from
   config.revealDuration (or the built-in default for the chosen name), the single number the
   CSS animation-duration and hawk.js's close()-then-hide timer both read, so the two can't drift
   out of sync. A consumer can also pass a name of their own and define matching
   [data-hawk-reveal="name"] rules — hawk.js only ever sets the attribute and the CSS variable. */
.hawk-modal[data-hawk-anim-state='closing'] {
  pointer-events: none;
}

@keyframes hawk-reveal-fade-in {
  from {
    opacity: 0;
  }
}
@keyframes hawk-reveal-fade-out {
  to {
    opacity: 0;
  }
}
@keyframes hawk-reveal-scale-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
}
@keyframes hawk-reveal-scale-out {
  to {
    opacity: 0;
    transform: scale(0.97);
  }
}
@keyframes hawk-reveal-slide-in {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
}
@keyframes hawk-reveal-slide-out {
  to {
    opacity: 0;
    transform: translateY(-14px);
  }
}
@keyframes hawk-reveal-blur-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0);
  }
}
@keyframes hawk-reveal-zoom-in {
  from {
    opacity: 0;
    transform: scale(1.045);
  }
}
@keyframes hawk-reveal-spring-in {
  from {
    opacity: 0;
    transform: scale(0.86);
  }
}

/* fade — a plain crossfade on both layers, no motion. The simplest and steadiest of the 5. */
[data-hawk-reveal='fade'][data-hawk-anim-state='opening'] .hawk-modal-backdrop,
[data-hawk-reveal='fade'][data-hawk-anim-state='opening'] .hawk-modal-dialog {
  animation: hawk-reveal-fade-in var(--hawk-reveal-duration, 160ms) ease both;
}
[data-hawk-reveal='fade'][data-hawk-anim-state='closing'] .hawk-modal-backdrop,
[data-hawk-reveal='fade'][data-hawk-anim-state='closing'] .hawk-modal-dialog {
  animation: hawk-reveal-fade-out var(--hawk-reveal-duration, 160ms) ease both;
}

/* scale-fade (default) — the command-palette standard (Linear/Raycast/VS Code Quick Open): the
   backdrop fades in place, the dialog fades in while easing up from a slight scale-down. */
[data-hawk-reveal='scale-fade'][data-hawk-anim-state='opening'] .hawk-modal-backdrop {
  animation: hawk-reveal-fade-in var(--hawk-reveal-duration, 200ms) ease both;
}
[data-hawk-reveal='scale-fade'][data-hawk-anim-state='opening'] .hawk-modal-dialog {
  animation: hawk-reveal-scale-in var(--hawk-reveal-duration, 200ms) cubic-bezier(0.16, 1, 0.3, 1)
    both;
}
[data-hawk-reveal='scale-fade'][data-hawk-anim-state='closing'] .hawk-modal-backdrop {
  animation: hawk-reveal-fade-out var(--hawk-reveal-duration, 200ms) ease both;
}
[data-hawk-reveal='scale-fade'][data-hawk-anim-state='closing'] .hawk-modal-dialog {
  animation: hawk-reveal-scale-out var(--hawk-reveal-duration, 200ms) ease both;
}

/* slide-down — the dialog drops in from just above its resting position (Alfred/Spotlight-top
   style) while the backdrop plain-fades underneath it. */
[data-hawk-reveal='slide-down'][data-hawk-anim-state='opening'] .hawk-modal-backdrop {
  animation: hawk-reveal-fade-in var(--hawk-reveal-duration, 220ms) ease both;
}
[data-hawk-reveal='slide-down'][data-hawk-anim-state='opening'] .hawk-modal-dialog {
  animation: hawk-reveal-slide-in var(--hawk-reveal-duration, 220ms) cubic-bezier(0.22, 1, 0.36, 1)
    both;
}
[data-hawk-reveal='slide-down'][data-hawk-anim-state='closing'] .hawk-modal-backdrop {
  animation: hawk-reveal-fade-out var(--hawk-reveal-duration, 220ms) ease both;
}
[data-hawk-reveal='slide-down'][data-hawk-anim-state='closing'] .hawk-modal-dialog {
  animation: hawk-reveal-slide-out var(--hawk-reveal-duration, 220ms) ease both;
}

/* blur-zoom — the backdrop's blur ramps up from 0 alongside its fade (rather than starting at
   full blur), while the dialog eases in from a slight zoomed-in scale. Reads as the search surface
   "materializing" rather than simply appearing. */
[data-hawk-reveal='blur-zoom'][data-hawk-anim-state='opening'] .hawk-modal-backdrop {
  animation: hawk-reveal-blur-in var(--hawk-reveal-duration, 260ms) ease both;
}
[data-hawk-reveal='blur-zoom'][data-hawk-anim-state='opening'] .hawk-modal-dialog {
  animation: hawk-reveal-zoom-in var(--hawk-reveal-duration, 260ms) ease-out both;
}
[data-hawk-reveal='blur-zoom'][data-hawk-anim-state='closing'] .hawk-modal-backdrop {
  animation: hawk-reveal-fade-out var(--hawk-reveal-duration, 260ms) ease both;
}
[data-hawk-reveal='blur-zoom'][data-hawk-anim-state='closing'] .hawk-modal-dialog {
  animation: hawk-reveal-scale-out var(--hawk-reveal-duration, 260ms) ease both;
}

/* spring — the bounciest and most "designed" of the 5 (the Arc-browser/macOS spring feel): a
   single cubic-bezier with a > 1 mid-curve value carries the dialog's scale past 1 before settling
   back, no multi-stage keyframe needed. Exits with a plain scale-fade, no bounce on the way out —
   the bounce reads as intentional only on entry. */
[data-hawk-reveal='spring'][data-hawk-anim-state='opening'] .hawk-modal-backdrop {
  animation: hawk-reveal-fade-in var(--hawk-reveal-duration, 340ms) ease both;
}
[data-hawk-reveal='spring'][data-hawk-anim-state='opening'] .hawk-modal-dialog {
  animation: hawk-reveal-spring-in var(--hawk-reveal-duration, 340ms)
    cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
[data-hawk-reveal='spring'][data-hawk-anim-state='closing'] .hawk-modal-backdrop {
  animation: hawk-reveal-fade-out var(--hawk-reveal-duration, 340ms) ease both;
}
[data-hawk-reveal='spring'][data-hawk-anim-state='closing'] .hawk-modal-dialog {
  animation: hawk-reveal-scale-out var(--hawk-reveal-duration, 340ms) ease both;
}

@media (prefers-reduced-motion: reduce) {
  /* Belt-and-suspenders: hawk.js already skips setting [data-hawk-anim-state] under reduced
     motion, so these never actually match in practice — kept in case a consumer's own CSS sets
     the attribute directly without going through open()/close(). */
  [data-hawk-reveal][data-hawk-anim-state] .hawk-modal-backdrop,
  [data-hawk-reveal][data-hawk-anim-state] .hawk-modal-dialog {
    animation: none;
  }
}

/*
 * Density presets — user/dev-selectable sizing on top of the numeric --hawk-scale multiplier.
 * 'medium' (the default) is the rule above, unchanged from before density existed.
 */
[data-hawk-density='fit'] .hawk-modal-dialog {
  max-width: min(calc(1400px * var(--hawk-scale, 1)), 96vw);
  max-height: 92vh;
}
[data-hawk-density='fit'] .hawk-results-pane,
[data-hawk-density='fit'] .hawk-preview-pane {
  padding: 1.25rem;
}
[data-hawk-density='compact'] .hawk-modal-dialog {
  max-width: calc(560px * var(--hawk-scale, 1));
  max-height: min(calc(520px * var(--hawk-scale, 1)), 70vh);
}
/* .hawk-modal-body's shared 380px min-height floor (above) assumes the ~134px of fixed chrome
   above/below it (header + filters + footer) plus itself fits inside the dialog's own max-height.
   That budget already has only ~6px of slack at compact density's default scale (520px - 134px =
   386px), so any --hawk-scale below 1 — e.g. the 'simple-dark' gallery theme's 0.9 — pushes total
   content past max-height, and since the dialog clips with overflow:hidden, the footer row
   (hint/counter/attribution) silently disappears with no visible sign anything is missing. A
   lower floor here keeps compact density's own already-reduced row height (below) in budget
   across its realistic scale range instead of relying on there happening to be enough slack. */
[data-hawk-density='compact'] .hawk-modal-body {
  min-height: 220px;
}
[data-hawk-density='compact'] .hawk-results-pane {
  padding: 0.35rem;
}
[data-hawk-density='compact'] .hawk-result-item {
  padding: 0.35rem 0.45rem;
}
[data-hawk-density='compact'] .hawk-result-meta {
  gap: 0.2rem 0.4rem;
  margin-top: 0.2rem;
}
[data-hawk-density='compact'] .hawk-result-desc {
  -webkit-line-clamp: 1;
}
[data-hawk-vertical-fit='true'][data-hawk-density='fit'] .hawk-modal-dialog,
[data-hawk-vertical-fit='true'][data-hawk-density='compact'] .hawk-modal-dialog {
  height: fit-content;
}

.hawk-modal-header {
  /* .hawk-modal-dialog is a column flex container with a fixed max-height — without
     flex-shrink:0 here (and on .hawk-modal-filters/.hawk-modal-footer below), this row has the
     same default flex-shrink:1 as every other row, including .hawk-modal-body's own flex:1. If
     the footer's hint text ever wraps onto a second line at a narrow width (nothing in it is
     nowrap-protected either — see .hawk-hint below) and that pushes total content past
     max-height, the shrink deficit gets redistributed across every row once .hawk-modal-body
     hits its own min-height floor — compressing this header's and the filter pills' padding
     instead of leaving them alone, since the flex algorithm has no notion of "this row is
     chrome, don't touch it" on its own. Confirmed via Playwright at 375x700: filter pills
     compressed from 24px to ~10px tall before this fix. flex-shrink:0 opts every fixed-height
     chrome row out of that redistribution entirely, leaving .hawk-modal-body (still flex:1) as
     the only row allowed to actually shrink. */
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--hawk-border-subtle, #1e293b);
}

.hawk-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.hawk-modal-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  /* 16px minimum — below this, iOS Safari auto-zooms the viewport on focus. */
  font-size: max(1rem, 16px);
  color: var(--hawk-text-primary, #f1f5f9);
}
.hawk-modal-input::placeholder {
  color: var(--hawk-text-muted, #64748b);
}

/*
 * Rotating placeholder overlay (config.rotatingPlaceholders) — an <input>'s native `placeholder`
 * attribute can't be typed character-by-character by an animation driver (it's browser-rendered,
 * not a DOM node), so this sits visually where the placeholder would be instead. Only present in
 * the DOM when rotatingPlaceholders is configured; hidden via [data-hawk-input-active] the
 * instant the input has a value (see hawk.js's #updatePlaceholderVisibility).
 */
.hawk-input-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  pointer-events: none;
  color: var(--hawk-text-muted, #64748b);
  font-size: max(1rem, 16px);
  white-space: nowrap;
  overflow: hidden;
}
.hawk-input-wrap[data-hawk-input-active='true'] .hawk-input-ghost {
  display: none;
}

.hawk-modal-esc {
  background: transparent;
  border: 1px solid var(--hawk-border-default, #253347);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  color: var(--hawk-text-muted, #64748b);
}

.hawk-density-toggle {
  display: flex;
  gap: 0.2rem;
}
.hawk-density-btn {
  background: transparent;
  border: 1px solid var(--hawk-border-default, #253347);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--hawk-text-muted, #64748b);
}
.hawk-density-btn:focus-visible {
  outline: 2px solid var(--hawk-accent, #38bdf8);
  outline-offset: 1px;
}
.hawk-density-btn.active {
  border-color: var(--hawk-accent, #38bdf8);
  color: var(--hawk-accent, #38bdf8);
  background: var(--hawk-accent-dim, rgba(56, 189, 248, 0.12));
}

@container (max-width: 30rem) {
  .hawk-modal-header {
    flex-wrap: wrap;
  }
  .hawk-input-wrap {
    flex-basis: 100%;
  }
  .hawk-density-btn,
  .hawk-modal-esc {
    min-height: 2.75rem;
  }
  .hawk-modal-esc {
    margin-inline-start: auto;
  }
}

.hawk-modal-filters {
  /* See .hawk-modal-header's comment — same column-flex shrink-redistribution risk. */
  flex-shrink: 0;
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--hawk-border-subtle, #1e293b);
  overflow-x: auto;
}

/*
 * Themed scrollbars — results pane, preview pane, and the filter strip's horizontal overflow.
 * Two layers, because no single CSS API covers both "themeable color" and "idle low-opacity,
 * brightens on hover/scroll" across engines yet:
 *   - scrollbar-color (Firefox, and any engine without the WebKit pseudo-elements below):
 *     themeable, but the standard doesn't support a separate hover/active state.
 *   - ::-webkit-scrollbar* (Blink/WebKit): does support per-state styling, so the idle-vs-active
 *     opacity difference only actually happens in engines that implement these pseudo-elements.
 */
.hawk-results-pane,
.hawk-preview-pane,
.hawk-modal-filters {
  scrollbar-width: thin;
  scrollbar-color: var(--hawk-scrollbar-thumb, rgba(148, 163, 184, 0.35)) transparent;
}
.hawk-results-pane::-webkit-scrollbar,
.hawk-preview-pane::-webkit-scrollbar,
.hawk-modal-filters::-webkit-scrollbar {
  width: 8px;
  height: 6px;
}
.hawk-results-pane::-webkit-scrollbar-track,
.hawk-preview-pane::-webkit-scrollbar-track,
.hawk-modal-filters::-webkit-scrollbar-track {
  background: transparent;
}
.hawk-results-pane::-webkit-scrollbar-thumb,
.hawk-preview-pane::-webkit-scrollbar-thumb,
.hawk-modal-filters::-webkit-scrollbar-thumb {
  background: var(--hawk-scrollbar-thumb, rgba(148, 163, 184, 0.35));
  border-radius: 999px;
  transition: background-color 0.15s ease;
}
.hawk-results-pane:hover::-webkit-scrollbar-thumb,
.hawk-results-pane::-webkit-scrollbar-thumb:hover,
.hawk-preview-pane:hover::-webkit-scrollbar-thumb,
.hawk-preview-pane::-webkit-scrollbar-thumb:hover,
.hawk-modal-filters:hover::-webkit-scrollbar-thumb,
.hawk-modal-filters::-webkit-scrollbar-thumb:hover,
.hawk-results-pane[data-hawk-scrolling='true']::-webkit-scrollbar-thumb,
.hawk-preview-pane[data-hawk-scrolling='true']::-webkit-scrollbar-thumb,
.hawk-modal-filters[data-hawk-scrolling='true']::-webkit-scrollbar-thumb {
  /* [data-hawk-scrolling] (see hawk.js's #wireScrollBrighten) brightens on any scroll activity,
     not just a mouse sitting over the pane — this is what makes keyboard-driven scrolling (the
     preview pane's arrow-key handler) light the scrollbar up too. */
  background: var(--hawk-scrollbar-thumb-active, rgba(148, 163, 184, 0.7));
}

.hawk-filter-pill {
  /* This row scrolls horizontally (.hawk-modal-filters' overflow-x:auto) rather than wrapping or
     compressing pills — flex-shrink:0 makes that the only possible outcome under width pressure,
     matching white-space:nowrap's role for text. */
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: 1px solid var(--hawk-border-default, #253347);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  color: var(--hawk-text-muted, #64748b);
  cursor: pointer;
  white-space: nowrap;
}
.hawk-filter-pill:focus-visible {
  outline: 2px solid var(--hawk-accent, #38bdf8);
  outline-offset: 1px;
}
/* config.tabs[].accentColor (see hawk.js's #renderFilters) writes --hawk-tab-accent inline on
   just that pill — every rule below falls back to the theme's own --hawk-accent when a tab
   doesn't set one, so this is a no-op for tabs that don't opt in. */
.hawk-filter-pill.active {
  border-color: var(--hawk-tab-accent, var(--hawk-accent, #38bdf8));
  color: var(--hawk-tab-accent, var(--hawk-accent, #38bdf8));
  background: var(--hawk-accent-dim, rgba(56, 189, 248, 0.12));
}
@supports (background: color-mix(in srgb, red 10%, transparent)) {
  .hawk-filter-pill.active {
    /* Refines the flat --hawk-accent-dim fallback above into a tint of this tab's own accent,
       in engines that support color-mix (2023+) — progressive enhancement, not a requirement. */
    background: color-mix(
      in srgb,
      var(--hawk-tab-accent, var(--hawk-accent, #38bdf8)) 14%,
      transparent
    );
  }
}
/* The color dot renders even when a tab isn't the active one, so an accent reads as "this tab's
   color" at a glance across the whole row, not just on selection — transparent (invisible, no
   layout/visual change) for any tab that didn't set accentColor. */
.hawk-filter-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hawk-tab-accent, transparent);
  flex-shrink: 0;
}

.hawk-modal-body {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  /* Without an explicit row track, the single implicit row sizes to its tallest item's content
     (auto), not to this container's own height — so a long result list silently overflowed
     max-height instead of the pane itself scrolling (min-height:0 on the panes, below, isn't
     sufficient on its own: that stops an item's content forcing the row taller, but doesn't make
     the row fill the container in the first place). minmax(0, 1fr) makes the one row exactly
     this container's available height, whatever that resolves to between min/max-height. */
  grid-template-rows: minmax(0, 1fr);
  min-height: 380px;
  max-height: 480px;
  flex: 1;
  overflow: hidden;
}
.hawk-modal-body[data-hawk-discovery='true'] {
  grid-template-rows: minmax(0, 1fr) auto;
}
.hawk-modal-body[data-hawk-columns='1'] {
  grid-template-columns: 1fr;
}
/* #applyParams's own comment documents columns:1 as forcing "1 column like below breakpoint (or
   compact density)" — but only the breakpoint/compact-density paths (below) actually hid the
   preview pane to match; a theme or config setting columns:1 directly (density left at 'fit' or
   'medium', e.g. by an in-modal density-toggle click that changes data-hawk-density without
   recomputing data-hawk-columns — surfaced by the 'simple-dark' gallery theme, whose columns:1
   pairs with density:'compact' by default but not once someone switches density in the open
   modal) got a 1-column grid with BOTH panes still visible. Two items in one grid column/row
   don't share space — the auto-placed second item (preview) gets its own implicit row sized to
   its full content, and results (the sole item in the explicit minmax(0,1fr) row) gets squeezed
   toward nothing competing against it, rather than either pane being hidden. */
.hawk-modal-body[data-hawk-columns='1'] .hawk-preview-pane {
  display: none;
}
[data-hawk-second-column='false'] .hawk-preview-pane {
  display: none !important;
}
/* config.params.alignment only ever governs the preview pane's cross-axis fit (e.g. a theme that
   doesn't want short preview content stretched to match a taller results list). It must not touch
   .hawk-results-pane: that pane's own min-height:0 + overflow-y:auto (above) depends on the grid
   row's default align-items:stretch to size it to the row and make its overflow reachable by
   scrolling — align-items:start on the whole body sized it to its content instead, silently
   clipping everything past .hawk-modal-body's max-height with no way to scroll to it (surfaced by
   the 'simple-dark' gallery theme, which pairs alignment:'start' with a single-column layout). */
.hawk-results-pane {
  align-self: stretch;
}
.hawk-modal-body[data-hawk-alignment='start'] .hawk-preview-pane {
  align-self: start;
}
.hawk-modal-body[data-hawk-alignment='center'] .hawk-preview-pane {
  align-self: center;
}

[data-hawk-compact='true'] .hawk-modal-body,
[data-hawk-density='compact'] .hawk-modal-body {
  grid-template-columns: 1fr !important;
}
[data-hawk-compact='true'] .hawk-preview-pane,
[data-hawk-density='compact'] .hawk-preview-pane {
  display: none;
}
/* Tabbing focus into the preview pane (see hawk.js's 'focus'/'blur' listeners on
   .hawk-preview-pane) reveals it in place of the results pane in single-column layouts, where
   it's otherwise hidden — the only way to reach it is via this focus-zone navigation. Scoped to
   single-column contexts only: in 2-column layouts both panes are already visible. */
[data-hawk-compact='true'][data-hawk-show-preview='true'] .hawk-results-pane,
[data-hawk-density='compact'][data-hawk-show-preview='true'] .hawk-results-pane,
/* data-hawk-show-preview lives on .hawk-modal (root); data-hawk-columns lives on the nested
   .hawk-modal-body — an ancestor-then-descendant selector, unlike the two rules above where both
   attributes sit on the same (root) element. */
.hawk-modal[data-hawk-show-preview='true'] .hawk-modal-body[data-hawk-columns='1'] .hawk-results-pane {
  display: none;
}
[data-hawk-compact='true'][data-hawk-show-preview='true'] .hawk-preview-pane,
[data-hawk-density='compact'][data-hawk-show-preview='true'] .hawk-preview-pane,
.hawk-modal[data-hawk-show-preview='true'] .hawk-modal-body[data-hawk-columns='1'] .hawk-preview-pane {
  display: block;
}

.hawk-results-pane {
  /* Without this, a grid item's automatic minimum size defaults to its content's size, not the
     grid row's — so a long result list just grows the item past .hawk-modal-body's fixed height
     instead of the item itself becoming the scroll container. .hawk-modal-body's own
     overflow:hidden then silently clips everything past ~480px instead of it being reachable by
     scrolling: no visible bug in short lists, a real "can't get to the rest of the results" bug
     once the list is long enough to matter. */
  min-height: 0;
  overflow-y: auto;
  /* Reserve scrollbar gutter so its appearance/disappearance on hover doesn't cause a layout
     shift that makes the modal jitter. */
  scrollbar-gutter: stable;
  border-right: 1px solid var(--hawk-border-subtle, #1e293b);
  padding: 0.5rem;
}
.hawk-results-pane:focus-visible,
.hawk-preview-pane:focus-visible {
  outline: 2px solid var(--hawk-accent, #38bdf8);
  outline-offset: -2px;
}

.hawk-result-item {
  display: block;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.hawk-result-item--subpage {
  position: relative;
  margin-inline-start: 1rem;
  padding-inline-start: 1.15rem;
}

.hawk-result-item--subpage::before {
  content: '';
  position: absolute;
  inset-block: 0.35rem;
  inset-inline-start: 0.3rem;
  width: 1px;
  border-radius: 999px;
  background: var(--hawk-border-default, #253347);
}

/* ── Staggered result-row reveal ──────────────────────────────────────────────────────────
   config.resultsReveal (default true) + config.resultsRevealDirection ('up'|'down'|'left'|
   'right', default 'up') — see hawk.js's #mount() and #renderResults(). [data-hawk-results-
   reveal] on #root selects the direction; each row's own --hawk-row-index (capped at 10, set
   inline per row) staggers its animation-delay via --hawk-results-stagger. A single 2-stop
   keyframe (opacity + one transform) with a spring-y cubic-bezier gets real overshoot cheaply —
   same technique as the modal's own 'spring' reveal — rather than a heavier multi-stage
   keyframe, which matters here since it can run on every keystroke's re-render, not once per
   open(). transform+opacity only: no layout-triggering properties, so this stays cheap even
   stacked across ~10 rows firing close together. */
[data-hawk-results-reveal] .hawk-result-item {
  animation-duration: 260ms;
  animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
  animation-fill-mode: both;
  animation-delay: calc(var(--hawk-row-index, 0) * var(--hawk-results-stagger, 22ms));
}
@keyframes hawk-result-reveal-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
@keyframes hawk-result-reveal-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
}
@keyframes hawk-result-reveal-left {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
}
@keyframes hawk-result-reveal-right {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}
[data-hawk-results-reveal='up'] .hawk-result-item {
  animation-name: hawk-result-reveal-up;
}
[data-hawk-results-reveal='down'] .hawk-result-item {
  animation-name: hawk-result-reveal-down;
}
[data-hawk-results-reveal='left'] .hawk-result-item {
  animation-name: hawk-result-reveal-left;
}
[data-hawk-results-reveal='right'] .hawk-result-item {
  animation-name: hawk-result-reveal-right;
}
@media (prefers-reduced-motion: reduce) {
  [data-hawk-results-reveal] .hawk-result-item {
    animation: none;
  }
}

.hawk-result-item:hover,
.hawk-result-item.is-selected {
  background: var(--hawk-accent-dim, rgba(56, 189, 248, 0.12));
}
.hawk-result-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hawk-result-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.hawk-meta-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--hawk-result-accent, var(--hawk-border-default, #253347)) 60%, transparent);
  background: color-mix(in srgb, var(--hawk-result-accent, transparent) 14%, transparent);
  color: color-mix(in srgb, var(--hawk-result-accent, var(--hawk-text-muted, #64748b)) 80%, var(--hawk-text-primary, #f1f5f9));
  white-space: nowrap;
}
.hawk-pin-btn {
  display: inline-block;
  margin-left: auto;
  font-size: 0.68rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--hawk-border-default, #253347);
  color: var(--hawk-text-muted, #64748b);
  white-space: nowrap;
  cursor: pointer;
}
.hawk-pin-btn:hover {
  border-color: var(--hawk-accent, #38bdf8);
  color: var(--hawk-accent, #38bdf8);
}
.hawk-pin-btn.is-pinned {
  border-color: var(--hawk-accent-alt, #fb923c);
  color: var(--hawk-accent-alt, #fb923c);
  background: var(--hawk-accent-alt-dim, rgba(251, 146, 60, 0.12));
}
.hawk-result-desc {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--hawk-text-secondary, #94a3b8);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hawk-result-desc mark {
  background: var(--hawk-mark-bg, var(--hawk-accent-glow, rgba(56, 189, 248, 0.25)));
  color: var(--hawk-mark-color, inherit);
  font-weight: var(--hawk-mark-weight, inherit);
  font-style: var(--hawk-mark-style, inherit);
  border-radius: 3px;
}

.hawk-result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin-top: 0.4rem;
}

.hawk-result-date {
  color: var(--hawk-text-muted, #64748b);
  font-size: 0.7rem;
  white-space: nowrap;
  /* Both zero-cost until a theme sets them — same fallback-token pattern as --hawk-dialog-blur
     above. No theme needs a distinct date font by default, so this inherits the modal's own
     --hawk-font-family (itself falling further back to `inherit`) rather than forcing a choice;
     --hawk-result-date-opacity stays fully opaque until a theme wants the date to read as
     quieter/secondary than the rest of the metadata row without a second color token. */
  font-family: var(--hawk-result-date-font-family, var(--hawk-font-family, inherit));
  opacity: var(--hawk-result-date-opacity, 1);
}

.hawk-result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.hawk-result-tags:empty {
  display: none;
}

.hawk-result-tag {
  padding: 0.05rem 0.28rem;
  border: none;
  border-radius: 999px;
  /* --hawk-tag-accent (set inline per tag by config.tagAccentColors, see hawk.js's
     #resultMetaMarkup) takes priority over the whole row's single --hawk-result-accent, so tags
     within one result can each read as their own subtle color instead of a uniform block —
     falls back the same as before when tagAccentColors is off.
     No border, a paler background (12% -> 8%) and a text-color mix pulled toward
     --hawk-text-secondary rather than --hawk-text-primary (55% vs. the old 75%, toward the
     muted end rather than the bright one) — reads as a soft, blended hashtag label rather than a
     bordered chip competing with the title/excerpt for attention. */
  background: color-mix(in srgb, var(--hawk-tag-accent, var(--hawk-result-accent, var(--hawk-accent, #38bdf8))) 8%, transparent);
  color: color-mix(in srgb, var(--hawk-tag-accent, var(--hawk-result-accent, var(--hawk-accent, #38bdf8))) 55%, var(--hawk-text-secondary, #94a3b8));
  font-size: 0.64rem;
  line-height: 1.35;
}

/* A CSS-only "#" prefix (not baked into hawk.js's rendered text) so a theme can hide it with one
   rule (content: none) without touching the tag's actual text, and so the value hawk.js writes
   here always matches what config.resultTagsMetaKey's Pagefind data — and the tag:value inline
   filter syntax — actually contain, with no "#" to strip back out. */
.hawk-result-tag::before {
  content: '#';
}

.hawk-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--hawk-text-muted, #64748b);
}

.hawk-preview-pane {
  /* See .hawk-results-pane's comment — same fix, same reason. */
  min-height: 0;
  overflow-y: auto;
  /* Reserve scrollbar gutter so its appearance/disappearance on hover doesn't cause a layout
     shift that makes the modal jitter. */
  scrollbar-gutter: stable;
  padding: 1rem;
  background: var(--hawk-preview-bg, rgba(9, 13, 22, 0.65));
}

/* A reserved gutter is useful once the modal has enough room for the pane's scrollbar, but on
 * phone layouts it needlessly removes several pixels from an already narrow result column and
 * changes wrapping. Keep the maintained phone layout independent of scrollbar visibility. */
@media (max-width: 30rem) {
  .hawk-results-pane,
  .hawk-preview-pane {
    scrollbar-gutter: auto;
  }
}

.hawk-preview-empty {
  color: var(--hawk-text-muted, #64748b);
  font-size: 0.85rem;
}
.hawk-anchor-badge {
  display: inline-block;
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--hawk-accent-alt, #fb923c);
  color: var(--hawk-accent-alt, #fb923c);
}
.hawk-preview-title {
  margin: 0.5rem 0;
  font-size: 1.05rem;
}
.hawk-preview-content {
  font-size: 0.85rem;
  color: var(--hawk-text-secondary, #94a3b8);
  line-height: 1.5;
}
.hawk-preview-content mark {
  background: var(--hawk-mark-bg, var(--hawk-accent-glow, rgba(56, 189, 248, 0.25)));
  color: var(--hawk-mark-color, inherit);
  font-weight: var(--hawk-mark-weight, inherit);
  font-style: var(--hawk-mark-style, inherit);
  border-radius: 3px;
}
.hawk-preview-loading {
  color: var(--hawk-text-muted, #64748b);
  font-size: 0.8rem;
}

.hawk-discovery-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--hawk-border-subtle, #1e293b);
  background: var(--hawk-bg-surface-elevated, #111c30);
  overflow-y: auto;
}
.hawk-discovery-row[hidden] {
  display: none;
}
.hawk-discovery-status {
  grid-column: 1 / -1;
  color: var(--hawk-text-muted, #64748b);
  font-size: 0.78rem;
}
.hawk-discovery-group {
  min-width: 0;
}
.hawk-discovery-title {
  margin: 0 0 0.28rem;
  color: var(--hawk-text-muted, #64748b);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hawk-discovery-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hawk-discovery-link {
  display: inline-flex;
  max-width: 100%;
  min-height: 1.55rem;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border: 1px solid var(--hawk-border-default, #253347);
  border-radius: 999px;
  color: var(--hawk-text-secondary, #94a3b8);
  font-size: 0.68rem;
  line-height: 1.25;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.hawk-discovery-link:hover {
  border-color: var(--hawk-accent, #38bdf8);
  color: var(--hawk-accent, #38bdf8);
}
.hawk-discovery-link:focus-visible {
  outline: 2px solid var(--hawk-accent, #38bdf8);
  outline-offset: 2px;
}
.hawk-discovery-empty {
  margin: 0;
  color: var(--hawk-text-muted, #64748b);
  font-size: 0.72rem;
}

[data-hawk-compact='true'] .hawk-discovery-row,
[data-hawk-density='compact'] .hawk-discovery-row {
  grid-template-columns: 1fr;
  gap: 0.4rem;
  padding: 0.45rem 0.65rem;
  max-height: min(11rem, 30vh);
}
[data-hawk-compact='true'] .hawk-discovery-title,
[data-hawk-density='compact'] .hawk-discovery-title {
  margin-bottom: 0.2rem;
}
/* 2.75rem (44px) is a floor, not a target — the touch-target minimum from Epic 6, kept exactly
   at that floor rather than padded further, so compact mode stays as minimal as the accessibility
   requirement allows. */
[data-hawk-compact='true'] .hawk-discovery-link,
[data-hawk-density='compact'] .hawk-discovery-link {
  min-height: 2.75rem;
  padding-inline: 0.6rem;
}

/*
 * Markdown element styling for fetched page content (see #loadPreviewContent in hawk.js).
 * Code block *coloring* comes for free from the site's own build (e.g. Hugo's chroma
 * highlighter with noClasses:true bakes token colors in as inline styles) — these rules only
 * handle layout: spacing, block chrome, and readable defaults for un-highlighted markup.
 *
 * Every selector below is scoped :not([data-hawk-markdown-styles="off"]) — set via
 * config.disableDefaultMarkdownStyles, this attribute lets a consumer opt out of hawk's own
 * prose opinions entirely and target .hawk-preview-content with their own CSS (e.g. an existing
 * site-wide .prose class) instead of fighting these rules' specificity.
 */
.hawk-preview-content:not([data-hawk-markdown-styles='off']) :first-child {
  margin-top: 0;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) :last-child {
  margin-bottom: 0;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h1,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h2,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h3,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h4,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h5,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h6 {
  color: var(--hawk-text-primary, #f1f5f9);
  line-height: 1.3;
  margin: 1.1em 0 0.4em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h1 {
  font-size: 1.15em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h2 {
  font-size: 1.08em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h3,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h4,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h5,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) h6 {
  font-size: 1em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) p,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) ul,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) ol,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) blockquote,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) table,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) pre {
  margin: 0 0 0.85em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) ul,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) ol {
  padding-left: 1.3em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) li {
  margin: 0.2em 0;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) a {
  color: var(--hawk-accent, #38bdf8);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) strong {
  color: var(--hawk-text-primary, #f1f5f9);
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) hr {
  border: none;
  border-top: 1px solid var(--hawk-border-subtle, #1e293b);
  margin: 1.2em 0;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) img {
  max-width: 100%;
  border-radius: 6px;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) blockquote {
  border-left: 3px solid var(--hawk-accent-dim, rgba(56, 189, 248, 0.12));
  padding: 0.1em 0 0.1em 0.9em;
  color: var(--hawk-text-muted, #64748b);
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) th,
.hawk-preview-content:not([data-hawk-markdown-styles='off']) td {
  border: 1px solid var(--hawk-border-subtle, #1e293b);
  padding: 0.35em 0.55em;
  text-align: left;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) th {
  color: var(--hawk-text-primary, #f1f5f9);
}

/* Code: inline vs. block. `pre > code` is a highlighted block; bare `code` is inline. */
.hawk-preview-content:not([data-hawk-markdown-styles='off']) code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) :not(pre) > code {
  background: var(--hawk-bg-surface-elevated, #1e293b);
  border-radius: 4px;
  padding: 0.1em 0.4em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) pre {
  background: var(--hawk-bg-canvas, #090d16);
  border: 1px solid var(--hawk-border-subtle, #1e293b);
  border-radius: 8px;
  padding: 0.75em 0.9em;
  overflow-x: auto;
  line-height: 1.45;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) pre code {
  background: none;
  padding: 0;
  white-space: pre;
}
/* Hugo/chroma wraps highlighted blocks in .highlight > pre — flatten our chrome onto it too. */
.hawk-preview-content:not([data-hawk-markdown-styles='off']) .highlight {
  margin: 0 0 0.85em;
}
.hawk-preview-content:not([data-hawk-markdown-styles='off']) .highlight pre {
  margin: 0;
}

/* config.previewSections — a page-level match's content broken into clickable heading+excerpt
   rows instead of the full page dump (see hawk.js's #renderPreviewSections). .hawk-preview-section-row
   is an <a> inside .hawk-preview-content, which the markdown-styling block above already targets
   with ".hawk-preview-content:not([data-hawk-markdown-styles='off']) a { text-decoration: underline }"
   at specificity (0,2,1) — ".hawk-preview-section-row" alone is only (0,1,0) and can never outrank
   that regardless of source order, so the selector below repeats ".hawk-preview-content" to reach
   the same (0,2,1) and let source position (this comes later) actually decide the tie. */
.hawk-preview-content a.hawk-preview-section-row {
  display: block;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--hawk-border-subtle, #1e293b);
  text-decoration: none;
  color: inherit;
}
.hawk-preview-section-row:first-child {
  padding-top: 0;
}
.hawk-preview-section-row:last-child {
  border-bottom: none;
}
.hawk-preview-section-row:hover .hawk-preview-section-title {
  color: var(--hawk-accent, #38bdf8);
}
.hawk-preview-section-title {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--hawk-text-primary, #f1f5f9);
}
.hawk-preview-section-excerpt {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--hawk-text-secondary, #94a3b8);
  line-height: 1.5;
}

.hawk-modal-footer {
  /* See .hawk-modal-header's comment — same column-flex shrink-redistribution risk. Also
     overflow-x:auto (not wrap): none of .hawk-hint/.hawk-modal-counter/.hawk-powered-by below
     had white-space:nowrap, so at a narrow width the hint text used to wrap onto a second line
     instead of the row scrolling — growing this row's own height, which is exactly what fed the
     header/filters squish above (a taller footer pushes the dialog past max-height, and once
     .hawk-modal-body hits its min-height floor, the deficit lands on every other row). Matches
     .hawk-modal-filters' own scroll-not-wrap pattern. */
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--hawk-border-subtle, #1e293b);
  font-size: 0.75rem;
  color: var(--hawk-text-muted, #64748b);
  overflow-x: auto;
}
.hawk-hint {
  flex-shrink: 0;
  white-space: nowrap;
}
.hawk-modal-counter {
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
}
.hawk-powered-by {
  flex-shrink: 0;
  color: var(--hawk-powered-by-color, var(--hawk-text-muted, #64748b));
  opacity: var(--hawk-powered-by-opacity, 0.7);
  text-decoration: none;
  white-space: nowrap;
}
.hawk-powered-by:hover,
.hawk-powered-by:focus-visible {
  opacity: 1;
  text-decoration: underline;
}

/*
 * Built-in trigger button (config.trigger) — an alternative to the consumer hand-building their
 * own [data-search-trigger] markup. Unscoped by [data-hawk-theme] since it renders outside
 * hawk's own root element (into config.trigger.container, wherever the consumer's page puts it);
 * a theme's CSS file still reaches it fine since --hawk-* custom properties inherit normally.
 */
.hawk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--hawk-border-default, #253347);
  border-radius: 8px;
  background: var(--hawk-bg-surface, #0f172a);
  color: var(--hawk-text-muted, #64748b);
  cursor: pointer;
  font-family: var(--hawk-font-family, inherit);
  font-size: 0.85rem;
}
.hawk-trigger:hover,
.hawk-trigger:focus-visible {
  border-color: var(--hawk-accent, #38bdf8);
  color: var(--hawk-text-primary, #f1f5f9);
}
.hawk-trigger-minimal {
  padding: 0.45rem;
}
.hawk-trigger-icon {
  flex-shrink: 0;
}
.hawk-trigger-kbd {
  margin-left: 0.25rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--hawk-border-default, #253347);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--hawk-text-muted, #64748b);
}
