:root {
    --rapid-background: #050906;
    --rapid-surface: #09110b;
    --rapid-surface-elevated: #0d1810;
    --rapid-green: #6fc83a;
    --rapid-green-bright: #9aff52;
    --rapid-text: #f4f7ef;
    --rapid-text-muted: #91a093;
    --rapid-warning: #dda23f;
    --rapid-danger: #db6659;
    --rapid-border: rgba(144, 190, 118, .16);
    --rapid-radius: 15px;
    --rapid-shadow: 0 18px 54px rgba(0, 0, 0, .34);
    --rapid-glow: 0 0 28px rgba(126, 255, 65, .18);
}

.rapid-ai-page {
    min-height: 100dvh;
    overflow-x: hidden;
    background:
      radial-gradient(760px 420px at 50% -190px, rgba(72, 151, 43, .17), transparent 72%),
      linear-gradient(180deg, #030605, var(--rapid-background) 55%, #040805);
    color: var(--rapid-text);
  }

  .rapid-ai-header { border-color: var(--rapid-border); background: rgba(3, 7, 4, .94); backdrop-filter: blur(16px); }
  .rapid-ai-owner-banner { border-color: rgba(123, 229, 67, .2); background: #08130a; color: var(--rapid-green-bright); }
  .rapid-ai-shell { border-color: var(--rapid-border); border-radius: 20px; background: var(--rapid-surface); box-shadow: var(--rapid-shadow); }
  .rapid-ai-rail { border-color: var(--rapid-border); background: #060c08; }
  .rapid-ai-rail li { border-color: var(--rapid-border); }
  .rapid-ai-stage { min-height: min(860px, calc(100dvh - 126px)); }
  .rapid-ai-stage > header { max-width: 720px; margin-bottom: clamp(1.5rem, 4vw, 2.75rem); }
  .rapid-ai-stage h1,
  .rapid-ai-stage h2 { max-width: 900px; font-size: clamp(2.7rem, 6vw, 5.8rem); line-height: .88; letter-spacing: -.045em; }
  .rapid-ai-stage > header > p:last-child { max-width: 620px; color: var(--rapid-text-muted); font-size: clamp(.9rem, 1.3vw, 1.05rem); line-height: 1.65; }
  .rapid-ai-kicker { color: var(--rapid-green-bright); }

  .rapid-upload-core { --rapid-upload-progress: 0deg; display: grid; width: min(260px, 70vw); aspect-ratio: 1; margin: 0 auto 2.25rem; place-items: center; }
  .rapid-upload-ring {
    position: relative; display: grid; width: 100%; height: 100%; place-content: center; justify-items: center; border-radius: 50%;
    background:
      radial-gradient(circle at 50% 50%, #08110a 0 56%, transparent 57%),
      conic-gradient(var(--rapid-green-bright) var(--rapid-upload-progress), rgba(102, 144, 83, .15) 0);
    box-shadow: inset 0 0 28px rgba(132, 255, 74, .12), var(--rapid-glow);
    transition: background .25s ease;
  }
  .rapid-upload-ring::before,
  .rapid-upload-ring::after { content: ""; position: absolute; border: 1px solid rgba(151, 255, 97, .18); border-radius: 50%; inset: 8%; }
  .rapid-upload-ring::after { inset: 17%; border-style: dashed; animation: rapid-spin 18s linear infinite reverse; }
  .rapid-upload-ring > span { display: grid; width: 47px; height: 47px; margin-bottom: 8px; place-items: center; border-radius: 50%; background: rgba(126, 255, 65, .09); color: var(--rapid-green-bright); font-size: 1.7rem; }
  .rapid-upload-ring strong { font: 800 clamp(1.6rem, 5vw, 2.4rem)/1 Inter, sans-serif; }
  .rapid-upload-ring small { margin-top: 7px; color: var(--rapid-text-muted); font: 650 .67rem Inter, sans-serif; }
  .rapid-photo-tip { display: flex; align-items: center; gap: 11px; margin: 18px 0 4px; padding: 13px 15px; border: 1px solid var(--rapid-border); border-radius: 12px; background: rgba(19, 40, 20, .5); color: var(--rapid-text-muted); font-size: .75rem; }
  .rapid-photo-tip strong { color: var(--rapid-green-bright); font-size: .61rem; letter-spacing: .12em; }
  .rapid-ai-photo { animation: rapid-photo-in .24s ease both; }
  .rapid-ai-preparation-status { min-height: 1.4em; margin: 8px 0; color: var(--rapid-green-bright); font: 650 .72rem/1.4 "IBM Plex Mono", monospace; }
  .rapid-ai-photo--failed { display: grid; min-height: 150px; padding: 14px; align-content: space-between; border: 1px solid rgba(255, 139, 92, .55); background: rgba(75, 24, 12, .45); }
  .rapid-ai-photo--failed strong,.rapid-ai-photo--failed small { display: block; }
  .rapid-ai-photo--failed small { margin-top: 7px; color: var(--rapid-text-muted); line-height: 1.45; }
  .rapid-ai-photo--failed > div:last-child { display: flex; gap: 8px; }
  .rapid-ai-photo--failed button { position: static; width: auto; height: auto; padding: 8px 12px; border: 1px solid var(--rapid-border); background: #142317; color: var(--rapid-text); }

  .rapid-analysis-stage > header { margin-inline: auto; text-align: center; }
  .rapid-analysis-layout { display: grid; grid-template-columns: minmax(270px, .9fr) minmax(340px, 1.1fr); gap: clamp(24px, 5vw, 72px); align-items: center; max-width: 1120px; margin: 0 auto; }
  .rapid-analysis-hero { display: grid; justify-items: center; text-align: center; }
  .rapid-analysis-hero > small { color: #617064; font: 500 .62rem/1.5 "IBM Plex Mono", monospace; }
  .rapid-ai-analysis-note { min-height: 2.6em; margin: 20px 0 4px; color: var(--rapid-text); font: 700 .75rem/1.4 "IBM Plex Mono", monospace; letter-spacing: .02em; }

  .rapid-energy-core { container-type: inline-size; position: relative; display: grid; width: clamp(220px, 28vw, 330px); aspect-ratio: 1; place-items: center; isolation: isolate; }
  .rapid-energy-core::before,
  .rapid-energy-core::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
  .rapid-energy-core::before { inset: 19%; z-index: -1; background: radial-gradient(circle, rgba(92, 255, 48, .14), rgba(10, 27, 12, .1) 48%, transparent 72%); box-shadow: 0 0 55px rgba(88, 255, 43, .17); animation: rapid-breathe 3.4s ease-in-out infinite; }
  .rapid-energy-core::after { inset: 6%; z-index: -2; border: 1px solid rgba(133, 255, 77, .06); box-shadow: inset 0 0 36px rgba(97, 233, 45, .05); }
  .rapid-energy-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 7px rgba(106, 255, 55, .32)); }
  .energy-orbit,
  .energy-arc { fill: none; vector-effect: non-scaling-stroke; transform-origin: 120px 120px; }
  .energy-orbit { stroke: var(--rapid-green-bright); stroke-width: 1.2; opacity: .58; filter: url(#rapid-energy-glow); }
  .energy-orbit--outer { stroke-dasharray: 2 8 18 7; animation: rapid-spin 15s linear infinite; }
  .energy-orbit--mid { stroke-width: 1.7; stroke-dasharray: 34 8 5 12; animation: rapid-spin 9s linear infinite reverse; }
  .energy-orbit--inner { stroke-width: .8; stroke-dasharray: 3 5; opacity: .42; animation: rapid-spin 22s linear infinite; }
  .energy-arc { stroke: #b3ff7d; stroke-width: 1.35; stroke-linecap: round; opacity: .8; }
  .energy-arc--one { stroke-dasharray: 30 14 5 40; animation: rapid-dash 4.6s linear infinite, rapid-spin 18s linear infinite; }
  .energy-arc--two { stroke-dasharray: 22 34 7 18; animation: rapid-dash 3.8s linear infinite reverse, rapid-spin 13s linear infinite reverse; }
  .energy-arc--three { stroke-dasharray: 12 26 41 18; animation: rapid-dash 5.4s linear infinite, rapid-spin 24s linear infinite; }
  .rapid-energy-centre { display: grid; grid-template-columns: minmax(0, 1fr); width: 48%; aspect-ratio: 1; align-content: center; justify-items: center; border: 1px solid rgba(151, 255, 97, .14); border-radius: 50%; background: radial-gradient(circle, rgba(15, 35, 17, .84), rgba(4, 11, 6, .96)); box-shadow: inset 0 0 24px rgba(113, 255, 58, .08); text-align: center; }
  .rapid-energy-centre small { color: var(--rapid-green-bright); font: 700 .55rem "IBM Plex Mono", monospace; letter-spacing: .12em; }
  .rapid-energy-centre strong { width: 94%; margin-top: 7px; color: var(--rapid-text); font: 850 clamp(.95rem, 8.5cqw, 1.65rem)/1 Inter, sans-serif; letter-spacing: -.04em; overflow-wrap: normal; word-break: normal; white-space: nowrap; }
  .rapid-energy-core.is-medium-text .rapid-energy-centre strong { font-size: clamp(.82rem, 7cqw, 1.4rem); }
  .rapid-energy-core.is-long-text .rapid-energy-centre strong { font-size: clamp(.68rem, 5.3cqw, 1.05rem); }
  .energy-particle { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #c9ff9e; box-shadow: 0 0 8px #75ff38; }
  .particle-one { top: 15%; left: 49%; animation: rapid-particle-a 5s ease-in-out infinite; }
  .particle-two { right: 13%; top: 46%; animation: rapid-particle-b 6s ease-in-out infinite .8s; }
  .particle-three { bottom: 17%; left: 36%; animation: rapid-particle-a 7s ease-in-out infinite 1.4s; }
  .particle-four { left: 15%; top: 37%; animation: rapid-particle-b 4.5s ease-in-out infinite 2s; }
  .rapid-energy-core.is-idle .energy-orbit,
  .rapid-energy-core.is-complete .energy-orbit { opacity: .42; animation-duration: 24s; }
  .rapid-energy-core.is-finalising { transform: scale(.97); transition: transform .3s ease; }
  .rapid-energy-core.is-complete .rapid-energy-centre { border-color: rgba(154, 255, 82, .34); box-shadow: inset 0 0 30px rgba(113, 255, 58, .13), 0 0 22px rgba(106, 255, 55, .1); }
  .rapid-energy-core.is-warning { --rapid-green-bright: var(--rapid-warning); filter: saturate(.72); }
  .rapid-energy-core.is-error { --rapid-green-bright: var(--rapid-danger); filter: saturate(.58); }

  .rapid-ai-analysis-list { display: grid; gap: 8px; margin: 0; padding: 0; }
  .rapid-ai-analysis-list li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; min-height: 72px; padding: 12px 14px; border: 1px solid var(--rapid-border); border-radius: 12px; background: rgba(7, 15, 9, .78); }
  .rapid-ai-analysis-list li > span { display: grid; width: 27px; height: 27px; place-items: center; border: 1px solid rgba(137, 164, 128, .2); border-radius: 50%; color: #627065; font: 700 .57rem "IBM Plex Mono", monospace; }
  .rapid-ai-analysis-list li div { display: grid; gap: 4px; }
  .rapid-ai-analysis-list li strong { color: var(--rapid-text); font-size: .78rem; }
  .rapid-ai-analysis-list li small { color: var(--rapid-text-muted); font-size: .64rem; }
  .rapid-ai-analysis-list li em { color: #667068; font: 700 .55rem "IBM Plex Mono", monospace; text-transform: uppercase; }
  .rapid-ai-analysis-list li.is-processing { border-color: rgba(139, 255, 78, .34); background: linear-gradient(100deg, rgba(26, 60, 22, .5), rgba(7, 15, 9, .78)); }
  .rapid-ai-analysis-list li.is-processing > span { border-color: var(--rapid-green-bright); color: var(--rapid-green-bright); box-shadow: 0 0 13px rgba(126, 255, 65, .14); animation: rapid-pulse 1.3s ease-in-out infinite; }
  .rapid-ai-analysis-list li.is-processing em { color: var(--rapid-green-bright); }
  .rapid-ai-analysis-list li.is-complete > span { border-color: var(--rapid-green); background: var(--rapid-green); color: #061006; font-size: 0; }
  .rapid-ai-analysis-list li.is-complete > span::after { content: "✓"; font-size: .75rem; font-weight: 900; }
  .rapid-ai-analysis-list li.is-complete em { color: var(--rapid-green); }

  .rapid-result > header { text-align: center; }
  .rapid-result > header h1 { margin-inline: auto; }
  .rapid-result-hero { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(260px, 1fr); gap: clamp(20px, 5vw, 70px); align-items: center; max-width: 940px; margin: 0 auto 24px; padding: clamp(16px, 3vw, 28px); border: 1px solid rgba(130, 241, 70, .2); border-radius: 18px; background: radial-gradient(circle at 24% 50%, rgba(57, 126, 39, .13), transparent 38%), #07100a; }
  .rapid-result-hero.is-review { border-color: rgba(221, 162, 63, .28); }
  .rapid-result-hero > div:last-child { display: grid; gap: 8px; }
  .rapid-result-hero > div:last-child span,
  .rapid-result-hero > div:last-child small { color: var(--rapid-text-muted); font: 650 .65rem "IBM Plex Mono", monospace; text-transform: uppercase; }
  .rapid-result-hero > div:last-child strong { color: var(--rapid-green-bright); font: 850 clamp(2rem, 5vw, 4.2rem)/.95 Inter, sans-serif; letter-spacing: -.055em; }
  .rapid-result-hero.is-review > div:last-child strong { color: var(--rapid-warning); }
  .rapid-result-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; max-width: 680px; margin: 0 auto 16px; padding: 5px; border: 1px solid var(--rapid-border); border-radius: 12px; background: #060c08; }
  .rapid-result-tabs button { min-height: 42px; border: 0; border-radius: 8px; background: transparent; color: var(--rapid-text-muted); font: 750 .66rem Inter, sans-serif; cursor: pointer; }
  .rapid-result-tabs button.is-active { background: rgba(49, 91, 36, .55); color: var(--rapid-green-bright); }
  .rapid-result-panel { display: none; animation: rapid-panel-in .22s ease both; }
  .rapid-result-panel.is-active { display: block; }
  .rapid-result-summary,
  .rapid-pricing-card { margin: 12px 0; padding: 18px; border: 1px solid var(--rapid-border); border-radius: var(--rapid-radius); background: var(--rapid-surface-elevated); }
  .rapid-result-summary small { color: var(--rapid-green-bright); font: 700 .57rem "IBM Plex Mono", monospace; letter-spacing: .1em; }
  .rapid-result-summary p,
  .rapid-pricing-card p { color: var(--rapid-text-muted); line-height: 1.65; }
  .rapid-result .rapid-ai-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--rapid-border); border-radius: var(--rapid-radius); overflow: hidden; }
  .rapid-result .rapid-ai-metrics article { min-width: 0; background: #08110a; }
  .rapid-result .rapid-ai-metrics strong { overflow-wrap: anywhere; }
  .rapid-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin: 24px 0 10px; }
  .rapid-section-heading h2 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
  .rapid-section-heading span { color: var(--rapid-text-muted); font-size: .65rem; }
  .rapid-result-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .rapid-result-photos img { width: 100%; aspect-ratio: 4 / 3; border: 1px solid var(--rapid-border); border-radius: 10px; object-fit: cover; }
  .rapid-inventory-list { display: grid; gap: 7px; }
  .rapid-inventory-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--rapid-border); border-radius: 11px; background: #08110a; }
  .rapid-inventory-list article div { display: grid; gap: 4px; }
  .rapid-inventory-list article strong { font-size: .78rem; }
  .rapid-inventory-list article small,
  .rapid-inventory-list > p { color: var(--rapid-text-muted); font-size: .67rem; }
  .rapid-inventory-list article > span { color: var(--rapid-green-bright); font: 750 .7rem "IBM Plex Mono", monospace; }
  .rapid-pricing-card > div { display: flex; align-items: end; justify-content: space-between; gap: 15px; padding-bottom: 16px; border-bottom: 1px solid var(--rapid-border); }
  .rapid-pricing-card > div span { color: var(--rapid-text-muted); font-size: .72rem; }
  .rapid-pricing-card > div strong { color: var(--rapid-green-bright); font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.05em; }
  .rapid-pricing-card dl { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; margin: 17px 0; }
  .rapid-pricing-card dt { color: var(--rapid-text-muted); font-size: .7rem; }
  .rapid-pricing-card dd { margin: 0; color: var(--rapid-text); font-size: .7rem; font-weight: 750; text-align: right; }
  .rapid-failure { display: grid; grid-template-columns: minmax(220px, .7fr) minmax(300px, 1fr); gap: 30px; align-items: center; }
  .rapid-failure > div:first-child { display: grid; min-width: 0; place-items: center; }
  .rapid-failure .rapid-energy-core { margin-inline: auto; }
  .rapid-failure > header { width: 100%; min-width: 0; }
  .rapid-failure h1 { font-size: clamp(2.6rem, 6vw, 5rem); }
  .rapid-failure-note { color: var(--rapid-text-muted); font-size: .72rem; }
  .rapid-failure footer { justify-content: flex-start; margin-top: 22px; }

  .rapid-ai-page .rwr-contact-rail { position: fixed; right: 20px; bottom: 100px; }

  @keyframes rapid-spin { to { transform: rotate(360deg); } }
  @keyframes rapid-dash { to { stroke-dashoffset: -110; } }
  @keyframes rapid-breathe { 50% { transform: scale(1.045); opacity: .76; } }
  @keyframes rapid-pulse { 50% { transform: scale(.88); opacity: .7; } }
  @keyframes rapid-particle-a { 50% { transform: translate(9px, -7px) scale(.6); opacity: .45; } }
  @keyframes rapid-particle-b { 50% { transform: translate(-8px, 10px) scale(1.5); opacity: .72; } }
  @keyframes rapid-photo-in { from { opacity: 0; transform: translateY(7px) scale(.98); } }
  @keyframes rapid-panel-in { from { opacity: 0; transform: translateY(6px); } }

  @media (max-width: 850px) {
    .rapid-ai-header img { width: 100px; }
    .rapid-ai-owner-banner span { max-width: 100%; overflow-wrap: anywhere; }
    .rapid-ai-shell { width: calc(100% - 16px); max-width: calc(100vw - 16px); min-height: calc(100dvh - 80px); overflow: hidden; border-radius: 14px; }
    .rapid-ai-rail { display: none; }
    .rapid-ai-stage,.rapid-ai-stage > * { width: 100%; max-width: 100%; min-width: 0; }
    .rapid-ai-stage > .rapid-upload-core { width: min(260px,70vw); }
    .rapid-ai-stage { min-height: calc(100dvh - 88px); padding: clamp(1.75rem, 6vw, 2.5rem) clamp(1rem, 4vw, 1.5rem) calc(2rem + env(safe-area-inset-bottom, 0px)); overflow-x: hidden; }
    .rapid-ai-stage > header { padding-top: 8px; }
    .rapid-analysis-stage > header { padding-top: 14px; }
    .rapid-ai-stage h1,
    .rapid-ai-stage h2 { max-width: 100%; font-size: clamp(2.35rem, 10vw, 4.5rem); line-height: .92; overflow-wrap: anywhere; }
    .rapid-ai-upload-actions,.rapid-ai-photo-status,.rapid-ai-photo-grid,.rapid-ai-actions { width: 100%; max-width: 100%; min-width: 0; }
    .rapid-analysis-layout,
    .rapid-result-hero,
    .rapid-failure { grid-template-columns: 1fr; }
    .rapid-analysis-layout { gap: 22px; }
    .rapid-energy-core { width: clamp(220px, 68vw, 280px); }
    .rapid-result-hero { justify-items: center; text-align: center; }
    .rapid-result-hero > div:last-child { justify-items: center; }
    .rapid-result .rapid-ai-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rapid-failure { gap: clamp(16px, 4vw, 24px); padding-top: 8px; justify-items: center; text-align: center; }
    .rapid-failure > div:first-child,
    .rapid-failure > header { max-width: 680px; margin-inline: auto; }
    .rapid-failure footer { justify-content: center; }
  }

  @media (max-width: 600px) {
    .rapid-ai-page .rwr-contact-rail { display: none; }
  }

  @media (max-width: 430px) {
    .rapid-ai-header { padding-top: env(safe-area-inset-top, 0px); height: calc(62px + env(safe-area-inset-top, 0px)); }
    .rapid-ai-header img { width: 94px; }
    .rapid-ai-rail { top: calc(62px + env(safe-area-inset-top, 0px)); }
    .rapid-ai-owner-banner { font-size: .52rem; }
    .rapid-ai-stage { padding-inline: 12px; }
    .rapid-ai-stage h1,.rapid-ai-stage h2 { font-size: clamp(2.2rem, 10vw, 2.7rem); }
    .rapid-upload-core { width: min(230px, 68vw); margin-bottom: 1.6rem; }
    .rapid-ai-upload-actions { gap: 9px; }
    .rapid-ai-upload-button { min-height: 82px; padding: 17px; }
    .rapid-ai-upload-button span { font-size: 1rem; }
    .rapid-ai-upload-button small { font-size: .58rem; }
    .rapid-energy-core { width: min(240px, 70vw); }
    .rapid-failure .rapid-energy-core { width: min(196px, 56vw); }
    .rapid-ai-analysis-list li { grid-template-columns: 29px 1fr auto; gap: 9px; min-height: 65px; padding: 10px; }
    .rapid-ai-analysis-list li small { font-size: .58rem; }
    .rapid-result-tabs button { font-size: .6rem; }
    .rapid-result .rapid-ai-metrics { grid-template-columns: 1fr 1fr; }
    .rapid-result .rapid-ai-metrics article { padding: 12px; }
    .rapid-pricing-card > div { align-items: start; flex-direction: column; }
    .rapid-ai-booking { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  }

  @media (min-width: 1180px) {
    .rapid-analysis-stage,
    .rapid-result { padding-inline: clamp(3rem, 6vw, 6rem); }
  }

  @media (prefers-reduced-motion: reduce) {
    .rapid-energy-core *,
    .rapid-upload-ring::after,
    .rapid-ai-photo,
    .rapid-result-panel { animation: none !important; }
    .rapid-energy-core::before { opacity: .7; }
  }
