/* Furrow: /search/. One page with two views: the starting view (a question, the composer,
   the saved answers to start from) and a result (an answer, its sources, and what to ask
   next). It stands on site.css (type, colours, the composer, sourced phrases, the scene). */

.m-page {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  overflow-x: clip;
}

.m-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* The starting view shows unless the words in the address fit one saved answer, which shows
   the result. search.js decides, and marks the root. */
.m-page > main {
  display: flex;
  flex: 1;
  flex-direction: column;
}

html:not(.has-query) .m-result,
html:not(.has-query) .m-new,
.has-query .m-home-main {
  display: none;
}

/* Topic, Depth and Speed are folded behind one button, and come out beside it when it is
   pressed. Folded, a dot on the button says one of them has been moved off its default.
   Where they take more than a row, the button that sends stays beside them, at the foot. */
.m-settings {
  display: flex;
  flex: 1 1 0%;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.m-settings ~ button {
  align-self: flex-end;
}

/* The kind of search: three radios shown as one switch, each with its sign. The chosen one is
   raised; the others are quiet until pointed at. */
.m-kind {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 230, 0.07);
}

.m-kind label {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px 0 10px;
  border-radius: 999px;
  color: var(--soft);
  font: 400 14px/1 var(--sans);
  white-space: nowrap;
  cursor: pointer;
}

/* The radio itself lies over its label, unseen, so it still takes the keyboard and the press. */
.m-kind input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.m-kind svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.m-kind label:hover {
  color: var(--fg);
}

.m-kind label:has(:checked) {
  background: var(--raised);
  box-shadow: var(--edge), 0 1px 3px rgba(0, 0, 0, 0.45);
  color: var(--fg);
}

.m-kind label:has(:checked) svg {
  color: var(--ember);
}

.m-kind label:has(:focus-visible) {
  outline: 2px solid var(--iris);
  outline-offset: 2px;
}

/* Dynamic is the kind most searches want, and on being chosen it says so, briefly: light in
   the composer's colours runs once round the edge of its pill and is gone, and its sign opens
   out. It does not stay, because the composer's own rim is already turning. The light is a
   square of colour behind the pill, with a fill laid over all but the rim. */
.m-kind .m-fav {
  isolation: isolate;
  overflow: hidden;
}

.m-kind .m-fav::before,
.m-kind .m-fav::after {
  content: "";
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.m-kind .m-fav::before {
  z-index: -2;
  top: 50%;
  left: 50%;
  width: 170%;
  aspect-ratio: 1;
  margin: -85% 0 0 -85%;
  background: conic-gradient(#FFD0B0, #FF7A5C, #F6667C, #BC46A8, #B9C2FF, #FFD0B0);
}

.m-kind .m-fav::after {
  z-index: -1;
  inset: 1.5px;
  border-radius: inherit;
  background: linear-gradient(180deg, #2E2536 0%, #231C2A 100%);
}

.m-kind .m-fav:has(:checked)::after {
  opacity: 1;
}

@media (prefers-reduced-motion: no-preference) {
  .m-kind .m-fav:has(:checked)::before {
    animation: fav-flare 0.95s cubic-bezier(0.3, 0.6, 0.2, 1) both;
  }

  .m-kind .m-fav:has(:checked) svg {
    animation: fav-open 0.6s var(--ease);
  }

  /* Arriving, an answer is laid down a few words at a time (search.js numbers them), and a
     sourced phrase comes in with its first word, so no underline stands waiting for it. */
  .m-body.is-arriving .m-w,
  .m-body.is-arriving .m-phrase {
    animation: arrive-word 0.34s ease-out both;
    animation-delay: calc(0.35s + var(--i) * 32ms);
  }

  /* Sent. The rows give way, the box is lit and gives a little under the press, and its arrow
     becomes a turning ring. */
  [data-searching] .suggest {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
  }

  [data-searching] .m-ask {
    animation: press 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  [data-searching] .m-ask::before {
    opacity: 0.3;
  }

  [data-searching] .m-ask .composer-rim::after {
    opacity: 1;
  }

  [data-searching] .m-ask button[type="submit"] {
    position: relative;
  }

  [data-searching] .m-ask button[type="submit"] span {
    opacity: 0;
  }

  [data-searching] .m-ask button[type="submit"]::after {
    content: "";
    position: absolute;
    inset: 27%;
    border: 2px solid rgba(20, 13, 18, 0.18);
    border-top-color: #140D12;
    border-radius: 50%;
    animation: turn 0.7s linear infinite;
  }

  /* The light leaves the box once: each layer comes up and goes, the next a little later and
     a little further out. Only opacity moves. */
  [data-searching] .m-bloom span {
    animation: bloom 0.56s ease-out both;
  }

  [data-searching] .m-bloom span:nth-child(2) {
    animation-delay: 0.08s;
  }

  [data-searching] .m-bloom span:nth-child(3) {
    animation-delay: 0.16s;
  }

  [data-searching] .m-bloom span:nth-child(4) {
    animation-delay: 0.24s;
  }

  /* Then the whole view lets go together, and the result fades in after it. */
  .m-home-main[data-opening] {
    opacity: 0;
    transition: opacity 0.24s ease-in;
  }
}

/* The light when a search is sent: the colours of the box's own rim, spilling out from behind
   it in hard pixels, the way the dusk behind the box is drawn. Four layers lie behind the box.
   Each shows through a window that reaches further past the box than the last (`--d`, fading
   over `--f`) and has fewer of its pixels filled (`--dots` on a `--tile`), so the colour is
   dense at the box and thins to scattered pixels away from it. */
.m-bloom {
  --px: clamp(12px, calc(50vw - 388px), 120px);
  position: absolute;
  z-index: -3;
  inset: -120px calc(0px - var(--px));
  overflow: hidden;
  pointer-events: none;
}

.m-bloom span {
  --dots: conic-gradient(from 0deg at 3px 3px, transparent 75%, #000 0);
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(100deg, #FFB08E, #FF7A5C 26%, #F6667C 50%, #BC46A8 76%, #8A5BE0);
  -webkit-mask-image:
    var(--dots),
    linear-gradient(to right, transparent calc(var(--px) - var(--d) - var(--f)), #000 calc(var(--px) - var(--d)), #000 calc(100% - var(--px) + var(--d)), transparent calc(100% - var(--px) + var(--d) + var(--f))),
    linear-gradient(to bottom, transparent calc(120px - var(--d) - var(--f)), #000 calc(120px - var(--d)), #000 calc(100% - 120px + var(--d)), transparent calc(100% - 120px + var(--d) + var(--f)));
  mask-image:
    var(--dots),
    linear-gradient(to right, transparent calc(var(--px) - var(--d) - var(--f)), #000 calc(var(--px) - var(--d)), #000 calc(100% - var(--px) + var(--d)), transparent calc(100% - var(--px) + var(--d) + var(--f))),
    linear-gradient(to bottom, transparent calc(120px - var(--d) - var(--f)), #000 calc(120px - var(--d)), #000 calc(100% - 120px + var(--d)), transparent calc(100% - 120px + var(--d) + var(--f)));
  -webkit-mask-size: var(--tile), 100% 100%, 100% 100%;
  mask-size: var(--tile), 100% 100%, 100% 100%;
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.m-bloom span:nth-child(1) {
  --dots: repeating-conic-gradient(#000 0 25%, transparent 0 50%);
  --tile: 6px 6px;
  --d: 12px;
  --f: 8px;
  --lit: 1;
}

.m-bloom span:nth-child(2) {
  --tile: 6px 6px;
  --d: 34px;
  --f: 12px;
  --lit: 0.95;
}

.m-bloom span:nth-child(3) {
  --tile: 12px 6px;
  --d: 62px;
  --f: 16px;
  --lit: 0.9;
}

.m-bloom span:nth-child(4) {
  --tile: 12px 12px;
  --d: 94px;
  --f: 20px;
  --lit: 0.85;
}

@keyframes arrive-word {
  from {
    opacity: 0;
  }
}

@keyframes bloom {
  30% {
    opacity: var(--lit);
  }
}

@keyframes press {
  28% {
    transform: scale(0.985);
  }
}

@keyframes fav-flare {
  from {
    opacity: 1;
    transform: rotate(-0.2turn);
  }

  55% {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: rotate(0.8turn);
  }
}

@keyframes fav-open {
  from {
    transform: scale(0.4) rotate(-90deg);
  }

  60% {
    transform: scale(1.25) rotate(8deg);
  }
}

.m-opts .pick[hidden] {
  display: none;
}

/* On a phone the two kinds not chosen keep their sign and give up their name. */
@media (max-width: 720px) {
  .m-kind label:not(:has(:checked)) {
    padding: 0 9px;
  }

  .m-kind label:not(:has(:checked)) span {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .m-kind label {
    transition:
      background-color 0.15s,
      color 0.15s;
  }
}

.m-more {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--soft);
  font: 400 14px/1.4 var(--sans);
  cursor: pointer;
}

.m-more:hover,
.m-more[aria-expanded="true"] {
  background: rgba(255, 244, 230, 0.09);
  color: var(--fg);
}

.m-more:active {
  transform: scale(0.97);
}

.m-more:focus-visible {
  outline-offset: 2px;
  border-radius: 999px;
}

.m-more svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.4;
}

.m-more[data-changed]::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 24px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 2px #17131D;
}

/* The three stand in the same row as their button, and wrap with it. */
.m-opts {
  display: contents;
}

.m-opts[hidden] {
  display: none;
}

/* A question's own small picture, painted by search.js as hard pixels. */
.m-orb {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 230, 0.07);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* The starting view: the question, the composer, and the saved answers listed under it. The
   composer is the horizon of the page: behind its upper edge the hero's sun is going down,
   the last light lies along that edge, and over it are the first stars. Below it there is
   no picture, only the rows.

   The composer stands a little above the middle of the window whatever is listed under it:
   `--above` is how far its middle is below the top of this block, and `--head` how tall the
   masthead over the block is. */

.m-home-main {
  --above: 284px;
  --head: 68px;
  flex: 1;
  width: 100%;
  max-width: calc(900px + 2 * var(--gutter));
  padding-top: max(12px, calc(47svh - var(--head) - var(--above)));
  text-align: center;
}

.m-title {
  font: 400 clamp(40px, 4.6vw, 64px) / 1.02 var(--display);
  letter-spacing: -0.014em;
}

.m-sub {
  margin-top: 14px;
  color: var(--body);
  font-size: 17.5px;
}

/* The sky. Its box is a line across the top of the composer, with room over it for the sun.
   The picture hangs from that line down to the composer's middle, where the composer hides
   its edge, and up past the top of the page, as wide as the window. search.js paints it
   small, and it is shown as hard pixels like the site's other pictures. */
.m-sky {
  position: relative;
  z-index: -1;
  height: 0;
  margin-top: 116px;
  pointer-events: none;
}

.m-sky canvas {
  position: absolute;
  bottom: -52px;
  left: 50%;
  width: 100vw;
  height: max(70svh, 520px);
  transform: translateX(-50%);
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

/* What the preview can answer, as plain rows under the field, each with where its answer
   comes from. They narrow as the reader types and follow the arrow keys (search.js), and each
   is a link to its own search. One highlight serves the whole list: it moves to the row the
   pointer or the keys are on (`--at` and `--tall`, set by search.js) instead of each row
   lighting on its own. */
.suggest {
  max-width: 760px;
  margin: 14px auto 0;
  text-align: left;
}

.suggest ul {
  position: relative;
  isolation: isolate;
}

.suggest ul::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: var(--tall, 0);
  border-radius: 14px;
  background: rgba(255, 244, 230, 0.075);
  opacity: 0;
  transform: translateY(var(--at, 0));
}

.suggest ul[data-lit]::before {
  opacity: 1;
}

.suggest a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px 12px 26px;
  border-radius: 14px;
  color: var(--body);
  font-size: 16.5px;
  line-height: 1.35;
  text-decoration: none;
}

.suggest svg {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--soft);
}

.suggest a:hover,
.suggest a[data-active] {
  color: var(--fg);
}

.suggest a:hover svg,
.suggest a[data-active] svg {
  --furrow-accent: var(--ember);
  color: var(--fg);
}

/* The words of a question the reader's own have reached. */
.suggest b {
  color: var(--fg);
  font-weight: 600;
}

.suggest p {
  padding: 10px 26px 0 57px;
  color: var(--soft);
  font-size: 14px;
}

.suggest p:only-child {
  padding-top: 12px;
}

/* What the box at the foot of a result has to say when it cannot answer. */
.m-none {
  color: var(--body);
  font-size: 14.5px;
}

/* The footnote, at the foot of the page: under the middle of the starting view, and under
   the answer's column on a result. */
.m-foot {
  width: 100%;
  padding-block: 28px 30px;
  color: var(--soft);
  font-size: 14px;
  text-align: center;
}

.has-query .m-foot {
  text-align: left;
}

/* A result. The question is the head of the page, so no search field repeats it up there;
   under it the answer on the left and every source it rests on, open, on the right. The one
   composer is at the foot of the answer's column. */

.m-result {
  position: relative;
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 404px);
  column-gap: clamp(40px, 5.4vw, 84px);
  align-items: start;
  width: 100%;
  padding-block: 30px 0;
}

.m-kicker {
  display: flex;
  align-items: center;
  gap: 14px;
}

.m-kicker .m-orb {
  width: 42px;
  height: 42px;
  border-radius: 11px;
}

.m-main h1 {
  margin-top: 18px;
  font: 400 clamp(38px, 4.2vw, 58px) / 1.02 var(--display);
  letter-spacing: -0.012em;
}

/* What the answer rests on, counted. */
.m-facts {
  margin-top: 16px;
  color: var(--soft);
  font: 500 12px/1.5 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.m-facts span + span::before {
  content: "·";
  margin-inline: 10px;
}

/* The answer in one line, then the rest of it. */
.m-lead {
  margin-top: 34px;
  font: 400 clamp(27px, 2.7vw, 36px) / 1.12 var(--display);
  letter-spacing: -0.008em;
}

.m-body p:not(.m-lead) {
  max-width: 33em;
  margin-top: 18px;
  color: var(--body);
  font-size: 19.5px;
  line-height: 1.7;
}

.m-how,
.m-next {
  margin-top: 56px;
}

/* How we know: the chosen phrase followed back a step at a time, down one line. */
.m-steps {
  display: grid;
  row-gap: 24px;
  margin-top: 22px;
}

.m-steps li {
  position: relative;
  display: grid;
  grid-template-columns: 8.2em minmax(0, 1fr);
  column-gap: 20px;
  padding-left: 30px;
}

.m-steps li::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 0;
  width: 11px;
  height: 11px;
  border: 2px solid var(--ember);
  border-radius: 50%;
  background: var(--bg);
}

.m-steps li:first-child::before {
  background: var(--ember);
  box-shadow: 0 0 0 4px rgba(255, 122, 92, 0.2);
}

.m-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 22px;
  bottom: -24px;
  left: 5px;
  border-left: 1px solid rgba(255, 122, 92, 0.5);
}

.m-steps .label {
  grid-row: 1 / span 2;
  padding-top: 5px;
}

.m-steps b {
  display: block;
  font: 400 22px/1.15 var(--display);
}

.m-steps span:not(.label) {
  display: block;
  margin-top: 4px;
  color: var(--soft);
  font-size: 14.5px;
  line-height: 1.45;
}

/* Ask next: questions about this answer, which are answered on this page, and then the other
   saved answers, each a row with its picture. */
.m-next ul {
  margin: 12px -14px 0;
}

.m-next ul + h2 {
  margin-top: 30px;
}

button.m-next-row {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  font-size: 17px;
  text-align: left;
  cursor: pointer;
}

/* Where a saved answer has its picture, a question about this one has a mark. */
.m-glyph {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 230, 0.07);
  color: var(--ember);
  font: 400 17px/1 var(--sans);
}

.m-next-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border-radius: 16px;
  color: var(--body);
  font-size: 17px;
  text-decoration: none;
}

.m-next-row .m-orb {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.m-next-row:hover {
  background: rgba(255, 244, 230, 0.07);
  color: var(--fg);
}

/* Where a row's answer comes from, at its far end. */
.m-from {
  flex: none;
  margin-left: auto;
  padding-left: 16px;
  color: var(--soft);
  font-size: 13.5px;
  white-space: nowrap;
}

/* A reply stands under the answer the way the answer stands on the page: what it is, the
   question, then the words with their sources marked. */
.m-turns:empty {
  display: none;
}

.m-turn {
  margin-top: 56px;
  scroll-margin-top: 28px;
}

.m-turn:focus {
  outline: 0;
}

.m-turn-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.m-turn h3 {
  margin-top: 16px;
  font: 400 clamp(26px, 2.5vw, 34px) / 1.12 var(--display);
  letter-spacing: -0.008em;
}

.m-turn .m-body p {
  margin-top: 14px;
}

.m-turn .card-links {
  margin-top: 16px;
  font-size: 14.5px;
}

/* A passage quoted in a reply. */
.m-quote {
  max-width: 33em;
  margin: 18px 0 0;
}

.m-quote blockquote {
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--ember);
  color: var(--fg);
  font-size: 17px;
  line-height: 1.55;
}

.m-quote figcaption {
  margin-top: 8px;
  padding-left: 16px;
  color: var(--soft);
  font-size: 14.5px;
}

/* The thread is there only while the sources are where they start, and not before the page
   has come to rest; see search.js. It lies in a box of its own, which the motion block uses
   to draw it in from the phrase's side. */
.m-thread-wipe {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.m-result[data-held] .thread,
.m-result:not([data-tied]) .thread {
  opacity: 0;
}

/* The sources: every one the answer cites, in the order it cites them. The one whose phrase
   is chosen is open in full and tied to it by the thread; the rest show their first lines. */
.m-rail {
  position: sticky;
  top: 28px;
}

.m-sources {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  counter-reset: source;
}

.m-source {
  position: relative;
  padding: 16px 18px 16px 46px;
  border-radius: 16px;
  background: #110E16;
  box-shadow: inset 0 0 0 1px var(--line);
  counter-increment: source;
  cursor: pointer;
}

.m-source::before {
  content: counter(source);
  position: absolute;
  top: 19px;
  left: 20px;
  color: var(--ember);
  font: 600 12px/1 var(--mono);
}

.m-source:hover {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* Pointed out by its phrase, and the phrase by it. */
.m-source[data-near] {
  box-shadow: inset 0 0 0 1px rgba(255, 122, 92, 0.38);
}

.evidence[data-near] {
  background: rgba(255, 122, 92, 0.14);
  text-decoration-style: solid;
}

/* Here a sourced phrase is words in the line, so it breaks where the line does. The dotted
   rule is under its words only, not under its number. */
.m-phrase {
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  text-decoration: none;
}

.m-words {
  text-decoration: underline dotted var(--ember) 2px;
  text-underline-offset: 0.2em;
}

.m-phrase:hover .m-words,
.m-phrase[aria-expanded="true"] .m-words,
.m-phrase[data-near] .m-words {
  text-decoration-style: solid;
}

.m-phrase sup {
  display: inline;
}

.m-source[data-active] {
  background: linear-gradient(180deg, rgba(255, 122, 92, 0.13), rgba(255, 122, 92, 0.02) 72%), #110E16;
  box-shadow: inset 0 0 0 1px rgba(255, 122, 92, 0.55);
}

/* The words of a passage that carry the phrase. */
.m-source mark,
.m-quote mark {
  margin-inline: -2px;
  padding: 1px 2px;
  border-radius: 3px;
  background: rgba(255, 122, 92, 0.18);
  color: inherit;
}

.m-source[data-active] mark {
  background: rgba(255, 122, 92, 0.34);
  color: #fff;
}

/* What can be done with an answer, straight under what it rests on: one bar of small buttons,
   each with its sign, and at the other end the choice of how the answer is seen. The row
   measures itself, so where it is short the buttons keep their signs and give up their words
   before anything has to drop to a second line. */
.m-acts {
  container-type: inline-size;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.m-tools {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 19px;
  background: rgba(0, 0, 0, 0.3);
  box-shadow: inset 0 0 0 1px rgba(255, 244, 230, 0.07);
}

.m-act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--soft);
  font: 400 14px/1 var(--sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.m-act svg {
  flex: none;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.m-act:hover {
  background: rgba(255, 244, 230, 0.09);
  color: var(--fg);
}

/* Kept, or just copied: the sign takes the ember. */
.m-act[aria-pressed="true"],
.m-act[data-done] {
  color: var(--fg);
}

.m-act[aria-pressed="true"] svg,
.m-act[data-done] svg {
  color: var(--ember);
}

.m-act[aria-pressed="true"] svg {
  fill: var(--ember);
}

.m-view-name {
  align-self: center;
  padding: 0 5px 0 12px;
  color: var(--soft);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* The answer as an agent reads it. */
.m-md {
  max-height: 62svh;
  margin: 22px 0 0;
  padding: 20px 22px;
  overflow: auto;
  border-radius: 16px;
  background: var(--well);
  box-shadow: var(--sunk);
  color: var(--body);
  font: 13px/1.7 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.m-md[hidden],
[data-as-agent] .m-body,
[data-as-agent] .m-thread-wipe {
  display: none;
}

/* In the answer's column the row is never long enough for six words and the switch, so the
   buttons are their signs, each named when pointed at. Save keeps its word, since its word
   changes, until the row is a phone's. */
@container (max-width: 800px) {
  .m-tools .m-act {
    padding: 0 10px;
  }

  .m-tools .m-act:not([data-act="save"], [data-done]) span {
    display: none;
  }
}

@container (max-width: 520px) {
  .m-tools .m-act {
    padding: 0 9px;
  }

  .m-tools .m-act:not([data-done]) span,
  .m-view-name,
  .m-view label span {
    display: none;
  }

  .m-view label {
    padding: 0 9px;
  }
}

@container (max-width: 300px) {
  .m-tools .m-act,
  .m-view label {
    padding: 0 7px;
  }
}

.m-source-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  font-size: 15px;
}

.m-source-head b {
  font-weight: 500;
}

.m-source-head span {
  color: var(--soft);
  font-size: 13px;
}

.m-source cite {
  display: block;
  margin-top: 8px;
  font: italic 400 20px/1.18 var(--display);
}

.m-source .locator {
  margin-top: 6px;
}

.m-source blockquote {
  display: -webkit-box;
  margin: 12px 0 0;
  padding-left: 12px;
  overflow: hidden;
  border-left: 2px solid var(--line-strong);
  color: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.m-source[data-active] blockquote {
  display: block;
  border-color: var(--ember);
  color: var(--fg);
  font-size: 16px;
}

.m-source-method,
.m-source .card-links {
  display: none;
}

.m-source[data-active] .m-source-method {
  display: block;
  margin-top: 12px;
  color: var(--soft);
  font-size: 14px;
  line-height: 1.5;
}

.m-source[data-active] .card-links {
  display: flex;
  margin-top: 14px;
  font-size: 14.5px;
}

/* The one composer on a result: at the foot of the answer's column, and at the foot of the
   window for as long as the answer is on it. It stands on the page's own dark, which thins
   out upward, so what scrolls under it is gone before it reaches the field. */
.m-dock {
  position: sticky;
  z-index: 5;
  bottom: 0;
  margin-top: 40px;
  padding: 36px 0 22px;
}

.m-dock::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: var(--grain), var(--bg);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 36px);
  mask-image: linear-gradient(to bottom, transparent, #000 36px);
}

.m-dock .m-none {
  margin: 0 0 10px 22px;
}

/* Docked, the composer is two short rows: the field, and under it what goes with it, with
   what the box will do on the left and its options and the button that sends on the right.
   Left alone, its rim is only the quiet band. With the options out they take a row more. */
.m-follow {
  --round: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  max-width: none;
  margin: 0;
  padding: 6px;
}

/* What the box will do with what is typed: a switch on its left, in the manner of the search
   page's modes, with both choices always in sight so nothing moves when one is taken. The
   key that also changes it is named beside them, faint until something is typed, which is
   when the key does. */
.m-does {
  flex: none;
  align-items: center;
}

.m-does kbd {
  margin: 0 9px 0 7px;
  padding: 4px 6px 3px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 244, 230, 0.14);
  color: var(--soft);
  font: 500 10.5px/1 var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.45;
}

.m-follow:not(:has(input[type="search"]:placeholder-shown)) .m-does kbd {
  opacity: 1;
}

@media (max-width: 720px) {
  /* On a phone there is no Tab to name. */
  .m-does kbd {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .m-does kbd {
    transition: opacity 0.2s;
  }
}

.m-follow input {
  order: -1;
  flex: 1 1 100%;
  width: auto;
  min-width: 0;
  padding: 10px 14px 8px;
  font-size: 17px;
}

.m-follow .composer-bar {
  margin-left: auto;
}

.m-follow .composer-bar > button {
  width: 40px;
  height: 40px;
  font-size: 19px;
}

.m-follow:not(:focus-within) .composer-rim::before {
  opacity: 0;
}

/* The box has a row for its controls, so Options is named, as on the search page. Only the
   narrowest phones have no room for the word, and there it is the sign alone. */
@media (max-width: 400px) {
  .m-follow .m-more {
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
  }

  .m-follow .m-more-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .m-follow .m-more[data-changed]::after {
    top: 8px;
    left: 25px;
  }
}

.m-follow[data-open] .composer-bar {
  flex-basis: 100%;
  margin-left: -12px;
  padding-bottom: 2px;
}

@media (max-width: 900px) {
  .m-result {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 44px;
  }

  .m-rail {
    position: static;
  }
}

@media (max-width: 720px) {
  .suggest a {
    padding: 12px 12px 12px 18px;
    font-size: 16px;
  }

  .suggest p {
    padding-inline: 18px;
  }

  /* The header keeps Pricing, and on a result only the way back to a new question. */
  .m-nav a:first-child,
  .has-query .m-nav .bar-link {
    display: none;
  }

  .m-follow {
    padding-left: 18px;
  }

  .m-sub {
    font-size: 16.5px;
  }

  .m-home-main {
    --above: 315px;
    --head: 60px;
  }

  .m-sky {
    margin-top: 88px;
  }

  .m-result {
    padding-top: 12px;
  }

  /* Each step's name goes above what it names. */
  .m-steps li {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 4px;
  }

  .m-steps .label {
    grid-row: auto;
    padding-top: 2px;
  }

  .m-from {
    display: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .m-follow:not(:focus-within) .composer-rim::before {
    animation-play-state: paused;
  }

  .m-source {
    transition:
      background-color 0.25s,
      box-shadow 0.25s;
  }

  /* The list's highlight slides from row to row; it does not slide into being. */
  .suggest ul::before {
    transition: opacity 0.15s;
  }

  .suggest ul[data-lit]::before {
    transition:
      transform 0.22s var(--ease),
      height 0.22s var(--ease),
      opacity 0.15s;
  }

  /* The sun comes up behind the composer once, each time the view is opened. The picture is
     centred by a shift of its own, which the rise keeps. */
  .m-sky canvas {
    animation: sunrise 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) backwards;
  }

  @keyframes sunrise {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(28px);
    }
  }

  /* A result's question and its picture do not arrive: coming from another result they cross
     over in place, and they must be whole when the crossing starts. */
  .m-title,
  .m-sub,
  .suggest,
  .m-main > :not(.m-kicker, h1, .m-dock),
  .m-source {
    animation: arrive 0.7s var(--ease) both;
  }

  /* Where they stand beside the answer, the sources come in from their own side of the page.
     In one column that would push them past the edge of the screen, so there they come up
     like the rest. */
  @media (min-width: 901px) {
    .m-source {
      animation-name: arrive-side;
    }
  }

  @keyframes arrive-side {
    from {
      opacity: 0;
      transform: translateX(22px);
    }
  }

  .m-turn {
    animation: arrive 0.5s var(--ease) backwards;
  }

  .m-result .thread {
    transition: opacity 0.2s;
  }

  /* Once the page has come to rest the thread is drawn from the phrase to its source. Its box
     is moved so that its right edge passes from one end of the thread to the other
     (`--from` and `--to`, set by search.js), while the thread is moved the other way inside
     it: the line stays where it is and the edge of the box uncovers it. */
  .m-result[data-tied] .m-thread-wipe {
    animation: wipe 0.55s cubic-bezier(0.45, 0, 0.25, 1) backwards;
  }

  .m-result[data-tied] .m-thread-wipe .thread {
    animation: wipe-back 0.55s cubic-bezier(0.45, 0, 0.25, 1) backwards;
  }

  @keyframes wipe {
    from {
      transform: translateX(calc(var(--from) - 100%));
    }

    to {
      transform: translateX(calc(var(--to) - 100%));
    }
  }

  @keyframes wipe-back {
    from {
      transform: translateX(calc(100% - var(--from)));
    }

    to {
      transform: translateX(calc(100% - var(--to)));
    }
  }

  /* The options come out from behind their button, one after another. */
  .m-opts .pick {
    animation: come-out 0.24s var(--ease) backwards;
  }

  .m-opts .pick:nth-child(2) {
    animation-delay: 0.04s;
  }

  .m-opts .pick:nth-child(3) {
    animation-delay: 0.08s;
  }

  @keyframes come-out {
    from {
      opacity: 0;
      transform: translateX(-8px);
    }
  }

  /* From the starting view to a result nothing travels: the search page fades once it has
     looked (see "Looking" above) and the result fades in after it. The box is kept out of the
     crossing, whatever composer.js names it. Between two results the box at the foot stays
     where it is, and the picture and the question cross over in place. */
  .m-follow {
    view-transition-name: composer;
  }

  .m-ask {
    view-transition-name: none !important;
  }

  .m-kicker .m-orb {
    view-transition-name: m-orb;
  }

  .m-main h1 {
    view-transition-name: m-question;
  }

  .m-sky canvas {
    view-transition-name: m-sky;
  }

  ::view-transition-group(m-orb),
  ::view-transition-group(m-question) {
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1);
  }

  /* The question changes face on the way: the row's words are gone early and the headline's
     come in over them, so the two are never read at once. */
  ::view-transition-old(m-question) {
    animation: 0.16s ease-in both cross-out;
  }

  ::view-transition-new(m-question) {
    animation: 0.32s 0.1s ease-out both cross-in;
  }

  /* The sun is down before the answer has come in over it. */
  ::view-transition-old(m-sky) {
    animation: 0.2s cubic-bezier(0.4, 0, 1, 1) both sunset;
  }

  /* The field's words leave without the button that clears them (search.js marks the form
     as it is sent). */
  .m-ask[data-sent] input::-webkit-search-cancel-button {
    display: none;
  }

  /* The masthead does not cross over. It is the same on both sides but for one link, and two
     of it laid over each other read as a smear, so it changes at once. */
  .m-page .site-header {
    view-transition-name: m-head;
  }

  ::view-transition-old(m-head) {
    display: none;
  }

  ::view-transition-new(m-head) {
    animation: none;
  }

  /* The search page has already faded by the time it is left, so what remains of it goes at
     once and the result fades in. */
  ::view-transition-old(root) {
    animation-duration: 0.14s;
  }

  ::view-transition-new(root) {
    animation-duration: 0.42s;
  }

  @keyframes cross-out {
    to {
      opacity: 0;
    }
  }

  @keyframes cross-in {
    from {
      opacity: 0;
    }
  }

  @keyframes sunset {
    to {
      opacity: 0;
      transform: translateY(40px);
    }
  }

  .m-sub {
    animation-delay: 0.06s;
  }

  .suggest {
    animation-delay: 0.14s;
  }

  .m-main > :nth-child(2) {
    animation-delay: 0.05s;
  }

  .m-main > :nth-child(3) {
    animation-delay: 0.1s;
  }

  .m-main > :nth-child(4) {
    animation-delay: 0.16s;
  }

  .m-main > :nth-child(n + 5) {
    animation-delay: 0.24s;
  }

  .m-source:nth-child(1) {
    animation-delay: 0.2s;
  }

  .m-source:nth-child(2) {
    animation-delay: 0.27s;
  }

  .m-source:nth-child(n + 3) {
    animation-delay: 0.34s;
  }
}
