/* Doge Soft Explorer — search results page (serp/serp.js). Uses ledger.css tokens. */

body.serp-mode main > :not(#serp):not(#detailStage) {
  display: none !important;
}
body.serp-mode .live-rail {
  display: none;
}

.serp {
  padding: 28px 0 72px;
}
.serp[hidden] {
  display: none;
}

/* —— Bar + tabs —— */
.serp__bar {
  display: flex;
  align-items: center;
  gap: 14px;
}
.serp__back {
  flex: 0 0 auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.88rem;
}
.serp__back:hover {
  color: var(--ink);
  border-color: rgba(255, 113, 56, 0.45);
}
.serp__form {
  flex: 1;
  max-width: 720px;
}
.serp__form .search-input {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  padding: 14px 18px;
}

.serp__tabs {
  display: flex;
  gap: 4px;
  margin: 18px 0 0;
  padding-left: 96px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.serp__tabs::-webkit-scrollbar {
  display: none;
}
.stab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.92rem;
}
.stab span {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--line);
  font-size: 0.72rem;
}
.stab[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--orange);
}

/* —— Layout —— */
.serp__grid {
  display: grid;
  grid-template-columns: minmax(0, 660px) minmax(0, 360px);
  gap: 48px;
  padding-left: 96px;
  margin-top: 20px;
}
.serp__main {
  min-width: 0;
}
.serp__main > [hidden],
.serp__side[hidden] {
  display: none !important;
}
.serp__stat {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.84rem;
}
.serp__spin {
  display: inline-block;
  margin-right: 6px;
  color: var(--orange);
  font-weight: 800;
  animation: serp-spin 1.1s linear infinite;
}
@keyframes serp-spin {
  to {
    transform: rotate(360deg);
  }
}
.serp__fix {
  margin: -8px 0 18px;
  font-size: 0.95rem;
}
.serp__fix a {
  color: var(--orange);
}
.serp__h {
  margin: 0 0 12px;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 1.15rem;
}

/* —— A result —— */
.sr {
  margin: 0 0 30px;
}
.sr__src {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.sr__fav {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
}
.sr__fav img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.sr__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.sr__site {
  font-size: 0.86rem;
  font-weight: 600;
}
.sr__url {
  color: var(--muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sr__t {
  margin: 0 0 6px;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.24rem;
  font-weight: 600;
  line-height: 1.3;
}
.sr__t a {
  color: #c2410c;
  text-decoration: none;
}
[data-theme="dark"] .sr__t a {
  color: var(--yellow);
}
.sr__t a:hover {
  text-decoration: underline;
}
.sr__body {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.sr__thumb {
  display: grid;
  place-items: center;
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  overflow: hidden;
}
.sr__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}
.sr__thumb .media-ph {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--muted);
  font-weight: 800;
  font-size: 1.4rem;
}
.sr__thumb--icon svg {
  width: 30px;
  height: 30px;
  color: var(--orange);
}
.sr__snip {
  margin: 0;
  color: var(--ink);
  opacity: 0.86;
  font-size: 0.93rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.sr__snip b {
  opacity: 1;
  font-weight: 700;
}
.sr__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.sr__meta code {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 0.76rem;
}
.sr__chip {
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.sr__chip--live {
  border-color: rgba(26, 127, 90, 0.4);
  color: var(--green);
}
[data-theme="dark"] .sr__chip--live {
  color: #4ade80;
}
.sr__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
}
.sr__link {
  color: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
  opacity: 0.85;
}
.sr__link:hover {
  color: var(--orange);
  opacity: 1;
}

/* —— Sponsored (Origin plugs, builder queries only) —— */
.spon {
  margin: 0 0 30px;
  padding: 16px 18px 6px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}
.spon__h {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
}
.spon__tag {
  margin-right: 6px;
  color: var(--ink);
  font-weight: 800;
}
.sr--spon {
  margin-bottom: 20px;
}
.spon__more {
  margin: -6px 0 12px;
}

/* —— Instant answer (block) —— */
.ia {
  margin: 0 0 30px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
}
.ia__h {
  margin: 8px 0 10px;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 1.5rem;
}
.ia__v {
  margin: 8px 0 0;
}
.ia__hash {
  overflow-wrap: anywhere;
  font-size: 0.78rem;
}

/* —— People also ask —— */
.paa {
  margin: 0 0 32px;
}
.paa__i {
  border-bottom: 1px solid var(--line);
}
.paa__i:first-of-type {
  border-top: 1px solid var(--line);
}
.paa__i summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 2px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.paa__i summary::-webkit-details-marker {
  display: none;
}
.paa__i summary i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s;
}
.paa__i[open] summary i {
  transform: rotate(225deg);
}
.paa__a {
  padding: 0 2px 16px;
  font-size: 0.93rem;
}
.paa__a p {
  margin: 0 0 8px;
}
.paa__a a {
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
}

/* —— Doge Soft row, related, footer note —— */
.dsrow {
  margin: 0 0 30px;
}
.dsrow__g {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.dsrow__c {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  text-decoration: none;
  min-width: 0;
}
.dsrow__c:hover {
  border-color: rgba(255, 113, 56, 0.45);
}
.dsrow__c img {
  flex: 0 0 28px;
}
.dsrow__c span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.dsrow__c strong {
  font-size: 0.86rem;
}
.dsrow__c small {
  color: var(--muted);
  font-size: 0.74rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rel {
  margin: 0 0 26px;
}
.rel__g {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.rel__c {
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--line);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rel__c:hover {
  background: rgba(255, 113, 56, 0.16);
}
.serp__dev {
  color: var(--muted);
  font-size: 0.86rem;
}
.serp__dev a {
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
}

.serp__none {
  margin: 0 0 30px;
}
.serp__none h2 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 1.25rem;
}
.serp__none ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}
.serp__none li {
  margin: 6px 0;
}
.serp__none a {
  color: var(--orange);
}

/* —— Knowledge panel —— */
.serp__side {
  min-width: 0;
}
.kp {
  position: sticky;
  top: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.kp__art {
  margin: -6px -6px 14px;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--line);
}
.kp__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.kp__art .media-ph {
  display: grid;
  place-items: center;
  height: 100%;
  font-size: 3rem;
  font-weight: 800;
  color: var(--muted);
}
.kp__head h2 {
  margin: 0;
  font-family: "Space Grotesk", "DM Sans", sans-serif;
  font-size: 1.5rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.kp__head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.kp__head--row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.kp__head--row .sr__thumb {
  flex-basis: 56px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
}
.kp__mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--yellow);
  color: #17211b;
  font-size: 1.6rem;
  font-weight: 800;
}
.kp__p {
  margin: 12px 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
}
.kp__p a {
  color: var(--orange);
}
.kp__rows {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 14px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}
.kp__rows dt {
  color: var(--muted);
  font-weight: 600;
}
.kp__rows dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}
.kp__rows small {
  color: var(--muted);
}
.ia .kp__rows {
  border-top: 0;
  padding-top: 0;
}
.ia .kp__rows dd {
  text-align: left;
}
.kp__addr {
  padding: 0;
  border: 0;
  background: none;
  color: var(--orange);
  font-size: 0.82rem;
}
.kp__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.kp__links a,
.kp__links button {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
}
.kp__links button {
  border-color: transparent;
  background: var(--yellow);
  color: #17211b;
}
.kp__links a:hover {
  border-color: rgba(255, 113, 56, 0.5);
}

/* —— Suggest rows (hero + results bar) —— */
.search-suggest button {
  display: flex;
  align-items: center;
  gap: 10px;
}
.search-suggest button img,
.search-suggest .ss-ph {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  object-fit: cover;
}
.search-suggest .ss-ph {
  display: grid;
  place-items: center;
  background: var(--line);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}
.search-suggest .ss-l {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-suggest small {
  color: var(--muted);
  font-size: 0.72rem;
}
.search-suggest button:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: -2px;
}

/* —— Narrow screens —— */
@media (max-width: 1080px) {
  .serp__tabs,
  .serp__grid {
    padding-left: 0;
  }
  .serp__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
    gap: 28px;
  }
}
@media (max-width: 820px) {
  .serp {
    padding-top: 16px;
  }
  .serp__bar {
    gap: 8px;
  }
  .serp__back {
    padding: 12px 10px;
    font-size: 0;
  }
  .serp__back::before {
    content: "←";
    font-size: 1rem;
  }
  .serp__form.search {
    flex-direction: row;
    gap: 8px;
  }
  .serp__form .search-input {
    padding: 12px 14px;
  }
  .serp__form .search-btn {
    padding: 0 14px;
  }
  .serp__grid {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  /* The thing you searched for leads on phones; explainer panels follow the results. */
  .serp__side--entity {
    order: -1;
  }
  .kp {
    position: static;
    box-shadow: none;
  }
  .kp__art {
    aspect-ratio: 16 / 8;
  }
  .sr__thumb {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }
  .dsrow__g,
  .rel__g {
    grid-template-columns: minmax(0, 1fr);
  }
}
