/* Reusable PIE output and demonstration components. */

.hero-insight-card {
  position: absolute;
  z-index: 7;
  top: 50%;
  right: 0;
  width: min(520px, 66%);
  min-height: 390px;
  padding: 1.45rem;
  transform: translateY(-50%);
  border: 1px solid color-mix(in srgb, var(--aqua) 52%, var(--line));
  border-top: 2px solid var(--aqua);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, color-mix(in srgb, var(--aqua) 8%, var(--surface)), color-mix(in srgb, var(--surface) 96%, transparent));
  box-shadow: var(--shadow);
}
.hero-card-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.pie-badge { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); font: 600 .68rem var(--mono); letter-spacing: .1em; }
.pie-badge img { width: 24px; height: 24px; }
.demo-badge { padding: .32rem .48rem; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--aqua); font: 600 .56rem var(--mono); letter-spacing: .1em; }
.card-overline { margin: 2.1rem 0 .7rem; color: var(--aqua); font: 600 .65rem var(--mono); letter-spacing: .12em; }
.hero-insight-card h2 { max-width: 430px; margin: 0 0 .85rem; font-size: clamp(1.8rem, 2.3vw, 2.65rem); line-height: 1.08; letter-spacing: -.045em; }
.hero-insight-card > p:not(.card-overline) { max-width: 450px; margin-bottom: 1.4rem; color: var(--muted); font-size: .96rem; line-height: 1.58; }
.hero-metrics { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.hero-metrics div { min-width: 0; padding: .9rem .65rem .95rem 0; border-right: 1px solid var(--line); }
.hero-metrics div:not(:first-child) { padding-left: .65rem; }
.hero-metrics div:last-child { border-right: 0; }
.hero-metrics dt { color: var(--muted); font: 500 .65rem var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.hero-metrics dd { margin: .35rem 0 .15rem; font-size: 1.45rem; font-weight: 700; letter-spacing: -.05em; }
.hero-metrics dd small { color: var(--aqua); font-size: .67rem; }
.hero-metrics span { color: var(--aqua); font-size: .68rem; line-height: 1.35; }
.card-meta { padding-top: .85rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; color: var(--dim); font: 500 .66rem var(--mono); }

.source-mosaic { position: relative; min-height: 610px; }
.source-mosaic::before, .source-mosaic::after { content: ""; position: absolute; pointer-events: none; }
.source-mosaic::before { inset: 0; opacity: .38; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 46px 46px; mask-image: radial-gradient(circle at center, black, transparent 72%); }
.source-mosaic::after { top: 50%; left: 50%; width: 290px; height: 290px; transform: translate(-50%, -50%); border: 1px solid var(--line); border-radius: 50%; box-shadow: 0 0 80px rgba(117, 244, 233, .08); }
.source-mosaic article { position: absolute; z-index: 2; width: 230px; min-height: 114px; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface-2) 92%, transparent); box-shadow: 0 14px 40px rgba(0, 0, 0, .14); }
.source-mosaic article span { display: block; color: var(--muted); font-size: .78rem; }
.source-mosaic article strong { display: block; margin: .75rem 0 .25rem; font-size: 1rem; }
.source-mosaic article small { color: var(--dim); font-size: .72rem; line-height: 1.45; }
.source-mosaic article:nth-child(1) { top: 4%; left: 4%; }.source-mosaic article:nth-child(2) { top: 4%; right: 4%; }.source-mosaic article:nth-child(3) { bottom: 5%; left: 4%; }.source-mosaic article:nth-child(4) { right: 4%; bottom: 5%; }
.mosaic-question { position: absolute; z-index: 3; top: 50%; left: 50%; width: 300px; min-height: 190px; padding: 1.4rem; transform: translate(-50%, -50%); display: grid; place-content: center; border: 1px solid color-mix(in srgb, var(--aqua) 45%, var(--line)); border-radius: 50%; background: radial-gradient(circle at 35% 25%, var(--surface-3), var(--bg-deep) 75%); text-align: center; }
.mosaic-question span { color: var(--aqua); font: 600 .7rem var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.mosaic-question strong { margin-top: .65rem; font-size: 1.25rem; line-height: 1.3; }

.module-card { position: relative; min-height: 410px; padding: 1.7rem; overflow: hidden; display: grid; align-content: start; border: 1px solid var(--line); border-right: 0; border-bottom: 0; background: color-mix(in srgb, var(--surface) 62%, transparent); }
.module-card:nth-child(3n), .module-card:last-child { border-right: 1px solid var(--line); }
.module-card:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line); }
.module-card:hover { border-color: color-mix(in srgb, var(--aqua) 42%, var(--line)); background: color-mix(in srgb, var(--aqua) 4%, var(--surface)); }
.module-featured { grid-column: span 2; background: linear-gradient(145deg, color-mix(in srgb, var(--aqua) 7%, var(--surface)), color-mix(in srgb, var(--surface) 92%, transparent)); }
.module-index { position: absolute; top: 1.7rem; right: 1.7rem; color: var(--dim); font: 500 .68rem var(--mono); }
.module-card > p { margin: 3.2rem 0 .9rem; color: var(--aqua); font: 600 .69rem var(--mono); letter-spacing: .11em; }
.module-card h3 { max-width: 520px; margin: 0 0 1rem; font-size: 1.65rem; line-height: 1.22; }
.module-card > span { max-width: 520px; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.module-icon { position: absolute; top: 1.2rem; left: 1.5rem; color: var(--coral); font-size: 1.25rem; }
.mini-comparison { margin-top: auto; padding-top: 2.4rem; display: flex; align-items: end; gap: .55rem; }
.mini-comparison i { width: 42px; height: 20px; background: color-mix(in srgb, var(--aqua) 28%, transparent); }
.mini-comparison i:nth-child(2) { height: 29px; }.mini-comparison i:nth-child(3) { height: 24px; }.mini-comparison i:nth-child(4) { height: 38px; }.mini-comparison i.active { height: 52px; background: var(--aqua); box-shadow: 0 0 24px rgba(117, 244, 233, .24); }
.module-route, .module-wave, .module-trend { width: 180px; margin-top: auto; padding-top: 2.5rem; overflow: visible; fill: none; stroke: var(--aqua); stroke-width: 2; }
.module-route circle { fill: var(--bg); stroke-width: 2; }.module-trend .ghost { stroke: var(--coral); stroke-opacity: .45; stroke-dasharray: 4 6; }
.module-bars { height: 74px; margin-top: auto; display: flex; align-items: end; gap: .5rem; }
.module-bars i { width: 22px; height: 28%; background: color-mix(in srgb, var(--aqua) 26%, transparent); }.module-bars i:nth-child(2) { height: 42%; }.module-bars i:nth-child(3) { height: 58%; }.module-bars i:nth-child(4) { height: 52%; }.module-bars i:nth-child(5) { height: 78%; }.module-bars i:nth-child(6) { height: 100%; background: var(--aqua); }
.module-timeline { margin-top: auto; padding-top: 3rem; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line-strong); }
.module-timeline i { width: 9px; height: 9px; margin-bottom: -5px; border: 2px solid var(--aqua); border-radius: 50%; background: var(--surface); }.module-timeline i:last-child { background: var(--aqua); box-shadow: 0 0 18px var(--aqua); }
.module-rings { position: relative; width: 90px; height: 90px; margin-top: auto; }
.module-rings i { position: absolute; inset: 0; border: 1px solid var(--line-strong); border-radius: 50%; }.module-rings i:nth-child(2) { inset: 15px; border-color: var(--aqua); }.module-rings strong { position: absolute; inset: 0; display: grid; place-items: center; color: var(--aqua); font-size: 1.2rem; }

.pie-card { min-width: 0; min-height: 480px; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border: 1px solid var(--line); border-top: 2px solid var(--aqua); border-radius: var(--radius-md); background: linear-gradient(150deg, color-mix(in srgb, var(--aqua) 4%, var(--surface)), var(--surface)); box-shadow: 0 18px 48px rgba(0, 0, 0, .16); }
.pie-card > header { min-height: 60px; padding: .85rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: .7rem; border-bottom: 1px solid var(--line); color: var(--dim); font: 600 .66rem var(--mono); letter-spacing: .08em; }
.card-brand { display: inline-flex; align-items: center; gap: .45rem; color: var(--ink); font-size: .68rem; letter-spacing: .1em; }.card-brand img { width: 22px; height: 22px; }
.card-body { padding: 1.35rem 1.25rem; }
.card-kicker { margin: 0 0 1.1rem; color: var(--aqua); font: 600 .68rem var(--mono); letter-spacing: .12em; }
.pie-card h3 { margin: 0 0 .85rem; font-size: clamp(1.45rem, 2vw, 1.9rem); line-height: 1.18; }
.pie-card .card-body > p:not(.card-kicker) { color: var(--muted); font-size: .93rem; line-height: 1.62; }
.card-metrics { margin: 2rem 0 0; display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); }
.card-metrics div { padding: .9rem 0 0; }.card-metrics dt { color: var(--dim); font: 500 .62rem var(--mono); text-transform: uppercase; }.card-metrics dd { margin: .35rem 0 0; color: var(--ink); font-size: 1.42rem; font-weight: 700; letter-spacing: -.04em; }
.pie-card > footer { min-height: 86px; padding: .85rem 1rem; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: .35rem 1rem; border-top: 1px solid var(--line); color: var(--muted); font: 500 .68rem/1.4 var(--mono); }
.pie-card > footer span:nth-child(2) { color: var(--aqua); text-align: right; }.pie-card > footer small { grid-column: 1 / -1; color: var(--dim); font-size: .66rem; }
.pie-card--route { border-top-color: #6fbcff; }.pie-card--route .card-kicker { color: #8ccaff; }
.pie-card--power { border-top-color: var(--coral); }.pie-card--power .card-kicker { color: var(--coral); }
.pie-card--trend { border-top-color: #a7e6a1; }.pie-card--trend .card-kicker { color: #a7e6a1; }
.pie-card--recovery { border-top-color: #c5a8ff; }.pie-card--recovery .card-kicker { color: #c5a8ff; }
.pie-card--limitation { border-top-color: var(--warning); }.pie-card--limitation .card-kicker { color: var(--warning); }
.card-sparkline { height: 84px; margin-top: 1.8rem; display: flex; align-items: end; gap: .55rem; }
.card-sparkline i { flex: 1; height: 30%; background: color-mix(in srgb, #a7e6a1 25%, transparent); }.card-sparkline i:nth-child(2) { height: 42%; }.card-sparkline i:nth-child(3) { height: 38%; }.card-sparkline i:nth-child(4) { height: 61%; }.card-sparkline i:nth-child(5) { height: 75%; }.card-sparkline i:nth-child(6) { height: 94%; background: #a7e6a1; }
.card-list { margin: 1.35rem 0 0; padding: 0; list-style: none; }.card-list li { position: relative; padding: .55rem 0 .55rem 1.25rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }.card-list li::before { content: "+"; position: absolute; left: 0; color: var(--warning); }

.messenger-shell { width: min(720px, 100%); overflow: hidden; border: 1px solid rgba(255, 255, 255, .2); border-radius: 34px; background: #152b3a; box-shadow: 0 34px 90px rgba(0, 0, 0, .36); color: #eef7fb; }
.messenger-header { min-height: 78px; padding: .75rem 1rem; display: flex; align-items: center; gap: .8rem; background: #1f6f9e; }
.messenger-back { font-size: 2rem; font-weight: 300; }.messenger-avatar { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: #0b1720; }.messenger-avatar img { width: 30px; }
.messenger-header div { display: grid; gap: .1rem; }.messenger-header strong { font-size: 1rem; }.messenger-header small { color: rgba(255, 255, 255, .75); font-size: .72rem; }.messenger-menu { margin-left: auto; letter-spacing: .14em; }
.messenger-chat { min-height: 720px; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; background-color: #102735; background-image: radial-gradient(circle at 14px 14px, rgba(255, 255, 255, .045) 1.5px, transparent 2px); background-size: 32px 32px; }
.chat-day { align-self: center; padding: .3rem .6rem; border-radius: 99px; background: rgba(0, 0, 0, .25); color: rgba(255, 255, 255, .74); font-size: .66rem; font-weight: 700; }
.chat-bubble { position: relative; max-width: 78%; padding: .72rem .75rem 1.15rem; border-radius: 12px; box-shadow: 0 4px 10px rgba(0, 0, 0, .12); font-size: .87rem; line-height: 1.48; }
.chat-bubble time { position: absolute; right: .55rem; bottom: .25rem; color: rgba(255, 255, 255, .7); font-size: .66rem; }
.chat-user { align-self: flex-end; background: #2b5278; }.chat-pie { align-self: flex-start; background: #182f3e; }
.chat-card { width: min(440px, 88%); align-self: flex-start; overflow: hidden; border: 1px solid rgba(117, 244, 233, .42); border-top: 3px solid #75f4e9; border-radius: 12px; background: linear-gradient(145deg, #10242e, #0a171e); box-shadow: 0 10px 26px rgba(0, 0, 0, .24); }
.chat-card > header { padding: .7rem .8rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, .12); color: #75f4e9; font: 600 .68rem var(--mono); letter-spacing: .08em; }.chat-card > header span { display: inline-flex; align-items: center; gap: .4rem; }.chat-card > header img { width: 20px; }.chat-card > header small { color: rgba(255, 255, 255, .7); }
.chat-card h3 { margin: 0; padding: 1rem .85rem .5rem; font-size: 1.3rem; line-height: 1.2; }
.chat-card > p { padding: 0 .85rem; color: rgba(255, 255, 255, .72); font-size: .8rem; line-height: 1.5; }
.chat-card dl { margin: .75rem .85rem 1rem; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(255, 255, 255, .12); }.chat-card dl div { padding-top: .7rem; }.chat-card dt { color: rgba(255, 255, 255, .72); font: 500 .68rem var(--mono); }.chat-card dd { margin: .3rem 0 0; font-size: 1.25rem; font-weight: 700; }
.chat-card > footer { padding: .65rem .85rem; border-top: 1px solid rgba(255, 255, 255, .12); color: #75f4e9; font: 500 .68rem var(--mono); }
.chat-card-route { border-top-color: #6fbcff; }.chat-card-route > header { color: #8ccaff; }
.chat-actions { width: min(440px, 88%); display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; }.chat-actions span { min-height: 44px; padding: .65rem .7rem; display: grid; place-items: center; border-radius: 8px; background: #1f6f9e; color: #fff; font-size: .75rem; text-align: center; }
.messenger-input { min-height: 62px; padding: .7rem 1rem; display: flex; align-items: center; gap: .8rem; background: #172d3b; }.messenger-input span { flex: 1; padding: .65rem 1rem; border-radius: 99px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .5); font-size: .78rem; }.messenger-input i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #2a95d6; font-style: normal; }

.report-visual { position: relative; min-height: 680px; padding: 1.2rem; order: -1; border: 1px solid var(--line); border-top: 2px solid var(--aqua); border-radius: var(--radius-md); background: linear-gradient(150deg, var(--surface-2), var(--bg-deep)); box-shadow: var(--shadow); }
.report-label { min-height: 68px; padding: .75rem .85rem 1rem; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .2rem .65rem; border-bottom: 1px solid var(--line); }.report-label img { grid-row: 1 / 3; width: 36px; }.report-label span { color: var(--aqua); font: 600 .68rem var(--mono); letter-spacing: .1em; }.report-label b { font-size: .88rem; }
.report-card { position: absolute; left: 5%; width: 58%; min-height: 126px; padding: 1rem; display: grid; align-content: center; gap: .45rem; border: 1px solid var(--line); border-left: 2px solid var(--aqua); border-radius: var(--radius-sm); background: var(--surface); box-shadow: 0 18px 40px rgba(0, 0, 0, .22); }
.report-card:nth-of-type(2) { top: 22%; left: 9%; }.report-card:nth-of-type(3) { top: 39%; left: 18%; }.report-card:nth-of-type(4) { top: 56%; left: 27%; }.report-card:nth-of-type(5) { top: 73%; left: 36%; }
.report-card span { color: var(--aqua); font: 600 .62rem var(--mono); letter-spacing: .1em; }.report-card strong { font-size: 1.08rem; line-height: 1.35; }.report-card small { color: var(--muted); font-size: .7rem; }
.report-summary { width: 72%; min-height: 145px; border-left-color: var(--coral); }.report-summary span { color: var(--coral); }.report-summary strong { font-size: 1.35rem; }
.report-meta { opacity: .72; }

@media (max-width: 1280px) {
  .module-card:nth-child(3n), .module-card:last-child { border-right: 0; }
  .module-card:nth-child(2n), .module-card:last-child { border-right: 1px solid var(--line); }
  .module-card:nth-last-child(-n + 3) { border-bottom: 0; }
  .module-card:nth-last-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 780px) {
  .hero-insight-card { position: relative; top: auto; right: auto; left: auto; grid-area: insight; width: 100%; min-height: 0; padding: 1.1rem; transform: none; }
  .hero-insight-card h2 { font-size: 1.65rem; }
  .hero-insight-card > p:not(.card-overline) { font-size: .86rem; }
  .card-overline { margin-top: 1.5rem; }
  .hero-metrics div { padding: .75rem .35rem .75rem 0; }.hero-metrics div:not(:first-child) { padding-left: .35rem; }
  .hero-metrics dt { font-size: .75rem; }.hero-metrics dd { font-size: 1.2rem; }.hero-metrics span { font-size: .75rem; }
  .card-meta { font-size: .75rem; }
  .source-mosaic { min-height: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
  .source-mosaic::after { display: none; }
  .source-mosaic article { position: relative; top: auto !important; right: auto !important; bottom: auto !important; left: auto !important; width: auto; min-height: 0; }
  .mosaic-question { position: relative; top: auto; left: auto; grid-column: 1 / -1; width: auto; min-height: 180px; transform: none; border-radius: var(--radius-lg); }
  .module-card { border-right: 1px solid var(--line) !important; border-bottom: 0 !important; padding: 1.4rem; }
  .module-card:last-child { border-bottom: 1px solid var(--line) !important; }
  .module-card > p { margin-top: 2.8rem; }
  .pie-card { min-height: 440px; }
  .pie-card h3 { font-size: 1.5rem; }
  .messenger-chat { min-height: 690px; padding: .75rem; }
  .chat-bubble { max-width: 88%; font-size: .82rem; }
  .chat-card, .chat-actions { width: 94%; }
  .chat-card h3 { font-size: 1.16rem; }
  .source-mosaic article small, .module-index, .module-card > p, .card-kicker { font-size: .75rem; }
  .pie-card > header, .pie-card > footer, .pie-card > footer small { font-size: .75rem; }
  .chat-card > header, .chat-card dt, .chat-card > footer, .chat-bubble time { font-size: .75rem; }
  .report-visual { min-height: 0; display: grid; gap: .75rem; }
  .report-card, .report-summary { position: relative; top: auto !important; left: auto !important; width: 100%; min-height: 0; }
}

@media (max-width: 430px) {
  .hero-insight-card { min-height: 0; }
  .hero-metrics dd { font-size: 1.05rem; }
  .pie-card { min-height: 455px; }
  .pie-card > header { padding: .75rem; }.card-body { padding: 1.1rem .95rem; }.pie-card > footer { padding: .75rem; }
  .pie-card > footer { grid-template-columns: 1fr; }.pie-card > footer span:nth-child(2) { text-align: left; }
  .chat-actions { grid-template-columns: 1fr; }
  .source-mosaic { grid-template-columns: 1fr; }
  .mosaic-question { grid-column: 1; }
  .report-visual { min-height: 0; padding: .75rem; }
  .report-card { min-height: 130px; padding: .85rem; }
  .report-card strong { font-size: .95rem; }.report-summary strong { font-size: 1.13rem; }
}

/* Compact landingpage variants. */
.compact-cards .pie-card { min-height: 420px; }
.compact-cards .pie-card > header { min-height: 58px; font-size: .72rem; }
.compact-cards .card-body { padding: 1.45rem 1.35rem; }
.compact-cards .pie-card h3 { font-size: clamp(1.55rem, 2vw, 1.85rem); }
.compact-cards .pie-card .card-body > p:not(.card-kicker) { font-size: 1rem; line-height: 1.65; }
.compact-cards .card-list li { font-size: .9rem; line-height: 1.5; }
.compact-cards .pie-card > footer, .compact-cards .pie-card > footer small { font-size: .72rem; }
.messenger-compact { width: min(660px, 100%); }
.messenger-compact .messenger-chat { min-height: 575px; }
.messenger-compact .chat-bubble { font-size: .94rem; line-height: 1.5; }
.messenger-compact .chat-card { width: min(460px, 90%); }
.messenger-compact .chat-card h3 { font-size: 1.35rem; }
.messenger-compact .chat-card dt, .messenger-compact .chat-card > footer { font-size: .72rem; }
.messenger-compact .chat-actions { width: min(460px, 90%); }

@media (max-width: 780px) {
  .compact-cards .pie-card { min-height: 420px; }
  .compact-cards .pie-card .card-body > p:not(.card-kicker) { font-size: 1rem; }
  .messenger-compact .messenger-chat { min-height: 560px; }
  .messenger-compact .chat-bubble { font-size: .95rem; }
  .messenger-compact .chat-card, .messenger-compact .chat-actions { width: 94%; }
}

@media (max-width: 430px) {
  .compact-cards .pie-card { min-height: 430px; }
  .compact-cards .card-body { padding: 1.2rem 1rem; }
  .messenger-compact .chat-bubble { font-size: .95rem; }
}
