:root {
  color-scheme: light;
  --paper: #f7f7f2;
  --surface: #ffffff;
  --surface-soft: #fbfbf7;
  --ink: #111b19;
  --muted: #5f6c69;
  --muted-light: #84908c;
  --line: #dfe4df;
  --line-strong: #cbd3cc;
  --teal: #087e78;
  --teal-dark: #05645f;
  --teal-soft: #dff5ef;
  --lime: #d8f35c;
  --lime-soft: #eff8bf;
  --olive: #536015;
  --danger: #b4234f;
  --page-pad: clamp(18px, 3vw, 40px);
  --content-width: 1440px;
  --radius: 18px;
  --shadow: 0 18px 55px rgba(17, 27, 25, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

a {
  color: inherit;
}

.app-shell {
  min-height: 100dvh;
  background:
    radial-gradient(circle at 92% 4%, rgba(216, 243, 92, 0.16), transparent 26rem),
    radial-gradient(circle at 5% 34%, rgba(8, 126, 120, 0.06), transparent 24rem),
    var(--paper);
}

.topbar,
.intro-stack,
.workspace,
.improvement-flywheel,
.footer {
  width: min(100%, var(--content-width));
  margin-inline: auto;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 82px;
  padding-inline: var(--page-pad);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 0.68rem;
  font-weight: 900;
}

.brand > span:last-child,
.status-copy {
  display: grid;
  gap: 2px;
}

.brand strong {
  font-size: 0.9rem;
  letter-spacing: -0.015em;
}

.brand small,
.dataset-status small {
  color: var(--muted-light);
  font-size: 0.66rem;
}

.dataset-status {
  display: flex;
  align-items: center;
  gap: 11px;
}

.dataset-status strong {
  font-size: 0.74rem;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a275;
  box-shadow: 0 0 0 4px rgba(22, 162, 117, 0.13);
}

.connection-label {
  margin-left: 4px;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--olive);
  background: var(--lime-soft);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.intro-stack {
  display: grid;
  gap: 18px;
  padding: 0 var(--page-pad) 18px;
}

.intro-panel {
  padding: clamp(54px, 7vw, 96px) 0 clamp(36px, 5vw, 62px);
}

.intro-title {
  max-width: 1050px;
  margin: 0 0 22px;
  font-size: clamp(2.9rem, 5.7vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.intro-context,
.intro-copy,
.source-note {
  max-width: 850px;
  margin: 0;
  color: var(--muted);
  font-size: 0.91rem;
  line-height: 1.65;
}

.intro-context {
  margin-bottom: 2px;
  color: var(--ink);
}

.source-note {
  margin-top: 8px;
  font-size: 0.74rem;
}

.source-note a {
  color: var(--teal-dark);
  font-weight: 800;
  text-underline-offset: 3px;
}

.dataset-connection {
  display: inline-flex;
  margin-top: 16px;
  padding: 7px 11px;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.dataset-connection span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #16a275;
  box-shadow: 0 0 0 3px rgba(22, 162, 117, 0.12);
}

.workflow-panel,
.chat-panel,
.result-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.workflow-panel {
  padding: clamp(24px, 3.5vw, 42px);
}

.workflow-panel > h2 {
  margin: 0 0 20px;
  font-size: clamp(1.55rem, 2.5vw, 2.2rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.workflow-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  counter-reset: workflow-step;
}

.workflow-step {
  position: relative;
  min-height: 144px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  counter-increment: workflow-step;
}

.workflow-step::before {
  content: "0" counter(workflow-step);
  display: block;
  margin-bottom: 34px;
  color: var(--teal);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.workflow-step:nth-child(even) {
  background: #fcfdeb;
}

.workflow-step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: -18px;
  z-index: 1;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 0.7rem;
  font-weight: 900;
}

.workflow-step strong {
  display: block;
  margin-bottom: 7px;
  font-size: 0.86rem;
}

.workflow-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

.workflow-examples {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.workflow-examples p {
  margin: 0;
  padding: 11px 13px;
  border-radius: 9px;
  color: var(--muted);
  background: var(--teal-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.workflow-examples p:nth-child(2) {
  background: #f0f3ef;
}

.workflow-examples p:nth-child(3) {
  background: var(--lime-soft);
}

.workspace {
  display: grid;
  min-height: 760px;
  padding: 0 var(--page-pad) 18px;
  grid-template-columns: minmax(420px, 0.92fr) minmax(520px, 1.08fr);
  gap: 18px;
}

.chat-panel,
.result-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
}

.panel-heading {
  display: flex;
  padding: 28px 28px 24px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 8px;
  font-size: clamp(1.7rem, 2.2vw, 2.2rem);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -0.035em;
}

h3 {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.panel-heading p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.assistant-badges {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.model-badge,
.privacy-badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 850;
  white-space: nowrap;
}

.model-badge {
  color: var(--olive);
  background: var(--lime-soft);
}

.privacy-badge {
  color: var(--teal-dark);
  background: var(--teal-soft);
}

.prompt-section {
  padding: 16px 28px 17px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.prompt-label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted-light);
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.suggestions button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.suggestions button:hover,
.suggestions button:focus-visible {
  border-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-soft);
  outline: none;
}

.messages {
  display: flex;
  min-height: 0;
  padding: 24px 28px;
  overflow-y: auto;
  flex-direction: column;
  gap: 20px;
  scrollbar-color: var(--line-strong) transparent;
}

.message {
  display: flex;
  width: min(90%, 680px);
  align-items: flex-start;
  gap: 11px;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 0.59rem;
  font-weight: 900;
}

.message.user .avatar {
  color: var(--surface);
  background: var(--teal);
}

.message-content {
  min-width: 0;
}

.message-label {
  display: block;
  margin: 0 0 5px 2px;
  color: var(--muted-light);
  font-size: 0.59rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.message.user .message-label {
  text-align: right;
}

.message-bubble {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px;
  background: var(--surface-soft);
}

.message.user .message-bubble {
  border-color: #bfe6dc;
  border-radius: 14px 4px 14px 14px;
  background: var(--teal-soft);
}

.message-bubble p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.composer {
  display: grid;
  padding: 15px 18px 17px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  min-height: 48px;
  padding: 11px 138px 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface-soft);
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input-wrap input::placeholder {
  color: var(--muted-light);
}

.input-wrap input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(8, 126, 120, 0.12);
}

.input-hint {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  color: var(--muted-light);
  font-size: 0.62rem;
  pointer-events: none;
}

.composer button {
  display: flex;
  min-width: 112px;
  min-height: 48px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 11px;
  color: var(--surface);
  background: var(--teal);
  font-size: 0.77rem;
  font-weight: 850;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease;
}

.composer button:hover {
  transform: translateY(-1px);
  background: var(--teal-dark);
}

.composer button:focus-visible {
  outline: 3px solid rgba(8, 126, 120, 0.22);
  outline-offset: 3px;
}

.composer button:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.result-panel {
  padding: 27px 28px;
  overflow-y: auto;
  scrollbar-color: var(--line-strong) transparent;
}

.result-header {
  display: flex;
  padding-bottom: 21px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
}

.result-count {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #f0f3ef;
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  min-height: calc(100% - 70px);
  padding: 52px 24px;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.empty-visual {
  display: flex;
  width: 152px;
  height: 94px;
  margin-bottom: 26px;
  padding: 18px 22px;
  align-items: end;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.empty-visual span {
  width: 16px;
  border-radius: 4px 4px 1px 1px;
  background: var(--teal);
}

.empty-visual span:nth-child(1) {
  height: 32%;
}

.empty-visual span:nth-child(2) {
  height: 58%;
  background: #62bcb0;
}

.empty-visual span:nth-child(3) {
  height: 82%;
  background: var(--lime);
}

.empty-visual span:nth-child(4) {
  height: 46%;
  background: var(--teal-dark);
}

.empty-state h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.empty-state p {
  max-width: 430px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.58;
}

.capability-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.capability-list span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.63rem;
}

.result-content {
  display: grid;
  padding-top: 18px;
  gap: 16px;
}

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

.summary-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.summary-card span {
  display: block;
  overflow: hidden;
  color: var(--muted-light);
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.04rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-card,
.table-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.section-title-row {
  display: flex;
  padding: 13px 15px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.section-title-row span {
  color: var(--muted-light);
  font-size: 0.62rem;
  text-transform: capitalize;
}

.chart {
  display: flex;
  min-height: 220px;
  padding: 20px 14px 12px;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  scrollbar-color: var(--line-strong) transparent;
}

.bar-wrap {
  display: grid;
  min-width: 58px;
  max-width: 100px;
  flex: 1 0 58px;
  grid-template-rows: minmax(120px, 1fr) auto auto;
  gap: 6px;
  text-align: center;
}

.bar-area {
  display: flex;
  min-height: 120px;
  align-items: end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(to top, rgba(223, 228, 223, 0.5) 1px, transparent 1px);
  background-size: 100% 25%;
}

.bar {
  width: min(34px, 64%);
  min-height: 4px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #56b9ad, var(--teal));
}

.bar-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-value {
  color: var(--ink);
  font-size: 0.61rem;
  font-weight: 850;
}

.table-wrap {
  max-height: 240px;
  overflow: auto;
  scrollbar-color: var(--line-strong) transparent;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.69rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.57rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #f4fbf8;
}

.sql-details {
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.69rem;
}

.sql-details summary {
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
}

pre {
  max-height: 190px;
  margin: 0;
  padding: 14px;
  overflow: auto;
  border-radius: 0 0 10px 10px;
  color: #e2ede9;
  background: var(--ink);
  font: 0.67rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
}

.improvement-flywheel {
  padding: clamp(48px, 6vw, 76px) var(--page-pad) clamp(54px, 7vw, 88px);
}

.flywheel-heading {
  display: grid;
  max-width: 760px;
  margin: 0 auto 30px;
  justify-items: center;
  text-align: center;
}

.flywheel-heading h2 {
  margin: 0 0 13px;
  font-size: clamp(2rem, 3.8vw, 3.7rem);
  line-height: 1;
  letter-spacing: -0.06em;
}

.flywheel-heading > p:last-child {
  max-width: 670px;
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.flywheel-loop {
  position: relative;
  min-height: 570px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at center, rgba(216, 243, 92, 0.18), transparent 23%),
    linear-gradient(135deg, rgba(8, 126, 120, 0.045), transparent 42%),
    var(--surface);
  box-shadow: var(--shadow);
}

.flywheel-loop::before {
  content: "";
  position: absolute;
  inset: 76px 23%;
  border: 1px dashed rgba(8, 126, 120, 0.27);
  border-radius: 50%;
}

.flywheel-step {
  position: absolute;
  z-index: 2;
  width: min(28%, 330px);
  min-height: 146px;
  padding: 48px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(251, 251, 247, 0.96);
  box-shadow: 0 12px 30px rgba(17, 27, 25, 0.06);
}

.flywheel-step::before {
  content: "0" attr(data-step);
  position: absolute;
  top: 16px;
  left: 18px;
  color: var(--teal);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.flywheel-step::after {
  content: "\2192";
  position: absolute;
  z-index: 3;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--lime);
  font-size: 0.72rem;
  font-weight: 900;
}

.flywheel-step[data-step="1"] {
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
}

.flywheel-step[data-step="2"] {
  top: 112px;
  right: 24px;
}

.flywheel-step[data-step="3"] {
  right: 24px;
  bottom: 32px;
}

.flywheel-step[data-step="4"] {
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
}

.flywheel-step[data-step="5"] {
  bottom: 32px;
  left: 24px;
}

.flywheel-step[data-step="6"] {
  top: 112px;
  left: 24px;
}

.flywheel-step[data-step="1"]::after {
  top: 68%;
  right: -19%;
  transform: rotate(35deg);
}

.flywheel-step[data-step="2"]::after {
  right: 17%;
  bottom: -31%;
  transform: rotate(90deg);
}

.flywheel-step[data-step="3"]::after {
  bottom: -19%;
  left: 22%;
  transform: rotate(145deg);
}

.flywheel-step[data-step="4"]::after {
  bottom: 25%;
  left: -17%;
  transform: rotate(215deg);
}

.flywheel-step[data-step="5"]::after {
  top: -27%;
  left: 17%;
  transform: rotate(270deg);
}

.flywheel-step[data-step="6"]::after {
  top: -19%;
  right: 20%;
  transform: rotate(325deg);
}

.flywheel-step strong {
  display: block;
  margin-bottom: 7px;
  font-size: 0.87rem;
  line-height: 1.25;
}

.flywheel-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.5;
}

.flywheel-step:nth-child(even) {
  background: rgba(252, 253, 235, 0.97);
}

.flywheel-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: grid;
  width: min(32%, 350px);
  aspect-ratio: 1;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(8, 126, 120, 0.23);
  border-radius: 50%;
  background: rgba(223, 245, 239, 0.72);
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.62);
}

.flywheel-center {
  display: grid;
  max-width: 250px;
  padding: 26px;
  justify-items: center;
  text-align: center;
}

.flywheel-center span {
  margin-bottom: 10px;
  color: var(--teal-dark);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.flywheel-center strong {
  font-size: clamp(1.2rem, 2vw, 1.75rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.flywheel-center small {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
}

.flywheel-signals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.flywheel-signal {
  display: flex;
  min-width: 0;
  padding: 15px 16px;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.signal-mark {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 0.74rem;
  font-weight: 900;
}

.flywheel-signal:nth-child(2) .signal-mark {
  color: var(--olive);
  background: var(--lime-soft);
}

.flywheel-signal > span:last-child {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.flywheel-signal strong {
  display: block;
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 0.73rem;
}

.footer {
  display: flex;
  min-height: 58px;
  padding: 0 var(--page-pad);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted-light);
  font-size: 0.59rem;
}

.is-hidden {
  display: none !important;
}

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

@media (max-width: 1100px) {
  .workflow-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-step:not(:last-child)::after {
    display: none;
  }

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

  .chat-panel {
    min-height: 690px;
  }

  .result-panel {
    min-height: 620px;
  }

  .flywheel-loop {
    display: grid;
    min-height: 0;
    padding: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .flywheel-loop::before {
    display: none;
  }

  .flywheel-step,
  .flywheel-step[data-step] {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    width: auto;
    min-height: 138px;
    transform: none;
  }

  .flywheel-step::after {
    display: none;
  }

  .flywheel-stage {
    position: relative;
    top: auto;
    left: auto;
    width: auto;
    min-height: 180px;
    aspect-ratio: auto;
    grid-column: 1 / -1;
    grid-row: 1;
    transform: none;
    border-radius: 14px;
    box-shadow: none;
  }

  .flywheel-signals {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  :root {
    --page-pad: 14px;
  }

  .topbar {
    min-height: 72px;
  }

  .status-copy,
  .connection-label {
    display: none;
  }

  .intro-stack {
    gap: 12px;
  }

  .intro-panel {
    padding: 44px 4px 34px;
  }

  .intro-title {
    font-size: clamp(2.7rem, 13vw, 4rem);
  }

  .workflow-panel {
    padding: 24px 18px 18px;
  }

  .workflow-flow,
  .workflow-examples {
    grid-template-columns: 1fr;
  }

  .workflow-step {
    min-height: auto;
  }

  .workflow-step::before {
    margin-bottom: 24px;
  }

  .workspace {
    gap: 12px;
    padding-bottom: 12px;
  }

  .chat-panel,
  .result-panel {
    border-radius: 15px;
  }

  .chat-panel {
    min-height: 720px;
    grid-template-rows: auto auto minmax(260px, 1fr) auto;
  }

  .panel-heading {
    padding: 22px 18px 18px;
  }

  .assistant-badges {
    display: none;
  }

  .prompt-section {
    padding: 14px 18px;
  }

  .suggestions {
    flex-wrap: nowrap;
    padding-bottom: 3px;
    overflow-x: auto;
  }

  .suggestions button {
    flex: 0 0 auto;
  }

  .messages {
    padding: 20px 18px;
  }

  .message {
    width: 96%;
  }

  .composer {
    padding: 14px;
    grid-template-columns: 1fr;
  }

  .input-wrap input {
    padding-right: 14px;
  }

  .input-hint {
    display: none;
  }

  .composer button {
    min-height: 46px;
  }

  .result-panel {
    min-height: 620px;
    padding: 22px 17px;
  }

  .improvement-flywheel {
    padding-top: 42px;
    padding-bottom: 52px;
  }

  .flywheel-heading {
    justify-items: start;
    text-align: left;
  }

  .flywheel-loop {
    padding: 12px;
    grid-template-columns: 1fr;
  }

  .flywheel-stage {
    grid-column: auto;
    min-height: 170px;
  }

  .flywheel-step,
  .flywheel-step[data-step] {
    min-height: 0;
  }

  .summary-cards {
    grid-template-columns: 1fr;
  }

  .footer {
    min-height: 66px;
    padding-top: 12px;
    padding-bottom: 12px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
