/* Home (DESIGN-v3 §8). Loaded only on / and /en. Tokens and primitives only; no hex, no !important. */
.v4 { min-width: 0; }
.home-v3 .v4 h2 { margin: 0 0 var(--s4); }
.v4-sec, .v4-hero, .v4-qsec, .v4-fact { min-width: 0; }
.v4 > .section:first-of-type { margin-top: var(--s7); }

/* ---- hero ---- */
.v4-hero { padding: var(--s5) 0 0; }
.v4-newpill {
  display: inline-flex; align-items: center; gap: var(--s2); max-width: 100%;
  min-height: 48px; padding: var(--s2) var(--s4);
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 1rem;
}
.v4-newpill b { color: var(--link); font-weight: 700; }
.v4-newpill .v4-newt { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; min-width: 0; line-height: 1.3; }
.v4-newpill:hover { background: var(--surface-2); color: var(--ink); }
.v4-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--action); flex: none; }
.v4-hero h1 { max-width: 22ch; hyphens: manual; margin: var(--s4) 0 var(--s3); }
.home-v3 .v4-stream { margin: 0 0 var(--s5); font-size: 1.125rem; line-height: 1.55; }
@media (min-width: 701px) { .home-v3 .v4-stream { font-size: 1.25rem; } }
.v4-newpill .age { flex: none; white-space: nowrap; }
@media (min-width: 1024px) {
  .v4-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); column-gap: var(--s7); align-items: end; }
  .v4-hero > .v4-newpill { grid-column: 1 / -1; justify-self: start; }
  .v4-hero h1 { grid-column: 1; max-width: 22ch; margin-bottom: 0; }
  .v4-hero-side { grid-column: 2; }
  .home-v3 .v4-stream { margin-bottom: var(--s4); }
}
.v4-cta { display: flex; flex-wrap: wrap; gap: var(--s4); }

/* ---- topic tabs: the only topic list on the page ---- */
.v4-tabs {
  display: flex; gap: var(--s2); overflow-x: auto; margin: 0 0 var(--s5);
  padding: var(--s1) var(--s1) var(--s2); scrollbar-width: thin;
}
.v4-tabs .chip {
  flex: none; display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s4); text-decoration: none; white-space: nowrap; font-size: 1rem; font-weight: 400;
}
.v4-tabs .chip[aria-current] { font-weight: 700; }
.v4-tabs .chip:hover { background: var(--surface-2); color: var(--ink); }
.v4-hue { width: 10px; height: 10px; border-radius: 50%; background: var(--hue, var(--sky)); flex: none; }

/* ---- bento: lead + 4 cards, no holes ---- */
.v4-bento { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.v4-meta .age { font-size: 0.9rem; padding: var(--s1) var(--s3); border-radius: var(--r-s); font-weight: 700; }
.v4-lead-b h3 { margin: var(--s2) 0 var(--s3); font-family: var(--font-ui); font-weight: 700; font-size: 1.35rem; line-height: 1.25; }
.v4-lead-b h3 a { color: var(--ink); text-decoration: none; }
.v4-lead-b h3 a:hover { color: var(--link); text-decoration: underline; }
.v4-meta { margin: 0; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; font-size: 0.95rem; color: var(--ink-2); font-family: var(--font-ui); }
.v4-dvedumi {
  background: var(--sun); color: var(--on-sun); border: 2px solid var(--action-deep);
  border-radius: var(--r); box-shadow: var(--shadow-hard); padding: var(--s4); margin: var(--s4) var(--s2) var(--s5) 0;
}
.v4-dvedumi b { display: block; font-size: 0.95rem; font-weight: 700; }
.v4-dvedumi p { margin: var(--s1) 0 0; font-size: 1.125rem; line-height: 1.5; max-width: 60ch; }
.v4-vrow { margin: 0; }
.v4-tile {
  display: flex; flex-direction: column; gap: var(--s2); min-width: 0; min-height: 48px;
  color: var(--ink); text-decoration: none;
}
.v4-tile b { font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.v4-tile-foot { margin-top: auto; padding-top: var(--s2); }
.v4-tile:hover { background: var(--surface); color: var(--ink); }
.v4-tile:hover b { text-decoration: underline; }
@media (min-width: 701px) {
  .v4-bento { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .v4-bento .v4-lead-b { grid-column: 1 / -1; }
  .v4-bento[data-n="4"] .v4-lead-b { grid-column: span 6; grid-row: span 2; }
  .v4-bento[data-n="4"] .v4-tile { grid-column: span 3; }
  .v4-bento[data-n="3"] .v4-tile { grid-column: span 4; }
  .v4-bento[data-n="2"] .v4-tile { grid-column: span 6; }
  .v4-bento[data-n="1"] .v4-tile { grid-column: 1 / -1; }
}

/* ---- certainty ---- */
.v4-claim { margin: 0 0 var(--s4); display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; font-size: 1.15rem; font-weight: 700; line-height: 1.4; }
.v4-cbar { list-style: none; margin: 0 0 var(--s3); padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s1); }
.v4-cbar li { display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center; font-size: 0.9rem; line-height: 1.25; overflow-wrap: anywhere; }
.v4-cbar li i { display: grid; place-items: center; width: 100%; height: 36px; border: 1px solid var(--line); font-style: normal; font-weight: 700; color: var(--ink); }
.v4-cbar li:first-child i { border-radius: var(--r-s) 0 0 var(--r-s); }
.v4-cbar li:last-child i { border-radius: 0 var(--r-s) var(--r-s) 0; }
.v4-s1 i { background: var(--coral-soft); }
.v4-s2 i, .v4-s3 i { background: var(--ochre-soft); }
.v4-s4 i, .v4-s5 i { background: var(--leaf-soft); }
.v4-cbar .cur { font-weight: 700; }
.v4-cbar .cur i { outline: 3px solid var(--link); outline-offset: 2px; }

/* ---- what do you want ---- */
.v4-ocards { display: grid; gap: var(--s4); grid-template-columns: 1fr; }
.v4-oc { display: flex; gap: var(--s3); align-items: center; min-height: 48px; color: var(--ink); text-decoration: none; }
.v4-oc:hover { background: var(--surface); color: var(--ink); }
.v4-oc b { display: block; font-size: 1.15rem; font-weight: 700; }
.v4-oc span span { display: block; font-size: 1.125rem; color: var(--ink-2); }
.v4-ico { flex: none; color: var(--link); }
@media (min-width: 701px) { .v4-ocards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---- safety line ---- */
.v4-safe { margin: var(--s7) 0 0; font-size: 1.125rem; display: flex; gap: var(--s3); align-items: flex-start; flex-wrap: wrap; }
.v4-safe-ico { flex: none; color: var(--coral); margin-top: var(--s1); }
.v4-safe b { flex: none; }
@media (min-width: 701px) { .v4-safe { margin-top: var(--s8); } }

/* ---- which AI for what ---- */
.home-v3 .home-ai .tw { margin: 0 0 var(--s5); }
.home-ai-duo { display: grid; gap: var(--s5); grid-template-columns: 1fr; align-items: start; margin-bottom: var(--s5); }
@media (min-width: 701px) { .home-ai-duo { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: var(--s6); } }
.v4-flapcard { margin: 0; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }
.v4-flapcard .kicker { color: var(--ink-2); margin: 0; }
.v4-flap { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: var(--s1); margin: var(--s3) 0; }
.v4-fc { position: relative; aspect-ratio: 3 / 4; background: var(--action); border-radius: var(--r-s); display: grid; place-items: center; font: 700 clamp(0.7rem, 1.6vw, 0.95rem) / 1 var(--font-data); color: var(--on-action); overflow: hidden; }
.v4-fc::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--hairline); }
.v4-fc.hl { background: var(--sun); color: var(--on-sun); }
.v4-fc b { display: block; font: inherit; }
.v4-src { margin: 0; font-family: var(--font-ui); font-size: 1rem; color: var(--ink-2); }
.v4-src a { color: inherit; text-decoration: underline; display: inline-flex; align-items: center; min-height: 48px; }
.home-v3 .mc .v4-mc-n { grid-column: 1; display: flex; align-items: center; gap: var(--s3); }
.v4-mc-num { font: 700 1.25rem var(--font-data); }
.home-models { display: grid; gap: var(--s4); grid-template-columns: 1fr; margin: 0 0 var(--s5); align-items: start; }
@media (min-width: 701px) { .home-models { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.home-v3 .mc { border: 1px solid var(--line); border-radius: var(--r); box-shadow: none; background: var(--bg); }
.home-v3 .mc:hover { transform: none; background: var(--surface); }
.home-v3 .mc h3 { font-size: 1.2rem; }
.home-st { margin: var(--s4) 0 0; display: flex; gap: var(--s2); flex-wrap: wrap; }
.home-tasks-h { margin: 0 0 var(--s3); font-size: 1.15rem; color: var(--ink-2); }
.home-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.home-tasks .chip { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s4); text-decoration: none; font-size: 1rem; }
.home-tasks .chip:hover { background: var(--surface-2); color: var(--ink); }

/* ---- quiz + fact ---- */
.v4-duo { display: grid; gap: var(--s5); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 701px) { .v4-duo { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.v4-qsec, .v4-fact { padding: var(--s5); border-radius: var(--r); }
.v4-qsec h2, .v4-fact h2 { margin-bottom: var(--s3); }
.v4-slot { margin: 0 0 var(--s3); font-size: 0.95rem; color: var(--ink-2); font-family: var(--font-ui); }
.v4-qq { margin: 0 0 var(--s3); font-size: 1.1rem; font-weight: 700; }
.v4-choices { display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.v4-ch { position: relative; cursor: pointer; display: block; }
.v4-ch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.v4-cx { display: grid; gap: var(--s1); min-height: 56px; padding: var(--s3) var(--s4) var(--s3) 48px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg); position: relative; }
.v4-cx::before { content: ""; position: absolute; left: var(--s4); top: var(--s4); width: 20px; height: 20px; border: 2px solid var(--link); border-radius: 50%; background: var(--bg); }
.v4-cx small { font-size: 0.9rem; color: var(--ink-2); }
.v4-ch input:focus-visible + .v4-cx { outline: 3px solid var(--focus); outline-offset: 2px; }
.v4-ch input:checked + .v4-cx { border-color: var(--link); box-shadow: inset 0 0 0 2px var(--link); }
.v4-ch input:checked + .v4-cx::before { background: var(--action); box-shadow: inset 0 0 0 4px var(--bg); }
.v4-ch.good .v4-cx { background: var(--leaf-soft); }
.v4-ch.bad .v4-cx { background: var(--coral-soft); }
.v4-fb { min-height: 1.6em; margin: var(--s3) 0 0; font-size: 1.125rem; }
.v4-fb .v4-vd { display: inline-flex; margin-right: var(--s2); padding: var(--s1) var(--s3); border: 2px solid currentColor; border-radius: var(--r-s); font-weight: 700; }
.v4-fb .v4-vd.ok { background: var(--leaf-soft); color: var(--leaf); }
.v4-fb .v4-vd.no { background: var(--coral-soft); color: var(--coral); }
.v4-fact p { margin: 0 0 var(--s3); font-size: 1.125rem; line-height: 1.5; }
.v4-fact .v4-meta { font-size: 0.95rem; }
@media (min-width: 701px) { .v4-fact p { font-size: 1.25rem; line-height: 1.55; margin-bottom: var(--s4); } .v4-cx { min-height: 48px; padding-block: var(--s2); } .v4-choices { gap: var(--s2); } }
.v4-fact { scroll-margin-top: var(--s5); }

/* ---- fact dialog ---- */
.v4 dialog { border: 0; padding: 0; background: none; max-width: min(440px, calc(100vw - 32px)); }
.v4 dialog::backdrop { background: var(--scrim); }
.v4-dlg { background: var(--bg); color: var(--ink); border: 2px solid var(--line-accent); border-radius: var(--r); padding: var(--s5); }
.v4-dlg h2 { margin: 0 0 var(--s3); }
.v4-dlg .v4-cta { margin-top: var(--s4); }
.v4-dlg button { background: var(--action); color: var(--on-action); border-color: var(--action); }
.v4-dlg button.ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }

/* ---- changed + search ---- */
.home-v3 .today-card { padding: var(--s5); border-radius: var(--r); border: 0; }
.home-v3 .today-card h2 { margin: 0 0 var(--s3); font-family: var(--font-display); font-weight: 400; line-height: 1.2; font-size: clamp(1.5rem, 1.25rem + 1.1vw, 2.05rem); }
.home-v3 .ai-empty { margin: 0 0 var(--s4); max-width: 56ch; }
.home-v3 .today-more { margin: 0; display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; }
.home-v3 .home-search { display: grid; gap: var(--s3); grid-template-columns: 1fr; padding: var(--s5); border: 1px solid var(--line); border-radius: var(--r); }
.home-v3 .home-search label { font-weight: 700; font-size: 1.1rem; }
.home-v3 .home-search input { min-height: 48px; padding: 0 var(--s4); border: 1px solid var(--line-strong); border-radius: var(--r-s); background: var(--bg); color: var(--ink); font: 400 1rem var(--font-ui); min-width: 0; }
@media (min-width: 701px) { .home-v3 .home-search { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; } }

@media (prefers-reduced-motion: reduce) {
  .v4 *, .v4 *::before, .v4 *::after { animation: none; transition: none; }
}

/* legacy .chip adds a currentColor dot and per-topic tints; the topic hue dot is the only marker here */
.v4-tabs .chip, .home-tasks .chip { background: var(--surface); border-color: var(--line); font-weight: 400; }
.v4-tabs .chip::before, .home-tasks .chip::before { content: none; }
.v4-tabs .chip[aria-current] { background: var(--surface-2); font-weight: 700; }
.home-v3 .home-search { width: 100%; max-width: none; box-sizing: border-box; }
.v4-duo { align-items: stretch; }
.v4-qlinks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.v4-qlinks .chip { display: inline-flex; align-items: center; min-height: 48px; padding: 0 var(--s4); text-decoration: none; font-size: 1rem; }
