html, body {
  height: auto;
}

body {
  line-height: 1.65;
}

@font-face {
  font-family: "Manrope";
  src: url("/assets/fonts/manrope-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Shadows Into Light";
  src: url("/assets/fonts/shadows-into-light-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --display: "Manrope", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --hand: "Shadows Into Light", "Segoe Print", "Bradley Hand", cursive;
}

html {
  scroll-padding-top: 6rem;
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.1rem max(1.5rem, calc((100% - 1080px) / 2));
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease-smooth);
}

html[data-theme] .site-header {
  position: sticky;
  top: 0;
  z-index: 30;
}

html[data-theme] .site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html[data-theme] .site-header::before {
    background: var(--bg);
  }
}

.site-header.is-scrolled {
  border-bottom-color: var(--line);
}

.brand img {
  display: block;
  /* Layout box is the compact size and never changes; the large state is a
     transform-only scale (no layout work per frame, header height constant). */
  width: 96px;
  height: auto;
  transform: scale(1.5625);
  transform-origin: left center;
  transition: transform 0.2s var(--ease-smooth);
  will-change: transform;
}

.site-header.is-scrolled .brand img {
  transform: none;
}

.header-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem 1.2rem;
  margin-left: auto;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.menu-toggle {
  display: none;
  padding: 0.3rem 0.2rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
}

.menu-toggle:focus-visible {
  outline: 1px solid var(--accent-text);
  outline-offset: 3px;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
}

.site-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.6;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  background: linear-gradient(var(--accent-text), var(--accent-text)) left bottom / 0 1px no-repeat;
  transition: opacity 0.16s var(--ease-snappy), background-size 0.33s var(--ease-snappy);
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a[aria-current="page"] {
  opacity: 1;
  background-size: 100% 1px;
}

.site-nav a:focus-visible {
  outline: 1px solid var(--accent-text);
  outline-offset: 4px;
}

.site-nav a.lang {
  margin-left: 0.6rem;
  opacity: 0.6;
}

.site-nav a.lang:hover {
  opacity: 1;
}

.content {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.content.wide {
  max-width: 1080px;
  padding-top: 4rem;
}

.content h1 {
  margin: 0 0 1rem;
  font-family: var(--display);
  font-size: clamp(1.9rem, 4.8vw, 2.7rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--accent-text);
  text-wrap: balance;
}

.content h1 .h1-sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.7em;
  font-weight: 300;
  opacity: 0.85;
}

.content .lead {
  margin: 0 0 2rem;
  font-size: 1.1rem;
  opacity: 0.9;
}

.content h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--accent-text);
  text-wrap: balance;
}

.content p,
.content li {
  opacity: 0.85;
}

.content ul {
  padding-left: 1.2rem;
}

.content li {
  margin: 0.4rem 0;
}

.content a {
  color: var(--accent-text);
}

.content .eyebrow {
  margin: 0 0 0.4rem;
  font-family: var(--hand);
  font-size: 1.25rem;
  letter-spacing: 0.02em;
  color: var(--accent-text);
  opacity: 1;
}

.content article {
  counter-reset: prod;
}

.content .product {
  position: relative;
  margin-top: 3.5rem;
  padding-top: 2rem;
  counter-increment: prod;
}

.content .product::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  transform-origin: left;
}

.content .product h2 {
  margin-top: 0;
  font-family: var(--display);
  font-size: 1.45rem;
  font-weight: 300;
  letter-spacing: -0.005em;
}

.content h3 {
  margin: 1.5rem 0 0.8rem;
  font-size: 1.05rem;
  font-weight: 400;
  text-wrap: balance;
  color: var(--text);
}

.content .product h2 + h3 {
  margin-top: 0;
}

.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
}

.site-footer a {
  color: var(--text);
}

body.cookie-banner-visible .site-footer {
  padding-bottom: 4.5rem;
}

.teaser {
  max-width: 960px;
  min-height: 1.7em;
  margin: 0.9rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: var(--accent-text);
  transition: opacity 0.23s var(--ease-snappy);
}

.teaser.is-fading {
  opacity: 0;
}

@media (min-width: 700px) {
  .teaser {
    text-align: right;
  }
}

.drvn-cursor {
  --ox: 16px;
  --oy: 16px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.16s var(--ease-snappy);
}

.drvn-cursor.is-on {
  opacity: 1;
}

.drvn-cursor.is-up {
  --oy: -44px;
}

.drvn-cursor.is-left {
  --ox: calc(-100% - 16px);
}

.drvn-cursor .p {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.34rem 0.85rem;
  border: 1px solid var(--accent-text);
  border-radius: 999px;
  background: var(--pill);
  transform: translate(var(--ox), var(--oy));
}

.drvn-cursor .a {
  font-size: 0.85rem;
  line-height: 1;
  color: var(--accent-text);
}

.drvn-cursor .t {
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--text);
}

.drvn-cursor .t:empty {
  display: none;
}

html.has-cursor .teaser {
  display: none;
}

@media (hover: none), (pointer: coarse) {
  .drvn-cursor {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav a,
  .teaser,
  .drvn-cursor {
    transition: none;
  }
}

[data-cursor] {
  -webkit-tap-highlight-color: transparent;
}

.touch-pulse {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tint) 0%, var(--accent) 45%, transparent 72%);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.12s var(--ease-snappy), transform 0.12s var(--ease-snappy);
}

.touch-pulse.is-active {
  opacity: 0.6;
  transform: scale(1.6);
}

@media (prefers-reduced-motion: reduce) {
  .touch-pulse {
    transition: none;
  }
}

.content .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--bg) 30%, transparent),
    linear-gradient(to left, var(--bg) 30%, transparent) right,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.22), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.22), transparent) right;
  background-repeat: no-repeat;
  background-size: 32px 100%, 32px 100%, 12px 100%, 12px 100%;
  background-attachment: local, local, scroll, scroll;
}

.content table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.content th,
.content td {
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.content th {
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-text);
}

.content code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.85em;
  color: var(--accent-text);
}

.btn-outline {
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent-text);
  border-radius: 6px;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text);
  cursor: pointer;
  transition: background 0.16s var(--ease-snappy);
}

.btn-outline:hover {
  background: var(--tint);
}

.site-footer .company {
  margin-top: 0.4rem;
}

/* Needs guide */
.needs {
  margin: 2.5rem 0 2rem;
  border-top: 1px solid var(--line);
}

.need {
  border-bottom: 1px solid var(--line);
}

.need summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 0;
  font-size: 1.15rem;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.need summary::-webkit-details-marker {
  display: none;
}

.need summary::after {
  content: '+';
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent-text);
  transition: transform 0.21s var(--ease-snappy);
}

.need[open] summary::after {
  transform: rotate(45deg);
}

.need summary:hover span,
.need summary:focus-visible span {
  color: var(--accent-text);
}

.need summary:focus-visible {
  outline: 1px solid var(--accent-text);
  outline-offset: 4px;
}

.need-answer {
  max-width: 40rem;
  padding: 0 0 1.8rem;
  animation: need-in 0.3s var(--ease-smooth);
}

.content .need-lead {
  color: var(--text);
  font-size: 1.05rem;
}

.content .need-product {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 1.4rem 0;
}

.content .need-product a {
  padding: 0.35rem 0.95rem;
  border: 1px solid var(--accent-text);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

.content .need-product span {
  font-size: 0.9rem;
  opacity: 0.75;
}

.content .need-mail a {
  font-size: 0.9rem;
}

.cta-pill {
  display: inline-block;
  margin: 2rem 0;
  padding: 0.55rem 1.3rem;
  border: 1px solid var(--accent-text);
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  transition: background 0.16s var(--ease-snappy), color 0.16s var(--ease-snappy), transform 0.12s var(--ease-snappy), border-color 0.12s var(--ease-snappy);
}

.cta-pill:hover,
.cta-pill:focus-visible {
  background: var(--accent);
  color: var(--on-accent);
}

.cta-pill.is-pressed {
  transform: scale(0.95);
  background: var(--tint);
  border-color: var(--accent);
}

.cta-pill.is-settling {
  animation: cta-settle 0.12s var(--ease-snappy);
}

@keyframes cta-settle {
  0% { transform: scale(0.95); }
  60% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .cta-pill {
    transition: background 0.16s var(--ease-snappy), color 0.16s var(--ease-snappy), border-color 0.12s var(--ease-snappy);
  }

  .cta-pill.is-pressed {
    transform: none;
  }

  .cta-pill.is-settling {
    animation: none;
  }
}

.content .need-mail .cta-pill {
  margin: 0;
  display: inline-block;
}

.content .need-related {
  margin-top: 1.4rem;
  font-size: 0.85rem;
  opacity: 0.75;
}

@keyframes need-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .need-answer { animation: none; }
  .need summary::after { transition: none; }
}

/* Design lift: hero, product layout, cards, facts */
.content .hero {
  margin-bottom: 1rem;
}

.content.wide .hero h1 {
  font-size: clamp(2.3rem, 5.6vw, 4rem);
  line-height: 1.08;
}

.content.wide .hero .lead {
  font-size: 1.15rem;
  line-height: 1.6;
}

.content .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}

.content .facts li {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
  opacity: 1;
}

.product-body ul {
  display: grid;
  gap: 1rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: pt;
}

.product-body li {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.95rem;
  opacity: 1;
  counter-increment: pt;
  transition: background 0.21s var(--ease-snappy), border-color 0.21s var(--ease-snappy);
}

.product-body li::before {
  content: counter(pt, decimal-leading-zero);
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: var(--accent-text);
}

.product-body li:hover {
  border-color: var(--accent);
  background: var(--surface);
}

@media (min-width: 700px) {
  .product-body ul {
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  }
}

.product:not(:only-of-type) .product-head::before {
  content: counter(prod, decimal-leading-zero);
  display: block;
  margin-bottom: 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: var(--accent-text);
}

@media (min-width: 900px) {
  .content.wide .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 0 4rem;
    align-items: end;
  }

  .content.wide .hero .eyebrow {
    grid-column: 1 / -1;
  }

  .content.wide .hero .lead {
    margin: 0 0 0.6rem;
  }

  .content.wide .product {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 0 4rem;
    margin-top: 5rem;
    padding-top: 2.5rem;
  }

  .content.wide .product-head {
    position: sticky;
    top: 6rem;
    align-self: start;
  }

  .content.wide article > :not(.hero):not(.product) {
    max-width: calc(61.5% - 1.6rem);
    margin-left: auto;
  }
}

/* Motion */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.58s var(--ease-smooth), transform 0.58s var(--ease-smooth);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

.product.reveal::before {
  transform: scaleX(0);
  transition: transform 0.83s var(--ease-smooth) 0.1s;
}

.product.reveal.is-in::before {
  transform: none;
}

/* Staggered reveal: head, then body, then each list item in sequence */
.product.reveal .product-head,
.product.reveal .product-body {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s var(--ease-smooth), transform 0.5s var(--ease-smooth);
  transition-delay: var(--reveal-delay, 0ms);
}

.product.reveal .product-head.is-in,
.product.reveal .product-body.is-in {
  opacity: 1;
  transform: none;
}

.product.reveal .product-body li {
  opacity: 0;
  transform: translateY(10px);
  transition-property: opacity, transform, background, border-color;
  transition-duration: 0.5s, 0.5s, 0.25s, 0.25s;
  transition-timing-function: var(--ease-smooth), var(--ease-smooth), var(--ease-snappy), var(--ease-snappy);
  transition-delay: var(--reveal-delay, 0ms), var(--reveal-delay, 0ms), 0s, 0s;
}

.product.reveal .product-body li.is-in {
  opacity: 1;
  transform: none;
}

.glow {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 520px;
  height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 155, 109, 0.11), transparent 65%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.33s var(--ease-smooth);
}

.glow.is-on {
  opacity: 1;
}

/* Mobile menu (only when JavaScript is available) */
.brand,
.header-tools {
  position: relative;
  z-index: 2;
}

@media (max-width: 720px) {
  html[data-theme] .menu-toggle {
    display: inline-block;
  }

  html[data-theme] .site-header.has-menu .site-nav {
    display: none;
  }

  html[data-theme].menu-open {
    overflow: hidden;
  }

  html[data-theme].menu-open .site-header.has-menu .site-nav {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    background: var(--bg);
  }

  html[data-theme].menu-open .site-header.has-menu .site-nav a {
    font-size: 1.15rem;
    opacity: 1;
  }

  html[data-theme].menu-open .site-header.has-menu .site-nav a.lang {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .product.reveal::before,
  .site-header,
  .brand img,
  .product-body li,
  .product-head,
  .product-body {
    transition: none;
  }
}

/* Labels and navigation in Inter Medium */
.site-nav a,
.menu-toggle,
.content .facts li,
.product .product-head::before,
.product-body li::before {
  font-weight: 500;
}

.content .closing {
  margin: 4rem 0 1.5rem;
  font-family: var(--hand);
  font-size: 1.7rem;
  line-height: 1.3;
  color: var(--accent-text);
  opacity: 1;
}

/* Buyer situations on the needs guide: thin one-line strips */
.content .strip {
  margin: 1.6rem 0;
  font-size: 0.85rem;
  opacity: 1;
}

.content .strip-label {
  margin-right: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.content .strip a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Marknad: helhet-eller-förstärkning split, and the idea-to-business flow line */
.content .split {
  display: grid;
  gap: 1.5rem;
  margin: 3.5rem 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.content .split h3 {
  margin: 0 0 0.4rem;
}

.content .split p {
  margin: 0;
  opacity: 1;
}

@media (min-width: 640px) {
  .content .split {
    grid-template-columns: 1fr 1fr;
    gap: 0 3rem;
  }

  .content .split > div:first-child {
    border-right: 1px solid var(--line);
    padding-right: 3rem;
  }
}

.content .flow {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  opacity: 1;
}

.content .feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.content .eyebrow-line {
  margin: 3.5rem 0 0;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* Interactive tools (tools.js): hidden until JS unhides them */
.tool {
  margin: 2.5rem 0;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.tool[hidden],
.tool [hidden] {
  display: none;
}

.content .tool h2 {
  margin-top: 0;
}

.tool-form {
  display: grid;
  gap: 1rem;
  max-width: 32rem;
}

.tool-form label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
}

.tool-form input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.8rem;
  font: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--btn-border);
  border-radius: 10px;
}

.tool-form input:focus-visible {
  outline: 1px solid var(--accent-text);
  outline-offset: 2px;
}

.tool-btn,
.tool-copy,
.tool-restart {
  display: inline-block;
  padding: 0.55rem 1.3rem;
  border: 1px solid var(--accent-text);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-text);
  cursor: pointer;
  transition: background 0.16s var(--ease-snappy), color 0.16s var(--ease-snappy), transform 0.12s var(--ease-snappy);
}

.tool-btn:hover,
.tool-btn:focus-visible,
.tool-copy:hover,
.tool-copy:focus-visible {
  background: var(--accent);
  color: var(--on-accent);
}

.tool-btn:active,
.tool-copy:active {
  transform: scale(0.96);
}

.tool-btn-quiet {
  border-color: var(--btn-border);
  color: var(--text);
}

.tool-copy {
  flex: none;
  padding: 0.35rem 0.9rem;
  font-size: 0.7rem;
}

.tool-restart {
  margin-top: 1rem;
  border-color: transparent;
  padding-left: 0;
  padding-right: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tool-questions {
  padding-left: 1.2rem;
}

.tool-questions li {
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.tool-questions li > button {
  float: right;
  margin-left: 1rem;
}

.tool-out p[data-out] {
  font-size: 1.1rem;
  color: var(--text);
}

.tool-more {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9rem;
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tool-more:focus-visible {
  outline: 1px solid var(--accent-text);
  outline-offset: 3px;
}

.tool-more-fields {
  display: grid;
  gap: 1rem;
}

.tool-hint {
  font-size: 0.8rem;
  opacity: 0.75;
}

.tool-out p.tool-total {
  font-weight: 600;
}

.tl {
  max-width: 32rem;
  margin: 1.2rem 0;
}

.tl-label {
  margin: 0.8rem 0 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
}

.tl-bar {
  display: flex;
  height: 0.9rem;
  border-radius: 999px;
  overflow: hidden;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--accent-text);
}

.tl-bar .tl-seg {
  flex: none;
  transition: width 0.45s var(--ease-snappy);
}

.tl-rec {
  background: transparent;
  border: 1px dashed var(--accent-text);
  box-sizing: border-box;
}

.tl-ramp {
  background: var(--tint);
  background-image: repeating-linear-gradient(135deg, transparent 0 4px, var(--accent-text) 4px 5px);
}

.tl-bar .tl-ramp {
  border-left: 1px solid var(--accent-text);
}

.tl-go {
  background: var(--accent);
}

.tl-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  color: var(--text);
}

.tl-key {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  margin-right: 0.35rem;
  vertical-align: -0.1rem;
  border-radius: 50%;
  box-sizing: border-box;
  border: 1px solid var(--accent-text);
}

.tool-note,
.content .tool-note {
  font-size: 0.85rem;
  opacity: 0.75;
}

.tool-step {
  font-size: 1.15rem;
  color: var(--text);
  margin-top: 0;
}

.tool-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.tool-pick {
  margin: 0;
  color: var(--accent-text);
}

/* Next move chooser */
.tool-stage {
  animation: tool-in 0.28s var(--ease-snappy) both;
}

@keyframes tool-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.tool-stepno {
  margin: 0 0 0.3rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
}

.tool-step:focus {
  outline: none;
}

.tool-opts {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.tool-opt {
  display: grid;
  gap: 0.2rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.16s var(--ease-snappy), background 0.16s var(--ease-snappy), transform 0.12s var(--ease-snappy);
}

.tool-opt-label {
  font-size: 1.05rem;
  font-weight: 500;
}

.tool-opt-hint {
  font-size: 0.88rem;
  opacity: 0.75;
}

.tool-opt:hover {
  border-color: var(--accent-text);
}

.tool-opt:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
  border-color: var(--accent-text);
}

.tool-opt:active {
  transform: scale(0.99);
}

.tool-opt-quiet {
  border-style: dashed;
}

.tool-result-card {
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--accent-text);
  border-radius: 12px;
}

.tool-result-title {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  color: var(--accent-text);
}

.tool-result-lead,
.tool-result-close {
  margin: 0 0 0.6rem;
  color: var(--text);
}

.tool-result-link {
  color: var(--accent-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.needs-title {
  margin: 2rem 0 0.8rem;
  font-size: 1.1rem;
}

@media (max-width: 480px) {
  .tool {
    padding: 1.2rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tl-bar .tl-seg {
    transition: none;
  }

  .tool-stage {
    animation: none;
  }

  .tool-opt,
  .tool-opt:active {
    transition: none;
    transform: none;
  }

  .tool-btn,
  .tool-copy,
  .tool-restart {
    transition: none;
  }

  .tool-btn:active,
  .tool-copy:active {
    transform: none;
  }
}
