:root {
  color-scheme: light;
  --navy-950: #07182e;
  --navy-900: #0b1f3a;
  --navy-800: #14345c;
  --navy-700: #215184;
  --blue-600: #2c67d8;
  --blue-100: #eaf1ff;
  --blue-050: #f5f8ff;
  --ink: #13233a;
  --ink-soft: #40536c;
  --muted: #596b82;
  --line: #d9e0e8;
  --line-soft: #e9edf2;
  --paper: #ffffff;
  --canvas: #edf1f5;
  --green-700: #117657;
  --green-100: #def3eb;
  --amber-800: #80500a;
  --amber-600: #bd7612;
  --amber-100: #fff0cf;
  --red-800: #8e2f2b;
  --red-100: #fde9e7;
  --shadow: 0 22px 60px rgba(15, 35, 60, 0.12), 0 4px 12px rgba(15, 35, 60, 0.05);
  --radius: 14px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #1b56ad;
  outline-offset: 3px;
}

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

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--navy-900);
  box-shadow: var(--shadow);
  transform: translateY(-180%);
  transition: transform 160ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-shell {
  width: min(100%, 1600px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 34px 24px;
}

.site-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(19, 35, 58, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px 13px 4px 13px;
  background: var(--navy-900);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  box-shadow: 0 7px 18px rgba(11, 31, 58, 0.2);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-copy strong {
  font-size: 15px;
  letter-spacing: -0.015em;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.header-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.status-tag,
.connection-state,
.mode-state,
.time-guide,
.evidence-count,
.urgency-state,
.sentiment-state {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.status-tag svg {
  width: 15px;
  height: 15px;
}

.sample-tag {
  background: var(--blue-100);
  color: #194f9e;
}

.action-tag {
  background: var(--amber-100);
  color: var(--amber-800);
}

.connection-state {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink-soft);
}

.connection-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber-600);
}

.connection-state.online i {
  background: var(--green-700);
}

.connection-state.offline i {
  background: var(--red-800);
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  padding: 36px 0 24px;
}

.intro-copy {
  max-width: 760px;
}

.intro h1 {
  max-width: 18ch;
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(30px, 3.1vw, 48px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.12;
  text-wrap: balance;
}

.keep-together {
  white-space: nowrap;
}

.intro p {
  max-width: 68ch;
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.process-line {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
}

.process-line li {
  position: relative;
  min-width: 86px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.process-line li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 11px;
  left: calc(50% + 13px);
  width: calc(100% - 26px);
  height: 1px;
  background: #b7c3d1;
}

.process-line span {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  z-index: 1;
  border: 1px solid #a8b5c4;
  border-radius: 50%;
  background: var(--canvas);
  color: var(--navy-800);
  font-size: 10px;
}

.privacy-notice {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px 16px;
  border: 1px solid #cdd9ea;
  border-radius: 12px;
  background: #f3f7fc;
  color: var(--navy-800);
}

.privacy-notice > svg {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.privacy-notice strong {
  font-size: 13px;
}

.privacy-notice p {
  margin: 1px 0 0;
  color: #405b79;
  font-size: 12px;
}

.demo-workspace {
  min-height: 720px;
  display: grid;
  grid-template-columns: minmax(350px, 0.72fr) minmax(560px, 1.28fr);
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.scenario-panel,
.decision-panel {
  min-width: 0;
}

.scenario-panel {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #f8fafc;
}

.panel-heading,
.decision-header,
.section-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading h2,
.decision-header h2,
.result-view h3 {
  margin: 0;
  letter-spacing: -0.02em;
}

.panel-heading h2,
.decision-header h2 {
  color: var(--navy-950);
  font-size: 18px;
  line-height: 1.3;
}

.panel-heading p,
.decision-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.time-guide {
  flex: 0 0 auto;
  background: #e8edf3;
  color: var(--ink-soft);
}

.scenario-list {
  min-height: 265px;
  display: flex;
  flex-direction: column;
  margin: 22px -24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.scenario-option {
  position: relative;
  width: 100%;
  min-height: 86px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 15px 24px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.scenario-option:last-child {
  border-bottom: 0;
}

.scenario-option:hover {
  background: #f0f4f8;
}

.scenario-option[aria-pressed="true"] {
  background: var(--navy-900);
  color: #fff;
}

.scenario-index {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid #b9c5d2;
  border-radius: 50%;
  color: var(--navy-700);
  font-size: 11px;
  font-weight: 750;
}

.scenario-option[aria-pressed="true"] .scenario-index {
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.scenario-copy {
  min-width: 0;
}

.scenario-copy strong {
  display: block;
  font-size: 14px;
}

.scenario-copy span {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenario-option[aria-pressed="true"] .scenario-copy span {
  color: #b9c9dc;
}

.scenario-tone {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-700);
}

.scenario-tone.caution {
  background: #d79a36;
}

.scenario-tone.blocked {
  background: #d86a62;
}

.scenario-skeleton {
  min-height: 86px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(100deg, #f3f5f7 20%, #e8edf2 40%, #f3f5f7 60%);
  background-size: 220% 100%;
  animation: skeleton 1.6s linear infinite;
}

.scenario-load-error {
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 24px;
  color: var(--ink-soft);
  text-align: center;
}

.scenario-load-error strong {
  color: var(--navy-950);
}

.scenario-load-error p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.message-form {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  margin-top: 22px;
}

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

.field-heading label {
  color: var(--navy-950);
  font-size: 13px;
  font-weight: 720;
}

.field-heading span {
  color: var(--muted);
  font-size: 11px;
}

#customer-message,
#draft-text {
  width: 100%;
  resize: vertical;
  border: 1px solid #c8d2dd;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  line-height: 1.7;
}

#customer-message {
  min-height: 154px;
  margin-top: 8px;
  padding: 13px 14px;
  font-size: 13px;
}

#customer-message::placeholder,
#draft-text::placeholder {
  color: #5c6d84;
}

#customer-message:focus,
#draft-text:focus {
  border-color: var(--blue-600);
}

.field-help,
.shortcut-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.form-actions {
  display: flex;
  gap: 9px;
  margin-top: 16px;
}

.primary-button,
.secondary-button,
.copy-button,
.text-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.primary-button {
  flex: 1 1 auto;
  padding: 0 16px;
  border: 1px solid var(--navy-900);
  background: var(--navy-900);
  color: #fff;
}

.primary-button:hover:not(:disabled) {
  background: var(--navy-800);
}

.primary-button svg {
  width: 17px;
  height: 17px;
}

.secondary-button,
.copy-button {
  padding: 0 14px;
  border: 1px solid #c6d1dd;
  background: #fff;
  color: var(--ink-soft);
}

.secondary-button:hover:not(:disabled),
.copy-button:hover:not(:disabled) {
  border-color: #9fabb9;
  background: #f7f9fb;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.shortcut-hint {
  text-align: right;
}

.decision-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.decision-header {
  min-height: 86px;
  align-items: center;
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
}

.mode-state {
  background: var(--green-100);
  color: var(--green-700);
}

.empty-state {
  min-height: 630px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 54px;
  text-align: center;
}

.empty-diagram {
  position: relative;
  width: 230px;
  height: 100px;
  margin-bottom: 34px;
}

.diagram-input,
.diagram-output,
.diagram-node {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
}

.diagram-input {
  left: 0;
  width: 50px;
  height: 64px;
  border: 1px solid #879bb2;
  border-radius: 9px;
}

.diagram-input::before,
.diagram-input::after,
.diagram-output::before,
.diagram-output::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  height: 2px;
  background: #c0cad5;
}

.diagram-input::before,
.diagram-output::before {
  top: 20px;
}

.diagram-input::after,
.diagram-output::after {
  top: 30px;
}

.diagram-output {
  right: 0;
  width: 64px;
  height: 78px;
  border: 1px solid var(--navy-700);
  border-radius: 9px;
  box-shadow: 0 9px 20px rgba(18, 52, 92, 0.09);
}

.diagram-output::after {
  top: 38px;
}

.diagram-node {
  width: 16px;
  height: 16px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--blue-600);
  box-shadow: 0 0 0 1px #7f9ccd;
}

.node-one {
  left: 82px;
}

.node-two {
  left: 123px;
  background: var(--amber-600);
  box-shadow: 0 0 0 1px #c89a58;
}

.diagram-line {
  position: absolute;
  top: 50%;
  height: 1px;
  background: #8fa1b7;
}

.line-one {
  left: 50px;
  width: 79px;
}

.line-two {
  left: 129px;
  width: 37px;
}

.empty-state h3 {
  margin: 0;
  color: var(--navy-950);
  font-size: 20px;
  letter-spacing: -0.02em;
}

.empty-state p {
  max-width: 56ch;
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.empty-state ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 24px 0 0;
  padding: 0;
  color: var(--ink-soft);
  font-size: 11px;
  list-style: none;
}

.empty-state li::before {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--green-700);
  vertical-align: 1px;
}

.loading-state,
.error-state {
  min-height: 630px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 44px;
}

.loading-state strong,
.error-state strong {
  color: var(--navy-950);
  font-size: 15px;
}

.loading-state p,
.error-state p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.loading-sequence {
  display: flex;
  align-items: center;
  gap: 5px;
}

.loading-sequence span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue-600);
  animation: loading-dot 1.1s ease-in-out infinite;
}

.loading-sequence span:nth-child(2) {
  animation-delay: 120ms;
}

.loading-sequence span:nth-child(3) {
  animation-delay: 240ms;
}

.error-state > svg {
  width: 34px;
  height: 34px;
  color: var(--red-800);
}

.text-button {
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--blue-600);
}

.result-view {
  overflow: hidden;
  animation: result-reveal 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.result-view > section,
.judgement-grid {
  border-bottom: 1px solid var(--line);
}

.customer-input,
.evidence-section,
.missing-section,
.draft-section,
.handoff-section {
  padding: 22px 26px;
}

.section-label {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 7px;
}

.section-label span {
  color: var(--navy-700);
  font-size: 11px;
  font-weight: 800;
}

.section-label small {
  color: var(--muted);
  font-size: 10px;
}

.customer-input blockquote {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 620;
  line-height: 1.65;
}

.judgement-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
}

.judgement-section {
  min-width: 0;
  padding: 22px 26px;
}

.judgement-section + .judgement-section {
  border-left: 1px solid var(--line);
}

.result-view h3 {
  color: var(--navy-950);
  font-size: 15px;
}

.intent-title {
  margin: 12px 0 14px;
  color: var(--navy-800);
  font-size: 17px;
  font-weight: 720;
  line-height: 1.35;
}

.state-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.urgency-state,
.sentiment-state {
  min-height: 27px;
  padding: 4px 9px;
  background: #e9eef4;
  color: var(--ink-soft);
  font-size: 10px;
}

.urgency-state.high {
  background: var(--amber-100);
  color: var(--amber-800);
}

.urgency-state.critical {
  background: var(--red-100);
  color: var(--red-800);
}

.risk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.risk-list li {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  gap: 9px;
  color: var(--ink-soft);
  font-size: 12px;
}

.risk-dot {
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--green-700);
}

.risk-dot.medium,
.risk-dot.high {
  background: var(--amber-600);
}

.risk-dot.critical {
  background: var(--red-800);
}

.risk-list strong {
  color: var(--ink);
  font-weight: 720;
}

.risk-list span {
  display: block;
  margin-top: 1px;
}

.evidence-count {
  min-height: 27px;
  background: var(--blue-100);
  color: #194f9e;
  font-size: 10px;
}

.source-list {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.source-item {
  border-bottom: 1px solid var(--line-soft);
}

.source-item summary {
  min-height: 50px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.source-item summary::-webkit-details-marker {
  display: none;
}

.source-number {
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 800;
}

.source-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 690;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-meta {
  color: var(--muted);
  font-size: 10px;
}

.source-item summary::after {
  content: "+";
  grid-column: 4;
  color: var(--navy-700);
  font-size: 18px;
  font-weight: 400;
}

.source-item[open] summary::after {
  content: "−";
}

.source-item p {
  max-width: 75ch;
  margin: 0;
  padding: 2px 38px 16px;
  color: var(--ink-soft);
  font-size: 12px;
}

.source-empty {
  margin-top: 14px;
  padding: 13px 0;
  color: var(--red-800);
  font-size: 12px;
}

.template-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin-top: 13px;
  color: var(--ink-soft);
  font-size: 11px;
}

.template-line span {
  color: var(--navy-700);
  font-weight: 750;
}

.template-line p {
  margin: 0;
}

.missing-section {
  display: grid;
  grid-template-columns: minmax(170px, 0.45fr) minmax(0, 1.55fr);
  align-items: center;
  gap: 24px;
  background: #fbfcfd;
}

.missing-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.missing-list li {
  padding: 5px 9px;
  border: 1px solid #d4dce5;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 620;
}

.copy-button {
  min-height: 36px;
}

.copy-button svg {
  width: 15px;
  height: 15px;
}

#draft-text {
  min-height: 154px;
  margin-top: 14px;
  padding: 14px 15px;
  background: var(--blue-050);
  font-size: 13px;
}

.draft-section > p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.handoff-section {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  border-bottom: 0 !important;
  background: #edf6f2;
}

.handoff-section.required {
  background: #fff8e9;
}

.handoff-state-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--green-700);
}

.handoff-section.required .handoff-state-icon {
  color: var(--amber-800);
}

.handoff-state-icon svg {
  width: 22px;
  height: 22px;
}

.handoff-copy p {
  max-width: 70ch;
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.handoff-copy > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

footer {
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 11px;
}

footer p {
  margin: 0;
}

footer a {
  color: var(--navy-700);
  font-weight: 700;
  text-underline-offset: 3px;
}

/*
 * The public gateway appends this return link after the application HTML.
 * Its inline stylesheet is intentionally rejected by this page's CSP, so the
 * size and positioning must live in this same-origin stylesheet instead.
 */
.agent-home-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 42px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--navy-900);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease, box-shadow 200ms ease;
}

.agent-home-button:hover {
  transform: translateY(-2px);
  border-color: var(--navy-700);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.agent-home-button:active {
  transform: scale(0.97);
}

.agent-home-button:focus-visible {
  outline: 3px solid rgba(27, 86, 173, 0.32);
  outline-offset: 3px;
}

.agent-home-button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 100;
  max-width: min(380px, calc(100vw - 32px));
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--navy-950);
  color: #fff;
  box-shadow: 0 15px 34px rgba(7, 24, 46, 0.28);
  font-size: 12px;
}

@keyframes skeleton {
  to {
    background-position-x: -220%;
  }
}

@keyframes loading-dot {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.75);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes result-reveal {
  from {
    opacity: 0.2;
    clip-path: inset(0 0 12% 0);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    filter: blur(0);
  }
}

@media (max-width: 1180px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .process-line {
    width: 100%;
  }

  .process-line li {
    flex: 1 1 0;
  }

  .demo-workspace {
    grid-template-columns: minmax(320px, 0.8fr) minmax(480px, 1.2fr);
  }

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

  .judgement-section + .judgement-section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .missing-section {
    grid-template-columns: 1fr;
    gap: 13px;
  }
}

@media (max-width: 900px) {
  .page-shell {
    padding-inline: 20px;
  }

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

  .scenario-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .scenario-list {
    min-height: auto;
  }

  .empty-state,
  .loading-state,
  .error-state {
    min-height: 500px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .page-shell {
    padding: 0 12px 16px;
  }

  .site-header {
    min-height: 68px;
  }

  .brand-copy small,
  .action-tag,
  .mode-state,
  .shortcut-hint {
    display: none;
  }

  .header-status {
    gap: 5px;
  }

  .status-tag,
  .connection-state {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 10px;
  }

  .intro {
    padding: 26px 4px 20px;
  }

  .intro h1 {
    font-size: 31px;
  }

  .intro p {
    font-size: 13px;
  }

  .process-line {
    width: 100%;
    overflow: visible;
    justify-content: stretch;
    padding-bottom: 0;
  }

  .process-line li {
    min-width: 0;
    flex: 1 1 20%;
    font-size: 9px;
    text-align: center;
    white-space: normal;
  }

  .privacy-notice {
    align-items: flex-start;
    padding: 11px 13px;
  }

  .demo-workspace {
    border-radius: 12px;
  }

  .scenario-panel,
  .decision-header,
  .customer-input,
  .judgement-section,
  .evidence-section,
  .missing-section,
  .draft-section,
  .handoff-section {
    padding-right: 16px;
    padding-left: 16px;
  }

  .scenario-panel {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .scenario-list {
    margin-right: -16px;
    margin-left: -16px;
  }

  .scenario-option {
    padding-right: 16px;
    padding-left: 16px;
  }

  .form-actions {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .primary-button,
  .secondary-button {
    min-height: 46px;
  }

  .empty-state {
    min-height: 440px;
    padding: 38px 24px;
  }

  .empty-diagram {
    transform: scale(0.88);
  }

  .empty-state ul {
    flex-direction: column;
    align-items: flex-start;
  }

  .loading-state,
  .error-state {
    min-height: 420px;
    flex-direction: column;
    text-align: center;
  }

  .customer-input blockquote {
    font-size: 15px;
  }

  .source-item summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .source-meta {
    display: none;
  }

  .source-item summary::after {
    grid-column: 3;
  }

  .source-item p {
    padding-left: 0;
  }

  .section-heading-row {
    align-items: center;
  }

  .copy-button {
    min-width: 44px;
    padding: 0 10px;
  }

  .copy-button svg {
    width: 17px;
    height: 17px;
  }

  .handoff-section {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .handoff-section > .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  footer {
    min-height: 82px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
  }

  .agent-home-button {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
  }

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

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
