/*
 * The public results page (public_results/*, layout "public_results") and
 * its switch on Your site (sites/_public_results). The page body is
 * .shell, so it reads the app's Day and Night tokens (shell.css) and the
 * shared components (ui.css: cards, labels, step nodes, the hatch, empty
 * states, buttons); this file only lays them out. Rules sit under
 * .shell .pg-results and .shell .pg-site .site-share: Propshaft links every
 * stylesheet on every page.
 */

/* ── The page ── */
.shell.res-body { overflow-x: hidden; }

.shell .pg-results {
  position: relative; min-height: 100dvh; display: flex; flex-direction: column;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  color: var(--app-ink); font-size: 15px; line-height: 1.5;
}
.shell .pg-results > *:not(.res-glow) { position: relative; z-index: 1; }
.shell .pg-results :is(a, button):focus-visible { outline: 2px solid var(--app-focus); outline-offset: 2px; border-radius: 6px; }

/* The warm light of the sign-in pages, softer by day. */
.shell .pg-results .res-glow {
  position: absolute; inset: 0 0 auto; z-index: 0; height: 560px; pointer-events: none;
  background:
    radial-gradient(42% 60% at 18% 0%, rgba(255, 106, 61, 0.11), transparent 72%),
    radial-gradient(36% 52% at 86% 0%, rgba(255, 165, 82, 0.10), transparent 72%);
}
html.dark .shell .pg-results .res-glow {
  background:
    radial-gradient(42% 60% at 18% 0%, rgba(255, 106, 61, 0.17), transparent 72%),
    radial-gradient(36% 52% at 86% 0%, rgba(255, 165, 82, 0.10), transparent 72%);
}

.shell .pg-results .res-main { display: grid; gap: 44px; width: 100%; max-width: 880px; margin: 0 auto; padding: 64px 0 32px; }

/* ── Hero: favicon, domain, since when ── */
.shell .pg-results .res-hero { display: grid; justify-items: start; min-width: 0; }
.shell .pg-results .res-fav {
  display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 22px; border-radius: 16px;
  background: #fff; box-shadow: var(--app-card-shadow);
}
.shell .pg-results .res-fav img { width: 32px; height: 32px; border-radius: 6px; object-fit: contain; }
.shell .pg-results .res-fav:has(.res-fav__letter) { background: var(--app-sheen); }
.shell .pg-results .res-fav__letter { font-family: var(--f-display); font-size: 24px; font-weight: 800; color: var(--app-on-sheen); }
.shell .pg-results .res-kicker { margin-bottom: 10px; color: var(--app-accent); }
.shell .pg-results .res-domain {
  max-width: 100%; margin: 0; font-family: var(--f-display); font-size: clamp(36px, 7.2vw, 64px); font-weight: 800;
  line-height: 1.02; letter-spacing: -0.04em; color: var(--app-ink); overflow-wrap: anywhere;
}
.shell .pg-results .res-since { display: inline-flex; align-items: center; gap: 10px; margin: 16px 0 0; font-size: 16px; color: var(--app-ink-2); }
.shell .pg-results .res-since i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--app-ember); animation: app-ping 2.4s ease-out infinite; }
.shell .pg-results .res-proof { display: inline-flex; align-items: center; gap: 7px; margin: 10px 0 0; font-size: 13.5px; font-weight: 600; color: var(--app-ink-2); }
.shell .pg-results .res-proof svg { flex: none; color: var(--app-ok); }

/* ── The ladder: four columns (five with Cited), a list on phones ── */
.shell .pg-results .res-ladder { padding: 28px 28px 26px; }
.shell .pg-results .res-ladder > .ui-label { margin-bottom: 24px; overflow-wrap: anywhere; }
.shell .pg-results .res-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.shell .pg-results .res-steps:has(> .res-step:nth-child(5)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.shell .pg-results .res-step { min-width: 0; }
.shell .pg-results .res-step__top { display: flex; align-items: center; gap: 10px; height: 18px; }
.shell .pg-results .res-step__label {
  margin: 0; font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--app-ink-2); white-space: nowrap;
}
.shell .pg-results .res-step__rung {
  flex: 1; min-width: 12px; height: 2px; margin: 0 12px 0 2px; border-radius: 2px;
  background: repeating-linear-gradient(90deg, var(--app-hair-2) 0 4px, transparent 4px 8px);
}
.shell .pg-results .res-step:has(+ .res-step.is-done) .res-step__rung { background: var(--app-sheen); }
.shell .pg-results .res-step__num { display: flex; align-items: flex-end; min-height: 52px; margin: 20px 0 0; }
.shell .pg-results .res-step__num b {
  font-family: var(--f-display); font-size: 48px; font-weight: 800; line-height: 1; letter-spacing: -0.035em;
  color: var(--app-ink); font-variant-numeric: tabular-nums;
}
.shell .pg-results .res-step__of { margin-left: 2px; font-family: var(--f-display); font-size: 18px; font-weight: 500; line-height: 1.2; color: var(--app-ink-3); font-variant-numeric: tabular-nums; }
.shell .pg-results .res-step__hatch { width: 56px; height: 44px; }
.shell .pg-results .res-step__say { margin: 10px 0 0; padding-right: 20px; font-size: 13px; line-height: 1.45; color: var(--app-ink-2); }
.shell .pg-results .res-step:not(.is-done) .res-step__say { color: var(--app-ink-3); }

/* ── Sections: flat, a hair rule under the header ── */
.shell .pg-results .res-sec { min-width: 0; }
.shell .pg-results .res-sec__head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--app-hair);
}
.shell .pg-results .res-sec__title { min-width: 0; margin: 0; font-family: var(--f-display); font-size: 19px; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; color: var(--app-ink); overflow-wrap: anywhere; }
.shell .pg-results .res-sec__meta { font-family: var(--f-mono); font-size: 11.5px; color: var(--app-ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.shell .pg-results .res-note { margin: 12px 0 0; font-size: 13px; color: var(--app-ink-3); }

/* ── Clicks from Google ── */
.shell .pg-results .res-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 20px 0 0; }
.shell .pg-results .res-total b { font-family: var(--f-display); font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--app-ink); font-variant-numeric: tabular-nums; }
.shell .pg-results .res-total span { font-size: 14px; color: var(--app-ink-2); }
.shell .pg-results .res-chart { height: 96px; margin-top: 18px; }
.shell .pg-results .res-chart svg { display: block; width: 100%; height: 96px; overflow: visible; }
.shell .pg-results .res-chart__base { stroke: var(--app-hair-2); stroke-width: 1; }
.shell .pg-results .res-chart__bar { fill: var(--app-ink-3); opacity: 0.35; }
.shell .pg-results .res-chart__bar.is-hot { fill: var(--app-ember); opacity: 1; }
.shell .pg-results .res-chart__axis { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--f-mono); font-size: 10.5px; color: var(--app-ink-3); }

/* ── Live articles ── */
.shell .pg-results .res-list { margin: 0; padding: 0; list-style: none; }
.shell .pg-results .res-item {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 24px;
  padding: 15px 0; border-bottom: 1px solid var(--app-hair);
}
.shell .pg-results .res-item__title { flex: 1 1 0%; min-width: 0; font-size: 15.5px; font-weight: 600; line-height: 1.4; color: var(--app-ink); text-decoration: none; overflow-wrap: anywhere; }
.shell .pg-results a.res-item__title svg { display: inline-block; margin-left: 6px; vertical-align: -1px; color: var(--app-ink-3); transition: color 0.15s var(--app-ease), transform 0.15s var(--app-ease); }
.shell .pg-results a.res-item__title:hover span { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.shell .pg-results a.res-item__title:hover svg { color: var(--app-accent); transform: translate(1px, -1px); }
.shell .pg-results .res-item__date { flex: none; font-family: var(--f-mono); font-size: 12px; color: var(--app-ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* An AI answer cites the site for the article's search: a line under it. */
.shell .pg-results .res-item__cited { display: inline-flex; flex-basis: 100%; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--app-ink-2); }
.shell .pg-results .res-item__cited svg { flex: none; color: var(--app-ember); }

/* ── Footer: "Made with Balzac" ── */
.shell .pg-results .res-foot {
  display: flex; justify-content: center; width: 100%; max-width: 880px; margin: auto auto 0;
  padding: 24px 0 max(32px, env(safe-area-inset-bottom));
}
.shell .pg-results .res-made {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 18px; border-radius: 99px;
  background: var(--app-surface); box-shadow: inset 0 0 0 1px var(--app-hair-2);
  color: var(--app-ink-2); font-size: 13.5px; font-weight: 500; text-decoration: none;
  transition: box-shadow 0.15s var(--app-ease), color 0.15s var(--app-ease);
}
.shell .pg-results .res-made:hover { color: var(--app-ink); box-shadow: inset 0 0 0 1px var(--app-ink-3); }
.shell .pg-results .res-made__logo { display: block; flex: none; height: auto; margin-top: 3px; color: var(--app-ink); }

/* ── A link that leads nowhere ── */
.shell .pg-results .res-main.res-gone { align-content: center; justify-items: start; gap: 0; max-width: 560px; min-height: 64dvh; }
.shell .pg-results .res-gone__tile { width: 44px; height: 44px; margin-bottom: 22px; border-radius: 12px; }
.shell .pg-results .res-gone__title { margin: 0; font-family: var(--f-display); font-size: clamp(30px, 6vw, 40px); font-weight: 800; line-height: 1.08; letter-spacing: -0.035em; color: var(--app-ink); }
.shell .pg-results .res-gone__text { margin: 14px 0 0; font-size: 16px; line-height: 1.55; color: var(--app-ink-2); }
.shell .pg-results .res-gone__btn { margin-top: 26px; }

/* ── Phones: the ladder becomes a list, the number on the right ── */
@media (max-width: 639.98px) {
  .shell .pg-results .res-main { gap: 36px; padding-top: 40px; }
  .shell .pg-results .res-fav { width: 48px; height: 48px; margin-bottom: 18px; border-radius: 14px; }
  .shell .pg-results .res-fav img { width: 28px; height: 28px; }
  .shell .pg-results .res-since { align-items: flex-start; font-size: 15px; }
  .shell .pg-results .res-since i { margin-top: 8px; }

  .shell .pg-results .res-ladder { padding: 20px 18px 6px; }
  .shell .pg-results .res-ladder > .ui-label { margin-bottom: 18px; }
  .shell .pg-results .res-steps, .shell .pg-results .res-steps:has(> .res-step:nth-child(5)) { grid-template-columns: minmax(0, 1fr); }
  .shell .pg-results .res-step {
    display: grid; grid-template-columns: 18px minmax(0, 1fr) auto;
    grid-template-areas: "node label num" "rung say num"; column-gap: 14px; align-items: center;
  }
  .shell .pg-results .res-step__top { display: contents; }
  .shell .pg-results .res-step .ui-node { grid-area: node; }
  .shell .pg-results .res-step__label { grid-area: label; }
  .shell .pg-results .res-step__rung {
    grid-area: rung; align-self: stretch; justify-self: center; width: 2px; height: auto; min-width: 0; min-height: 18px; margin: 6px 0 4px;
    background: repeating-linear-gradient(180deg, var(--app-hair-2) 0 4px, transparent 4px 8px);
  }
  .shell .pg-results .res-step:has(+ .res-step.is-done) .res-step__rung { background: var(--app-sheen-y); }
  .shell .pg-results .res-step__num { grid-area: num; align-self: start; justify-content: flex-end; min-height: 0; margin: 0; }
  .shell .pg-results .res-step__num b { font-size: 34px; }
  .shell .pg-results .res-step__hatch { width: 44px; height: 34px; }
  .shell .pg-results .res-step__say { grid-area: say; align-self: start; margin: 2px 0 0; padding: 0 0 18px; }

  .shell .pg-results .res-item { flex-direction: column; gap: 4px; }
  .shell .pg-results .res-item__title, .shell .pg-results .res-item__cited { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  .shell .pg-results *, .shell .pg-results *::before, .shell .pg-results *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* ── The switch on Your site (a side card) ── */
.shell .pg-site .site-share__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.shell .pg-site .site-share__link { display: flex; gap: 8px; margin-top: 14px; }
.shell .pg-site .site-share__link .ui-input {
  flex: 1; min-width: 0; min-height: 36px; padding: 6px 10px;
  font-family: var(--f-mono); font-size: 12px; text-overflow: ellipsis; color: var(--app-ink-2);
}
.shell .pg-site .site-share__copy { flex: none; }
.shell .pg-site .site-share__link.is-copied .site-share__copy { color: var(--app-ok); }
.shell .pg-site .site-share__actions { display: flex; flex-wrap: wrap; gap: 2px; margin: 8px -10px 0; }
.shell .pg-site .site-share__form { display: inline-flex; margin: 0; }
.shell .pg-site .site-share__opts { margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--app-hair); }
.shell .pg-site .site-share__opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0 0; }
.shell .pg-site .site-share__opt + .site-share__opt { margin-top: 12px; border-top: 1px solid var(--app-hair); }
.shell .pg-site .site-share__opt-text { display: grid; gap: 2px; min-width: 0; }
.shell .pg-site .site-share__opt-label { font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--app-ink); }
.shell .pg-site .site-share__opt-hint { font-size: 12.5px; line-height: 1.4; color: var(--app-ink-3); }
.shell .pg-site .site-share__facts { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.shell .pg-site .site-share__facts li { display: flex; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--app-ink-2); }
.shell .pg-site .site-share__facts svg { flex: none; margin-top: 2px; color: var(--app-ink-3); }
.shell .pg-site .site-share__on { margin-top: 16px; }
.shell .pg-site .site-share__next { margin-top: 12px; }
.shell .pg-site .site-share__msg { display: flex; align-items: baseline; gap: 8px; margin: 14px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--app-ink-2); }
.shell .pg-site .site-share__msg::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--app-ok); transform: translateY(-1px); }

@media (max-width: 1023.98px) {
  .shell .pg-site .site-share__link .ui-input { min-height: 44px; font-size: 16px; }
  .shell .pg-site .site-share__copy { height: 44px; }
  .shell .pg-site .site-share__actions { margin: 8px -10px 0; }
}
