/* ============================================================================
   tools.css — the chrome the free tools need and pages.css does not carry.

   pages.css describes prose pages: a hero, a measure, headings, a footer. The
   tool pages are the only ones on this site that take an address and print a
   verdict, and every one of them prints it through the SAME emitter — the
   row() helper shared by /js/tool-website.js, /js/tool-robots.js and
   /js/tool-headers.js. One emitter, one stylesheet. Three near-identical
   copies of this file would be the "two stylesheets describing one idea"
   mistake pages.css's own header warns about.

   Loaded AFTER pages.css, deliberately: .prose h3 sets a 1.8em top margin and
   a 30ch measure, which is right for a heading in an essay and wrong for the
   title of a result card. Same specificity, so source order is what settles
   it. Move this link above pages.css and the result rows grow gaps.

   Every colour here is a token that tokens.css actually defines. --surface,
   --bg-sunk, --shadow, --accent-soft and --focus are referenced by pages.css
   but declared nowhere on the site, so they resolve to nothing; anything built
   on them here would have been an invisible border on a transparent card.
   ========================================================================= */

/* ------------------------------------------------------------ the question */

/* .phero and .sbody each bring their own vertical padding, and stacked they
   put ~90px of nothing between the question and the box you answer it in.
   On a tool page the field IS the page, so the body starts where the hero
   stops. p{margin:0} is pages.css's base, so the qualifying line under the
   lede needs its own gap or it sits on top of it. */
.toolbody { padding-block-start: 0; }
.phero .sub { margin-top: 14px; }

/* The address field and its button on one line, wrapping to two when the
   field can no longer hold a domain. Both are 48px tall, which is the same
   target height .btn uses, so a thumb meets the same size everywhere. */
.toolq {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.toolq input[type="text"] {
  flex: 1 1 18rem;
  min-width: 0;
  min-height: 48px;
  padding: 0 18px;
  font: inherit;
  font-size: 16px;          /* stated: below 16px iOS zooms the page on focus */
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color var(--d-1) var(--e-std);
}
.toolq input[type="text"]::placeholder { color: var(--muted); }
.toolq input[type="text"]:hover { border-color: var(--muted); }
.toolq input[type="text"]:focus { border-color: var(--accent); }

/* .go is the submit. It matches .btn-primary rather than reusing it, because
   .btn's resting background is var(--surface), which is undeclared. */
.go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  font: inherit;
  font-size: 15px;
  /* Not --fg for the ground: in the dark theme --fg IS --off-white, so this
     button became cream text on a cream pill and lost its label entirely.
     --ink is the constant dark ground the site's other primary button uses,
     and the border is --fg so the pill still has an edge against ink. */
  color: var(--off-white);
  background: var(--ink);
  border: 1px solid var(--fg);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--d-1) var(--e-std), border-color var(--d-1) var(--e-std);
}
.go:hover { background: var(--accent); border-color: var(--accent); }
.go[disabled] { opacity: .55; cursor: progress; }

/* The link back up to the hub. Kept as a component because /tools and the
   older tool shells still carry it, and because a rule that exists is
   cheaper than a page that renders an unstyled one. */
.back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.back:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------- the answer */

/* aria-live, so the rows are announced when they replace each other. The grid
   gap is the only thing separating them; the cards carry no margins of their
   own, which is what lets the emitter print one row or six without the
   spacing changing. */
.out { display: grid; gap: 10px; }
.out:empty { display: none; }

.r {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: 12px;
  padding: 16px 18px;
}
.r-pass    { border-left-color: var(--good); }
.r-warn    { border-left-color: var(--warn); }
.r-fail    { border-left-color: var(--bad); }
.r-unknown { border-left-color: var(--muted); }

/* Overrides .prose h3, which is two lines above this in the cascade. */
.r h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin: 0;
  max-width: none;
  font-size: 16.5px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--fg);
}

/* The short word above the title. It is the first thing read, so it carries
   the verdict's colour and the title stays ink. */
.tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.r-pass    .tag { color: var(--good); }
.r-warn    .tag { color: var(--warn); }
.r-fail    .tag { color: var(--bad); }
.r-unknown .tag { color: var(--muted); }

.r p {
  margin: 8px 0 0;
  max-width: none;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--body);
}
.r b { color: var(--fg); font-weight: 500; }

/* A stranger's URL has no spaces in it and will push the card wider than the
   page if it is allowed to. This is the one place on the site where
   break-anywhere is correct. */
.r code {
  font-family: var(--font-mono);
  font-size: .88em;
  color: var(--body);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .1em .38em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ------------------------------------------------------------- the caveats */

/* --surface, not --off-white-sunk: the second is a palette entry defined once
   in :root and never redefined, so this block stayed cream on the dark theme --
   a lit slab on a black page, with .note b's --fg text turning cream inside it
   and disappearing. */

/* The quieter line under a heading or a field: a qualifier, not a paragraph. */
.sub { font-size: 14.5px; color: var(--muted); max-width: 64ch; }

/* The read-next row the tool pages close with, inside <main>. Not .pfoot —
   that is the site footer and it sits outside main. */
main > .wrap footer,
.prose > footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}
.prose > footer a { color: var(--body); text-underline-offset: 3px; }
.prose > footer a:hover { color: var(--fg); }

@media (max-width: 480px) {
  .toolq .go { width: 100%; }
}
