.search-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 72px 16px 120px;
  overflow-y: auto;
  border: 0;
  background: transparent;
  color: var(--ink);
}
.search-dialog::backdrop {
  background: var(--scrim);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.sbox {
  overflow: hidden;
  width: min(100%, 760px);
  margin: 0 auto;
  border-radius: 14px;
  background: var(--surface);
}
.s-input {
  display: flex;
  align-items: center;
  padding: 18px 22px;
  gap: 14px;
  border-bottom: 1px solid var(--rule);
}
.s-input > .ic {
  width: 24px;
  height: 24px;
  color: var(--accent);
}
.s-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font-size: 24px;
}
.s-input input::placeholder {
  color: color-mix(in oklab, var(--muted) 62%, var(--surface));
  opacity: 1;
}

/* The field itself has no outline, so the row shows keyboard focus */
.search-dialog[data-keyboard] .s-input:focus-within { box-shadow: inset 0 -2px 0 var(--accent); }
.s-input input::-webkit-search-cancel-button { display: none; }
.x-btn {
  display: grid;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink);
  place-items: center;
}
.x-btn:hover { background: color-mix(in oklab, currentColor 10%, transparent); }
.s-meta {
  margin: 0;
  padding: 12px 22px;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}
.s-meta:empty { display: none; }
.s-group + .s-group { border-top: 1px solid var(--rule); }
.s-group h2 {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding: 18px 24px 6px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
}
.s-group h2 span:first-child { color: var(--ink); }
.s-list {
  margin: 0;
  padding: 0 10px 10px;
  list-style: none;
}

/* Text first, so titles line up whether a result has a picture or not */
.s-list a {
  display: grid;
  grid-auto-columns: auto;
  grid-auto-flow: column;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding: 12px 14px;
  gap: 18px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}
.s-list a:hover, .s-list a:focus-visible { background: var(--tint); }
.s-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.s-text {
  display: grid;
  gap: 4px;
}
.s-list .t {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  text-wrap: pretty;
}
.s-list .x {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.s-list .d {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13.5px;
}

/* The match stands out by weight, not by a box */
.s-list mark {
  padding: 0;
  background: none;
  color: inherit;
  font-weight: 700;
}
.s-list .t mark {
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--accent) 55%, transparent);
  text-decoration-thickness: 2px;
  text-underline-offset: .2em;
}
.s-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  background: var(--soft);
  object-fit: cover;
}
.s-empty { padding: 8px 22px 22px; }
.s-empty h2 {
  margin: 14px 0 10px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
}
.s-empty ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.s-empty li a {
  display: flex;
  align-items: center;
  padding: 8px 0;
  gap: 10px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  font-size: 17px;
  text-decoration: none;
}
.s-empty li a:hover { color: var(--accent); }
.s-none {
  margin: 0;
  padding: 22px;
  color: var(--ink-2);
}
.s-foot {
  display: flex;
  flex-wrap: wrap;
  padding: 14px 22px;
  gap: 20px;
  border-top: 1px solid var(--rule);
  background: color-mix(in oklab, var(--surface) 60%, var(--ground));
  color: var(--muted);
}
.s-foot span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.s-foot .all { margin-left: auto; }
@media (max-width: 860px) {
  .search-dialog { padding: 16px 10px 96px; }
  .s-input input { font-size: 20px; }
  .s-thumb {
    width: 52px;
    height: 52px;
  }
  .s-foot span { display: none; }
  .s-foot .all { margin-left: 0; }
}
