.search {
  position: relative;
  overflow: visible;
  transition: box-shadow .24s ease, transform .24s ease, background .24s ease;
}

body.search-view { overflow: hidden; }
body.search-view .topbar {
  position: relative;
  z-index: 151;
  box-shadow: 0 1px 0 rgba(16, 58, 47, .12);
}
body.search-view .topbar .search {
  background: #fff;
  box-shadow: 0 12px 34px rgba(14, 52, 42, .12), inset 0 0 0 1px rgba(18, 75, 61, .1);
  transform: translateY(1px);
}
body.search-view .topbar .search input { color: #102f27; }

.global-search-page {
  --search-green: #114d3f;
  --search-deep: #0c382f;
  --search-gold: #bc8a37;
  position: fixed;
  inset: 74px 0 0;
  z-index: 150;
  overflow: auto;
  overscroll-behavior: contain;
  background: radial-gradient(circle at 91% 4%, rgba(188, 138, 55, .09), transparent 27rem), linear-gradient(180deg, #f4f5f1 0, #f8f5ee 100%);
  color: var(--ink, #142d26);
  opacity: 0;
  transform: translateY(14px);
}
.global-search-page[hidden] { display: none !important; }
body.search-view .global-search-page { display: block; animation: globalSearchEnter .34s cubic-bezier(.22, .74, .18, 1) forwards; }
body.search-closing .global-search-page { animation: globalSearchLeave .18s ease forwards; pointer-events: none; }
@keyframes globalSearchEnter {
  from { opacity: 0; transform: translateY(14px); clip-path: inset(0 0 5% 0 round 18px); }
  to { opacity: 1; transform: translateY(0); clip-path: inset(0 round 0); }
}
@keyframes globalSearchLeave {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}

.global-search-workspace {
  width: min(1480px, calc(100% - 72px));
  min-height: 100%;
  margin: 0 auto;
  padding: 42px 0 72px;
}
.global-search-header {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(220px, 300px);
  gap: 30px;
  align-items: end;
  padding: 0 0 30px;
  border-bottom: 1px solid rgba(20, 52, 43, .16);
}
.global-search-back {
  align-self: start;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid rgba(17, 77, 63, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  color: var(--search-deep);
  font: 700 13px/1 var(--sans, Arial, sans-serif);
  cursor: pointer;
  transition: color .16s ease, background .16s ease, transform .16s ease;
}
.global-search-back span:first-child { font-size: 18px; line-height: 1; }
.global-search-back:hover, .global-search-back:focus-visible {
  background: var(--search-deep);
  color: #fff;
  outline: none;
  transform: translateX(-2px);
}
.global-search-intro .eyebrow { margin: 0 0 10px; color: #8a692f; font-size: 11px; letter-spacing: .18em; }
.global-search-intro h1 {
  max-width: 850px;
  margin: 0;
  color: #102f27;
  font: 500 clamp(34px, 4vw, 58px)/1.03 var(--serif, Georgia, serif);
  letter-spacing: -.035em;
}
.global-search-intro > p:last-child { max-width: 780px; margin: 16px 0 0; color: #5d6f68; font-size: 14px; line-height: 1.55; }
.global-search-summary { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-left: 3px solid var(--search-gold); background: rgba(255, 253, 249, .67); }
.global-search-summary strong { color: var(--search-deep); font: 700 16px/1.2 var(--sans, Arial, sans-serif); }
.global-search-summary span { color: #708078; font-size: 11px; line-height: 1.45; }

.global-search-filters {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 0;
  background: linear-gradient(180deg, #f4f5f1 78%, rgba(244, 245, 241, 0));
  scrollbar-width: none;
}
.global-search-filters::-webkit-scrollbar { display: none; }
.global-search-filters button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 0 14px;
  border: 1px solid #cbd5d0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: #40574f;
  font: 700 11px/1 var(--sans, Arial, sans-serif);
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.global-search-filters button span { display: grid; min-width: 19px; height: 19px; place-items: center; padding: 0 5px; border-radius: 999px; background: #eef2ef; color: #66766f; font-size: 9px; }
.global-search-filters button:hover, .global-search-filters button:focus-visible { border-color: var(--search-green); color: var(--search-green); outline: none; }
.global-search-filters button.active { border-color: var(--search-green); background: var(--search-green); color: #fff; }
.global-search-filters button.active span { background: rgba(255, 255, 255, .15); color: #fff; }

.global-search-results { min-height: min(560px, calc(100vh - 310px)); padding-top: 6px; }
.global-search-welcome, .global-search-empty, .global-search-error {
  min-height: 430px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 48px;
  border: 1px dashed #c9d2cd;
  border-radius: 18px;
  background: rgba(255, 253, 249, .68);
  text-align: center;
}
.global-search-welcome > span, .global-search-empty > span, .global-search-error > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: 50%;
  background: #e4ece7;
  color: var(--search-green);
  font: 400 25px/1 Georgia, serif;
}
.global-search-welcome .eyebrow { margin: 0 0 10px; color: #8a692f; }
.global-search-welcome h2, .global-search-empty h2, .global-search-error h2 { margin: 0; color: #13382f; font: 500 30px/1.15 var(--serif, Georgia, serif); }
.global-search-welcome > p:last-of-type, .global-search-empty p, .global-search-error p { max-width: 600px; margin: 12px auto 0; color: #697a72; font-size: 13px; line-height: 1.6; }
.global-search-welcome > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.global-search-welcome > div span { padding: 8px 11px; border: 1px solid #d8ded9; border-radius: 999px; color: #53665e; font: 700 10px/1 var(--sans, Arial, sans-serif); }

.global-search-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-bottom: 40px; }
.search-result-group {
  align-self: start;
  overflow: hidden;
  border: 1px solid #d5dcd7;
  border-top: 3px solid var(--group-accent, var(--search-green));
  border-radius: 14px;
  background: rgba(255, 253, 249, .94);
  box-shadow: 0 16px 38px rgba(22, 53, 44, .06);
  animation: searchGroupEnter .34s both;
  animation-delay: calc(var(--group-index, 0) * 35ms);
}
@keyframes searchGroupEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.search-result-group[data-kind="judgment"] { --group-accent: #bc8a37; }
.search-result-group[data-kind="post"], .search-result-group[data-kind="event"] { --group-accent: #527364; }
.search-result-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 20px 22px 15px; border-bottom: 1px solid #e4e7e3; }
.search-result-heading h2 { margin: 0; color: #173b31; font: 500 22px/1.15 var(--serif, Georgia, serif); }
.search-result-heading span { color: #8e6c32; font: 800 9px/1 var(--sans, Arial, sans-serif); letter-spacing: .12em; text-transform: uppercase; }
.search-result-list { display: grid; padding: 5px 10px 10px; }
.search-result-item {
  width: 100%;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 24px;
  gap: 13px;
  align-items: center;
  min-height: 72px;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid #e8e9e5;
  border-radius: 9px;
  background: transparent;
  color: #263a32;
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.search-result-item:last-child { border-bottom: 0; }
.search-result-item:hover, .search-result-item.active, .search-result-item:focus-visible { background: #edf2ee; outline: none; transform: translateX(2px); }
.search-result-icon { width: 46px; height: 46px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: #e2ebe5; color: var(--search-green); font: 700 15px/1 Georgia, serif; }
.search-result-icon.person { border-radius: 50%; background-position: center; background-size: cover; }
.search-result-icon.judgment { background: #f5ead7; color: #916622; }
.search-result-copy { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.search-result-copy strong, .search-result-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-copy strong { color: #17372e; font: 700 12px/1.35 var(--sans, Arial, sans-serif); }
.search-result-copy small { color: #728079; font: 400 10px/1.35 var(--sans, Arial, sans-serif); }
.search-result-kind { color: #8b9a93; font: 400 19px/1 Georgia, serif; }

.global-search-skeleton { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.global-search-skeleton section { min-height: 250px; padding: 24px; border: 1px solid #d8ded9; border-top: 3px solid #d3b77f; border-radius: 14px; background: #fffdfa; }
.global-search-skeleton i { display: block; height: 14px; margin-bottom: 20px; border-radius: 999px; background: linear-gradient(90deg, #e8ece8 20%, #f6f7f4 48%, #e8ece8 75%); background-size: 220% 100%; animation: searchShimmer 1.25s infinite linear; }
.global-search-skeleton i:first-child { width: 34%; }
.global-search-skeleton i:nth-child(2) { width: 92%; height: 58px; }
.global-search-skeleton i:nth-child(3) { width: 80%; height: 58px; }
@keyframes searchShimmer { to { background-position: -220% 0; } }
.global-search-help { margin: 14px 0 0; color: #809088; font-size: 10px; text-align: center; }

@media (max-width: 1050px) {
  .global-search-workspace { width: min(100% - 36px, 980px); padding-top: 30px; }
  .global-search-header { grid-template-columns: auto minmax(0, 1fr); }
  .global-search-summary { grid-column: 2; }
}
@media (max-width: 720px) {
  body.search-view .topbar .brand, body.search-view .topbar .topnav { display: none; }
  body.search-view .topbar { grid-template-columns: 1fr; padding-inline: 12px; }
  body.search-view .topbar .search { width: 100%; }
  .global-search-page { inset: 64px 0 0; }
  .global-search-workspace { width: calc(100% - 24px); padding: 22px 0 48px; }
  .global-search-header { grid-template-columns: 1fr; gap: 18px; padding-bottom: 22px; }
  .global-search-back { min-height: 38px; }
  .global-search-intro h1 { font-size: 34px; }
  .global-search-intro > p:last-child { font-size: 12px; }
  .global-search-summary { grid-column: 1; }
  .global-search-filters { margin-inline: -12px; padding-inline: 12px; }
  .global-search-grid, .global-search-skeleton { grid-template-columns: 1fr; }
  .global-search-welcome, .global-search-empty, .global-search-error { min-height: 380px; padding: 30px 18px; }
  .search-result-heading { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .global-search-page, body.search-view .global-search-page, body.search-closing .global-search-page, .search-result-group, .global-search-skeleton i { animation: none !important; transition: none !important; transform: none !important; }
  body.search-view .global-search-page { opacity: 1; }
}

/* One subtle focus treatment around the complete search control. */
.topbar .search:focus-within{border-color:#a1b1a9!important;outline:2px solid #b2bfb8!important;outline-offset:2px;box-shadow:none!important}
#globalSearch:focus,#globalSearch:focus-visible{outline:none!important;box-shadow:none!important;border-color:transparent!important}
@media(forced-colors:active){.topbar .search:focus-within{outline-color:Highlight!important}}

/* Keep the search workspace usable independently of the compact mobile header. */
@media(max-width:820px){
 body.search-view .topbar{display:flex!important;height:64px!important;min-height:64px;padding:8px 12px!important;gap:0!important}
 body.search-view .topbar .brand,body.search-view .topbar .topnav{display:none!important}
 body.search-view .topbar .search,body.search-view .topbar .search:focus-within{position:relative!important;inset:auto!important;display:flex!important;flex:1 1 auto!important;width:100%!important;min-width:0!important;max-width:none!important;height:44px!important;padding:0 10px!important;transform:none;justify-content:flex-start;background:#fff}
 body.search-view .topbar #globalSearch{width:100%!important;min-width:0!important;flex:1!important;padding:0 8px!important;opacity:1!important;pointer-events:auto!important;font-size:16px!important}
 body.search-view .topbar .search kbd{display:none!important}
 body.search-view .global-search-page{inset:64px 0 0!important}
 .global-search-workspace{width:calc(100% - 24px);padding:12px 0 calc(24px + env(safe-area-inset-bottom))}
 .global-search-header{grid-template-columns:minmax(0,1fr);gap:12px;padding-bottom:14px}
 .global-search-back{min-height:44px;font-size:12px}
 .global-search-intro .eyebrow{font-size:10px;margin-bottom:8px}
 .global-search-intro h1{font-size:28px;line-height:1.12;letter-spacing:-.025em}
 .global-search-intro>p:last-child{font-size:13px;line-height:1.5;margin-top:10px}
 .global-search-summary{grid-column:1;padding:10px 12px;gap:4px}
 .global-search-summary strong{font-size:14px}
 .global-search-summary span{font-size:11px;overflow-wrap:anywhere}
 .global-search-filters{max-width:calc(100% + 24px);margin-inline:-12px;padding:12px;gap:6px}
 .global-search-filters button{min-height:44px;font-size:11px;padding-inline:12px}
 .global-search-results{min-height:0;padding-top:0}
 .global-search-grid,.global-search-skeleton{grid-template-columns:minmax(0,1fr);gap:12px;padding-bottom:12px}
 .global-search-welcome,.global-search-empty,.global-search-error{min-height:0;padding:24px 16px;border-radius:12px}
 .global-search-welcome>span,.global-search-empty>span,.global-search-error>span{width:42px;height:42px;margin-bottom:12px;font-size:22px}
 .global-search-welcome .eyebrow{font-size:10px;line-height:1.5}
 .global-search-welcome h2,.global-search-empty h2,.global-search-error h2{font-size:23px}
 .global-search-welcome>p:last-of-type,.global-search-empty p,.global-search-error p{font-size:12px;overflow-wrap:anywhere}
 .global-search-welcome>div{gap:6px;margin-top:16px}
 .search-result-heading{padding:14px;gap:8px}
 .search-result-heading h2{font-size:20px}
 .search-result-item{grid-template-columns:36px minmax(0,1fr) 16px;gap:9px;padding:10px 4px}
 .search-result-icon{width:36px;height:36px}
 .search-result-copy strong,.search-result-copy small{white-space:normal;overflow-wrap:anywhere}
 .search-result-copy strong{font-size:12px}
 .global-search-help{display:none}
}
@media(max-width:820px){body.search-view .topbar .search svg{position:static!important;transform:none!important;width:20px;height:20px;flex:0 0 20px}}
