:root {
  color-scheme: light;
  --who-ink: #171717;
  --who-copy: #43434a;
  --who-meta: #5f6368;
  --who-muted: #8d9098;
  --who-canvas: #fafafa;
  --who-card: #ffffff;
  --who-control: #f7f7fa;
  --who-line: #ececf1;
  --who-line-strong: #d8d8e2;
  --who-purple: #7c3aed;
  --who-purple-deep: #6d28d9;
  --who-lavender: #f5f1ff;
  --who-lavender-strong: #ded2ff;
  --who-focus: rgba(124, 58, 237, 0.22);
  --who-shadow-card: 0 1px 2px rgba(16, 16, 24, 0.04), 0 8px 24px rgba(16, 16, 24, 0.05);
  --who-shadow-action: 0 8px 22px rgba(124, 58, 237, 0.3);
  --who-shadow-dialog: 0 24px 70px rgba(16, 16, 24, 0.22);
  --who-success: #237a4b;
  --who-success-bg: #eaf7ef;
  --who-warning: #8a5a00;
  --who-warning-bg: #fff6dd;
  --who-danger: #a23a42;
  --who-danger-bg: #fff0f1;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--who-canvas);
  color: var(--who-ink);
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; background: var(--who-canvas); }

button, input { font: inherit; }

.workstation { width: min(860px, calc(100% - 40px)); margin: 32px auto 56px; }

.masthead { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; }
.brand-lockup { display: flex; align-items: center; gap: 9px; margin-bottom: 26px; color: var(--who-purple); }
.brand-node { width: 13px; height: 13px; border: 4px solid var(--who-lavender-strong); border-radius: 50%; background: var(--who-purple); box-shadow: 0 0 0 4px var(--who-lavender); }
.brand-name { font-size: 21px; font-weight: 800; letter-spacing: -0.045em; }

h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 620px; margin-bottom: 0; font-size: clamp(28px, 5vw, 38px); font-weight: 800; letter-spacing: -0.045em; line-height: 1.08; }
h2 { margin-bottom: 8px; font-size: 22px; font-weight: 750; letter-spacing: -0.025em; }
h3 { margin: 0; font-size: 15px; font-weight: 750; letter-spacing: -0.01em; }

.eyebrow, .section-number { margin-bottom: 7px; color: var(--who-purple); font-size: 11px; font-weight: 750; letter-spacing: 0.11em; }
.mode-badge { border: 1px solid var(--who-lavender-strong); border-radius: 999px; padding: 7px 11px; background: var(--who-lavender); color: var(--who-purple-deep); font-size: 11px; font-weight: 750; letter-spacing: 0.06em; }
.supporting-copy, .source-note { color: var(--who-meta); font-size: 14px; line-height: 1.5; }
.source-note { max-width: 320px; margin-bottom: 0; text-align: right; }

.login-panel, .dispatch-panel { border: 1px solid var(--who-line); border-radius: 22px; background: var(--who-card); padding: 30px; box-shadow: var(--who-shadow-card); }
.login-panel { max-width: 500px; }
form { display: grid; gap: 8px; }
label { margin-top: 5px; color: var(--who-copy); font-size: 13px; font-weight: 650; }
input { width: 100%; min-height: 48px; border: 1px solid var(--who-line-strong); border-radius: 11px; padding: 10px 14px; background: var(--who-control); color: var(--who-ink); transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease; }
input:hover { border-color: var(--who-muted); }
input:focus { outline: 0; border-color: var(--who-purple); background: var(--who-card); box-shadow: 0 0 0 4px var(--who-focus); }
button { min-height: 46px; border: 1px solid transparent; border-radius: 11px; padding: 10px 18px; font-weight: 700; cursor: pointer; transition: background 150ms ease, border-color 150ms ease, color 150ms ease, box-shadow 150ms ease, transform 150ms ease; }
button:hover:not(:disabled) { transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(0); }
button:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--who-focus); }
button:disabled { cursor: not-allowed; opacity: 0.48; }
.primary { background: var(--who-purple); color: var(--who-card); box-shadow: var(--who-shadow-action); }
.primary:hover:not(:disabled) { background: var(--who-purple-deep); }
.secondary { border-color: var(--who-line-strong); background: var(--who-card); color: var(--who-ink); }
.secondary:hover:not(:disabled) { border-color: var(--who-purple); color: var(--who-purple-deep); }
.send { background: var(--who-ink); color: var(--who-card); }
.send:hover:not(:disabled) { background: var(--who-purple-deep); }
.login-panel .primary { margin-top: 8px; }

.dispatch-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 30px; padding: 9px; border: 1px solid var(--who-line); border-radius: 16px; background: var(--who-control); }
.stage { position: relative; min-height: 52px; display: flex; gap: 9px; align-items: center; padding: 9px 11px; border-radius: 11px; color: var(--who-meta); font-size: 13px; font-weight: 700; }
.stage:not(:last-child)::after { content: ""; position: absolute; z-index: 0; top: 50%; right: -8px; width: 8px; border-top: 2px dotted var(--who-lavender-strong); }
.stage span { position: relative; z-index: 1; display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px; border: 1px solid var(--who-lavender-strong); border-radius: 50%; background: var(--who-card); color: var(--who-purple); font-size: 11px; font-weight: 800; }
.stage small { display: block; margin-left: auto; color: var(--who-warning); font-size: 10px; font-weight: 650; }
.stage.active { background: var(--who-lavender); color: var(--who-purple-deep); }
.stage.active span { border-color: var(--who-purple); background: var(--who-purple); color: var(--who-card); box-shadow: 0 0 0 4px var(--who-focus); }
.stage.done { background: var(--who-success-bg); color: var(--who-success); }
.stage.done span { border-color: var(--who-success); background: var(--who-success); color: var(--who-card); }
.stage.boundary { box-shadow: inset 3px 0 0 var(--who-warning-bg); }

.ticket-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.order-entry { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
#crm-order-id { font: 700 18px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; }

.receipt { border-top: 1px solid var(--who-line); margin-top: 28px; padding-top: 22px; }
.receipt-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.status-pill { padding: 6px 10px; border: 1px solid currentColor; border-radius: 999px; font-size: 11px; font-weight: 750; }
.status-pill.pending { color: var(--who-warning); background: var(--who-warning-bg); }
.status-pill.success { color: var(--who-success); background: var(--who-success-bg); }
.status-pill.failed { color: var(--who-danger); background: var(--who-danger-bg); }
dl { margin: 18px 0; overflow: hidden; border: 1px solid var(--who-line); border-radius: 16px; }
dl div { display: grid; grid-template-columns: 138px 1fr; border-bottom: 1px solid var(--who-line); }
dl div:last-child { border-bottom: 0; }
dt, dd { margin: 0; padding: 11px 13px; }
dt { color: var(--who-meta); background: var(--who-control); font-size: 11px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
dd { min-width: 0; border-left: 1px solid var(--who-line); color: var(--who-copy); font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
dd a { color: var(--who-purple-deep); font-weight: 700; }
.receipt-actions { display: flex; justify-content: flex-end; gap: 8px; }
.heading-side { display: grid; justify-items: end; gap: 10px; }
.message { min-height: 20px; margin: 14px 0 0; color: var(--who-danger); font-size: 13px; font-weight: 650; line-height: 1.45; }
dialog { width: min(480px, calc(100% - 32px)); border: 1px solid var(--who-line); border-radius: 18px; padding: 28px; background: var(--who-card); color: var(--who-ink); box-shadow: var(--who-shadow-dialog); }
dialog::backdrop { background: rgba(23, 23, 23, 0.52); backdrop-filter: blur(3px); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

@media (max-width: 620px) {
  .workstation { width: min(100% - 20px, 860px); margin: 20px auto 32px; }
  .login-panel, .dispatch-panel { padding: 20px; border-radius: 18px; }
  .masthead, .ticket-heading { display: block; }
  .brand-lockup { margin-bottom: 20px; }
  .mode-badge { display: inline-block; margin-top: 12px; }
  .source-note { max-width: none; text-align: left; }
  .dispatch-strip { grid-template-columns: 1fr; }
  .stage:not(:last-child)::after { top: auto; right: auto; bottom: -8px; left: 23px; width: 0; height: 8px; border-top: 0; border-left: 2px dotted var(--who-lavender-strong); }
  .stage.boundary { box-shadow: inset 0 3px 0 var(--who-warning-bg); }
  .order-entry { grid-template-columns: 1fr; }
  dl div { grid-template-columns: 108px 1fr; }
  .receipt-actions { flex-direction: column; }
  .heading-side { justify-items: start; }
  .dialog-actions { flex-direction: column-reverse; }
}
