:root {
  color-scheme: light;
  --page: #eef1ed;
  --ink: #101412;
  --paper: #fbfcfa;
  --paper-strong: #ffffff;
  --paper-soft: #f3f5f1;
  --muted: #5f6a63;
  --muted-dark: #66716a;
  --line: #dbe2da;
  --line-dark: #cbd4cb;
  --green: #36d39a;
  --green-ink: #08745b;
  --amber: #d99b2b;
  --red: #d45b52;
  --shadow: 0 10px 28px rgba(20, 26, 21, 0.08);
}

* {
  box-sizing: border-box;
  max-width: 100%;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

body::before {
  content: none;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  width: min(1480px, calc(100vw - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 0 48px;
}

.search-stage {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid var(--line-dark);
  border-radius: 10px;
  background: rgba(251, 252, 250, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  max-width: 100%;
  overflow: hidden;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(8, 116, 91, 0.34);
  border-radius: 7px;
  background: #eaf7f1;
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 850;
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.05;
}

.brand small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.statusline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 640;
  white-space: nowrap;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(54, 211, 154, 0.12);
}

.status-dot.fail {
  background: var(--red);
}

.command-search {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 34px;
  align-items: center;
  min-height: 54px;
  padding: 6px 8px;
  border: 1px solid #c9d3ca;
  border-radius: 9px;
  background: var(--paper-strong);
  box-shadow: none;
  max-width: 100%;
  min-width: 0;
}

.command-search:focus-within {
  border-color: rgba(8, 116, 91, 0.65);
  box-shadow: 0 0 0 4px rgba(54, 211, 154, 0.14);
}

.search-glyph {
  position: relative;
  display: block;
  width: 21px;
  height: 21px;
  margin-left: 5px;
}

.search-glyph::before {
  content: "";
  position: absolute;
  inset: 2px 6px 6px 2px;
  border: 2px solid #2e3b33;
  border-radius: 50%;
}

.search-glyph::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 3px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #2e3b33;
  transform: rotate(45deg);
  transform-origin: center;
}

#queryInput {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  padding: 9px 10px;
  font-size: 20px;
  font-weight: 520;
  line-height: 1.25;
}

#queryInput::placeholder {
  color: #879089;
}

#clearBtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #dce2dc;
  border-radius: 7px;
  background: var(--paper-soft);
  color: #425047;
  padding: 0;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

#clearBtn:hover {
  border-color: #b9c4ba;
  color: var(--ink);
}

.syntax-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.syntax-row span {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #d9e2da;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 650;
}

.syntax-row span:first-child {
  border-color: rgba(54, 211, 154, 0.45);
  background: rgba(54, 211, 154, 0.12);
  color: #bdf8df;
}

.syntax-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.search-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

#modeChip {
  border: 1px solid rgba(8, 116, 91, 0.25);
  border-radius: 999px;
  background: rgba(54, 211, 154, 0.1);
  color: var(--green-ink);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 760;
  white-space: nowrap;
}

#coverageSummary {
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.results-shell {
  border: 1px solid var(--line-dark);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: none;
  overflow: hidden;
  max-width: 100%;
}

.buckets {
  display: grid;
}

.bucket {
  min-width: 0;
  overflow: hidden;
  background: var(--paper);
}

.bucket + .bucket {
  border-top: 1px solid #dce2da;
}

.bucket-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  padding: 12px 16px 10px;
  background: #f7f9f5;
  border-bottom: 1px solid var(--line);
}

.bucket-kicker {
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bucket-title {
  margin-top: 2px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 820;
  line-height: 1.1;
}

.bucket-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.grid-head {
  display: grid;
  grid-template-columns: 14px minmax(360px, 1.35fr) minmax(260px, 0.78fr) minmax(300px, 1fr);
  align-items: center;
  min-height: 32px;
  border-bottom: 1px solid var(--line);
  background: #eef3ee;
  color: #55635b;
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.02em;
}

.grid-head span {
  min-width: 0;
  padding: 0 16px;
}

.grid-head span + span {
  border-left: 1px solid var(--line);
}

.hit {
  display: grid;
  grid-template-columns: 14px minmax(360px, 1.35fr) minmax(260px, 0.78fr) minmax(300px, 1fr);
  gap: 0;
  align-items: start;
  padding: 0;
  border-top: 1px solid #e4e9e2;
}

.hit:hover {
  background: #ffffff;
}

.hit-signal {
  width: 3px;
  height: calc(100% - 28px);
  min-height: 34px;
  margin: 14px 0 0 11px;
  border-radius: 999px;
  background: var(--green-ink);
}

.hit-c2 .hit-signal {
  background: var(--amber);
}

.hit-c3 .hit-signal {
  background: #3b7ce2;
}

.hit-col {
  min-width: 0;
  min-height: 100%;
  padding: 14px 16px;
}

.hit-col + .hit-col {
  border-left: 1px solid #e4e9e2;
}

.hit-match {
  padding-left: 16px;
}

.hit-title {
  display: block;
  max-width: 100%;
  color: var(--ink);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

a.hit-title:hover {
  color: var(--green-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.match-stack {
  display: grid;
  gap: 9px;
  margin-top: 9px;
}

.match-field {
  color: var(--green-ink);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hit-snippet {
  max-width: 72ch;
  margin-top: 6px;
  color: #39443d;
  font-size: 13px;
  line-height: 1.48;
  overflow-wrap: break-word;
}

.hit-snippet mark {
  border-radius: 3px;
  background: rgba(54, 211, 154, 0.22);
  color: #052f23;
  padding: 0 2px;
}

.hit-details,
.hit-related {
  font-size: 11px;
  line-height: 1.3;
}

.open-source {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 28px;
  margin-bottom: 11px;
  border: 1px solid rgba(8, 116, 91, 0.28);
  border-radius: 8px;
  background: rgba(54, 211, 154, 0.1);
  color: var(--green-ink);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 780;
  text-decoration: none;
}

.open-source:hover {
  border-color: rgba(8, 116, 91, 0.55);
  background: rgba(54, 211, 154, 0.16);
}

.open-source.muted {
  border-color: #dfe5dd;
  background: #f6f8f4;
  color: #8b948e;
}

.detail-grid,
.stand {
  display: grid;
  gap: 7px;
}

.detail-row,
.stand-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
}

.detail-row span,
.stand-row span {
  font-weight: 720;
  color: #68746c;
}

.detail-row strong,
.stand-row strong {
  min-width: 0;
  color: #26322c;
  font-weight: 620;
  overflow-wrap: anywhere;
}

.detail-row a {
  color: var(--green-ink);
  text-decoration: none;
}

.detail-row a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.related-title {
  margin-bottom: 9px;
  color: #26322c;
  font-size: 12px;
  font-weight: 820;
}

.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.related-chip,
.related-empty {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 1px solid #dce3db;
  border-radius: 999px;
  background: #fbfcfa;
  color: #445149;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 680;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-chip em {
  color: #66716a;
  font-style: normal;
  font-size: 10px;
  font-weight: 760;
}

.related-person,
.related-language {
  border-color: rgba(8, 116, 91, 0.22);
  background: rgba(54, 211, 154, 0.09);
}

.related-company,
.related-domain,
.related-source {
  border-color: rgba(59, 124, 226, 0.22);
  background: rgba(59, 124, 226, 0.08);
}

.related-risk,
.related-sector,
.related-topic {
  border-color: rgba(217, 155, 43, 0.28);
  background: rgba(217, 155, 43, 0.1);
}

.stand {
  border-top: 1px solid #e4e9e2;
  padding-top: 10px;
}

.more {
  padding: 12px 20px 16px 52px;
  border-top: 1px solid #e4e9e2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.empty-state,
.error {
  margin: 0;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}

.error {
  color: #a43b34;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 820px) {
  .shell {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    padding-top: 10px;
  }

  .search-stage {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    padding: 10px;
    border-radius: 9px;
  }

  .topline,
  .search-state {
    align-items: flex-start;
  }

  .search-state {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .statusline,
  #coverageSummary {
    text-align: left;
    white-space: normal;
  }

  .command-search {
    grid-template-columns: 28px minmax(0, 1fr) 36px;
    width: 100%;
    min-height: 52px;
  }

  #queryInput {
    padding: 10px 8px;
    font-size: 17px;
  }

  .results-shell {
    width: calc(100vw - 32px);
    max-width: calc(100vw - 32px);
    border-radius: 12px;
  }

  .bucket-head {
    grid-template-columns: minmax(0, 1fr);
    padding: 15px 16px 11px;
  }

  .bucket-count {
    justify-self: start;
  }

  .grid-head {
    display: none;
  }

  .hit {
    grid-template-columns: 14px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 16px;
    max-width: 100%;
  }

  .hit-signal {
    margin: 6px 0 0 0;
  }

  .hit-col {
    padding: 0;
  }

  .hit-col + .hit-col {
    border-left: 0;
    border-top: 1px solid #e4e9e2;
    padding-top: 12px;
    margin-top: 12px;
  }

  .hit-match,
  .hit-details,
  .hit-related {
    grid-column: 2;
  }

  .hit-title,
  .hit-snippet {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .hit-match {
    width: min(100%, calc(100vw - 92px));
    max-width: calc(100vw - 92px);
  }

  .detail-row,
  .stand-row {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .more {
    padding-left: 40px;
  }
}

/* p23: search-first Firesearch-style surface */
:root {
  --page: #f7f8f4;
  --ink: #171814;
  --paper: #ffffff;
  --paper-strong: #ffffff;
  --paper-soft: #f4f5ef;
  --muted: #6b6d66;
  --muted-dark: #545850;
  --line: #e4e6dd;
  --line-dark: #d7dbcf;
  --green: #2fd38f;
  --green-ink: #08745b;
  --fire: #ff6b1a;
  --fire-ink: #b33d00;
  --amber: #ff8c42;
  --red: #d45b52;
  --shadow: 0 18px 50px rgba(23, 24, 20, 0.08);
}

html,
body {
  background:
    radial-gradient(ellipse 900px 360px at 50% 116px, rgba(255, 107, 26, 0.19), rgba(255, 195, 106, 0.1) 36%, rgba(247, 248, 244, 0) 74%),
    linear-gradient(180deg, #fffdf8 0, #fbf5eb 160px, rgba(247, 248, 244, 0.98) 450px),
    repeating-linear-gradient(90deg, rgba(23, 24, 20, 0.035) 0, rgba(23, 24, 20, 0.035) 1px, transparent 1px, transparent 88px);
  color: var(--ink);
  font-family: Aptos, "SF Pro Display", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.46) 42%, rgba(247, 248, 244, 0.82) 100%),
    radial-gradient(circle at 50% 118px, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0) 310px);
  z-index: -1;
}

.shell {
  width: min(1500px, calc(100vw - 32px));
  padding-top: 24px;
}

.search-stage {
  position: sticky;
  top: 14px;
  z-index: 20;
  width: min(920px, 100%);
  margin: 0 auto 22px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

.search-stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 58px;
  z-index: -2;
  width: 100%;
  height: 320px;
  border-radius: 999px;
  pointer-events: none;
  transform: translateX(-50%);
  background:
    linear-gradient(180deg, rgba(255, 107, 26, 0.2), rgba(255, 185, 96, 0.11) 32%, rgba(247, 248, 244, 0) 86%),
    radial-gradient(ellipse at 50% 0, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0) 64%);
  filter: blur(22px);
}

.topline {
  display: none;
}

.command-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  min-height: 70px;
  padding: 8px 10px 8px 24px;
  border: 1px solid rgba(255, 107, 26, 0.26);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 251, 245, 0.68));
  box-shadow: 0 30px 90px rgba(255, 107, 26, 0.1), 0 18px 60px rgba(23, 24, 20, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(26px) saturate(1.08);
}

.command-search::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: -1;
  border-radius: 21px;
  background: linear-gradient(92deg, rgba(255, 107, 26, 0.5), rgba(255, 191, 102, 0.26), rgba(247, 248, 244, 0));
  opacity: 0.46;
}

.command-search:focus-within {
  border-color: rgba(255, 107, 26, 0.42);
  box-shadow: 0 36px 100px rgba(255, 107, 26, 0.14), 0 16px 48px rgba(23, 24, 20, 0.08);
}

.search-glyph {
  display: none;
}

.search-glyph::before {
  border-color: var(--ink);
}

.search-glyph::after {
  background: var(--ink);
}

#queryInput {
  padding: 12px 14px 12px 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 650;
}

#queryInput::placeholder {
  color: #8c9087;
  font-weight: 520;
}

#clearBtn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(23, 24, 20, 0.11);
  border-radius: 12px;
  background: #f2f3ed;
  color: #4b4e47;
  font-size: 23px;
}

#clearBtn:hover {
  border-color: rgba(255, 107, 26, 0.5);
  background: #fff6ef;
  color: var(--fire-ink);
}

.search-progress {
  position: relative;
  height: 2px;
  width: calc(100% - 28px);
  margin: 10px auto 0;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 107, 26, 0.15), rgba(23, 24, 20, 0.06), rgba(255, 107, 26, 0.08));
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.search-progress::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -42%;
  width: 42%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--fire), #ffc15a, transparent);
  animation: search-line 980ms cubic-bezier(0.66, 0, 0.34, 1) infinite;
}

.search-stage.is-loading .search-progress {
  opacity: 1;
  transform: translateY(0);
}

.search-stage:not(.is-loading) .search-progress::after {
  display: none;
  animation: none;
}

@keyframes search-line {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(340%);
  }
}

.search-state {
  display: none;
}

.results-shell {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.buckets {
  gap: 18px;
}

.bucket {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 18px 50px rgba(23, 24, 20, 0.045);
  backdrop-filter: blur(10px);
}

.bucket + .bucket {
  border-top: 1px solid var(--line);
}

.bucket-head {
  padding: 16px 18px 13px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(249, 250, 246, 0.66));
}

.bucket-kicker {
  color: var(--fire-ink);
}

.bucket-title {
  font-size: 18px;
  font-weight: 820;
}

.grid-head {
  grid-template-columns: 10px minmax(380px, 1.35fr) minmax(260px, 0.78fr) minmax(300px, 1fr);
  min-height: 34px;
  background: #f4f6f0;
  color: #60655c;
}

.hit {
  grid-template-columns: 10px minmax(380px, 1.35fr) minmax(260px, 0.78fr) minmax(300px, 1fr);
  border-top: 1px solid #eceee7;
}

.hit:hover {
  background: rgba(255, 250, 246, 0.52);
}

.hit-signal {
  width: 2px;
  margin-left: 7px;
  background: var(--fire);
}

.hit-title {
  font-size: 16px;
  font-weight: 760;
}

a.hit-title:hover {
  color: var(--fire-ink);
}

.match-field {
  color: var(--fire-ink);
}

.hit-snippet {
  color: #373b35;
  font-size: 13px;
}

.hit-snippet mark {
  background: rgba(255, 107, 26, 0.18);
  color: #281407;
}

.open-source {
  border-color: rgba(255, 107, 26, 0.28);
  background: rgba(255, 107, 26, 0.08);
  color: var(--fire-ink);
}

.open-source:hover {
  border-color: rgba(255, 107, 26, 0.52);
  background: rgba(255, 107, 26, 0.13);
}

.related-chip,
.related-empty {
  border-color: #dde2d7;
  background: #fbfcf8;
  color: #444a41;
}

.related-risk,
.related-sector,
.related-topic {
  border-color: rgba(255, 107, 26, 0.28);
  background: rgba(255, 107, 26, 0.08);
}

.empty-state,
.error {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
}

@media (max-width: 820px) {
  .shell {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding-top: 12px;
  }

  .search-stage {
    top: 8px;
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .command-search {
    grid-template-columns: minmax(0, 1fr) 40px;
    min-height: 62px;
    border-radius: 16px;
    padding-left: 18px;
  }

  #queryInput {
    font-size: 19px;
  }

  .results-shell,
  .bucket {
    width: 100%;
    max-width: 100%;
  }

  .bucket {
    border-radius: 14px;
  }

  .hit {
    grid-template-columns: 10px minmax(0, 1fr);
    padding: 14px;
  }

  .hit-signal {
    margin-left: 0;
  }

  .hit-match {
    width: min(100%, calc(100vw - 76px));
    max-width: calc(100vw - 76px);
  }
}

/* p26: Firesearch-inspired search surface, blue Cymonides variant */
:root {
  --page: #f8fbff;
  --ink: #111827;
  --paper: #ffffff;
  --paper-soft: #f8fafc;
  --muted: #6b7280;
  --muted-dark: #4b5563;
  --line: #e5e7eb;
  --line-dark: #d1d5db;
  --blue: #2563eb;
  --blue-strong: #1d4ed8;
  --blue-deep: #1e3a8a;
  --blue-soft: #dbeafe;
  --blue-wash: #eff6ff;
  --shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

html,
body {
  background:
    radial-gradient(820px 360px at 50% -70px, rgba(37, 99, 235, 0.22), rgba(191, 219, 254, 0.12) 40%, rgba(248, 251, 255, 0) 72%),
    radial-gradient(680px 340px at 8% 120px, rgba(147, 197, 253, 0.18), rgba(248, 251, 255, 0) 70%),
    radial-gradient(700px 340px at 92% 150px, rgba(59, 130, 246, 0.12), rgba(248, 251, 255, 0) 72%),
    linear-gradient(180deg, #f8fbff 0, #ffffff 310px, #f8fafc 100%);
  color: var(--ink);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.36) 0, rgba(255, 255, 255, 0.84) 48%, rgba(248, 250, 252, 0.96) 100%),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 0 1px, transparent 1px 96px);
  mask-image: linear-gradient(180deg, #000 0, rgba(0, 0, 0, 0.52) 310px, rgba(0, 0, 0, 0.16) 100%);
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  padding-top: 34px;
}

.search-stage {
  top: 16px;
  width: min(860px, 100%);
  margin-bottom: 28px;
}

.search-stage::after {
  top: 43px;
  width: min(760px, 96%);
  height: 145px;
  background:
    radial-gradient(ellipse at 50% 0, rgba(37, 99, 235, 0.18), rgba(96, 165, 250, 0.08) 42%, rgba(248, 251, 255, 0) 78%);
  filter: blur(18px);
}

.command-search {
  grid-template-columns: minmax(0, 1fr) 40px;
  min-height: 56px;
  padding: 7px 8px 7px 22px;
  border: 1px solid rgba(209, 213, 219, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.055), 0 0 0 1px rgba(255, 255, 255, 0.62) inset;
  backdrop-filter: blur(16px);
}

.command-search::before {
  display: none;
}

.command-search:focus-within {
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.12), 0 0 0 3px rgba(37, 99, 235, 0.09);
}

#queryInput {
  padding: 8px 14px 8px 0;
  color: #111827;
  font-size: 16px;
  font-weight: 500;
}

#queryInput::placeholder {
  color: #8a94a6;
  font-weight: 450;
}

#clearBtn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #ffffff;
  font-size: 21px;
  line-height: 1;
  box-shadow: 0 7px 18px rgba(37, 99, 235, 0.22);
  opacity: 0;
  transform: scale(0.88);
  pointer-events: none;
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

#clearBtn.is-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

#clearBtn:hover {
  background: var(--blue-strong);
  color: #ffffff;
  box-shadow: 0 8px 20px rgba(29, 78, 216, 0.26);
}

.search-progress {
  width: calc(100% - 42px);
  height: 2px;
  margin-top: 9px;
  background: rgba(37, 99, 235, 0.08);
}

.search-progress::after {
  left: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, #60a5fa, var(--blue), transparent);
  animation: search-line-blue 900ms cubic-bezier(0.66, 0, 0.34, 1) infinite;
}

.results-shell {
  width: 100%;
}

.buckets {
  gap: 14px;
}

.bucket {
  border: 1px solid rgba(229, 231, 235, 0.96);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
  backdrop-filter: blur(8px);
}

.bucket-head {
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.86));
}

.bucket-kicker {
  color: var(--blue-strong);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.bucket-title {
  color: #111827;
  font-size: 17px;
  font-weight: 720;
}

.bucket-count {
  color: #6b7280;
  font-size: 12px;
}

.grid-head {
  grid-template-columns: 8px minmax(350px, 1.35fr) minmax(260px, 0.78fr) minmax(300px, 1fr);
  min-height: 32px;
  background: #f8fafc;
  color: #6b7280;
  font-size: 10px;
  letter-spacing: 0.02em;
}

.hit {
  grid-template-columns: 8px minmax(350px, 1.35fr) minmax(260px, 0.78fr) minmax(300px, 1fr);
  border-top: 1px solid #edf0f3;
  background: rgba(255, 255, 255, 0.58);
}

.hit:hover {
  background: rgba(239, 246, 255, 0.46);
}

.hit-signal {
  width: 2px;
  margin-left: 5px;
  background: var(--blue);
}

.hit-c2 .hit-signal,
.hit-c3 .hit-signal,
.hit-c0 .hit-signal,
.hit-other .hit-signal {
  background: var(--blue);
}

.hit-title {
  color: #111827;
  font-size: 15px;
  font-weight: 680;
}

a.hit-title:hover {
  color: var(--blue-strong);
}

.match-field {
  color: var(--blue-strong);
  font-size: 10px;
  letter-spacing: 0.11em;
}

.hit-snippet {
  color: #374151;
  font-size: 13px;
  line-height: 1.48;
}

.hit-snippet mark {
  border-radius: 4px;
  background: rgba(147, 197, 253, 0.35);
  color: #0f172a;
}

.detail-row span,
.stand-row span {
  color: #6b7280;
}

.detail-row strong,
.stand-row strong {
  color: #1f2937;
}

.open-source {
  border-color: rgba(37, 99, 235, 0.22);
  background: rgba(239, 246, 255, 0.9);
  color: var(--blue-strong);
}

.open-source:hover {
  border-color: rgba(37, 99, 235, 0.42);
  background: #dbeafe;
  color: var(--blue-deep);
}

.related-title {
  color: #1f2937;
}

.related-chip,
.related-empty {
  border-color: #dbe2ea;
  background: #ffffff;
  color: #374151;
}

.related-risk,
.related-sector,
.related-topic {
  border-color: rgba(37, 99, 235, 0.23);
  background: rgba(239, 246, 255, 0.92);
}

.empty-state,
.error {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

@media (max-width: 820px) {
  .shell {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    padding-top: 18px;
  }

  .search-stage {
    top: 10px;
  }

  .command-search {
    grid-template-columns: minmax(0, 1fr) 38px;
    min-height: 52px;
    padding: 6px 7px 6px 18px;
  }

  #queryInput {
    font-size: 16px;
  }

  #clearBtn {
    width: 38px;
    height: 38px;
  }

  .bucket {
    border-radius: 12px;
  }

  .bucket-head {
    padding: 14px 16px;
  }

  .hit {
    grid-template-columns: 8px minmax(0, 1fr);
    padding: 14px 12px;
  }

  .hit-match {
    width: min(100%, calc(100vw - 70px));
    max-width: calc(100vw - 70px);
  }

  .hit-title {
    font-size: 15px;
  }

  .hit-snippet {
    font-size: 13px;
  }
}

@keyframes search-line-blue {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(390%);
  }
}

/* p27: square search bar variant */
.command-search {
  border-radius: 0;
  padding-left: 18px;
}

.command-search:focus-within {
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.1), 0 0 0 3px rgba(37, 99, 235, 0.08);
}

#clearBtn {
  border-radius: 0;
}

.search-stage::after {
  top: 47px;
  height: 120px;
  border-radius: 0;
}

@media (max-width: 820px) {
  .command-search {
    border-radius: 0;
    padding-left: 16px;
  }

  #clearBtn {
    border-radius: 0;
  }
}
