/* Boostify shared styles — builds on assets/system.css, ui/cards.css, layout/layout.css */

/* Ensure readable body contrast (>= 7:1 on #0a0d14) while keeping .muted for labels/meta */
.hero .hero__lead,
.hero__lead,
.section p.t-lead,
.faq p {
  color: #d6dde8;
}

/* Hero centred window fallback & layout (from layout/hero-centred.html + demo.css) */
.hero--centred .hero__window {
  overflow: hidden;
  background:
    radial-gradient(80% 70% at 18% 20%, #244a7c 0%, transparent 65%),
    radial-gradient(70% 80% at 85% 25%, #1d5d7a 0%, transparent 65%),
    radial-gradient(90% 60% at 50% 100%, #1a2d4d 0%, transparent 70%),
    linear-gradient(155deg, #101d35, #18365b 55%, #13223b);
}
.d-win {
  background: #111622; color: #eceef0; border-radius: 12px; overflow: hidden;
  font: 400 14px/1.4 var(--font-text); text-align: left;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .1), 0 30px 70px -30px rgb(0 0 0 / .85);
}
.d-win--dark { background: #111622; color: #eceef0; }
.d-win__bar {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px;
  border-bottom: 1px solid rgb(255 255 255 / .08); font-size: 13px; color: #9ea6b2;
}
.d-win__dots { display: flex; gap: 6px; flex: none; }
.d-win__dots i { width: 10px; height: 10px; border-radius: 50%; background: #3a3e43; }
.d-win__body { display: grid; grid-template-columns: 250px 1fr; min-height: 360px; }
.d-win--dark .d-win__bar b { color: #eceef0; font-weight: 500; }
.d-win--dark .d-win__bar .sp { flex: 1; }
.d-chat { display: grid; gap: 8px; align-content: start; padding: 12px 16px; font-size: 14px; }
.d-msg { max-width: 82%; padding: 8px 12px; border-radius: 12px; background: rgb(255 255 255 / .07); line-height: 1.4; font-size: 13px; }
.d-msg--me { justify-self: end; background: #e9edf3; color: #0a0d14; border-bottom-right-radius: 4px; }
.d-msg--bot { border-bottom-left-radius: 4px; background: #1c2434; color: #e9edf3; }
.d-msg small { display: block; margin-top: 4px; font-size: 12px; opacity: .7; }
.d-tool { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #9ea6b2; }
.d-tool::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; flex: none; }
.hero__window .d-chat { padding: 12px 16px; gap: 8px; }
.hero__window .d-msg { padding: 8px 12px; font-size: 13px; line-height: 1.4; }
.hero__window .d-msg--me small { display: none; }
.hero__window .d-msg--bot { max-width: 88%; }
.hero__window .d-msg--bot small { display: inline; margin: 0 0 0 8px; white-space: nowrap; }

.inbox { border-right: 1px solid rgb(255 255 255 / .07); padding: 10px; display: grid; align-content: start; gap: 2px; }
.inbox .q { height: 32px; margin-bottom: 4px; border-radius: 9px; background: rgb(255 255 255 / .06); display: flex; align-items: center; padding: 0 10px; color: #9ea6b2; font-size: 13px; }
.inbox .t { display: grid; grid-template-columns: 30px 1fr auto; gap: 1px 10px; padding: 8px; border-radius: 9px; font-size: 13px; text-align: left; }
.inbox .t.is-on { background: rgb(255 255 255 / .07); }
.inbox .t i { grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 12px/1 var(--font-text); font-style: normal; color: #0a0d14; }
.inbox .t b { font-weight: 500; color: #eceef0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox .t time { color: #9ea6b2; font-size: 12px; font-variant-numeric: tabular-nums; }
.inbox .t span { grid-column: 2 / -1; color: #a7afbb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.convo { display: grid; min-width: 0; align-content: start; }
.d-msg--bot { background: #1e2430; color: #e9edf3; }
.acts { display: flex; gap: 8px; }
.acts span { height: 30px; padding: 0 12px; border-radius: 99px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; background: #5ab9fc; color: #0a0d14; }
.acts span + span { background: rgb(255 255 255 / .08); color: #e9edf3; }

/* High-contrast focus ring for pause controls over lit sand/mesh panels */
.hero__window .loop-pause:focus-visible,
.convo .loop-pause:focus-visible {
  outline: 2px solid #0a0d14;
  outline-offset: 2px;
  background: #e9edf3;
  color: #0a0d14;
}

@media (max-width: 639px) {
  .hero__window .d-win__bar .sp ~ span { display: none; }
  .d-win--dark .d-win__body { grid-template-columns: 1fr; }
  .inbox { display: none; }
  .hero__window .d-chat { font-size: 13px; padding: 12px 14px; }
  .hero__window .d-msg--bot small, .hero__window .d-tool { display: none; }
}

/* App-frame workspace (sections-library.md app-frame recipe) */
.app.ui {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  margin-top: var(--s-6);
  background: #111622;
  color: #e9edf3;
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px -24px rgb(0 0 0 / 0.65);
  overflow: hidden;
  --u-bg: #111622;
  --u-surface: #181f2f;
  --u-ink: #e9edf3;
  --u-muted: #9da6b5;
  --u-accent: #5ab9fc;
  --u-accent-ink: #0a0d14;
  --u-line: rgb(255 255 255 / 0.08);
  --u-line-2: rgb(255 255 255 / 0.14);
  --u-fill: rgb(255 255 255 / 0.04);
  --u-fill-2: rgb(255 255 255 / 0.08);
  --u-text-2: #d6dde8;
}
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.app > .app__pane + .app__pane { border-left: 1px solid var(--u-line); }
.app > .app__pane::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 48px;
  background: linear-gradient(transparent, var(--u-bg)); pointer-events: none; z-index: 2;
}
.app-bar {
  display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px;
  border-bottom: 1px solid var(--u-line); font-size: 13px; flex: none;
}
.app-bar b { font-weight: 500; color: var(--u-ink); }
.app-bar .sp { flex: 1; }
.app-list { display: grid; align-content: start; padding: 8px; gap: 2px; }
.app-row {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 10px;
  padding: 8px 10px; border-radius: 10px; font-size: 13px; align-items: center;
}
.app-row.is-on { box-shadow: inset 2px 0 0 var(--u-accent); }
.app-row i {
  grid-row: 1 / span 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 600 12px/1 var(--font-text); font-style: normal; color: #0a0d14;
}
.app-row b { font-weight: 500; color: var(--u-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-row time { font-size: 12px; color: var(--u-muted); font-variant-numeric: tabular-nums; }
.app-row__sub { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--u-muted); font-size: 12px; }
.app-row__sub span:first-child { min-width: 0; }
.app-tag {
  font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: 6px;
  background: var(--u-fill-2); color: var(--u-text-2); flex: none;
}
.app-tag--accent { background: color-mix(in oklab, var(--u-accent) 18%, transparent); color: var(--u-accent); }

.app-thread { padding: 16px 20px; display: grid; gap: 10px; align-content: start; }
.app-bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45;
}
.app-bubble--in { justify-self: start; background: var(--u-fill-2); color: var(--u-ink); border-bottom-left-radius: 4px; }
.app-bubble--out { justify-self: end; background: #17344f; color: #e9edf3; border-bottom-right-radius: 4px; border: 1px solid color-mix(in oklab, #5ab9fc 28%, transparent); }
.app-bubble small { display: block; margin-top: 4px; font-size: 11px; color: var(--u-muted); }
.app-ctx {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--u-fill); border: 1px solid var(--u-line); font-size: 12px; color: var(--u-text-2);
}
.app-ctx img { width: 16px; height: 16px; flex: none; }
.app-draft {
  padding: 12px 14px; border-radius: 12px; background: transparent;
  border: 1px solid color-mix(in oklab, var(--u-accent) 42%, var(--u-line));
  display: grid; gap: 8px;
}
.app-draft__head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--u-accent); }
.app-draft__body { font-size: 13px; line-height: 1.45; color: var(--u-ink); }
.app-draft__actions { display: flex; align-items: center; gap: 8px; }

@media (min-width: 1024px) and (max-width: 1279px) {
  .app.ui { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}
@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .app > .app__pane--list { max-height: none; overflow: visible; }
  .app > .app__pane--list::after { display: none; }
  .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--u-line); }
  .app-row:nth-child(n+4) { display: none; }
}
@media (max-width: 639px) {
  .app.ui { grid-template-rows: minmax(0, 1fr); margin-top: var(--s-5); }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0; }
  .app-thread { padding: 14px; gap: 8px; }
  .app-bubble--out, .app-bubble--out + .app-ctx { display: none; }
}

/* Feature panels (2x2) */
#features .panel { --p-h: 320px; }
@media (min-width: 640px) and (max-width: 1023px) {
  #features .card { grid-column: auto / span 6; }
  #features .panel { --p-h: 440px; }
}
@media (max-width: 639px) {
  #features { --hm: 2; }
  #features .card { --c-pad: 16px; }
  #features .panel { --p-h: 166px; }
  #features .stage { --fade-h: 24px; }
  #features .b-row:nth-child(n+4) { display: none; }
}

/* Mock UI cards inside .stage (uses base.css --u-* variables) */
.b-card {
  width: 100%; background: var(--u-bg); color: var(--u-ink);
  border: 1px solid var(--u-border); border-radius: var(--u-r); box-shadow: var(--u-shadow);
  overflow: hidden;
}
.b-rows { display: grid; }
.b-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid var(--u-line); font-size: 13px;
}
.b-row:last-child { border-bottom: 0; }
.b-row__meta { display: grid; gap: 1px; min-width: 0; }
.b-row__meta b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-row__meta span { font-size: 12px; color: var(--u-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b-switch {
  width: 34px; height: 20px; border-radius: 99px; background: var(--u-fill-3);
  position: relative; flex: none;
}
.b-switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px;
  border-radius: 50%; background: var(--u-bg); box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
}
.b-switch.is-on { background: var(--u-accent); }
.b-switch.is-on::after { left: 17px; background: var(--u-accent-ink); }

.b-chat { padding: 14px 16px; display: grid; gap: 10px; }
.b-msg { max-width: 88%; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.b-msg--user { justify-self: end; background: var(--u-ink); color: var(--u-bg); }
.b-msg--bot { justify-self: start; background: var(--u-fill-2); color: var(--u-ink); }
.b-srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.b-src {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 11px; font-weight: 500; color: var(--u-ink);
  background: var(--u-bg); border: 1px solid var(--u-line-2);
}
.b-src img { width: 12px; height: 12px; }

.b-pane { padding: 16px; display: grid; gap: 12px; }
.b-pane__top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.b-pane__num { font-size: 26px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.b-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; gap: 2px; }
.b-bar i { display: block; height: 100%; }
.b-legend { display: grid; gap: 6px; font-size: 12px; }
.b-legend div { display: flex; align-items: center; gap: 8px; }
.b-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; background: var(--c); margin-right: 7px; }
.b-legend b { margin-left: auto; font-weight: 500; font-variant-numeric: tabular-nums; }

.b-creative { padding: 12px 14px; display: grid; gap: 8px; }
.b-creative__prompt {
  padding: 7px 10px; border-radius: 8px; background: var(--u-fill);
  border: 1px solid var(--u-line); font-size: 12px; color: var(--u-ink);
}
.b-creative__preview {
  border-radius: 10px; border: 1px solid var(--u-line-2); overflow: hidden; background: var(--u-surface);
}
.b-creative__banner {
  padding: 10px 12px; background: #121c2b;
  color: #e9edf3; display: flex; align-items: center; gap: 12px;
}
.b-creative__thumb {
  width: 72px; height: 42px; border-radius: 6px; object-fit: cover; flex: none;
  border: 1px solid rgb(255 255 255 / 0.14);
}
.b-creative__banner-text { min-width: 0; flex: 1; }
.b-creative__banner strong { display: block; font-size: 13px; font-weight: 500; color: #e9edf3; }
.b-creative__banner span:not(.ui-btn) { display: block; font-size: 11px; color: #dbe6f2; }
.b-creative__banner .ui-btn--accent { color: #0a0d14; }
.b-creative__copy { padding: 9px 12px; font-size: 12px; line-height: 1.4; color: var(--u-ink); }

/* Statement + 6-workflow grid (higher specificity than moments/letters-assemble/moment.css) */
#statement .mo-la__type {
  font-family: var(--font-display); font-weight: var(--display-weight);
  font-size: clamp(36px, 3vw + 16px, 56px); line-height: 1.06; letter-spacing: -0.035em;
  max-width: 18ch;
}
.statement-wrap { min-width: 0; max-width: 100%; justify-content: space-between; gap: var(--s-6); }
.wf-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5) var(--gutter);
}
.wf-item {
  display: flex; align-items: flex-start; gap: 14px; padding: var(--s-4);
  border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line);
  min-width: 0;
}
.wf-item__ic {
  width: 36px; height: 36px; border-radius: 8px; flex: none;
  background: var(--bg); border: 1px solid var(--line);
  display: grid; place-items: center; color: var(--ink);
}
.wf-item__ic svg, .wf-item__ic img { width: 18px; height: 18px; }
.wf-item__text { display: grid; gap: 4px; min-width: 0; }
.wf-item__text b { font-size: 16px; font-weight: 500; color: var(--ink); }
.wf-item__text span { font-size: 14px; line-height: 1.45; color: #d6dde8; }
@media (max-width: 1023px) {
  .wf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
}
@media (max-width: 639px) {
  .wf-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .wf-item { padding: 10px 12px; }
}

/* Integrations split diagram + clean fallback when opened via file:// */
#integrations .frame--split { --p-h: 640px; min-height: 640px; }
#integrations .dg-node { transition: none !important; }
.frame--split:has(.dg-svg) .dg-fallback { display: none; }
.dg-fallback {
  position: relative; z-index: 1; width: 100%; height: 100%;
  padding: 28px; display: grid; align-content: center; gap: 20px;
}
.dg-fallback__core {
  justify-self: center; display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 99px; background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 500;
}
.dg-fallback__core img { width: 18px; height: 18px; }
.dg-fallback__grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.dg-fallback__node {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line);
  font-size: 14px; font-weight: 500; color: var(--ink);
}
.dg-fallback__tile {
  width: 30px; height: 30px; border-radius: 7px; background: #fff;
  display: grid; place-items: center; flex: none;
}
.dg-fallback__tile img { width: 18px; height: 18px; object-fit: contain; }
@media (max-width: 1023px) { #integrations .frame--split { --p-h: 520px; min-height: 520px; margin-top: var(--s-4); } }
@media (max-width: 639px) { #integrations .frame--split { min-height: 400px; height: 400px; } .dg-fallback { padding: 16px; gap: 12px; } }

/* Pricing controls, plan cards & hover */
#pricing .section-head { margin-bottom: var(--s-4); }
#pricing .card--plan { --c-pad: 18px; gap: var(--s-2); }
.pricing-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); margin-top: var(--s-3); }
.seg {
  display: inline-flex; padding: 3px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
}
.seg button {
  font: inherit; font-size: 13px; font-weight: 500; border: 0; background: none;
  color: var(--muted); height: 36px; padding: 0 14px; border-radius: calc(var(--r-sm) - 2px); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

.plan-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.plan-top__meta { display: flex; align-items: center; gap: 10px; }
.plan-top h3 { font-size: 18px; font-weight: 500; margin: 0; }
.card--plan .price { font-family: var(--font-display); font-size: clamp(28px, 1.5vw + 18px, 40px); font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card--plan .price small { font-size: 15px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.checks { display: grid; gap: 8px; font-size: 15px; line-height: 1.4; color: var(--ink); }
.checks li { display: flex; align-items: center; gap: 10px; }
.checks li:has(svg)::before { display: none; }
.checks li svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

@media (hover: hover) and (pointer: fine) {
  html:not([data-motion="off"]) .card--plan { transition: transform var(--m-out, 120ms) var(--m-ease), border-color var(--m-out, 120ms) var(--m-ease); }
  html:not([data-motion="off"]) .card--plan:hover { transform: translateY(-2px); transition-duration: var(--m-in, 150ms); }
}

@media (max-width: 1023px) {
  #pricing .card--plan { --c-pad: 18px; gap: var(--s-3); grid-column: auto / span 4; min-height: 440px; }
  #pricing .card--plan .checks { font-size: 14px; gap: 8px; }
}
@media (max-width: 639px) {
  #pricing { --hm: 2; }
  #pricing .section-head { margin-bottom: var(--s-4); }
  #pricing .card--plan { grid-column: 1 / -1; --c-pad: 16px; gap: var(--s-2); min-height: 0; }
  #pricing .card--plan .checks li:nth-child(n+4) { display: none; }
  .pricing-controls { width: 100%; }
  .seg { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .seg button { min-height: 44px; padding: 0 10px; }
}

/* FAQ spacing & compliance panel */
#faq .faq__item { padding: var(--s-5) 0; }
#faq .faq__item:first-child { padding-top: 0; }
.faq-card { margin-top: var(--s-4); }
.footer__legal { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: var(--s-3) var(--s-6); }
.footer__legal .socials { display: none; }
.footer__legal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
@media (max-width: 1023px) {
  #faq .faq__item { padding: var(--s-3) 0; }
  .faq-card .b-row:nth-child(n+2) { display: none; }
}
@media (max-width: 639px) {
  #statement { --hm: 1; }
  #statement .mo-la__type { font-size: 32px; }
  .statement-wrap { gap: var(--s-4); }
  #faq { --hm: 1; }
  #faq .faq__item { padding: var(--s-3) 0; }
  #faq .faq__item:nth-child(n+5) { display: none; }
  footer.closing { --hm: 1; }
  footer.closing > .wrap { row-gap: var(--s-5); }
  .closing__cta { gap: var(--s-4); }
  .closing__links { gap: var(--s-4); }
  .footer__legal { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* Comparison table (pricing.html) */
.cmp-table { margin-top: var(--s-7); display: grid; }
.cmp-row {
  display: grid; grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2.66fr));
  gap: var(--gutter); align-items: center; min-height: 48px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 15px;
}
.cmp-row--head { border-bottom: 1px solid var(--line-strong); font-weight: 500; padding-bottom: 16px; }
.cmp-row--group { padding-top: var(--s-6); border-bottom: 1px solid var(--line); }
@media (max-width: 767px) {
  .cmp-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 14px 0; }
  .cmp-row--head { display: none; }
  .cmp-cell[data-plan]::before { content: attr(data-plan) ": "; color: var(--muted); font-size: 13px; }
}

/* Inner pages (features, pricing, contact, privacy, terms) */
body.is-inner main > section { height: auto; min-height: auto; }
.page-head { padding-top: calc(var(--nav) + var(--s-9)); padding-bottom: var(--s-7); border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 18ch; }
.page-head .t-lead { margin-top: var(--s-4); max-width: 58ch; color: #d6dde8; }
.prose { max-width: 68ch; display: grid; gap: var(--s-5); padding-block: var(--s-8); }
.prose h2 { font-size: clamp(24px, 1vw + 18px, 32px); margin-top: var(--s-4); }
.prose p, .prose li { font-size: 16px; line-height: 1.65; color: color-mix(in oklab, var(--ink) 88%, var(--bg)); }
.prose ul { display: grid; gap: 8px; padding-left: 20px; list-style: disc; }

.contact-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s-7); }
@media (max-width: 639px) { .contact-panel { padding: var(--s-5); } }
