:root {
  --po-bg: var(--bg);
  --po-ink: var(--ink);
  --po-muted: var(--muted);
  --po-panel: var(--panel-soft);
  --po-panel-strong: var(--panel);
  --po-line: rgba(16, 18, 15, 0.1);
  --po-brand: var(--brand);
  --po-brand-strong: var(--brand-dark);
  --po-blue: var(--accent);
  --po-amber: #b87333;
  --po-dark: #0f1713;
  --po-dark-soft: #16211b;
  --po-glow: rgba(9, 228, 173, 0.18);
  --po-shadow: var(--shadow);
}

html {
  scroll-behavior: smooth;
}

body.po-page {
  color: var(--po-ink);
}

.po-main {
  width: var(--container);
  margin: 0 auto;
}

.po-main {
  padding-bottom: 110px;
}

.glass-panel,
.tool-shell,
.comparison-card,
.validation-card,
.use-card,
.compare-card,
.example-card,
.library-header,
.saved-card {
  background: var(--po-panel);
  border: 1px solid var(--po-line);
  box-shadow: var(--po-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: block;
  padding: 8px 0 48px;
}

.hero-copy-wrap {
  max-width: 100%;
  padding: 14px 0 8px;
}

.hero-copy-wrap h1 {
  margin: 0 0 16px;
  max-width: 920px;
  font-size: 4.7rem;
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy-strong {
  max-width: 860px;
  margin-top: 0;
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--po-muted);
}

.snippet-card {
  margin-top: 28px;
  border-radius: var(--radius-lg);
  padding: 26px 28px;
  width: min(100%, 920px);
}

.snippet-card h2 {
  margin: 8px 0 12px;
  font-size: 1.42rem;
}

.snippet-card p:last-child {
  margin-bottom: 0;
  line-height: 1.68;
  color: var(--po-muted);
}

.snippet-label,
.tool-eyebrow,
.section-label,
.trust-label,
.library-label,
.sticky-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--po-brand-strong);
}

.hero-actions {
  margin-top: 28px;
  width: min(100%, 920px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-actions .btn {
  min-height: auto;
  padding: 12px 18px;
  border-radius: 12px;
}

.btn-strong {
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(9, 127, 87, 0.22);
}

.btn-strong::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.3) 50%, transparent 80%);
  transform: translateX(-120%);
  animation: shine 4s ease-in-out infinite;
}

.text-link {
  color: var(--po-ink);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding-top: 0;
  flex-basis: 100%;
}

.trust-strip {
  margin-top: 28px;
  border-radius: 22px;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  width: min(100%, 920px);
}

.trust-copy strong,
.trust-badge {
  font-size: 0.96rem;
}

.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--po-ink);
}

.badge-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--po-brand), var(--po-blue));
  box-shadow: 0 0 0 8px rgba(13, 159, 110, 0.08);
}

.tool-shell {
  position: relative;
  border-radius: var(--radius-lg);
  margin-top: 40px;
  padding: clamp(24px, 2.8vw, 34px);
  overflow: hidden;
}

.tool-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 24%),
    radial-gradient(circle at top right, rgba(9, 228, 173, 0.18), transparent 32%);
  pointer-events: none;
}

.tool-header,
.result-card-header,
.library-header,
.sticky-cta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.tool-header h2 {
  margin: 6px 0 0;
  font-size: 1.8rem;
}

.tool-status-chip,
.tiny-chip,
.fitness-badge,
.saved-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tool-status-chip,
.tiny-chip {
  background: rgba(13, 159, 110, 0.1);
  color: var(--po-brand-strong);
  border: 1px solid rgba(13, 159, 110, 0.18);
}

.optimizer-form,
.tool-results {
  position: relative;
  z-index: 1;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 9px;
  font-size: 0.95rem;
  font-weight: 700;
}

.input-group input,
.input-group textarea {
  width: 100%;
  border: 1px solid rgba(16, 18, 15, 0.12);
  border-radius: var(--radius-sm);
  padding: 15px 17px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--po-ink);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

#rough-prompt {
  min-height: 168px;
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: rgba(13, 159, 110, 0.45);
  box-shadow: 0 0 0 4px rgba(13, 159, 110, 0.12);
}

.detail-toggle {
  border: 1px solid rgba(16, 18, 15, 0.08);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.72);
  color: var(--po-ink);
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease;
}

.detail-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.92);
}

.detail-fields {
  margin-top: 20px;
}

.detail-grid,
.results-grid,
.comparison-grid,
.validation-grid,
.use-grid,
.compare-grid,
.example-grid {
  display: grid;
  gap: 16px;
}

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

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.tool-footnote {
  margin: 16px 0 0;
  color: var(--po-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.status-msg {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-size: 0.92rem;
}

.status-msg.is-visible {
  display: block;
}

.status-msg.error {
  background: rgba(201, 55, 55, 0.08);
  border-color: rgba(201, 55, 55, 0.16);
  color: #8e2f2f;
}

.status-msg.success {
  background: rgba(13, 159, 110, 0.08);
  border-color: rgba(13, 159, 110, 0.16);
  color: var(--po-brand-strong);
}

.hidden {
  display: none !important;
}

.tool-results {
  margin-top: 28px;
}

.results-grid {
  grid-template-columns: minmax(0, 1.04fr) minmax(300px, 0.96fr);
  align-items: start;
}

.result-card {
  border: 1px solid rgba(16, 18, 15, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 19, 0.96);
  color: #ecf7f0;
  padding: 20px;
}

.result-card p,
.result-card-header p {
  margin: 0;
  color: #a8b7ae;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.btn-sm {
  padding: 8px 12px;
  font-size: 0.84rem;
}

#optimized-output {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.92rem;
  line-height: 1.62;
  margin-top: 18px;
}

.change-card {
  background: rgba(255, 255, 255, 0.92);
  color: var(--po-ink);
}

.change-summary {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--po-muted);
  display: grid;
  gap: 10px;
  line-height: 1.58;
}

.diff-columns {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.diff-block {
  border-radius: 18px;
  padding: 14px;
  border: 1px solid rgba(16, 18, 15, 0.08);
  background: rgba(255, 255, 255, 0.85);
}

.diff-block strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.diff-lines {
  display: grid;
  gap: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.diff-line {
  padding: 8px 10px;
  border-radius: 12px;
}

.diff-line.added {
  background: rgba(13, 159, 110, 0.1);
  color: var(--po-brand-strong);
}

.diff-line.removed {
  background: rgba(201, 55, 55, 0.08);
  color: #9c4040;
}

.content-block {
  margin: 38px 0;
  padding: clamp(28px, 3vw, 44px);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 60px rgba(16, 18, 15, 0.05);
}

.section-heading h2 {
  margin: 8px 0 0;
  max-width: 14ch;
  font-size: 2.6rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.content-block p {
  color: var(--po-muted);
  font-size: 1.03rem;
  line-height: 1.68;
}

.takeaway-box {
  margin: 24px 0 28px;
  padding: 24px 26px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(13, 159, 110, 0.14);
  background: linear-gradient(135deg, rgba(13, 159, 110, 0.12), rgba(56, 171, 239, 0.04));
}

.takeaway-box strong {
  display: block;
  margin-bottom: 8px;
  color: var(--po-ink);
}

.takeaway-box p {
  margin: 0;
}

.dark-band {
  background:
    radial-gradient(circle at 0% 0%, rgba(13, 159, 110, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(15, 23, 19, 0.98), rgba(17, 28, 22, 0.98));
  border-color: rgba(138, 244, 203, 0.12);
  color: #eaf2ec;
  padding-block: clamp(34px, 4vw, 52px);
}

.dark-band h2,
.dark-band h3,
.dark-band .section-label,
.dark-band .takeaway-box strong {
  color: #ffffff;
}

.dark-band p,
.dark-band li {
  color: #bed0c5;
}

.dark-band .section-heading {
  max-width: 860px;
}

.dark-band .section-heading h2 {
  max-width: 17ch;
}

.dark-band > p {
  max-width: 72ch;
}

.takeaway-box-dark {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(138, 244, 203, 0.16);
  max-width: 860px;
}

.comparison-grid,
.validation-grid,
.use-grid,
.compare-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.comparison-card,
.validation-card,
.use-card,
.compare-card {
  border-radius: var(--radius-md);
  min-height: 100%;
  padding: 24px;
}

.comparison-card h3,
.validation-card h3,
.use-card h3,
.compare-card h3,
.example-panel h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

.comparison-card-soft {
  background: rgba(255, 255, 255, 0.88);
}

.comparison-card-dark {
  background: linear-gradient(180deg, rgba(15, 23, 19, 0.98), rgba(21, 33, 27, 0.98));
  color: #eff6f1;
}

.comparison-card-dark p,
.comparison-card-dark h3 {
  color: inherit;
}

.token-compare {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.token-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-radius: 16px;
  padding: 14px 16px;
  font-family: "IBM Plex Mono", monospace;
}

.token-bar-bloat {
  background: rgba(255, 109, 109, 0.1);
  color: #ffb0b0;
}

.token-bar-tight {
  background: rgba(138, 244, 203, 0.08);
  color: #8af4cb;
}

.process-rail {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.process-step:nth-child(-n + 3) {
  grid-column: span 2;
}

.process-step:nth-child(n + 4) {
  grid-column: span 3;
}

.process-step {
  position: relative;
  border-radius: var(--radius-md);
  min-height: 100%;
  padding: 24px 20px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.process-step span {
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--po-brand), var(--po-blue));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(9, 127, 87, 0.22);
}

.process-step h3 {
  margin: 16px 0 12px;
}

.process-step p {
  margin: 0;
  line-height: 1.7;
}

.process-visual {
  margin-top: 30px;
  border-radius: var(--radius-lg);
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 960px;
  background: rgba(5, 13, 10, 0.52);
  border: 1px solid rgba(138, 244, 203, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.process-visual div {
  position: relative;
  border-radius: var(--radius-sm);
  min-height: 72px;
  padding: 18px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  line-height: 1.25;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(20, 44, 35, 0.94), rgba(12, 27, 21, 0.94));
  border: 1px solid rgba(138, 244, 203, 0.16);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}

.example-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0 22px;
}

.example-tab {
  border: 1px solid rgba(16, 18, 15, 0.08);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.7);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.example-tab.active,
.example-tab:hover {
  background: linear-gradient(135deg, rgba(13, 159, 110, 0.14), rgba(56, 171, 239, 0.08));
  color: var(--po-ink);
  transform: translateY(-1px);
}

.example-panel {
  display: none;
}

.example-panel.active {
  display: block;
}

.example-grid {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: stretch;
}

.example-card {
  border-radius: var(--radius-md);
  min-height: 100%;
  padding: 22px;
}

.example-card span {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--po-brand-strong);
}

.example-card p,
.example-change {
  margin-bottom: 0;
}

.example-card-strong {
  background: linear-gradient(180deg, rgba(15, 23, 19, 0.98), rgba(21, 33, 27, 0.98));
  color: #eff7f1;
}

.example-card-strong span,
.example-card-strong p {
  color: inherit;
}

.example-change {
  margin-top: 18px;
  font-weight: 600;
}

.fitness-sheet,
.decision-matrix,
.library-header {
  margin-top: 26px;
  border-radius: var(--radius-lg);
  padding: 22px;
}

.fitness-header,
.fitness-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
}

.fitness-header {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(16, 18, 15, 0.08);
}

.fitness-row {
  padding-top: 12px;
}

.fitness-badge.weak {
  background: rgba(201, 55, 55, 0.08);
  color: #9c4040;
}

.fitness-badge.strong {
  background: rgba(13, 159, 110, 0.08);
  color: var(--po-brand-strong);
}

.decision-matrix {
  position: relative;
  padding: 46px 20px 20px 62px;
}

.matrix-label {
  position: absolute;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--po-muted);
}

.matrix-top {
  top: 14px;
  left: 62px;
}

.matrix-side {
  left: 18px;
  top: 50%;
  transform: rotate(-90deg) translateX(50%);
  transform-origin: left top;
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.matrix-cell {
  min-height: 138px;
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: end;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(16, 18, 15, 0.08);
}

.matrix-cell-hot {
  background: linear-gradient(135deg, rgba(13, 159, 110, 0.22), rgba(56, 171, 239, 0.14));
}

.compare-card-accent {
  background: linear-gradient(180deg, rgba(13, 159, 110, 0.12), rgba(56, 171, 239, 0.08));
}

.saved-library {
  margin-top: 20px;
  display: grid;
  gap: 14px;
}

.saved-card {
  border-radius: var(--radius-md);
  padding: 22px;
}

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

.saved-card h3 {
  margin: 8px 0 10px;
  font-size: 1.08rem;
}

.saved-meta {
  color: var(--po-muted);
  font-size: 0.88rem;
}

.saved-excerpt {
  margin: 12px 0 0;
  color: var(--po-muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.5;
}

.saved-chip {
  background: rgba(13, 159, 110, 0.08);
  color: var(--po-brand-strong);
}

.faq-list details {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(16, 18, 15, 0.08);
  margin-bottom: 12px;
  overflow: hidden;
}

.faq-list summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 18px 56px 18px 20px;
  font-weight: 700;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary::after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--po-brand-strong);
}

.faq-list details[open] summary::after {
  content: "-";
}

.faq-list details p {
  margin: 0;
  padding: 0 20px 20px;
}

.cta-inline {
  margin-top: 28px;
}

.sticky-cta-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 30;
  width: min(760px, calc(100vw - 24px));
  transform: translate(-50%, 130%);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: rgba(15, 23, 19, 0.88);
  border: 1px solid rgba(138, 244, 203, 0.12);
  box-shadow: 0 20px 60px rgba(15, 23, 19, 0.22);
  transition: transform 220ms ease;
}

.sticky-cta-bar.is-visible {
  transform: translate(-50%, 0);
}

.sticky-cta-bar strong,
.sticky-cta-bar .sticky-label {
  color: #eff7f1;
}

.sticky-cta-copy {
  display: grid;
  gap: 4px;
}

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

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 550ms ease, transform 550ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes shine {
  0%,
  70%,
  100% {
    transform: translateX(-120%);
  }
  22% {
    transform: translateX(120%);
  }
}

@media (max-width: 1100px) {
  .hero-grid {
    display: block;
  }

  .hero-copy-wrap h1 {
    max-width: 100%;
  }

  .results-grid,
  .comparison-grid,
  .validation-grid,
  .use-grid,
  .compare-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 980px) {
  .process-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .process-step:nth-child(-n + 3),
  .process-step:nth-child(n + 4) {
    grid-column: span 1;
  }
}

@media (max-width: 760px) {
  .detail-grid,
  .example-grid,
  .process-rail,
  .process-visual,
  .matrix-grid,
  .fitness-header,
  .fitness-row {
    grid-template-columns: 1fr;
  }

  .content-block,
  .tool-shell {
    padding: 20px;
  }

  .hero-grid {
    padding-bottom: 28px;
  }

  .hero-copy-wrap {
    max-width: 100%;
    padding-top: 4px;
  }

  .hero-copy-wrap h1 {
    font-size: 2.55rem;
    line-height: 0.98;
    margin-bottom: 14px;
  }

  .hero-copy-strong,
  .content-block p {
    font-size: 1rem;
    line-height: 1.62;
  }

  .dark-band .section-heading h2,
  .takeaway-box-dark,
  .dark-band > p,
  .process-visual {
    max-width: 100%;
  }

  .snippet-card,
  .trust-strip {
    padding: 20px;
  }

  .hero-actions {
    width: 100%;
    gap: 12px;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .section-heading h2 {
    font-size: 2rem;
    max-width: 100%;
  }

  .sticky-cta-bar,
  .tool-header,
  .library-header,
  .sticky-cta-actions,
  .saved-card-head,
  .saved-card-actions,
  .result-card-header {
    align-items: flex-start;
  }

  .sticky-cta-bar,
  .sticky-cta-actions {
    flex-direction: column;
  }

  .tool-header h2 {
    font-size: 1.55rem;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .process-step:nth-child(-n + 3),
  .process-step:nth-child(n + 4) {
    grid-column: span 1;
  }

  .matrix-side {
    position: static;
    transform: none;
    margin-bottom: 10px;
  }

  .decision-matrix {
    padding: 20px;
  }

  .matrix-top {
    position: static;
    display: block;
    margin-bottom: 10px;
  }

}
