:root {
  color-scheme: light;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --page: #fff8ef;
  --page-soft: #f7eee4;
  --surface: rgba(255, 252, 246, 0.82);
  --surface-strong: #ffffff;
  --surface-muted: #f1e6da;
  --text: #1d1814;
  --text-soft: #706459;
  --text-muted: #9a8c7f;
  --line: rgba(48, 37, 29, 0.12);
  --line-strong: rgba(48, 37, 29, 0.2);
  --accent: #ff6b14;
  --accent-deep: #df5307;
  --accent-soft: rgba(255, 107, 20, 0.14);
  --success: #2f8c67;
  --shadow-soft: 0 22px 70px rgba(58, 38, 20, 0.12);
  --shadow-card: 0 18px 55px rgba(58, 38, 20, 0.15);
  --radius-xl: 42px;
  --radius-lg: 30px;
  --radius-md: 22px;
  --header-height: 76px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0d0b;
  --page-soft: #16120f;
  --surface: rgba(25, 21, 18, 0.76);
  --surface-strong: #1b1713;
  --surface-muted: #211b16;
  --text: #f7efe6;
  --text-soft: #c8b9ab;
  --text-muted: #8f8174;
  --line: rgba(255, 241, 225, 0.12);
  --line-strong: rgba(255, 241, 225, 0.2);
  --accent-soft: rgba(255, 107, 20, 0.16);
  --success: #73d7ad;
  --shadow-soft: 0 26px 90px rgba(0, 0, 0, 0.38);
  --shadow-card: 0 24px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    radial-gradient(circle at 72% 8%, var(--accent-soft), transparent 30%),
    radial-gradient(circle at 10% 28%, rgba(255, 107, 20, 0.08), transparent 25%),
    var(--page);
  background-size: 84px 84px, 84px 84px, auto, auto, auto;
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open,
body.menu-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

main,
.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  z-index: 50;
  top: 18px;
  left: 50%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  width: min(1180px, calc(100% - 40px));
  min-height: var(--header-height);
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
  transform: translateX(-50%);
  transition: min-height 180ms ease, background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.site-header.scrolled,
.site-header.menu-open {
  min-height: 64px;
  border-color: var(--line-strong);
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.12);
}

.brand,
.header-nav,
.header-actions,
.hero-actions,
.proof-strip,
.score-badge,
.theme-button,
.footer-theme-buttons {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.brand-mark,
.modal-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: var(--accent);
  color: #140b06;
  font-weight: 950;
  box-shadow: 0 12px 28px rgba(255, 107, 20, 0.28);
}

.brand-name {
  font-size: 19px;
}

.header-nav {
  justify-content: center;
  gap: 6px;
}

.header-nav a {
  padding: 11px 14px;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 760;
  transition: background 160ms ease, color 160ms ease;
}

.header-nav a:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.header-actions {
  justify-content: flex-end;
  gap: 8px;
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 5px auto;
  border-radius: 99px;
  background: currentColor;
  transition: transform 180ms ease;
}

.site-header.menu-open .menu-button span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.site-header.menu-open .menu-button span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

.theme-picker {
  position: relative;
}

.theme-button {
  gap: 7px;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-size: 14px;
  font-weight: 780;
}

.theme-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  min-width: 158px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-card);
}

.theme-menu[hidden] {
  display: none;
}

.theme-menu button,
.footer-theme-buttons button {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 780;
}

.theme-menu button {
  padding: 10px 12px;
  text-align: left;
}

.theme-menu button:hover,
.theme-menu button.active,
.footer-theme-buttons button:hover,
.footer-theme-buttons button.active {
  background: var(--accent-soft);
  color: var(--text);
}

.primary-button,
.secondary-button,
.footer-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 0 22px;
  border-radius: 18px;
  cursor: pointer;
  font-weight: 850;
  letter-spacing: -0.02em;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-button {
  border: 1px solid rgba(255, 107, 20, 0.7);
  background: linear-gradient(180deg, #ff8a28, var(--accent));
  color: #170c05;
  box-shadow: 0 18px 38px rgba(255, 107, 20, 0.28);
}

.secondary-button,
.footer-link {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.primary-button:hover,
.secondary-button:hover,
.footer-link:hover {
  transform: translateY(-2px);
}

.compact-button {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
}

.hero-section {
  min-height: 100vh;
  padding: 150px 0 72px;
}

.hero-copy {
  width: min(900px, 100%);
  margin: 0 auto 48px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: currentColor;
  content: "";
}

.hero-copy h1,
.section-kicker h2,
.trust-copy h2,
.qc-head h2,
.final-cta h2 {
  margin: 0;
  color: var(--text);
  letter-spacing: -0.055em;
}

.hero-copy h1 {
  margin-top: 24px;
  font-size: clamp(56px, 8.2vw, 128px);
  line-height: 0.88;
}

.hero-copy p {
  width: min(680px, 100%);
  margin: 28px auto 0;
  color: var(--text-soft);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.5;
}

.hero-actions {
  justify-content: center;
  gap: 12px;
  margin-top: 34px;
  flex-wrap: wrap;
}

.result-board {
  position: relative;
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 18px;
  padding: clamp(14px, 2vw, 24px);
  border: 1px solid var(--line);
  border-radius: clamp(30px, 5vw, 58px);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 107, 20, 0.13), transparent 34%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 88%, transparent), color-mix(in srgb, var(--surface) 72%, transparent));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
}

.source-card,
.final-card,
.result-notes,
.copy-comparison article,
.action-panel,
.trust-section,
.qc-section,
.final-cta,
.pricing-card,
.pricing-placeholder {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.source-card,
.final-card {
  overflow: hidden;
  border-radius: 34px;
}

.source-card {
  align-self: end;
  padding: 14px;
  transform: translateY(38px);
}

.source-card span,
.media-tag,
.copy-comparison span,
.final-copy span {
  display: inline-flex;
  width: fit-content;
  padding: 8px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 850;
}

.source-card img,
.final-media img,
.trust-media img,
.action-panel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-card img {
  height: 340px;
  margin-top: 12px;
  border-radius: 24px;
}

.source-card p {
  margin: 14px 4px 4px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.45;
}

.final-card {
  position: relative;
  display: grid;
  grid-template-rows: minmax(430px, 0.95fr) auto;
  min-height: 720px;
}

.final-media {
  position: relative;
  overflow: hidden;
}

.final-media::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.28));
  content: "";
}

.media-tag {
  position: absolute;
  z-index: 2;
  left: 20px;
  bottom: 20px;
  background: rgba(20, 14, 10, 0.68);
  color: rgba(255, 248, 239, 0.86);
  backdrop-filter: blur(14px);
}

.score-badge {
  position: absolute;
  z-index: 2;
  top: 22px;
  right: 22px;
  gap: 2px;
  padding: 14px 17px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  background: rgba(20, 14, 10, 0.72);
  color: #fff7ef;
  backdrop-filter: blur(16px);
}

.score-badge strong {
  font-size: clamp(42px, 6vw, 76px);
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.score-badge span {
  color: rgba(255, 247, 239, 0.68);
  font-weight: 850;
}

.final-copy {
  display: grid;
  gap: 14px;
  padding: clamp(22px, 3vw, 34px);
}

.final-copy h2 {
  margin: 0;
  font-size: clamp(34px, 5vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.final-copy p {
  max-width: 760px;
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.55;
}

.result-notes {
  position: absolute;
  right: 34px;
  bottom: -42px;
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 4px;
  padding: 10px;
  border-radius: 24px;
}

.result-notes div {
  display: grid;
  gap: 2px;
  min-width: 126px;
  padding: 14px 16px;
  border-radius: 17px;
  background: var(--surface-strong);
}

.result-notes b {
  color: var(--accent);
  font-size: 24px;
  letter-spacing: -0.04em;
}

.result-notes span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 740;
}

.proof-strip {
  justify-content: center;
  gap: 8px;
  margin: 46px 0 94px;
  flex-wrap: wrap;
}

.proof-strip span {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 780;
}

section {
  scroll-margin-top: 110px;
}

.showcase-section,
.actions-section,
.trust-section,
.qc-section,
.final-cta {
  margin-top: 118px;
}

.section-kicker {
  display: grid;
  gap: 18px;
  width: min(760px, 100%);
  margin-bottom: 34px;
}

.section-kicker.wide {
  width: min(900px, 100%);
  margin-inline: auto;
  text-align: center;
}

.section-kicker.wide .eyebrow {
  justify-self: center;
}

.section-kicker h2,
.trust-copy h2,
.qc-head h2,
.final-cta h2 {
  font-size: clamp(38px, 5.2vw, 78px);
  line-height: 0.96;
}

.section-kicker p,
.qc-head p,
.final-cta p,
.trust-copy > p {
  margin: 0;
  color: var(--text-soft);
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.55;
}

.compare-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: stretch;
}

.compare-widget {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface-muted);
  box-shadow: var(--shadow-card);
  touch-action: none;
  user-select: none;
}

.compare-layer {
  position: absolute;
  inset: 0;
}

.compare-layer img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compare-before span,
.compare-after span {
  position: absolute;
  z-index: 4;
  top: 22px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(20, 14, 10, 0.68);
  color: #fff7ef;
  font-size: 13px;
  font-weight: 850;
  backdrop-filter: blur(14px);
}

.compare-before span {
  left: 22px;
}

.compare-after {
  overflow: hidden;
  clip-path: inset(0 0 0 var(--compare-position));
}

.compare-after span {
  right: 22px;
}

.compare-divider {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: var(--compare-position);
  width: 1px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(18, 14, 11, 0.78);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  cursor: grab;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(16px);
}

.compare-handle::before,
.compare-handle::after {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 2px solid #fff7ef;
  border-left: 2px solid #fff7ef;
  content: "";
}

.compare-handle::before {
  left: 14px;
  transform: translateY(-50%) rotate(-45deg);
}

.compare-handle::after {
  right: 14px;
  transform: translateY(-50%) rotate(135deg);
}

.compare-widget.is-dragging .compare-handle {
  cursor: grabbing;
}

.copy-comparison {
  display: grid;
  gap: 16px;
}

.copy-comparison article {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: clamp(24px, 3vw, 34px);
  border-radius: var(--radius-lg);
}

.copy-comparison article:last-child {
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
}

.copy-comparison h3 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.copy-comparison p {
  margin: 0;
  color: var(--text-soft);
  font-size: 17px;
  line-height: 1.56;
}

.action-panels {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 20px;
  margin-top: 42px;
}

.action-panel {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 460px;
  overflow: hidden;
  padding: clamp(24px, 3vw, 34px);
  border-radius: var(--radius-xl);
}

.action-panel h3 {
  margin: 20px 0 12px;
  font-size: clamp(36px, 4.2vw, 62px);
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.action-panel p {
  max-width: 520px;
  margin: 0;
  color: var(--text-soft);
  font-size: 18px;
  line-height: 1.55;
}

.action-panel img {
  position: absolute;
  z-index: -1;
  right: 0;
  bottom: 0;
  width: 52%;
  height: 58%;
  opacity: 0.82;
  mask-image: linear-gradient(90deg, transparent, #000 32%);
}

.create-panel {
  grid-row: span 2;
  min-height: 620px;
  background:
    linear-gradient(140deg, var(--surface-strong) 0 42%, color-mix(in srgb, var(--accent-soft) 72%, var(--surface)) 100%);
}

.create-panel img {
  width: 64%;
  height: 56%;
}

.panel-number {
  width: fit-content;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.audit-preview {
  width: min(300px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--surface-strong);
}

.audit-preview strong {
  color: var(--accent);
  font-size: 72px;
  letter-spacing: -0.08em;
  line-height: 0.9;
}

.audit-preview span {
  color: var(--text-muted);
  font-weight: 850;
}

.audit-preview p {
  margin-top: 12px;
  font-size: 15px;
}

.trust-section {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  padding: clamp(18px, 2.4vw, 28px);
  border-radius: var(--radius-xl);
}

.trust-media {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border-radius: 32px;
}

.trust-label {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(18, 14, 11, 0.68);
  color: #fff7ef;
  backdrop-filter: blur(16px);
}

.trust-label span {
  color: rgba(255, 247, 239, 0.72);
}

.trust-copy {
  display: grid;
  align-content: center;
  gap: 22px;
  padding: clamp(14px, 3vw, 42px);
}

.trust-rules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.trust-rules article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface-strong);
}

.trust-rules h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.trust-rules p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.qc-section {
  padding: clamp(24px, 4vw, 46px);
  border-radius: var(--radius-xl);
}

.qc-head {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.75fr);
  gap: 28px;
  align-items: end;
}

.qc-head h2 {
  margin-top: 16px;
}

.cost-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 34px;
}

.cost-grid article {
  display: grid;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
}

.cost-grid span {
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 780;
}

.cost-grid b {
  color: var(--accent);
  font-size: 28px;
  letter-spacing: -0.05em;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.pricing-card,
.pricing-placeholder {
  display: grid;
  gap: 12px;
  min-height: 250px;
  padding: 22px;
  border-radius: 26px;
}

.pricing-placeholder {
  grid-column: 1 / -1;
  min-height: auto;
  color: var(--text-soft);
}

.pricing-card.popular {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background:
    linear-gradient(180deg, var(--surface-strong), var(--surface)),
    var(--accent-soft);
}

.popular-label {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.pricing-card h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.pricing-card b {
  color: var(--accent);
  font-size: 42px;
  letter-spacing: -0.065em;
}

.pricing-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.45;
}

.pricing-card .primary-button {
  width: 100%;
  min-height: 46px;
  margin-top: auto;
}

.qc-cta {
  width: fit-content;
  margin-top: 18px;
}

.final-cta {
  display: grid;
  justify-items: center;
  gap: 20px;
  padding: clamp(42px, 7vw, 86px) 24px;
  border-radius: var(--radius-xl);
  text-align: center;
}

.final-cta p {
  width: min(620px, 100%);
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, auto) auto;
  gap: 24px;
  align-items: start;
  padding: 70px 0 38px;
  color: var(--text-soft);
}

.site-footer p {
  margin: 12px 0 0;
  line-height: 1.5;
}

.site-footer nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.site-footer nav a,
.footer-link {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 14px;
}

.footer-theme {
  display: grid;
  gap: 10px;
}

.footer-theme > span {
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.footer-theme-buttons {
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}

.footer-theme-buttons button {
  min-height: 34px;
  padding: 0 11px;
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(14, 10, 7, 0.62);
  cursor: pointer;
  backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-card);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 22px;
}

.modal-card h2 {
  margin: 18px 0 10px;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.modal-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.telegram-login-box {
  min-height: 48px;
  margin-top: 22px;
}

.auth-status {
  margin-top: 16px !important;
  font-size: 14px;
}

.account-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
}

.account-state strong {
  font-size: 22px;
}

.account-state span {
  color: var(--accent);
  font-weight: 850;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy,
  .result-board,
  .proof-strip,
  .section-kicker,
  .compare-layout,
  .action-panel,
  .trust-section,
  .qc-section,
  .final-cta {
    animation: riseIn 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }

  .result-board {
    animation-delay: 100ms;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1060px) {
  .header-nav {
    display: none;
  }

  .menu-button {
    display: block;
    justify-self: end;
  }

  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .site-header.menu-open {
    align-items: start;
    border-radius: 28px;
  }

  .site-header.menu-open .header-nav,
  .site-header.menu-open .header-actions {
    display: grid;
    grid-column: 1 / -1;
    justify-content: stretch;
    width: 100%;
    margin-top: 14px;
  }

  .site-header.menu-open .header-nav a,
  .site-header.menu-open .header-actions button,
  .site-header.menu-open .theme-picker {
    width: 100%;
  }

  .theme-menu {
    left: 0;
    right: 0;
  }

  .result-board,
  .compare-layout,
  .trust-section,
  .qc-head {
    grid-template-columns: 1fr;
  }

  .source-card {
    transform: none;
  }

  .result-notes {
    position: static;
    grid-column: 1 / -1;
  }

  .action-panels {
    grid-template-columns: 1fr;
  }

  .create-panel {
    grid-row: auto;
  }

  .pricing-grid,
  .cost-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-footer {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  main,
  .site-footer,
  .site-header {
    width: min(100% - 24px, 1180px);
  }

  .site-header {
    top: 12px;
    padding: 10px;
  }

  .brand-name,
  .theme-button span:last-child {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .compact-button {
    padding: 0 12px;
  }

  .hero-section {
    padding-top: 116px;
  }

  .hero-copy {
    text-align: left;
  }

  .hero-copy h1 {
    font-size: clamp(48px, 16vw, 74px);
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button,
  .action-panel > .primary-button,
  .action-panel > .secondary-button {
    width: 100%;
  }

  .result-board {
    padding: 10px;
    border-radius: 30px;
  }

  .source-card,
  .final-card,
  .compare-widget,
  .action-panel,
  .trust-section,
  .qc-section,
  .final-cta {
    border-radius: 28px;
  }

  .source-card img {
    height: 260px;
  }

  .final-card {
    min-height: 0;
    grid-template-rows: auto auto;
  }

  .final-media {
    min-height: 330px;
  }

  .final-media img {
    min-height: 330px;
  }

  .score-badge {
    top: 14px;
    right: 14px;
    padding: 10px 12px;
  }

  .media-tag {
    left: 14px;
    bottom: 14px;
  }

  .result-notes {
    grid-template-columns: 1fr;
  }

  .compare-widget {
    min-height: 430px;
  }

  .copy-comparison {
    grid-template-columns: 1fr;
  }

  .action-panel {
    min-height: 430px;
  }

  .action-panel img {
    width: 76%;
    height: 44%;
    opacity: 0.55;
  }

  .trust-media {
    min-height: 380px;
  }

  .trust-rules,
  .pricing-grid,
  .cost-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer nav,
  .footer-theme-buttons {
    align-items: stretch;
    flex-direction: column;
  }

  .footer-theme-buttons {
    border-radius: 22px;
  }
}

/* Polish layer for the primary public landing. Keeps the page quieter and prevents overflow. */
main *,
.site-header *,
.site-footer * {
  min-width: 0;
}

h1,
h2,
h3,
p,
b,
span {
  overflow-wrap: anywhere;
}

:root {
  --shadow-soft: 0 18px 50px rgba(58, 38, 20, 0.09);
  --shadow-card: 0 16px 46px rgba(58, 38, 20, 0.12);
  --radius-xl: 34px;
  --radius-lg: 26px;
}

[data-theme="dark"] {
  --shadow-soft: 0 22px 70px rgba(0, 0, 0, 0.34);
  --shadow-card: 0 24px 80px rgba(0, 0, 0, 0.42);
}

main,
.site-footer,
.site-header {
  width: min(1160px, calc(100% - 40px));
}

body {
  background:
    radial-gradient(circle at 72% 4%, var(--accent-soft), transparent 30%),
    linear-gradient(180deg, var(--page), var(--page-soft) 56%, var(--page));
}

.hero-section {
  min-height: auto;
  padding: 142px 0 58px;
}

.hero-copy {
  width: min(820px, 100%);
  margin-bottom: 38px;
}

.hero-copy h1 {
  font-size: clamp(52px, 7.2vw, 104px);
  line-height: 0.92;
  text-wrap: balance;
}

.hero-copy p {
  width: min(620px, 100%);
  margin-top: 24px;
}

.result-board {
  display: block;
  padding: clamp(10px, 1.6vw, 18px);
  border-radius: clamp(28px, 4vw, 42px);
}

.final-card {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  min-height: 0;
  border-radius: 28px;
}

.final-media {
  min-height: 540px;
}

.score-badge {
  top: 18px;
  right: 18px;
  padding: 11px 14px;
  border-radius: 22px;
}

.score-badge strong {
  font-size: clamp(38px, 5vw, 64px);
}

.final-copy {
  align-content: center;
  padding: clamp(26px, 4vw, 50px);
}

.final-copy h2 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.showcase-section,
.actions-section,
.trust-section,
.qc-section,
.final-cta {
  margin-top: 92px;
}

.section-kicker h2,
.trust-copy h2,
.qc-head h2,
.final-cta h2 {
  font-size: clamp(34px, 4.6vw, 66px);
  line-height: 1;
  text-wrap: balance;
}

.compare-widget {
  min-height: 540px;
}

.copy-comparison h3 {
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.08;
  text-wrap: balance;
}

.action-panels {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.action-panel {
  min-height: 340px;
}

.create-panel {
  min-height: 430px;
}

.action-panel h3 {
  font-size: clamp(34px, 3.8vw, 54px);
  line-height: 1;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.action-panel img {
  display: none;
}

.audit-preview {
  width: min(260px, 100%);
}

.audit-preview strong {
  font-size: clamp(54px, 6vw, 66px);
}

.trust-section {
  grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.12fr);
}

.trust-media {
  min-height: 480px;
}

.cost-grid,
.pricing-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cost-grid b {
  font-size: clamp(22px, 2.4vw, 28px);
  white-space: nowrap;
}

.pricing-card,
.pricing-placeholder {
  min-height: 220px;
  padding: 20px;
  border-radius: 24px;
}

.pricing-card h3 {
  font-size: clamp(19px, 1.8vw, 22px);
}

.pricing-card b {
  font-size: clamp(30px, 3.4vw, 40px);
  white-space: nowrap;
}

.pricing-card p {
  overflow-wrap: break-word;
}

@media (max-width: 1060px) {
  .final-card,
  .action-panels,
  .trust-section {
    grid-template-columns: 1fr;
  }

  .final-media {
    min-height: 460px;
  }

  .create-panel {
    grid-row: auto;
  }

  .cost-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  main,
  .site-footer,
  .site-header {
    width: min(100% - 24px, 1180px);
  }

  .hero-section {
    padding-top: 112px;
  }

  .hero-copy h1 {
    font-size: clamp(42px, 13vw, 64px);
    line-height: 0.96;
  }

  .hero-copy p {
    font-size: 18px;
  }

  .final-media,
  .final-media img {
    min-height: 320px;
  }

  .media-tag {
    max-width: calc(100% - 28px);
    font-size: 11px;
  }

  .score-badge {
    top: 12px;
    right: 12px;
    padding: 9px 11px;
  }

  .score-badge strong {
    font-size: 42px;
  }

  .final-copy {
    padding: 22px;
  }

  .final-copy h2,
  .section-kicker h2,
  .trust-copy h2,
  .qc-head h2,
  .final-cta h2 {
    font-size: clamp(30px, 9.4vw, 42px);
    line-height: 1.04;
  }

  .compare-widget {
    min-height: 360px;
  }

  .action-panel {
    min-height: 300px;
  }

  .trust-media {
    min-height: 320px;
  }

  .cost-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .qc-cta {
    width: 100%;
  }
}

/* Final request polish: calmer layout, clearer focus, safer text flow. */
:root {
  --grid-line: rgba(58, 38, 20, 0.048);
}

[data-theme="dark"] {
  --grid-line: rgba(255, 241, 225, 0.04);
}

body {
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(circle at 78% 4%, rgba(255, 107, 20, 0.11), transparent 28%),
    radial-gradient(circle at 12% 34%, rgba(255, 107, 20, 0.055), transparent 26%),
    linear-gradient(180deg, var(--page), var(--page-soft) 58%, var(--page));
  background-size: 78px 78px, 78px 78px, auto, auto, auto;
}

.brand {
  transition: color 180ms ease, transform 180ms ease;
}

.brand:hover {
  color: var(--accent);
}

.brand:hover .brand-mark {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--line));
  box-shadow: 0 14px 34px rgba(255, 107, 20, 0.22);
}

.brand-logo-placeholder {
  border: 1px dashed color-mix(in srgb, var(--accent) 36%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-strong) 88%, transparent), color-mix(in srgb, var(--accent-soft) 38%, var(--surface)));
  color: transparent;
  box-shadow: none;
}

.brand-logo {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  background: var(--surface-strong);
  box-shadow: 0 10px 26px rgba(255, 107, 20, 0.16);
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-section {
  padding-top: 148px;
}

.hero-copy {
  width: min(1080px, 100%);
  margin-bottom: 44px;
}

.hero-copy h1 {
  width: min(1040px, 100%);
  margin-right: auto;
  margin-left: auto;
  font-size: clamp(52px, 6.75vw, 98px);
  line-height: 0.95;
  letter-spacing: -0.062em;
}

.hero-nowrap {
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
}

.accent-word {
  display: inline !important;
  color: var(--accent);
}

.hero-lead {
  width: min(760px, 100%);
  margin-top: 28px;
  font-size: clamp(20px, 2.1vw, 27px);
  line-height: 1.42;
}

.hero-sublead {
  width: min(760px, 100%);
  margin-top: 10px;
  color: var(--text-muted);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.55;
}

.result-board {
  padding: clamp(12px, 1.7vw, 20px);
}

.final-media {
  min-height: 510px;
}

.media-tag {
  bottom: 38px;
  padding: 8px 12px;
}

.score-badge {
  top: 18px;
  right: 18px;
  padding: 8px 11px;
  border-radius: 18px;
}

.score-badge strong {
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.075em;
}

.score-badge span {
  font-size: 13px;
}

.final-copy h2 {
  font-size: clamp(31px, 3.55vw, 48px);
  letter-spacing: -0.04em;
}

.compare-widget {
  isolation: isolate;
}

.section-kicker h2 span {
  display: block;
}

.showcase-title-line {
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
}

.compare-before span,
.compare-after span {
  display: none;
}

.compare-label {
  position: absolute;
  z-index: 8;
  top: 22px;
  display: inline-flex;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(20, 14, 10, 0.74);
  color: #fff7ef;
  font-size: 13px;
  font-weight: 850;
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.compare-label-before {
  left: 22px;
}

.compare-label-after {
  right: 22px;
}

.compare-divider {
  z-index: 6;
}

.actions-section .section-kicker p {
  width: min(700px, 100%);
  margin-right: auto;
  margin-left: auto;
  text-align: center;
}

.action-panels {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.create-panel {
  grid-row: auto;
  min-height: 420px;
}

.action-panel {
  min-height: 420px;
  gap: 22px;
  align-content: start;
}

.action-panel h3 {
  margin-top: 18px;
  font-size: clamp(34px, 3.3vw, 48px);
}

.action-panel p {
  font-size: 17px;
}

.action-panel > .primary-button,
.action-panel > .secondary-button {
  align-self: end;
  width: fit-content;
  margin-top: auto;
}

.audit-preview {
  width: 100%;
  margin: 4px 0 8px;
  padding: 18px;
}

.audit-preview strong {
  font-size: clamp(46px, 5.2vw, 58px);
}

.qc-head {
  align-items: start;
}

.cost-grid,
.qc-cta {
  display: none !important;
}

.pricing-grid {
  margin-top: 34px;
  padding-top: 18px;
  overflow: visible;
}

.pricing-card {
  position: relative;
  min-height: 260px;
  align-content: start;
  grid-template-rows: auto auto auto 1fr auto;
}

.pricing-card.popular {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    var(--shadow-soft);
}

.popular-label {
  position: absolute;
  z-index: 2;
  top: -18px;
  left: 50%;
  max-width: calc(100% - 34px);
  padding: 8px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 82%, var(--accent-soft));
  box-shadow: 0 12px 28px rgba(255, 107, 20, 0.16);
  white-space: nowrap;
  transform: translateX(-50%);
}

.pricing-card.popular h3 {
  padding-right: 0;
}

.site-footer {
  grid-template-columns: minmax(220px, 1fr) minmax(260px, auto) minmax(280px, auto) auto;
}

.footer-theme {
  position: relative;
  justify-self: start;
  gap: 0;
}

.footer-theme-button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.footer-theme-button:hover,
.footer-theme-button[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
  background: var(--surface-strong);
  color: var(--text);
}

.footer-theme-button span {
  color: var(--accent);
  font-weight: 850;
}

.footer-theme-menu {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 16px);
  display: grid;
  gap: 5px;
  min-width: 150px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.footer-theme-menu[hidden] {
  display: none;
}

.footer-theme-menu button {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
}

.footer-theme-menu button:hover,
.footer-theme-menu button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

@media (max-width: 1060px) {
  .hero-copy h1 {
    font-size: clamp(48px, 8.2vw, 78px);
  }

  .action-panels {
    grid-template-columns: 1fr;
  }

  .action-panel,
  .create-panel {
    min-height: 340px;
  }

  .action-panel > .primary-button,
  .action-panel > .secondary-button {
    width: fit-content;
  }

  .site-footer {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .hero-copy h1 {
    font-size: clamp(40px, 12.4vw, 60px);
    letter-spacing: -0.052em;
  }

  .hero-nowrap {
    white-space: normal;
  }

  .hero-lead {
    font-size: 19px;
  }

  .hero-sublead {
    font-size: 16px;
  }

  .final-media,
  .final-media img {
    min-height: 310px;
  }

  .media-tag {
    bottom: 24px;
  }

  .score-badge strong {
    font-size: 30px;
  }

  .showcase-title-line {
    white-space: normal;
  }

  .compare-label {
    top: 14px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .compare-label-before {
    left: 14px;
  }

  .compare-label-after {
    right: 14px;
  }

  .action-panel,
  .create-panel {
    min-height: 310px;
  }

  .action-panel > .primary-button,
  .action-panel > .secondary-button {
    width: 100%;
  }

  .popular-label {
    top: -16px;
    position: absolute;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-theme-menu {
    right: auto;
    left: 0;
  }
}

/* Hard final override: keep the hero score card normal-sized, shrink only the number. */
.hero-section .score-badge {
  top: 22px !important;
  right: 22px !important;
  gap: 3px !important;
  padding: 14px 17px !important;
  border-radius: 24px !important;
}

.hero-section .score-badge .score-number {
  display: inline-block !important;
  color: #fff7ef !important;
  font-size: clamp(22px, 2.05vw, 30px) !important;
  font-weight: 950 !important;
  letter-spacing: -0.08em !important;
  line-height: 0.9 !important;
}

.hero-section .score-badge .score-total {
  display: inline-block !important;
  color: rgba(255, 247, 239, 0.68) !important;
  font-size: 15px !important;
  font-weight: 850 !important;
  line-height: 1.05 !important;
}

@media (max-width: 720px) {
  .hero-section .score-badge {
    top: 12px !important;
    right: 12px !important;
    padding: 10px 12px !important;
    border-radius: 20px !important;
  }

  .hero-section .score-badge .score-number {
    font-size: 22px !important;
  }
}

/* Hero product result: clean 50/50 grid without the old row layout. */
.hero-section .final-card {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  grid-template-rows: 1fr !important;
  grid-auto-rows: 0 !important;
  align-items: stretch !important;
  min-height: 0 !important;
}

.hero-section .final-media {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-height: 0 !important;
  height: 100% !important;
  aspect-ratio: auto !important;
}

.hero-section .final-media img {
  position: static !important;
  display: block !important;
  width: 100% !important;
  min-height: 0 !important;
  height: 100% !important;
  object-fit: cover !important;
}

.hero-section .final-copy {
  grid-column: 2 !important;
  grid-row: 1 !important;
  align-content: center !important;
}

@media (max-width: 1060px) {
  .hero-section .final-card {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    grid-auto-rows: auto !important;
    min-height: 0 !important;
  }

  .hero-section .final-media,
  .hero-section .final-copy {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .hero-section .final-media,
  .hero-section .final-media img {
    height: auto !important;
  }
}

/* Final typography polish: slightly more air in heavy text without changing the layout. */
.hero-copy h1 {
  letter-spacing: -0.045em !important;
}

.section-kicker h2,
.trust-copy h2,
.qc-head h2,
.final-cta h2 {
  letter-spacing: -0.034em !important;
}

.final-copy h2,
.action-panel h3 {
  letter-spacing: -0.032em !important;
}

.pricing-card b {
  letter-spacing: -0.045em !important;
}

.hero-section .score-badge .score-number {
  letter-spacing: -0.055em !important;
}

/* Authenticated web workspace */
body.app-open {
  min-height: 100vh;
}

.app-shell[hidden] {
  display: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  gap: 24px;
  width: min(1440px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0;
}

.app-sidebar,
.app-topbar,
.app-card,
.app-bottom-nav {
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 82%, transparent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(22px);
}

.app-sidebar {
  position: sticky;
  top: 22px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: calc(100vh - 44px);
  padding: 18px;
  border-radius: 30px;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 19px;
  font-weight: 850;
  letter-spacing: -0.02em;
  transition: color 160ms ease, background 160ms ease;
}

.app-brand:hover {
  background: var(--surface-muted);
  color: var(--accent);
}

.app-nav,
.app-sidebar-foot {
  display: grid;
  gap: 8px;
}

.app-nav {
  align-content: start;
  margin-top: 26px;
}

.app-nav button,
.app-bottom-nav button,
.app-ghost-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 780;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.app-nav button,
.app-ghost-button {
  padding: 0 14px;
}

.app-nav button:hover,
.app-nav button.active,
.app-bottom-nav button:hover,
.app-bottom-nav button.active,
.app-ghost-button:hover {
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.app-sidebar-foot {
  align-content: end;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.app-main {
  min-width: 0;
}

.app-topbar {
  position: sticky;
  z-index: 20;
  top: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 86px;
  padding: 16px 18px;
  border-radius: 28px;
}

.app-kicker {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.app-topbar h1,
.app-card h2,
.app-card h3,
.workspace-hero h2,
.scenario-panel h2 {
  margin: 0;
  letter-spacing: -0.032em;
}

.app-topbar h1 {
  font-size: clamp(25px, 2.7vw, 38px);
  line-height: 1.02;
}

.app-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.balance-chip,
.action-cost {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.balance-chip {
  cursor: pointer;
}

.app-screen {
  display: grid;
  gap: 22px;
  width: min(1080px, 100%);
  margin: 22px auto 0;
  padding-bottom: 24px;
}

.app-card {
  border-radius: 30px;
  padding: clamp(20px, 3vw, 30px);
}

.workspace-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.34fr);
  align-items: center;
  gap: 22px;
  min-height: 250px;
}

.workspace-hero h2,
.scenario-panel h2,
.app-card > h2 {
  font-size: clamp(32px, 4vw, 56px);
  line-height: 1;
}

.workspace-hero p,
.scenario-panel p,
.app-card p,
.hint {
  color: var(--text-soft);
  line-height: 1.55;
}

.balance-card {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.balance-card span {
  color: var(--text-soft);
  font-weight: 800;
}

.balance-card b,
.balance-big {
  color: var(--text);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.workspace-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.workspace-action {
  display: grid;
  min-height: 250px;
  align-content: start;
  gap: 14px;
}

.workspace-action h3 {
  font-size: clamp(24px, 2.5vw, 32px);
}

.workspace-action .primary-button,
.workspace-action .secondary-button {
  width: fit-content;
  align-self: end;
  margin-top: auto;
}

.section-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.operation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
}

.operation-row span,
.saved-card span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.operation-row strong {
  display: block;
  margin-top: 3px;
}

.operation-row time,
.operation-row em,
.saved-card small {
  color: var(--text-muted);
  font-style: normal;
  font-size: 13px;
}

.operation-row b {
  white-space: nowrap;
}

.operation-row b.positive {
  color: var(--success);
}

.empty-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 22px;
}

.scenario-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.36fr);
  gap: 20px;
  align-items: start;
}

.scenario-panel {
  display: grid;
  gap: 18px;
}

.scenario-aside {
  position: sticky;
  top: 126px;
  display: grid;
  gap: 16px;
}

.scenario-panel label,
.result-copy label {
  display: grid;
  gap: 9px;
  color: var(--text);
  font-weight: 820;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--text);
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="text"] {
  min-height: 52px;
  padding: 0 16px;
}

textarea {
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.file-zone {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 190px;
  place-items: center;
  padding: 22px;
  border: 1px dashed color-mix(in srgb, var(--accent) 34%, var(--line-strong));
  border-radius: 26px;
  background: color-mix(in srgb, var(--accent-soft) 28%, var(--surface));
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.file-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-zone span {
  font-size: 20px;
  font-weight: 900;
}

.file-zone small {
  color: var(--text-soft);
}

.preview-grid,
.saved-grid,
.photo-compare-result {
  display: grid;
  gap: 14px;
}

.preview-grid {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.preview-grid figure,
.photo-compare-result figure {
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.preview-grid img,
.photo-compare-result img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.preview-grid figcaption,
.photo-compare-result figcaption {
  padding: 9px 11px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
}

.segmented,
.mode-tabs,
.filter-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.segmented label,
.mode-tabs button,
.filter-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 840;
}

.segmented input {
  margin-right: 7px;
  accent-color: var(--accent);
}

.mode-tabs button.active,
.filter-tabs button.active,
.filter-tabs button:hover {
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: var(--accent-soft);
  color: var(--accent);
}

.cost-summary {
  display: grid;
  gap: 11px;
}

.cost-summary h3 {
  font-size: 20px;
}

.cost-summary div,
.cost-line,
.cost-table div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cost-summary .total {
  border-bottom: 0;
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
}

.wide-button {
  width: 100%;
}

.form-message {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, #d93b22 28%, var(--line));
  border-radius: 16px;
  background: color-mix(in srgb, #d93b22 10%, var(--surface));
  color: #d93b22;
  font-weight: 800;
}

.app-state {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 420px;
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  text-align: center;
}

.app-state h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.035em;
}

.app-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: app-spin 900ms linear infinite;
}

@keyframes app-spin {
  to {
    transform: rotate(360deg);
  }
}

.processing-state ol {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-soft);
}

.state-icon {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 950;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 24px;
  align-items: stretch;
}

.result-photo {
  width: 100%;
  height: 100%;
  min-height: 460px;
  border-radius: 24px;
  object-fit: cover;
}

.result-copy {
  display: grid;
  align-content: center;
  gap: 16px;
}

.result-copy h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: -0.034em;
}

.result-text {
  min-height: 220px;
  font-size: 16px;
  line-height: 1.55;
}

.result-text.muted {
  opacity: 0.72;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.characteristics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 0;
}

.characteristics div {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.characteristics dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.characteristics dd {
  margin: 4px 0 0;
  font-weight: 850;
}

.analysis-result,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.score-panel b {
  display: block;
  color: var(--accent);
  font-size: clamp(62px, 8vw, 110px);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.score-panel small {
  color: var(--text-muted);
  font-size: 0.32em;
  letter-spacing: -0.03em;
}

.wide-result {
  grid-column: 1 / -1;
}

.clean-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  color: var(--text-soft);
  line-height: 1.45;
}

.photo-compare-result {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: center;
}

.saved-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.saved-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.saved-card img,
.saved-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  object-fit: cover;
}

.saved-placeholder {
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}

.saved-card h3 {
  margin: 6px 0;
  font-size: 22px;
}

.saved-card p {
  min-height: 64px;
}

.saved-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.danger-button {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid color-mix(in srgb, #d93b22 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, #d93b22 8%, var(--surface));
  color: #d93b22;
  cursor: pointer;
  font-weight: 900;
}

.danger-button.compact-button {
  min-height: 40px;
  padding: 0 14px;
}

.profile-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.avatar {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 24px;
  background: var(--accent);
  color: #160b05;
  font-size: 34px;
  font-weight: 950;
}

.profile-card h2 {
  font-size: clamp(30px, 4vw, 48px);
}

.profile-card dl {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
}

.profile-card dl div,
.setting-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.profile-card dt,
.setting-row span {
  color: var(--text-muted);
  font-weight: 800;
}

.profile-card dd {
  margin: 0;
  font-weight: 900;
}

.profile-settings {
  display: grid;
  align-content: start;
  gap: 18px;
}

.cost-table {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 8px;
}

.cost-table div {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: var(--surface);
}

.app-pricing {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.app-back-button {
  width: fit-content;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  font-weight: 850;
}

.app-bottom-nav {
  position: fixed;
  z-index: 40;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 7px;
  border-radius: 24px;
}

.app-bottom-nav button {
  min-height: 48px;
  padding: 0 6px;
  border-radius: 18px;
  text-align: center;
  font-size: 12px;
}

/* Keep hero visual stable: image fills the media half, text lives in its own half. */
.hero-section .final-card {
  overflow: hidden !important;
}

.hero-section .final-media {
  position: relative !important;
  align-self: stretch !important;
  min-height: clamp(480px, 42vw, 620px) !important;
}

.hero-section .final-media img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

.hero-section .final-media::after {
  z-index: 1;
}

.hero-section .media-tag,
.hero-section .score-badge {
  z-index: 3;
}

.hero-section .score-badge .score-number {
  font-size: clamp(26px, 2.2vw, 34px) !important;
}

@media (max-width: 1180px) {
  .app-pricing,
  .cost-table {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 920px);
    padding-bottom: 92px;
  }

  .app-sidebar {
    display: none;
  }

  .app-topbar {
    top: 12px;
  }

  .app-bottom-nav {
    display: grid;
  }

  .workspace-hero,
  .workspace-actions,
  .scenario-layout,
  .result-layout,
  .analysis-result,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .scenario-aside {
    position: static;
  }

  .result-photo {
    min-height: 320px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 640px);
    padding-top: 10px;
  }

  .app-topbar {
    display: grid;
    min-height: 0;
    border-radius: 24px;
  }

  .app-top-actions {
    justify-content: stretch;
  }

  .balance-chip,
  .app-top-actions .secondary-button {
    width: 100%;
    justify-content: center;
  }

  .app-screen {
    margin-top: 14px;
  }

  .app-card,
  .app-state {
    border-radius: 24px;
    padding: 18px;
  }

  .workspace-hero h2,
  .scenario-panel h2,
  .app-card > h2 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .workspace-action {
    min-height: 220px;
  }

  .operation-row,
  .empty-inline,
  .section-row,
  .setting-row,
  .profile-card dl div {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .file-zone {
    min-height: 160px;
  }

  .photo-compare-result,
  .app-pricing,
  .cost-table {
    grid-template-columns: 1fr;
  }

  .result-actions .primary-button,
  .result-actions .secondary-button,
  .result-actions .danger-button,
  .saved-actions .primary-button,
  .saved-actions .secondary-button,
  .saved-actions .danger-button {
    width: 100%;
  }

  .app-bottom-nav {
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app-spinner {
    animation: none;
  }
}


/* Authenticated landing header */
.header-balance {
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  font-weight: 850;
}

.header-balance[hidden] {
  display: none;
}

/* Simplified workspace sidebar */
.app-sidebar {
  grid-template-rows: 1fr auto;
}

.app-nav {
  margin-top: 0;
}

/* workspace4 fixes */
.pricing-card b,
.app-pricing .pricing-card b {
  color: #ffffff !important;
}

@media (min-width: 981px) {
  .site-footer {
    grid-template-columns: minmax(220px, 1fr) auto auto auto !important;
    align-items: center;
  }

  .site-footer nav {
    flex-wrap: nowrap;
    white-space: nowrap;
  }

  .footer-theme {
    justify-self: end !important;
  }
}

.app-topbar {
  position: static !important;
  top: auto !important;
}

.app-main {
  padding-top: 0;
}

.app-screen {
  margin-top: 24px !important;
  scroll-margin-top: 24px;
}

.app-nav-divider {
  display: block;
  height: 1px;
  margin: 6px 8px;
  background: var(--line);
}

.app-shell[data-page="profile"] .app-topbar,
.app-shell[data-page="workspace"] .app-topbar {
  margin-bottom: 0;
}

/* workspace5: hidden elements must never be restored by component display rules */
[hidden] {
  display: none !important;
}

body.app-open #landingContent {
  display: none !important;
}

body.app-open #landingHeader,
body.app-open #landingFooter {
  display: grid !important;
}

body.app-open .app-shell {
  padding-top: calc(var(--header-height) + 58px) !important;
  padding-bottom: 48px !important;
  min-height: auto;
}

@media (max-width: 760px) {
  body.app-open .app-shell {
    padding-top: calc(var(--header-height) + 42px) !important;
    padding-bottom: 32px !important;
  }
}

body.app-open .app-shell:not([hidden]) {
  display: grid !important;
}


/* workspace7: separate Workspace and personal account */
.plan-usage {
  display: grid;
  gap: 7px;
  margin: 14px 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.plan-usage span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 780;
}

.app-shell[data-page="profile"] {
  grid-template-columns: minmax(0, 1fr) !important;
}

.app-shell[data-page="profile"] .app-sidebar,
.app-shell[data-page="profile"] .app-topbar,
.app-shell[data-page="profile"] .app-bottom-nav {
  display: none !important;
}

.app-shell[data-page="profile"] .app-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.app-shell[data-page="profile"] .app-screen {
  margin-top: 0 !important;
}

.profile-page {
  display: grid;
  gap: 18px;
}

.profile-card h1 {
  margin: 8px 0 0;
  font-size: clamp(38px, 5vw, 68px);
  line-height: .95;
  letter-spacing: -.05em;
}

.profile-actions {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.support-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 86px;
  padding: 0 28px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
  border-radius: 30px;
  background: color-mix(in srgb, var(--accent) 15%, var(--surface));
  color: var(--accent);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: -.03em;
}

.support-button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}

@media (max-width: 760px) {
  .app-shell[data-page="profile"] .app-main {
    width: min(100% - 24px, 1180px);
  }

  .support-button {
    min-height: 72px;
    padding: 0 20px;
    border-radius: 24px;
  }
}


/* pages1: standalone landing, workspace and profile documents */
body[data-page="workspace"],
body[data-page="profile"] {
  min-height: 100vh;
}

body[data-page="workspace"] #landingHeader,
body[data-page="profile"] #landingHeader {
  display: grid !important;
}

body[data-page="workspace"] #landingFooter,
body[data-page="profile"] #landingFooter {
  display: grid !important;
}

body[data-page="workspace"] .app-shell,
body[data-page="profile"] .app-shell {
  display: grid !important;
  padding-top: calc(var(--header-height) + 58px) !important;
  padding-bottom: 48px !important;
}

body[data-page="profile"] .app-shell {
  grid-template-columns: minmax(0, 1fr) !important;
}

body[data-page="profile"] .app-sidebar,
body[data-page="profile"] .app-topbar,
body[data-page="profile"] .app-bottom-nav {
  display: none !important;
}

body[data-page="profile"] .app-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

@media (max-width: 760px) {
  body[data-page="workspace"] .app-shell,
  body[data-page="profile"] .app-shell {
    padding-top: calc(var(--header-height) + 42px) !important;
    padding-bottom: 32px !important;
  }

  body[data-page="profile"] .app-main {
    width: min(100% - 24px, 1180px);
  }
}


/* App pages: never draw a focus frame around the whole page container. */
#appScreen:focus {
  outline: none;
}

/* Hero category carousel — transform-based, seamless and without a dark rear panel. */
.hero-carousel {
  position: relative;
  left: 50%;
  width: 100vw;
  margin-left: -50vw;
  overflow: hidden;
}

.hero-carousel-viewport {
  position: relative;
  overflow: visible;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}

.hero-carousel-viewport[data-dragging] {
  cursor: grabbing;
}

.hero-carousel-track {
  display: flex;
  gap: 20px;
  align-items: stretch;
  width: max-content;
  will-change: transform;
}

.hero-carousel-slide {
  flex: 0 0 min(1180px, calc(100vw - 40px));
  min-width: 0;
}

.hero-carousel-slide .result-board {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.hero-carousel-slide .final-card {
  height: 100%;
  box-shadow: none;
}

.hero-carousel-slide .final-card,
.hero-carousel-slide .final-media,
.hero-carousel-slide .final-copy {
  pointer-events: none;
}

.hero-carousel-arrow {
  position: absolute;
  z-index: 8;
  top: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(20, 14, 10, 0.76);
  color: #fff7ef;
  box-shadow: none;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(16px);
  transition: transform 160ms ease, background 160ms ease;
}

.hero-carousel-arrow:hover {
  background: rgba(20, 14, 10, 0.9);
  transform: translateY(-50%) scale(1.05);
}

.hero-carousel-arrow:active {
  transform: translateY(-50%) scale(0.96);
}

.hero-carousel-arrow span {
  display: block;
  margin-top: -4px;
  font-size: 42px;
  font-weight: 500;
  line-height: 1;
}

.hero-carousel-arrow-prev {
  left: max(18px, calc((100vw - 1180px) / 2 + 18px));
}

.hero-carousel-arrow-next {
  right: max(18px, calc((100vw - 1180px) / 2 + 18px));
}

@media (max-width: 760px) {
  .hero-carousel-track {
    gap: 12px;
  }

  .hero-carousel-slide {
    flex-basis: calc(100vw - 32px);
  }

  .hero-carousel-arrow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-carousel-track {
    transition-duration: 1ms !important;
  }
}

/* account-workspace1: account avatar, compact profile actions and ordered create steps */
.avatar {
  overflow: hidden;
}

.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-support-button {
  width: auto;
}

/* Keep all create steps in one ordered column; the cost panel stays on the right. */
#createForm > .scenario-panel {
  grid-column: 1;
}

#createForm > .scenario-aside {
  grid-column: 2;
  grid-row: 1 / span 3;
}

/* Workspace no longer has the internal top shape. */
body[data-page="workspace"] .app-screen {
  margin-top: 0 !important;
}

@media (max-width: 980px) {
  #createForm > .scenario-panel,
  #createForm > .scenario-aside {
    grid-column: 1;
    grid-row: auto;
  }
}


/* preview-auth1: spacing for the improve mode selector */
.improve-mode-card {
  display: grid;
  gap: clamp(24px, 3vw, 38px);
}

.improve-mode-heading {
  display: grid;
  gap: 14px;
}

.improve-mode-heading h2 {
  margin: 0;
}

.improve-mode-card .mode-tabs {
  margin-top: 0;
}

@media (max-width: 760px) {
  .improve-mode-card {
    gap: 22px;
  }
}


/* History library: saved results only */
.history-library {
  display: grid;
  gap: 24px;
}

.history-heading-row {
  align-items: end;
}

.history-heading-row > div:first-child {
  max-width: 660px;
}

.history-heading-row h2 {
  margin: 8px 0 10px;
}

.history-heading-row p {
  margin: 0;
}

.saved-library-grid {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

.saved-card {
  position: relative;
  grid-template-rows: auto 1fr auto auto;
  padding: 12px;
  overflow: hidden;
  background: color-mix(in srgb, var(--surface-strong) 72%, var(--surface));
}

.saved-card-media {
  position: relative;
}

.saved-card-media img,
.saved-card-media .saved-placeholder {
  aspect-ratio: 16 / 10;
}

.saved-placeholder {
  gap: 8px;
  align-content: center;
  text-align: center;
}

.saved-placeholder b,
.saved-detail-placeholder b {
  color: var(--accent);
  font-size: 58px;
  line-height: 1;
}

.saved-placeholder span,
.saved-detail-placeholder span {
  color: var(--text-soft);
  font-weight: 850;
}

.saved-kind-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 78%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
}

.saved-card-media > .saved-kind-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.saved-card-body {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 6px 4px 2px;
}

.saved-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.saved-card-meta span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.saved-card-meta time {
  color: var(--text-muted);
  font-size: 12px;
}

.saved-card p {
  min-height: 0;
  margin: 0;
}

.saved-card small {
  margin-top: 4px;
}

.saved-actions-primary,
.saved-actions-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.saved-actions .primary-button,
.saved-actions .secondary-button,
.saved-actions .danger-button {
  width: 100%;
}

.saved-card-create {
  border-color: color-mix(in srgb, var(--accent) 20%, var(--line));
}

.saved-card-analyze {
  border-color: color-mix(in srgb, var(--success) 22%, var(--line));
}

.saved-card-improve {
  border-color: color-mix(in srgb, #9a78ff 20%, var(--line));
}

.saved-detail {
  display: grid;
  gap: 20px;
}

.saved-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.saved-result-layout {
  padding: 0;
}

.saved-detail-placeholder {
  display: grid;
  min-height: 460px;
  place-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--accent-soft);
  text-align: center;
}

.result-static-text {
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

@media (max-width: 720px) {
  .history-heading-row {
    align-items: flex-start;
  }

  .saved-library-grid {
    grid-template-columns: 1fr;
  }

  .saved-actions-primary,
  .saved-actions-secondary {
    grid-template-columns: 1fr;
  }
}
