@font-face { font-family: "Liberation Serif"; font-weight: 400; font-display: swap; src: url(fonts/liberation-serif-regular.woff2) format("woff2"); }
@font-face { font-family: "Liberation Serif"; font-weight: 700; font-display: swap; src: url(fonts/liberation-serif-bold.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin-wght-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-weight: 100 900; font-display: swap; src: url(fonts/inter-latin-ext-wght-normal.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Xentovia brand (BRAND.md + xentovia-website --xv-* tokens) */
  --ground: #F5F6FA;      /* xv-light */
  --paper: #FFFFFF;
  --ink: #0A1128;         /* website ink */
  --stalk: #13296B;       /* Xentovia Navy: header, primary buttons, headings */
  --navy-deep: #0E2059;
  --straw: #6B2178;       /* Xentovia Purple: accent */
  --straw-soft: #E3D2EA;  /* lilac soft */
  --lilac: #C9A6D6;       /* on navy only */
  --muted: #3E4C6B;       /* Slate: secondary text */
  --line: #D9DEEA;
  /* result colours are data, not brand: kept distinct from navy/purple */
  --field: #2E6B34;       /* healthy */
  --rust: #B23A12;        /* disease */
  --amber: #9A6400;       /* not sure */
  --serif: "Liberation Serif", "Times New Roman", Times, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 16px/1.5 var(--sans); }
h1, h2, h3 { margin: 0; font-weight: 600; }
a { color: inherit; }
button, input, label.btn { font: inherit; }
:focus-visible { outline: 3px solid var(--straw); outline-offset: 2px; border-radius: 4px; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.top { background: var(--stalk); color: #fff; padding: 14px 20px 0; display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; }
@media (min-width: 900px) { .top { position: sticky; top: 0; z-index: 5; } }
.brand { display: flex; gap: 18px; align-items: center; min-width: 0; }
.logo { height: 52px; width: auto; display: block; flex: none; margin: 4px 0; }
.product-wrap { border-left: 1px solid rgba(201,166,214,.45); padding-left: 14px; min-width: 0; }
.product { font: 650 17px/1.2 var(--sans); color: #fff; }
.by { font-size: 13px; color: var(--lilac); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.by .sep { opacity: .5; margin: 0 2px; }
.controls { display: flex; gap: 10px; align-items: center; justify-self: end; }
.badge { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 6px 12px 6px 10px; border-radius: 999px; background: rgba(201,166,214,.14); color: #F1E6F5; border: 1px solid rgba(201,166,214,.5); }
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #7FD69A; box-shadow: 0 0 0 3px rgba(127,214,154,.25); }
.badge.loading .dot { animation: pulse 1.2s ease-in-out infinite; }
.badge.error { background: rgba(168,67,30,.25); border-color: #d77b58; color: #ffd9c9; }
.badge.error .dot { background: #e07650; }
@keyframes pulse { 50% { opacity: .3; } }
.lang { display: inline-flex; align-items: center; gap: 2px; border: 1.5px solid var(--lilac); border-radius: 10px; padding: 2px 2px 2px 8px; color: var(--lilac); }
.lang svg { width: 18px; height: 18px; margin-right: 4px; }
.lang button { background: transparent; color: #D9DEEA; border: 0; padding: 6px 12px; font-weight: 700; font-size: 14px; cursor: pointer; min-height: 40px; border-radius: 8px; }
.lang button[aria-pressed="true"] { background: var(--lilac); color: var(--stalk); }
.tabs { grid-column: 1 / -1; display: flex; gap: 4px; margin-top: 4px; }
.tabs button { background: none; border: 0; color: #C3CBE0; padding: 10px 16px 12px; min-height: 48px; font-weight: 650; font-size: 16px; cursor: pointer; border-bottom: 3px solid transparent; }
.tabs button[aria-selected="true"] { color: #fff; border-bottom-color: var(--lilac); }

main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 8px; }

/* ---------- scan layout ---------- */
.scan { display: grid; gap: 22px; }
@media (min-width: 900px) {
  .scan { grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr); align-items: start; gap: 32px; }
}
.hero h1 { font: 700 clamp(28px, 6vw, 38px)/1.1 var(--serif); color: var(--stalk); margin: 0 0 8px; }
.hero-line { margin: 0 0 18px; font-size: 18px; color: var(--ink); max-width: 46ch; }
.capture { display: grid; grid-template-columns: 1fr; gap: 10px; }
.uplink { justify-self: center; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; color: var(--stalk); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cam-msg { margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; background: #FFF4E0; color: #6B4500; font-size: 15px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--stalk); background: var(--paper); color: var(--stalk); font-weight: 700; font-size: 16px; cursor: pointer; text-align: center; }
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.primary { background: var(--stalk); color: #fff; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 15px; text-align: center; }

.gallery { margin-top: 22px; }
.gallery h2 { font: 700 20px/1.25 var(--serif); }
.note { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 899px) {
  .thumbs { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; margin: 0 -20px; padding-left: 20px; padding-right: 20px; scroll-padding: 0 20px; }
  .thumb { scroll-snap-align: start; }
}
.thumb { display: flex; flex-direction: column; text-align: left; padding: 0; position: relative; border: 1px solid var(--line); background: var(--paper); border-radius: 12px; overflow: hidden; cursor: pointer; color: var(--ink); }
.thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #E4E8F1; }
.thumb .pick { all: unset; display: flex; flex-direction: column; cursor: pointer; }
.thumb .pick:focus-visible { outline: 3px solid var(--straw); outline-offset: -3px; }
.thumb .lab { padding: 8px 10px 2px; font-size: 13px; line-height: 1.3; display: grid; gap: 2px; }
.srclink { display: flex; align-items: center; min-height: 44px; padding: 0 10px 4px; font-size: 12.5px; color: var(--muted); text-decoration: underline; text-decoration-color: #B8C0D6; text-underline-offset: 2px; line-height: 1.25; }
.thumb .lab b { font-weight: 700; font-size: 13.5px; }
.thumb .lab span { color: var(--muted); }
.thumb:hover { border-color: var(--straw); }
.thumb.active { border: 2px solid var(--straw); box-shadow: 0 0 0 3px rgba(107,33,120,.18); }

/* ---------- specimen sheet ---------- */
.sheet { background: var(--paper); border-radius: 6px; border: 1px solid var(--line); position: relative; padding: 18px; display: grid; gap: 18px; scroll-margin-top: 120px; box-shadow: 0 1px 0 #D9DEEA, 0 14px 30px -22px rgba(10,17,40,.4); }
.sheet:not(.empty) { grid-template-areas: "verdict" "actions" "figure" "details" "honesty" "again"; }
.sheet > .verdict { grid-area: verdict; } .sheet > .actions { grid-area: actions; } .sheet > .specimen { grid-area: figure; }
.sheet > .details { grid-area: details; } .sheet > .honesty { grid-area: honesty; margin-top: 0; } .sheet > .again { grid-area: again; }
@media (min-width: 640px) {
  .sheet:not(.empty) { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); grid-template-areas: "verdict verdict" "figure actions" "figure details" "honesty honesty" "again again"; align-items: start; }
  .sheet.tone-unsure, .sheet.tone-noleaf { grid-template-areas: "verdict verdict" "figure details" "honesty honesty" "again again"; }
}
.sheet.empty { min-height: 300px; place-items: center; text-align: center; }
.empty-state { max-width: 34ch; color: var(--muted); }
.empty-state svg { width: 64px; height: 64px; color: var(--straw); stroke-width: 1.4; }
.empty-state h2 { font: 700 22px/1.25 var(--serif); color: var(--ink); margin: 8px 0 6px; }
.empty-state p { margin: 0; }
.sheet.error .empty-state h2 { color: var(--rust); font-size: 18px; }
.sheet.busy > :not(.scanning) { opacity: .3; transition: opacity .2s; }
.scanning span::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 10px; vertical-align: -3px; border: 3px solid var(--lilac); border-top-color: var(--stalk); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scanning { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: var(--stalk); }
.scanning span { background: var(--straw-soft); padding: 8px 14px; border-radius: 999px; }

.specimen { margin: 0; }
.frame { position: relative; aspect-ratio: 1; width: 100%; background: #E4E8F1; }
.frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: auto; }
.specimen .cap { margin: 0 0 8px; font-size: 14px; display: grid; gap: 2px; }
.heatline { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.swatch { width: 34px; height: 10px; border-radius: 3px; flex: none; background: linear-gradient(90deg, #4686fb, #a2fc3c, #faba39, #e4460a, #7a0403); }

.muted { color: var(--muted); font-weight: 400; }
.slider { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; margin-top: 6px; }
.slider input { width: 100%; accent-color: var(--stalk); min-height: 44px; }
.ramp { grid-column: 2; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #30123b, #4686fb, #1ae4b6, #a2fc3c, #faba39, #e4460a, #7a0403); }

.body { display: flex; flex-direction: column; min-width: 0; }
.dname { font: 700 clamp(30px, 6.4vw, 44px)/1.05 var(--serif); letter-spacing: -.005em; color: var(--rust); }
.tone-healthy .dname { color: var(--field); }
.qtag { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 4px; background: #e2e5ea; color: #39424f; margin-bottom: 10px; }
.dname.noleaf { color: #39424f; font-size: clamp(24px, 4.6vw, 32px); line-height: 1.15; }
.dname.unsure { color: var(--amber); font-size: clamp(26px, 5.2vw, 34px); line-height: 1.12; }
.dalt { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.dalt i { font-style: italic; }
.conf { margin-top: 16px; }
.bar { height: 12px; border-radius: 6px; background: #E8EBF3; overflow: hidden; position: relative; }
.bar span { display: block; height: 100%; background: var(--rust); border-radius: 6px; }
.tone-healthy .bar span { background: var(--field); }
.tone-unsure .bar span { background: repeating-linear-gradient(-45deg, var(--amber) 0 6px, #d7a53c 6px 12px); }
.bar .th { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); }
.num { margin-top: 6px; font-size: 15px; color: var(--muted); }
.num b { color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.h3 { font: 700 13px/1.3 var(--sans); color: var(--muted); margin: 18px 0 6px; letter-spacing: .01em; }
.top3 { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.top3 li { display: grid; grid-template-columns: minmax(0, 1fr) 80px 66px; gap: 10px; align-items: center; font-size: 15px; }
.top3 .mini { height: 6px; background: #E8EBF3; border-radius: 3px; overflow: hidden; }
.top3 .mini span { display: block; height: 100%; background: var(--stalk); }
.top3 .p { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.timing { margin: auto 0 0; padding-top: 16px; font-size: 13px; color: var(--stalk); display: flex; align-items: center; gap: 8px; }
.chip { width: 10px; height: 10px; border-radius: 2px; background: var(--straw); flex: none; }

.actions { background: #F7F8FC; border: 1px solid var(--line); border-radius: 10px; padding: 4px 16px 14px; display: grid; gap: 4px 28px; }

.actions ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.actions li { display: grid; gap: 0; font-size: 16px; padding-left: 14px; position: relative; }
.actions li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; background: var(--straw); border-radius: 50%; }
.cite { display: inline-flex; align-items: center; min-height: 44px; font-size: 12.5px; color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 2px; }
.cite.own { text-decoration: none; font-style: italic; }
.guidance { margin: 10px 0 0; font-size: 13px; font-weight: 700; color: var(--amber); }

/* ---------- honesty ---------- */
.col-result.has-result > .honesty-slot { display: none; }

.honesty { margin-top: 14px; background: #F4ECF7; border-left: 5px solid var(--straw); border-radius: 0 6px 6px 0; padding: 14px 18px; }
.honesty summary { list-style: none; cursor: pointer; display: grid; gap: 4px; min-height: 44px; }
.honesty summary::-webkit-details-marker { display: none; }
.honesty .htitle { font: 700 14px/1.3 var(--sans); color: var(--stalk); }
.honesty .more { justify-self: start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--straw); text-decoration: underline; text-underline-offset: 3px; }
.honesty .m-close, .honesty[open] .m-open { display: none; }
.honesty[open] .m-close { display: inline; }
.honesty .xlink { color: var(--stalk); font-weight: 600; }
.honesty .data { color: var(--ink); }
.honesty p { margin: 6px 0 0; font-size: 14px; color: var(--muted); max-width: 72ch; }
.honesty .lead { font-size: 16px; color: var(--ink); font-weight: 500; line-height: 1.45; }

/* ---------- potential ---------- */
.pintro { font: 700 clamp(28px, 5vw, 42px)/1.1 var(--serif); max-width: 22ch; margin: 4px 0 6px; }
.psec { margin-top: 30px; }
.psec > h2 { font: 700 22px/1.2 var(--serif); padding-bottom: 8px; border-bottom: 2px solid var(--stalk); }
.grid { display: grid; gap: 12px; margin-top: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pcard { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.pcard .fig { font: 700 26px/1.1 var(--serif); color: var(--stalk); }
.pcard p { margin: 0; font-size: 14.5px; color: var(--muted); flex: 1; }
.pcard .cite { margin-top: 4px; }
.tag { align-self: flex-start; font-size: 11.5px; font-weight: 800; letter-spacing: .04em; padding: 2px 8px; border-radius: 4px; background: #E4E8F1; color: var(--stalk); }
.tag.paddy { background: #f6d9cb; color: #7d2f12; }
.tag.planned { background: var(--straw-soft); color: #571A62; }
.tag.vision { background: #DDE3F3; color: var(--stalk); }
.pcard.paddy { border-color: #ecc3ae; }
.pcard.paddy .fig { color: #7d2f12; }
.pnote { margin: 10px 0 0; font-size: 14px; font-weight: 600; color: #7d2f12; }
.poc .grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- footer ---------- */
.attrib { max-width: 1240px; margin: 34px auto 0; padding: 18px 20px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.attrib h2 { font: 700 12.5px/1.3 var(--sans); color: var(--ink); }
.attrib p { margin: 6px 0 0; max-width: 110ch; overflow-wrap: anywhere; }
.attrib .small { margin-top: 12px; }

@media (max-width: 640px) {
  .top { padding: 10px 14px 0; grid-template-columns: 1fr auto; }
  .controls { display: contents; }
  .badge { grid-column: 1 / -1; grid-row: 2; justify-self: start; font-size: 12px; padding: 4px 10px 4px 8px; }
  .lang { grid-row: 1; grid-column: 2; }
  .tabs { grid-row: 3; }
  .tabs button { padding: 8px 10px 10px; font-size: 14.5px; }
  main { padding: 16px 14px 8px; }
  .thumbs { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .product { font-size: 20px; }
  .sheet { padding: 14px; }
  .sheet { scroll-margin-top: 12px; }
  .attrib { padding: 16px 14px 32px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

.attrib .copy { margin-top: 10px; font-weight: 600; color: var(--stalk); }
@media (max-width: 640px) {
  .brand { grid-column: 1 / -1; grid-row: 1; flex-wrap: wrap; gap: 6px 12px; }
  .logo { height: 40px; }
  .lang { grid-row: 1; grid-column: 2; align-self: start; margin-top: 6px; }
  .brand { grid-column: 1; }
  .product-wrap { flex-basis: 100%; border-left: 0; padding-left: 0; display: block; }
  .product, .by { white-space: nowrap; }
  .product { font-size: 15px; }
  .btn { font-size: 15px; gap: 8px; padding: 12px 8px; white-space: nowrap; }
  .btn svg { width: 20px; height: 20px; }
}

/* ---------- result follow-up + phone readability ---------- */
.again { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.details .h3:first-child { margin-top: 0; }
.verdict .num { margin: 14px 0 6px; font-size: 16px; }
.verdict .num b { font-size: 26px; }
@media (max-width: 640px) {
  body { font-size: 17px; }
  .lang button { padding: 6px 10px; }
  .again { grid-template-columns: 1fr; }
  .top3 li, .actions li { font-size: 17px; }
  .dalt { font-size: 16px; }
  .note { font-size: 15px; }
  .hero-line { font-size: 17px; }
}

.btn .two { display: grid; text-align: left; line-height: 1.2; }
.btn .two small { font-size: 13px; font-weight: 500; opacity: .8; }
.yours { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.mini-photo { width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--line); }
.confnote { margin: 8px 0 0; font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.thkey { display: inline-block; width: 3px; height: 14px; background: var(--ink); flex: none; transform: translateY(2px); }
.cite { font-size: 13.5px; color: #33405E; text-decoration-color: #9AA5C0; }
.srclink { font-size: 13px; color: #33405E; }
.attrib { font-size: 13px; color: #33405E; }
.back { margin-top: 28px; display: flex; justify-content: center; }
.back .btn { min-width: 240px; }
@media (max-width: 640px) { .by { white-space: normal; } }
@media (pointer: fine) { .btn .two small { display: none; } }
/* inline links: 44px tall hit area without changing line layout */
.honesty .xlink, .attrib a { padding: 14px 0; }
.lang button { min-height: 44px; }
