:root {
  color-scheme: light;
  --page: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f7faff;
  --blue-ink: #071d58;
  --text: #10224a;
  --muted: #52658f;
  --line: #bdd0fb;
  --line-strong: #80a4ff;
  --blue: #2f66ff;
  --blue-soft: #eaf2ff;
  --teal: #0a9fa6;
  --teal-soft: #e8fbfa;
  --green: #2f8f5b;
  --cost: #0d8f79;
  --shadow: 0 20px 70px rgba(26, 55, 112, 0.12);
  --radius: 18px;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-family: var(--sans);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    linear-gradient(90deg, #edf2fa 0, #edf2fa calc((100vw - 1580px) / 2), transparent calc((100vw - 1580px) / 2), transparent calc(100vw - ((100vw - 1580px) / 2)), #edf2fa calc(100vw - ((100vw - 1580px) / 2))),
    var(--surface);
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
select,
input {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid #d9e4fb;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--blue-ink);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--blue);
  border-radius: 10px;
  color: var(--blue);
  background: var(--blue-soft);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 750;
}

.top-nav a {
  text-decoration: none;
}

.top-nav a:hover {
  color: var(--blue);
}

.top-nav .language-link {
  display: inline-flex;
  min-width: 2.35rem;
  min-height: 2.35rem;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  border-radius: 999px;
  line-height: 1;
}

.top-nav .language-link:hover,
.top-nav .language-link:focus-visible {
  background: var(--blue-soft);
  outline: none;
}

.sticky-meter {
  position: sticky;
  top: 72px;
  z-index: 25;
  border-bottom: 1px solid #d7e4fb;
  background: rgba(248, 251, 255, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(15, 35, 82, 0.06);
}

.meter-inner {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  max-width: 1120px;
  margin: 0 auto;
  border-left: 1px solid #d9e6fb;
  border-right: 1px solid #d9e6fb;
  background: #d9e6fb;
}

.meter-item {
  display: grid;
  gap: 2px;
  min-height: 64px;
  padding: 12px 16px;
  background: #ffffff;
}

.meter-item span,
.meter-note,
.section-pill,
.price-label,
.metric-card span,
.layer-heading span {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.meter-item strong {
  color: var(--blue-ink);
  font-family: var(--mono);
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1;
}

.meter-item:nth-child(2) strong,
.cost-metric-card strong {
  color: var(--cost);
}

.meter-muted strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
}

.meter-note {
  display: block;
  max-width: 1120px;
  margin: 0 auto;
  padding: 8px 16px 10px;
  color: var(--muted);
  background: #ffffff;
  border-left: 1px solid #d9e6fb;
  border-right: 1px solid #d9e6fb;
}

main {
  max-width: 1580px;
  margin: 0 auto;
  background: var(--surface);
  border-left: 1px solid #c9d8ef;
  border-right: 1px solid #c9d8ef;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  width: 100%;
  max-width: 20ch;
  margin: 0 auto 14px;
  color: var(--blue-ink);
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.95;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--blue-ink);
  border-radius: 12px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--blue-ink);
  box-shadow: 0 8px 0 #d7e2fb;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.secondary-button {
  color: var(--blue-ink);
  background: #ffffff;
  border-color: var(--line);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 0 #d7e2fb;
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
  box-shadow: 0 5px 0 #d7e2fb;
}

.secondary-button.small {
  min-height: 34px;
  border-radius: 10px;
  padding: 7px 10px;
  box-shadow: none;
  font-size: 0.86rem;
}

.machine-section,
.loop-section,
.rules-section {
  scroll-margin-top: 150px;
  padding: clamp(42px, 7vw, 76px) clamp(18px, 5vw, 72px);
}

.lead-loop {
  padding-top: clamp(28px, 4vw, 46px);
  padding-bottom: clamp(30px, 4vw, 48px);
  border-bottom: 1px solid #d9e4fb;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 68%, #f6faff 100%);
}

.loop-hero {
  display: grid;
  justify-items: stretch;
  max-width: 960px;
  margin: 0 auto 22px;
  text-align: center;
}

.loop-hero p {
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  color: #304778;
  font-size: clamp(1.05rem, 1.8vw, 1.34rem);
}

.section-heading {
  max-width: 820px;
  margin: 0 auto 34px;
  text-align: center;
}

.section-heading.narrow {
  max-width: 680px;
}

.section-heading h2 {
  margin-bottom: 12px;
  color: var(--blue-ink);
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.96;
}

.section-heading p {
  margin-bottom: 0;
  color: #3a5280;
  font-size: 1.06rem;
}

.chat-shell {
  max-width: 1120px;
  margin: 0 auto;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.window-bar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #f5f8fe;
  color: var(--blue-ink);
}

.window-dots {
  display: flex;
  gap: 8px;
}

.window-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.window-dots span:nth-child(1) {
  background: #ff8b7d;
}

.window-dots span:nth-child(2) {
  background: #ffd66b;
}

.window-dots span:nth-child(3) {
  background: #65d28a;
}

#turnCount {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 30px;
  border-radius: 999px;
  color: var(--blue);
  background: var(--blue-soft);
  font-family: var(--mono);
  font-weight: 900;
}

.model-strip {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  padding: 18px 22px;
  border-bottom: 1px solid #dbe7fb;
}

.model-strip label,
.layer-label {
  display: grid;
  gap: 7px;
  color: var(--blue-ink);
  font-size: 0.82rem;
  font-weight: 850;
}

select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--blue-ink);
  background: #ffffff;
}

.live-badge {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  color: var(--blue);
  background: var(--blue-soft);
  font-family: var(--mono);
  font-size: 0.86rem;
  font-weight: 900;
  white-space: nowrap;
}

.live-badge.cost {
  color: #087b68;
  background: #e8fbf6;
  border-color: #a5e3d8;
}

.chat-window {
  display: grid;
  gap: 16px;
  padding: 22px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.prompt-layers {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(170px, 1fr));
  align-items: start;
  gap: 12px;
}

.layer-card,
.visible-chat,
.work-area,
.pricing-panel,
.metric-card,
.loop-board article,
.rule-grid article {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.layer-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 148px;
  padding: 16px;
}

.system-layer {
  border-left: 5px solid var(--blue);
  background: #f5f9ff;
}

.layer-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.layer-art {
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid #d3e1fb;
  border-radius: 14px;
  object-fit: cover;
  background: #f6f9ff;
}

.layer-heading strong {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.system-layer > strong {
  color: var(--blue-ink);
  font-size: 1rem;
}

.system-layer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.layer-label {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.layer-label span {
  color: var(--blue-ink);
  font-weight: 900;
}

.layer-explain {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.layer-impact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #cfe0fb;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fbff;
}

.layer-impact span {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.layer-impact strong {
  color: var(--blue-ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  text-align: right;
}

.prompt-preview {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid #a9c3ff;
  border-radius: 12px;
  color: var(--blue-ink);
  background: #ffffff;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.prompt-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.prompt-actions a,
.source-note a {
  color: var(--teal);
  font-weight: 800;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

output {
  color: var(--blue);
  font-family: var(--mono);
  font-weight: 900;
}

.range-shell {
  display: grid;
  align-items: center;
  min-height: 38px;
  border: 1px solid #d7e5fb;
  border-radius: 999px;
  padding: 0 10px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

input[type="range"] {
  --progress: 0%;
  width: 100%;
  height: 24px;
  appearance: none;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--blue) 0 var(--progress), #e7effd var(--progress) 100%);
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 999px;
  background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  margin-top: -7px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(47, 102, 255, 0.32);
}

input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 999px;
  background: transparent;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 7px 18px rgba(47, 102, 255, 0.32);
}

.visible-chat {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #f6f9ff;
  border-color: var(--line-strong);
  border-left: 5px solid var(--blue);
}

.section-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e4eeff;
  color: var(--blue);
}

.section-pill.teal {
  color: var(--teal);
  background: #dff8f6;
}

.message {
  display: grid;
  gap: 8px;
  width: min(760px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.user-message {
  justify-self: end;
  background: #eef5ff;
}

.assistant-message {
  gap: 12px;
  justify-self: start;
}

.speaker {
  color: var(--blue-ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.message p {
  margin: 0;
}

.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  border: 1px solid #c7d9fb;
  border-radius: 999px;
  padding: 6px 10px 6px 6px;
  color: var(--blue-ink);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(26, 55, 112, 0.07);
}

.chat-chip img,
.chat-chip-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  object-fit: cover;
  background: #eef5ff;
}

.chat-chip-icon {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 900;
}

.chat-chip-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.chat-chip-text strong {
  overflow: hidden;
  color: var(--blue-ink);
  font-size: 0.78rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-chip-text small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.1;
}

.assistant-packet {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 12px;
  border: 1px solid #c7d9fb;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f8fbff;
}

.assistant-packet div {
  display: grid;
  gap: 4px;
}

.assistant-packet span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.assistant-packet strong {
  color: var(--blue);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.assistant-packet div:last-child strong {
  color: var(--cost);
}

.chat-history {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.88rem;
}

.work-area {
  margin: 0 22px 22px;
  padding: 20px;
  background:
    linear-gradient(180deg, #effdfb 0%, #f7fbff 100%);
  border-color: #71cfcc;
  border-left: 5px solid var(--teal);
}

.work-area-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.32fr);
  gap: 18px;
  align-items: end;
}

.work-area-header h3 {
  margin: 12px 0 8px;
  color: var(--blue-ink);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1;
}

.work-area-header p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.work-summary {
  display: grid;
  gap: 5px;
  border: 1px solid #bfe6df;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.work-summary span {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.work-summary strong {
  color: var(--blue-ink);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.25;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 14px;
  margin-top: 18px;
}

.control-panel {
  position: relative;
  display: grid;
  gap: 12px;
  border: 1px solid #9ddada;
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 48px rgba(16, 72, 92, 0.08);
}

.control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--blue-ink);
}

.control-heading span {
  color: var(--teal);
  background: #dff8f6;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
}

.control-explain {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.segmented {
  display: grid;
  gap: 10px;
}

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

.cache-options {
  grid-template-columns: 1fr;
}

.work-option {
  display: block;
  cursor: pointer;
}

.work-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-shell {
  display: grid;
  gap: 10px;
  min-height: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  color: #3c4f76;
  background: #ffffff;
  font-weight: 750;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.work-option:hover .option-shell {
  transform: translateY(-1px);
  border-color: #8fb0ff;
  box-shadow: 0 12px 28px rgba(26, 55, 112, 0.1);
}

.option-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 1px solid #d7e5fb;
  border-radius: 12px;
  object-fit: cover;
  background: #f6f9ff;
}

.option-copy {
  display: grid;
  gap: 2px;
}

.option-copy strong {
  color: var(--blue-ink);
  line-height: 1.1;
}

.option-copy small {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.25;
}

.option-stats {
  display: grid;
  gap: 2px;
  border: 1px solid #d9e6fb;
  border-radius: 10px;
  padding: 8px;
  background: #f8fbff;
}

.option-stats b,
.option-stats em {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-style: normal;
  line-height: 1.25;
}

.option-stats b {
  color: var(--blue);
}

.option-stats em {
  color: var(--cost);
}

.cache-options .option-shell {
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
}

.cache-options .option-thumb {
  grid-row: span 2;
}

.cache-options .option-stats {
  grid-column: 2;
}

.work-option input:checked + .option-shell {
  border-color: var(--blue);
  background: #eaf2ff;
  box-shadow: inset 0 0 0 1px var(--blue);
}

.work-option input:focus-visible + .option-shell {
  outline: 3px solid rgba(47, 102, 255, 0.22);
  outline-offset: 3px;
}

.button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}

.loop-button {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-width: min(100%, 260px);
  min-height: 58px;
  text-align: left;
}

.loop-button strong {
  line-height: 1.1;
}

.loop-button small {
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.2;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  max-width: 1120px;
  margin: 18px auto 0;
}

.metric-card {
  min-height: 150px;
  padding: 16px;
}

.metric-card strong {
  display: block;
  margin: 8px 0;
  color: var(--blue);
  font-family: var(--mono);
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  line-height: 1;
}

.metric-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.cost-metric-card {
  background: #eefcf8;
  border-color: #a8dfd3;
}

.pricing-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(320px, 1.15fr);
  gap: 18px;
  max-width: 1120px;
  margin: 18px auto 0;
  padding: 20px;
}

.pricing-panel h3 {
  margin-bottom: 10px;
  color: var(--blue-ink);
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 0;
}

.pricing-panel p {
  margin-bottom: 0;
  color: var(--muted);
}

.price-label {
  display: inline-flex;
  margin-bottom: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #dff8f6;
}

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

.rate-grid div {
  min-height: 102px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: var(--surface-soft);
}

.rate-grid dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rate-grid dd {
  margin: 8px 0 0;
  color: var(--green);
  font-family: var(--mono);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 900;
  line-height: 1.25;
}

.source-note {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid #d9e4fb;
  font-size: 0.9rem;
}

.loop-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "rules tools evidence"
    "return hub replay"
    "history answer reasoning";
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
}

.loop-board::before {
  content: "";
  position: absolute;
  inset: 72px 10% 72px;
  border: 2px solid #c8d8fb;
  border-radius: 36px;
  background: rgba(232, 244, 255, 0.3);
  pointer-events: none;
}

.loop-board article,
.rule-grid article {
  padding: 16px;
}

.loop-board article {
  z-index: 1;
  display: grid;
  align-content: start;
  min-height: 132px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 12px 32px rgba(26, 55, 112, 0.08);
}

.loop-step::after,
.loop-return-note::after {
  content: attr(data-arrow);
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #a9c0f3;
  border-radius: 999px;
  color: var(--blue);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(26, 55, 112, 0.14);
  font-family: var(--mono);
  font-weight: 900;
  line-height: 1;
}

.step-rules {
  grid-area: rules;
}

.step-tools {
  grid-area: tools;
}

.step-evidence {
  grid-area: evidence;
}

.step-replay {
  grid-area: replay;
}

.step-reasoning {
  grid-area: reasoning;
}

.step-answer {
  grid-area: answer;
}

.step-history {
  grid-area: history;
  border-color: #a8dfd3;
  background: linear-gradient(180deg, #ffffff, #effcf9);
}

.step-rules::after,
.step-tools::after {
  right: -27px;
  top: 50%;
  transform: translateY(-50%);
}

.step-evidence::after,
.step-replay::after {
  bottom: -27px;
  left: 50%;
  transform: translateX(-50%);
}

.step-reasoning::after,
.step-answer::after {
  left: -27px;
  top: 50%;
  transform: translateY(-50%);
}

.step-history::after {
  top: -27px;
  left: 50%;
  transform: translateX(-50%);
}

.loop-return-note {
  position: relative;
  z-index: 1;
  grid-area: return;
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 4px;
  width: min(100%, 210px);
  border: 1px solid #a8dfd3;
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--blue-ink);
  background: #eefcf8;
  text-align: center;
  box-shadow: 0 12px 32px rgba(26, 55, 112, 0.08);
}

.loop-return-note::after {
  content: "↑";
  top: -38px;
  left: 50%;
  transform: translateX(-50%);
}

.loop-return-note span,
.loop-hub span {
  color: var(--cost);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.loop-return-note strong {
  color: var(--blue-ink);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.1;
}

.loop-hub {
  position: relative;
  z-index: 2;
  grid-area: hub;
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  gap: 8px;
  width: min(100%, 270px);
  min-height: 132px;
  border: 1px solid #a9c0f3;
  border-radius: 24px;
  padding: 20px;
  color: var(--blue-ink);
  background: #ffffff;
  text-align: center;
  box-shadow: 0 18px 46px rgba(26, 55, 112, 0.14);
}

.loop-hub strong {
  max-width: 13ch;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  font-weight: 950;
  line-height: 0.98;
}

.loop-board span,
.rule-grid strong {
  display: block;
  margin-bottom: 10px;
  color: var(--blue-ink);
  font-weight: 900;
}

.loop-board p,
.rule-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.loop-accumulator {
  display: grid;
  gap: 8px;
  max-width: 1120px;
  margin: 16px auto 0;
  border: 1px solid #a8dfd3;
  border-radius: 16px;
  padding: 18px 20px;
  color: var(--blue-ink);
  background: #eefcf8;
}

.loop-accumulator span {
  color: var(--cost);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.loop-accumulator strong {
  font-family: var(--mono);
  font-size: clamp(1.2rem, 2.7vw, 2.1rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 1120px;
  margin: 0 auto;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  max-width: 1580px;
  margin: 0 auto;
  padding: 26px clamp(18px, 5vw, 72px);
  border-top: 1px solid #d9e4fb;
  border-left: 1px solid #c9d8ef;
  border-right: 1px solid #c9d8ef;
  color: var(--muted);
  background: #ffffff;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1180px) {
  .model-strip,
  .prompt-layers,
  .control-grid,
  .metrics-grid,
  .pricing-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 780px) {
  .site-header {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .top-nav {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .sticky-meter {
    top: 0;
  }

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

  .meter-item {
    min-height: 58px;
    padding: 10px 12px;
  }

  h1 {
    font-size: clamp(2.8rem, 11vw, 3.1rem);
    width: calc(100vw - 30px);
    max-width: calc(100vw - 30px);
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
  }

  .loop-hero p {
    width: calc(100vw - 30px);
    max-width: calc(100vw - 30px);
    min-width: 0;
  }

  .loop-board {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hub"
      "rules"
      "tools"
      "evidence"
      "replay"
      "reasoning"
      "answer"
      "history"
      "return";
    gap: 14px;
  }

  .loop-board::before {
    inset: 132px auto 34px 32px;
    width: 2px;
    border: 0;
    border-radius: 999px;
    background: #c8d8fb;
  }

  .loop-board article {
    min-height: 132px;
  }

  .loop-step::after {
    content: "↓";
    top: auto;
    right: auto;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
  }

  .step-history::after {
    content: "↓";
  }

  .loop-return-note {
    width: 100%;
    border-radius: 16px;
  }

  .loop-return-note::after {
    content: "↑";
    top: auto;
    bottom: -25px;
    width: 30px;
    height: 30px;
  }

  .loop-hub {
    width: 100%;
    min-height: 124px;
  }

  .assistant-packet {
    grid-template-columns: 1fr;
  }

  .machine-section,
  .loop-section,
  .rules-section {
    padding-inline: 14px;
  }

  .chat-window,
  .model-strip,
  .work-area {
    padding: 14px;
  }

  .work-area-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .work-area {
    margin: 0 14px 14px;
  }

  .reasoning-options,
  .rule-grid {
    grid-template-columns: 1fr;
  }

  .button-row,
  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .model-strip {
    align-items: stretch;
  }

  .live-badge {
    justify-content: flex-start;
  }

  .cache-options .option-shell {
    grid-template-columns: 1fr;
  }

  .cache-options .option-thumb,
  .cache-options .option-stats {
    grid-column: auto;
    grid-row: auto;
  }
}
