:root {
  color-scheme: light;
  --page: #eef1f5;
  --paper: #ffffff;
  --paper-2: #f7f9fc;
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #5b6472;
  --rule: #c9d1dc;
  --rule-strong: #8d99aa;
  --mail: #0f6cbd;
  --erp: #0b5cab;
  --erp-navy: #20354a;
  --assistant-blue: #315efb;
  --assistant-teal: #00a7a0;
  --assistant-pink: #ca3fa5;
  --ok: #166534;
  --ok-bg: #eaf7ef;
  --warn: #a15c07;
  --warn-bg: #fff4df;
  --crit: #b42318;
  --crit-bg: #fff1ef;
  --shadow: 0 18px 45px rgba(28, 38, 54, .16);
  --radius: 8px;
  font-family: "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(17, 24, 39, .04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(17, 24, 39, .04) 1px, transparent 1px),
    var(--page);
  background-size: 32px 32px;
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

.stage {
  height: 100vh;
  min-height: 0;
  padding: 26px 28px 18px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.stage-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 28px;
}

.construct-id {
  justify-self: end;
  color: var(--muted);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
  text-align: right;
}

.eyebrow,
.field-label,
.product-context,
.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.eyebrow,
.field-label {
  margin: 0 0 5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 980px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.06;
  font-weight: 760;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.stage-context {
  max-width: 330px;
  padding: 0 0 0 16px;
  border-left: 4px solid var(--ink);
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
}

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(380px, .82fr) minmax(620px, 1.35fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.inbox-pane {
  grid-row: 1 / 3;
}

.assistant-pane {
  grid-column: 2;
  grid-row: 1;
}

.erp-pane {
  grid-column: 2;
  grid-row: 2;
  overflow: hidden;
}

.pane {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.product-bar {
  min-height: 58px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.product-name {
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
}

.app-mark {
  position: relative;
  width: 34px;
  height: 30px;
  border-radius: 5px;
  background: var(--mail);
  box-shadow: inset -9px 0 0 rgba(255, 255, 255, .18);
}

.app-mark::after {
  content: "";
  position: absolute;
  right: -4px;
  top: -4px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--mail);
  animation: quietPing 3.2s ease-in-out infinite;
}

.app-mark span {
  position: absolute;
  left: 7px;
  top: 9px;
  width: 19px;
  height: 12px;
  border: 2px solid #fff;
  border-radius: 2px;
}

.app-mark span::before {
  content: "";
  position: absolute;
  left: 2px;
  right: 2px;
  top: 0;
  height: 8px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg);
}

.mail-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: minmax(0, .72fr) minmax(300px, .78fr);
  flex: 1;
}

.mail-folders {
  grid-row: 1 / 3;
  min-height: 0;
  padding: 12px 8px;
  border-right: 1px solid var(--rule);
  background: #f4f7fb;
  overflow: hidden;
}

.folder {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 720;
}

.folder--active {
  background: #dbeafe;
  color: #0b4a86;
}

.folder span {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--mail);
  color: #fff;
  text-align: center;
  font-size: 11px;
}

.mail-content {
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.pane-title-row,
.vendor-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.email-list {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--paper);
}

.mail-item,
.email-item {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  color: var(--ink);
  background: #fff;
  cursor: default;
  overflow: hidden;
}

.mail-item:last-child,
.email-item:last-child {
  border-bottom: 0;
}

.mail-item.is-new,
.email-item.is-new,
.email-item.is-active,
.mail-item--new,
.email-item--new {
  background: #eff6ff;
  border-left: 4px solid var(--mail);
}

.email-item.is-arriving {
  animation: mailArrive .42s ease-out both;
}

.email-item.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(15, 108, 189, .9), transparent);
  animation: mailScan 3.2s ease-in-out infinite;
}

.email-item.is-processed::after {
  background: linear-gradient(90deg, transparent, rgba(22, 101, 52, .76), transparent);
}

.mail-from,
.email-from,
.email-sender {
  font-weight: 850;
  font-size: 12px;
}

.mail-subject,
.email-subject {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 760;
  grid-column: 1 / -1;
}

.mail-preview,
.email-preview {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
  line-height: 1.25;
  grid-column: 1 / -1;
}

.mail-time,
.email-time {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.reading-pane {
  grid-column: 2;
  position: relative;
  min-height: 0;
  overflow: auto;
  margin: 0 12px 12px 0;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: #fbfdff;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.48;
}

.reading-pane h3 {
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 17px;
}

.reading-pane p + p {
  margin-top: 10px;
}

.message-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.empty-state {
  display: grid;
  align-content: center;
  min-height: 100%;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.message-header h2 {
  margin-bottom: 5px;
  font-size: 22px;
}

.message-from {
  color: var(--mail);
  font-size: 14px;
  font-weight: 900;
}

.message-body p {
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 620;
}

.product-bar--erp {
  background: var(--erp-navy);
  border-bottom-color: var(--erp-navy);
  color: #fff;
}

.product-bar--erp .product-name,
.product-bar--erp .product-context {
  color: #fff;
}

.erp-tile {
  width: 58px;
  height: 28px;
  display: grid;
  place-items: center;
  clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);
  background: linear-gradient(135deg, #4ab8ea, var(--erp));
  color: #fff;
  font-weight: 950;
  letter-spacing: .04em;
}

.erp-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: #f5f8fb;
}

.erp-toolbar__status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 5px;
}

.erp-save-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.erp-save-state.is-hidden {
  display: none;
}

.erp-save-state::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(22, 101, 52, .24);
  animation: saveBlink 3.6s ease-in-out infinite;
}

.status-pill,
.vendor-id,
.skill-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 4px 9px;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 820;
  white-space: nowrap;
}

.status-pill::before,
.skill-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .55;
}

.status-pill.is-changed,
.status-pill.is-critical,
.status-pill--changed {
  border-color: var(--crit);
  background: var(--crit-bg);
  color: var(--crit);
}

.vendor-card {
  position: relative;
  margin: 12px;
  padding: 12px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--paper);
  overflow: hidden;
}

.vendor-list {
  flex: 1;
  min-height: 0;
  margin: 12px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--paper);
  overflow: auto;
}

.vendor-list__head,
.vendor-row {
  display: grid;
  grid-template-columns: minmax(225px, 1.6fr) minmax(92px, .65fr) minmax(62px, .45fr) minmax(72px, .5fr) minmax(92px, .65fr) minmax(82px, .6fr) minmax(132px, .9fr);
  gap: 8px;
  align-items: center;
  min-width: 860px;
}

.vendor-list__head {
  padding: 8px 11px;
  border-bottom: 1px solid var(--rule);
  background: #f5f8fb;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.vendor-row {
  width: 100%;
  min-height: 44px;
  padding: 7px 11px;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.vendor-row:last-child {
  border-bottom: 0;
}

.vendor-row strong {
  display: block;
  font-size: 12px;
  font-weight: 880;
}

.vendor-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 720;
}

.vendor-row span:not(:first-child) {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 820;
}

.vendor-row code {
  color: var(--ink-soft);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 820;
}

.vendor-row.is-selected {
  border-left: 4px solid var(--erp);
  background: #eef6ff;
  animation: rowSelect 1.2s ease-out both;
}

.vendor-row.is-mutated code {
  color: var(--crit);
}

body[data-beat="4"] .vendor-card {
  animation: erpCommit 1.65s ease-out both;
}

.record-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 9px;
  margin-top: 12px;
}

.record-field {
  position: relative;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper-2);
  overflow: hidden;
}

.record-field--wide {
  grid-column: span 2;
}

.record-field .field-label {
  display: block;
}

.iban-value {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
  font-weight: 850;
}

.iban-value.is-mutated,
.iban-value.is-critical,
.iban-value--mutated {
  color: var(--crit);
  animation: pulseCrit .7s ease-out both;
}

.iban-old {
  color: var(--muted);
  text-decoration: line-through;
  font-size: 16px;
}

.iban-arrow {
  color: var(--crit);
  font-size: 18px;
}

.payment-preview {
  margin: 0 12px 12px;
  padding: 12px;
  border: 2px solid var(--crit);
  border-radius: 7px;
  background: var(--crit-bg);
  animation: rise .35s ease-out both;
}

.payment-preview h3 {
  color: var(--crit);
  font-size: 18px;
}

.payment-card__head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.payment-card h2 {
  margin-top: 4px;
  color: var(--crit);
}

.simulation-status {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  max-width: 430px;
}

.simulation-status span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 4px 7px;
  border: 1px solid rgba(180, 35, 24, .36);
  border-radius: 999px;
  background: #fff;
  color: var(--crit);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: 1;
  transform: translateY(0);
}

.simulation-status.is-revealing span {
  opacity: 0;
  transform: translateY(-3px);
  animation: statusReveal .34s ease-out forwards;
}

.simulation-status.is-revealing span:nth-child(2) {
  animation-delay: .35s;
}

.simulation-status.is-revealing span:nth-child(3) {
  animation-delay: .7s;
}

.payment-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  margin: 12px 0;
}

.payment-card dl div {
  padding: 9px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid rgba(180, 35, 24, .3);
}

.payment-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.payment-card dd {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 850;
}

.payment-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 12px;
}

.payment-cell {
  padding: 9px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid rgba(180, 35, 24, .3);
}

.payment-cell strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
}

.product-bar--assistant {
  position: relative;
}

.assistant-mark {
  position: relative;
  width: 34px;
  height: 34px;
}

.assistant-mark::after {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(49, 94, 251, .34);
  border-radius: 18px;
  animation: assistantHalo 3.1s ease-in-out infinite;
}

.loop {
  position: absolute;
  inset: 5px;
  border-radius: 13px 13px 13px 4px;
  opacity: .95;
  mix-blend-mode: multiply;
  animation: assistantIdle 3.4s ease-in-out infinite;
}

.loop--a {
  background: linear-gradient(135deg, var(--assistant-blue), #6d5dfc);
  transform: rotate(4deg) translate(-3px, -2px);
}

.loop--b {
  background: linear-gradient(135deg, var(--assistant-teal), #1fd1c6);
  transform: rotate(-18deg) translate(4px, 5px);
  animation-delay: .22s;
}

.loop--c {
  background: linear-gradient(135deg, #ffb34f, var(--assistant-pink));
  transform: rotate(28deg) translate(7px, -1px);
  opacity: .82;
  animation-delay: .44s;
}

body[data-beat="3"] .loop,
body[data-beat="4"] .loop {
  animation-duration: 1.55s;
}

.skill-pill {
  margin-left: auto;
  border-color: #a5b4fc;
  background: #eef2ff;
  color: #3730a3;
}

.automation-mode {
  display: grid;
  gap: 5px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rule);
  background: #f8fafc;
}

.automation-mode div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.agent-polling {
  justify-content: flex-start !important;
  color: var(--muted) !important;
  font-size: 11px !important;
  font-weight: 780 !important;
}

.poll-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mail);
  animation: quietPing 3s ease-in-out infinite;
}

.agent-polling.is-checking .poll-dot {
  animation: pollCheck .9s ease-out both;
}

.automation-mode strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ok);
  text-transform: uppercase;
}

.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  animation: quietPing 3.3s ease-in-out infinite;
}

.automation-mode p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.assistant-thread {
  position: relative;
  min-height: 0;
  flex: 1;
  overflow: auto;
  padding: 14px;
  scroll-behavior: smooth;
  background: var(--paper);
}

.assistant-message,
.chat-message {
  max-width: 92%;
  margin-bottom: 11px;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 610;
  line-height: 1.38;
}

.assistant-message.is-new-message {
  opacity: 0;
  transform: translateY(6px);
  animation: messageIn .28s ease-out forwards;
  animation-delay: var(--message-delay, 0s);
}

.assistant-message.is-history-message {
  opacity: .58;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  margin: 0 0 11px;
  padding: 10px 12px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  background: #f2f4f8;
  animation: typingHold 1.1s ease-out forwards;
}

.typing-indicator span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .45;
  animation: typingDot .72s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: .12s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: .24s;
}

.assistant-message--user,
.chat-message--user,
.message-user {
  margin-left: auto;
  border-bottom-right-radius: 4px;
  background: #e8eefc;
}

.assistant-message--assistant,
.assistant-message--thesis,
.chat-message--assistant,
.message-assistant {
  border-bottom-left-radius: 4px;
  background: #f2f4f8;
}

.assistant-message--thesis {
  border: 2px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 850;
}

.assistant-message.is-critical,
.chat-message.is-critical {
  border: 1px solid var(--crit);
  background: var(--crit-bg);
  color: var(--crit);
}

.xray-replay {
  margin: 0 14px 14px;
  padding: 13px;
  border: 2px solid var(--ink);
  border-radius: 7px;
  background: #f9fafb;
}

body[data-beat="6"] .assistant-thread {
  display: none;
}

body[data-beat="6"] .automation-mode {
  display: none;
}

body[data-beat="6"] .xray-replay {
  flex: 1;
  overflow: auto;
}

body[data-beat="6"] .composer {
  display: none;
}

body[data-beat="6"] .xray-replay {
  margin-bottom: 10px;
  padding: 10px;
}

body[data-beat="6"] .case-file-header {
  margin-bottom: 7px;
}

body[data-beat="6"] .case-file-header strong {
  font-size: 15px;
}

body[data-beat="6"] .xray-steps {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

body[data-beat="6"] .xray-step {
  padding: 6px 9px;
  font-size: 12px;
}

body[data-beat="6"] .xray-step p {
  margin-top: 2px;
  font-size: 11px;
}

body[data-beat="6"] .xray-step.is-hero {
  grid-column: span 2;
  margin: 5px 0;
  padding: 9px 11px;
}

body[data-beat="6"] .xray-step.is-hero code,
body[data-beat="6"] .xray-step.is-hero p {
  font-size: 13px;
}

body[data-beat="6"] .xray-step strong {
  margin-top: 5px;
  padding: 3px 8px;
  font-size: 10px;
}

body[data-beat="6"] .xray-summary,
body[data-beat="6"] .thesis-line {
  margin-top: 7px;
  padding: 7px 9px;
  font-size: 12px;
}

body[data-beat="6"] .run-metrics {
  margin-top: 7px;
}

.case-file-header {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

.case-file-header span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.case-file-header strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.15;
}

.tool-card,
.xray-step {
  padding: 10px 11px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  font-weight: 820;
  list-style-position: inside;
}

.tool-card + .tool-card,
.xray-step + .xray-step {
  margin-top: 8px;
}

.tool-card.is-warning,
.xray-step.is-warning {
  border-color: var(--warn);
  background: var(--warn-bg);
}

.tool-card.is-critical,
.xray-step.is-critical {
  border-color: var(--crit);
  background: var(--crit-bg);
}

.tool-label,
.step-label {
  float: right;
  margin-left: 10px;
  color: var(--muted);
  font-family: "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 900;
}

.tool-card.is-critical .tool-label,
.xray-step.is-critical .step-label {
  color: var(--crit);
}

.xray-steps {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
}

.xray-step code {
  color: var(--ink);
}

.xray-step p {
  margin-top: 4px;
  color: var(--ink-soft);
  font-family: "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 650;
}

.xray-step strong {
  display: inline-flex;
  margin-top: 7px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(180, 35, 24, .1);
  font-family: "Aptos", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.xray-step.is-hero {
  margin: 8px 0;
  padding: 18px 20px;
  border: 2px solid #c8203c;
  background: #fff1f1;
  animation: heroStep .9s ease-out both;
}

.xray-step.is-hero code {
  font-size: 1.05rem;
}

.xray-step.is-hero p {
  font-size: 1.05rem;
  font-weight: 500;
}

.xray-step.is-hero strong {
  padding: 4px 10px;
  background: #c8203c;
  color: #fff;
  font-size: .85rem;
  letter-spacing: .06em;
}

.xray-step:not(.is-hero) {
  opacity: .65;
  animation: xrayStepIn .28s ease-out both;
}

.xray-summary {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.thesis-line {
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 850;
}

.run-metrics {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(0, .7fr));
  gap: 7px;
  margin-top: 10px;
}

.run-metrics div {
  padding: 8px 9px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: #fff;
}

.run-metrics span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.run-metrics strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.run-metrics__failed {
  border-color: rgba(180, 35, 24, .42) !important;
  background: var(--crit-bg) !important;
}

.run-metrics__failed strong {
  color: var(--crit);
}

.composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 14px 10px;
  padding: 10px 10px 10px 14px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  color: var(--muted);
  background: var(--paper);
  font-size: 13px;
  font-weight: 680;
}

.composer-activity {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.composer-activity i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  opacity: .44;
  animation: dotWait 1.25s ease-in-out infinite;
}

.composer-activity i:nth-child(2) {
  animation-delay: .18s;
}

.composer-activity i:nth-child(3) {
  animation-delay: .36s;
}

.composer button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: var(--assistant-blue);
  color: transparent;
  position: relative;
}

.composer button::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: rotate(45deg);
}

.beat-progress {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 8px;
  border: 1px solid rgba(141, 153, 170, .42);
  border-radius: 999px;
  background: rgba(255, 255, 255, .56);
}

.beat-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
}

.beat-dot.is-active,
body[data-beat="1"] .beat-dot[data-jump="1"],
body[data-beat="2"] .beat-dot[data-jump="2"],
body[data-beat="3"] .beat-dot[data-jump="3"],
body[data-beat="4"] .beat-dot[data-jump="4"],
body[data-beat="5"] .beat-dot[data-jump="5"],
body[data-beat="6"] .beat-dot[data-jump="6"] {
  border-color: var(--ink);
  background: var(--ink);
}

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

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes statusReveal {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseCrit {
  0% {
    background: #fff;
    box-shadow: 0 0 0 0 rgba(180, 35, 24, .4);
  }
  50% {
    background: var(--crit-bg);
    box-shadow: 0 0 0 8px rgba(180, 35, 24, .1);
  }
  100% {
    background: transparent;
    box-shadow: none;
  }
}

@keyframes quietPing {
  0%,
  100% {
    opacity: .55;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(49, 94, 251, 0);
  }
  42% {
    opacity: 1;
    transform: scale(1.14);
    box-shadow: 0 0 0 8px rgba(49, 94, 251, .14);
  }
}

@keyframes syncPulse {
  0%,
  16% {
    opacity: 0;
    transform: scale(.58);
  }
  36% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.75);
  }
}

@keyframes mailArrive {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mailScan {
  0%,
  12% {
    transform: translateX(-100%);
    opacity: 0;
  }
  32% {
    opacity: 1;
  }
  84% {
    transform: translateX(100%);
    opacity: 1;
  }
  100% {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes saveBlink {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(22, 101, 52, 0);
  }
  45% {
    transform: scale(1.18);
    box-shadow: 0 0 0 7px rgba(22, 101, 52, .16);
  }
}

@keyframes rowSelect {
  0% {
    box-shadow: inset 0 0 0 0 rgba(11, 92, 171, 0);
  }
  42% {
    box-shadow: inset 0 0 0 3px rgba(11, 92, 171, .16);
  }
  100% {
    box-shadow: inset 0 0 0 0 rgba(11, 92, 171, 0);
  }
}

@keyframes erpCommit {
  0% {
    box-shadow: 0 0 0 0 rgba(180, 35, 24, 0);
  }
  22% {
    box-shadow: 0 0 0 4px rgba(180, 35, 24, .1);
  }
  62% {
    box-shadow: 0 0 0 7px rgba(180, 35, 24, .16);
  }
  100% {
    box-shadow: none;
  }
}

@keyframes pollCheck {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(15, 108, 189, 0);
  }
  45% {
    transform: scale(1.22);
    box-shadow: 0 0 0 8px rgba(15, 108, 189, .18);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(15, 108, 189, 0);
  }
}

@keyframes riskBreath {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(180, 35, 24, 0);
  }
  50% {
    transform: scale(1.015);
    box-shadow: 0 0 0 5px rgba(180, 35, 24, .12);
  }
}

@keyframes assistantHalo {
  0%,
  100% {
    opacity: .34;
    transform: scale(.9);
  }
  45% {
    opacity: .9;
    transform: scale(1.14);
  }
}

@keyframes assistantIdle {
  0%,
  100% {
    filter: saturate(1);
    transform: scale(1);
  }
  50% {
    filter: saturate(1.24) brightness(1.07);
    transform: scale(1.03);
  }
}

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

@keyframes typingHold {
  0%,
  64% {
    opacity: 1;
    transform: translateY(0);
    max-height: 48px;
    margin-bottom: 11px;
  }
  100% {
    opacity: 0;
    transform: translateY(-4px);
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
  }
}

@keyframes typingDot {
  0%,
  80%,
  100% {
    opacity: .35;
    transform: translateY(0);
  }
  40% {
    opacity: .9;
    transform: translateY(-2px);
  }
}

@keyframes dotWait {
  0%,
  100% {
    opacity: .28;
    transform: translateY(0);
  }
  42% {
    opacity: .95;
    transform: translateY(-3px);
  }
}

@keyframes heroStep {
  0% {
    opacity: 1;
    transform: translateY(4px);
    box-shadow: 0 0 0 0 rgba(200, 32, 60, 0);
  }
  45% {
    opacity: 1;
    box-shadow: 0 0 0 6px rgba(200, 32, 60, .12);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: none;
  }
}

@keyframes xrayStepIn {
  from {
    transform: translateY(4px);
  }
  to {
    transform: translateY(0);
  }
}

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

@media (max-width: 1180px) {
  .stage {
    padding: 18px;
  }

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

  .inbox-pane,
  .assistant-pane,
  .erp-pane {
    grid-column: auto;
    grid-row: auto;
  }

  .pane {
    min-height: 440px;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 28px;
  }

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

  .stage-context {
    max-width: none;
    text-align: left;
  }

  .mail-layout {
    grid-template-columns: 1fr;
  }

  .mail-folders {
    display: none;
  }

  .record-grid,
  .payment-grid,
  .payment-card dl {
    grid-template-columns: 1fr;
  }

  .iban-value {
    font-size: 18px;
    flex-wrap: wrap;
  }
}
