/* AXIOM — Roast page (/roast, /roast/{slug}). Uses the theme tokens so it
   follows light and dark ([data-theme="axiom-dark"]) without overrides. */

.roast-hero, .roast-result {
  --roast-line: color-mix(in srgb, var(--color-base-content) 14%, transparent);
  --roast-muted: color-mix(in srgb, var(--color-base-content) 68%, transparent);
  --roast-hot: #ff5a1f;
  --roast-mid: #f5a524;
  --roast-good: #17b26a;
  padding: 8rem 0 4rem;
}
.roast-hero .wrap { max-width: 760px; text-align: center; }
.roast-hero h1 { font-size: clamp(32px, 5.4vw, 56px); letter-spacing: -.025em; line-height: 1.05; margin: 1rem 0; }
.roast-hero .lead { color: var(--roast-muted); max-width: 60ch; margin: 0 auto 2rem; }
.roast-badge, .roast-kicker {
  display: inline-block; font-size: 14px; font-weight: 600; padding: 6px 14px;
  border-radius: var(--radius-pill); background: color-mix(in srgb, var(--roast-hot) 12%, transparent); color: var(--roast-hot);
}
.roast-kicker { margin: 0 0 .5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.roast-search { display: flex; gap: 8px; padding: 6px; border: 1px solid var(--roast-line); border-radius: var(--radius-pill); background: var(--color-base-100); box-shadow: var(--shadow-card); }
.roast-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 18px; font-size: 17px; color: inherit; outline: none; }
.roast-search .btn { white-space: nowrap; }
.cf-turnstile { margin-top: 12px; }
.roast-msg { min-height: 1.5em; margin: 12px 0 0; color: var(--roast-muted); }
.roast-msg.is-error { color: #e5484d; }

.roast-places { list-style: none; padding: 0; margin: 8px 0 0; text-align: left; border: 1px solid var(--roast-line); border-radius: var(--radius-lg); overflow: hidden; }
.roast-places button { display: block; width: 100%; text-align: left; padding: 14px 18px; background: var(--color-base-100); border: 0; border-top: 1px solid var(--roast-line); color: inherit; cursor: pointer; font: inherit; }
.roast-places li:first-child button { border-top: 0; }
.roast-places button:hover, .roast-places button:focus-visible { background: var(--color-base-200); }
.roast-places b { display: block; }
.roast-places span { font-size: 14px; color: var(--roast-muted); }

.roast-loading { margin: 2rem 0; }
.roast-flame { font-size: 56px; animation: roast-flicker .8s ease-in-out infinite alternate; }
@keyframes roast-flicker { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.15) rotate(4deg); } }
@media (prefers-reduced-motion: reduce) { .roast-flame { animation: none; } }

.roast-points { list-style: none; padding: 0; margin: 3rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: left; }
.roast-points li { padding: 16px; border: 1px solid var(--roast-line); border-radius: var(--radius-lg); }
.roast-points b { display: block; margin-bottom: 4px; }
.roast-points span { font-size: 14px; color: var(--roast-muted); }

/* --- Result --------------------------------------------------------------- */
.roast-card { display: flex; gap: 32px; align-items: center; padding: 32px; border: 1px solid var(--roast-line); border-radius: var(--radius-lg); background: var(--color-base-100); box-shadow: var(--shadow-card); }
.roast-score {
  --c: var(--roast-hot);
  flex: none; width: 150px; height: 150px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, var(--color-base-100) 80%, transparent 81%),
              conic-gradient(var(--c) calc(var(--score) * 1%), var(--roast-line) 0);
}
.roast-score span { font-size: 48px; font-weight: 700; line-height: 1; color: var(--c); }
.roast-score small { color: var(--roast-muted); }
.roast-mid { --c: var(--roast-mid); }
.roast-good { --c: var(--roast-good); }
.roast-head h1 { font-size: clamp(26px, 4vw, 40px); margin: 0; letter-spacing: -.02em; }
.roast-address { color: var(--roast-muted); margin: 4px 0 0; }
.roast-verdict { font-size: 20px; font-weight: 600; margin: 16px 0 0; }

.roast-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 24px; }
.roast-burns, .roast-breakdown, .roast-plan { padding: 28px; border: 1px solid var(--roast-line); border-radius: var(--radius-lg); }
.roast-result h2 { font-size: 22px; margin: 0 0 16px; }
.roast-burns ol { margin: 0; padding-left: 1.2em; display: grid; gap: 12px; }
.roast-burns li::marker { content: "🔥 "; }
.roast-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; font-size: 14px; }
.roast-share .btn { padding: 8px 14px; font-size: 14px; }

.roast-bar { margin-bottom: 12px; }
.roast-bar-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.roast-bar-track { height: 8px; border-radius: 4px; background: var(--roast-line); overflow: hidden; }
.roast-bar-track i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }

.roast-plan { margin-top: 24px; scroll-margin-top: 110px; }
.roast-teaser { color: var(--roast-muted); margin-top: -4px; }
.roast-ok { padding: 12px 16px; border-radius: 10px; background: color-mix(in srgb, var(--roast-good) 14%, transparent); }
.roast-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.roast-steps li { display: flex; gap: 16px; }
.roast-steps p { margin: 4px 0 0; color: var(--roast-muted); }
.roast-num { flex: none; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }

.roast-locked { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.roast-blur { filter: blur(5px); user-select: none; opacity: .7; }
.roast-form { padding: 24px; border-radius: var(--radius-lg); background: var(--color-base-200); }
.roast-lock { font-weight: 700; font-size: 18px; margin: 0 0 12px; }
.roast-roles { border: 0; padding: 0; margin: 0 0 16px; }
.roast-roles legend { font-weight: 600; margin-bottom: 6px; }
.roast-roles label { display: block; padding: 4px 0; cursor: pointer; }
.roast-form .btn { width: 100%; }
.roast-fine { font-size: 13px; color: var(--roast-muted); margin-top: 10px; }

.roast-next { display: flex; gap: 24px; align-items: center; justify-content: space-between; margin-top: 24px; padding: 20px 24px; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--brand) 10%, transparent); }
.roast-next p { margin: 4px 0 0; color: var(--roast-muted); }
.roast-next .btn { flex: none; }
.roast-again { text-align: center; margin-top: 32px; font-weight: 600; }
.roast-disclaimer { text-align: center; }

@media (max-width: 760px) {
  .roast-hero, .roast-result { padding-top: 6.5rem; }
  .roast-hero .wrap, .roast-result .wrap { padding: 0 16px; }
  .roast-search { flex-direction: column; border-radius: var(--radius-lg); }
  .roast-search input { padding: 12px; }
  .roast-points, .roast-grid, .roast-locked { grid-template-columns: 1fr; }
  .roast-card { flex-direction: column; text-align: center; padding: 24px; }
  .roast-burns, .roast-breakdown, .roast-plan { padding: 20px; }
  .roast-locked .roast-blur { display: none; }
  .roast-next { flex-direction: column; align-items: stretch; }
}

/* Radios + consent box: undo the full-width text-input styling of .contact-form. */
.roast-form input[type=radio], .roast-form input[type=checkbox] { width: auto; height: auto; min-height: 0; margin: 0; padding: 0; flex: none; accent-color: var(--brand); }
.roast-roles label, .roast-form .checkbox-line { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.roast-form .checkbox-line { align-items: flex-start; }
.roast-form .checkbox-line input { margin-top: 3px; }

/* --- Mobile: app shell ------------------------------------------------------
   Below 760px the roast pages drop the site chrome (nav, footer, WhatsApp
   bubble) and behave like a native app: app bar, bottom actions, tab bar. */
.roast-appbar, .roast-tabs, .roast-unlock-pill { display: none; }

@media (max-width: 760px) {
  body:has(.roast-app) > nav,
  body:has(.roast-app) #footer,
  body:has(.roast-app) .wa-fab { display: none; }
  body:has(.roast-app) { background: var(--color-base-200); overscroll-behavior-y: none; }
  .roast-app { min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
  .roast-app button, .roast-app .btn, .roast-app a { touch-action: manipulation; }
  .roast-app .btn:active, .roast-places button:active, .roast-tabs button:active { transform: scale(.97); }

  .roast-appbar {
    position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
    padding: calc(6px + env(safe-area-inset-top)) 8px 6px; min-height: 56px;
    background: color-mix(in srgb, var(--color-base-100) 82%, transparent);
    backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--roast-line, rgba(0,0,0,.08));
  }
  .roast-appbar-title { text-align: center; font-weight: 700; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .roast-appbar-icon, .roast-appbar-logo {
    width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: inherit;
    font-size: 26px; line-height: 1; text-decoration: none; border-radius: 50%; cursor: pointer;
  }
  .roast-appbar-logo svg, .roast-appbar-logo img { width: 24px; height: 24px; }
  .roast-appbar-icon:active { background: var(--color-base-200); }

  /* Landing: full-screen screen, primary action in the thumb zone. */
  .roast-hero, .roast-result { padding: 20px 0 calc(110px + env(safe-area-inset-bottom)); }
  .roast-hero .wrap { text-align: left; display: flex; flex-direction: column; }
  .roast-hero h1 { font-size: 34px; margin: 14px 0 10px; }
  .roast-hero .lead { margin: 0 0 20px; font-size: 16px; }
  .roast-badge { align-self: flex-start; }
  .roast-search { flex-direction: column; padding: 0; border: 0; box-shadow: none; background: none; }
  .roast-hero .roast-search input {
    padding: 0 16px; height: 56px; flex: none; font-size: 17px; border-radius: 14px;
    background: var(--color-base-100); border: 1px solid var(--roast-line); box-shadow: var(--shadow-card);
  }
  .roast-hero .roast-search input:focus { border-color: var(--brand); }
  .roast-search .btn, .roast-unlock-pill {
    position: fixed; z-index: 40; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
    height: 54px; border-radius: 16px; font-size: 17px; font-weight: 700; box-shadow: 0 10px 30px rgba(7, 86, 214, .35);
  }
  .roast-places { border-radius: 14px; background: var(--color-base-100); }
  .roast-places button { padding: 16px; position: relative; padding-right: 40px; }
  .roast-places button::after { content: "›"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 24px; color: var(--roast-muted); }
  .roast-points { display: flex; grid-template-columns: none; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 28px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
  .roast-points::-webkit-scrollbar { display: none; }
  .roast-points li { flex: 0 0 72%; scroll-snap-align: start; background: var(--color-base-100); }

  .roast-loading {
    position: fixed; inset: 0; z-index: 50; margin: 0; display: grid; place-content: center; text-align: center; gap: 12px;
    background: var(--color-base-100); padding: 24px;
  }
  .roast-loading[hidden] { display: none; }
  .roast-flame { font-size: 84px; }
  .roast-loading p { font-size: 18px; font-weight: 600; }

  /* Result: cards on a grey canvas, one tab visible at a time. */
  .roast-card, .roast-burns, .roast-breakdown, .roast-plan { background: var(--color-base-100); border: 0; border-radius: 20px; box-shadow: var(--shadow-card); }
  .roast-grid { gap: 12px; margin-top: 12px; }
  .roast-plan { margin-top: 12px; }
  .roast-score { width: 132px; height: 132px; }
  .roast-share .btn { flex: 1 1 40%; }

  .roast-app .rv { opacity: 1; transform: none; }
  .roast-app.tabs-on [data-tab] { display: none; }
  .roast-app.tabs-on[data-active="roast"] [data-tab="roast"],
  .roast-app.tabs-on[data-active="score"] [data-tab="score"],
  .roast-app.tabs-on[data-active="plan"] [data-tab="plan"] { display: block; }
  .roast-app.tabs-on[data-active="roast"] .roast-card[data-tab] { display: flex; }
  .roast-app.tabs-on .roast-grid { display: block; }
  .roast-app.tabs-on .roast-grid > [data-tab] + [data-tab] { margin-top: 12px; }
  .roast-app.tabs-on [data-tab] { animation: roast-in .22s ease-out; }
  @keyframes roast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

  .roast-app.tabs-on .roast-tabs {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--color-base-100) 88%, transparent);
    backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--roast-line, rgba(0,0,0,.08));
  }
  .roast-tabs button {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 50px;
    border: 0; background: none; color: var(--roast-muted, inherit); font: inherit; font-size: 12px; font-weight: 600; border-radius: 12px; cursor: pointer;
  }
  .roast-tabs button span { font-size: 22px; filter: grayscale(1); opacity: .6; }
  .roast-tabs button[aria-current="page"] { color: var(--brand); }
  .roast-tabs button[aria-current="page"] span { filter: none; opacity: 1; }

  .roast-app.tabs-on .roast-unlock-pill { display: block; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--brand); color: #fff; border: 0; cursor: pointer; }
  .roast-app.tabs-on[data-active="plan"] .roast-unlock-pill { display: none; }
  .roast-app.tabs-on .roast-result { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .roast-app.tabs-on [data-tab] { animation: none; }
}
