:root {
  color-scheme: light;
  --canvas: #f4f6f7;
  --surface: #ffffff;
  --surface-soft: #f7f9f9;
  --ink: #172127;
  --muted: #738088;
  --line: #dce3e5;
  --line-strong: #cbd5d8;
  --header: #151b20;
  --accent: #008b78;
  --accent-strong: #006f61;
  --accent-soft: #e4f4f0;
  --warning: #aa6b17;
  --danger: #bf3e50;
  --shadow: 0 14px 34px rgba(24, 37, 43, 0.07);
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }
.page-shell { min-height: 100vh; }
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 max(24px, calc((100% - 1040px) / 2));
  background: var(--header);
  color: #f7fbfb;
}
.brand, .header-actions, .brand-copy { display: flex; align-items: center; }
.brand { gap: 11px; }
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 3px;
  width: 17px;
  height: 17px;
}
.brand-mark i { display: block; border-radius: 1px; background: #71d8c5; }
.brand-mark i:nth-child(2) { background: #f2c66d; }
.brand-mark i:nth-child(3) { background: #d7ebeb; }
.brand-copy { flex-direction: column; align-items: flex-start; line-height: 1.15; }
.brand-copy strong { font-size: 14px; font-weight: 700; }
.brand-copy small { margin-top: 3px; color: #9aabb2; font-size: 10px; }
.header-actions { gap: 14px; }
.service-state, .request-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #bdc9cd;
  font-size: 12px;
  white-space: nowrap;
}
.service-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aab7bc;
}
.service-state.ready { color: #a7e2d6; }
.service-state.ready i { background: #49c9b3; box-shadow: 0 0 0 4px rgba(73, 201, 179, 0.14); }
.quiet-button {
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 8px 11px;
  background: transparent;
  color: inherit;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}
.app-header .quiet-button { border-color: #6c858d; background: #263239; color: #f2f7f7; }
.app-header .quiet-button:hover { border-color: #799097; background: #202a30; }
.app-main { width: min(1040px, calc(100% - 48px)); margin: 0 auto; padding: 42px 0 64px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 25px; }
.eyebrow, .label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .9px; }
.eyebrow { color: var(--accent); }
h1, h2, p { margin: 0; }
h1 { margin-top: 4px; font-size: 30px; line-height: 1.16; font-weight: 720; letter-spacing: 0; }
h2 { margin-top: 3px; font-size: 18px; line-height: 1.25; letter-spacing: 0; }
.flow { display: flex; align-items: center; gap: 0; margin: 0; padding: 0; list-style: none; }
.flow li { display: flex; align-items: center; color: #89959a; font-size: 12px; }
.flow li + li::before { width: 30px; height: 1px; margin: 0 9px; background: var(--line-strong); content: ""; }
.flow span { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--canvas); font-size: 11px; font-weight: 700; }
.flow em { margin-left: 6px; font-style: normal; }
.flow li.active { color: var(--accent-strong); }
.flow li.active span { border-color: var(--accent); background: var(--accent); color: #fff; }
.flow li.done { color: var(--accent-strong); }
.flow li.done span { border-color: #a9dcd0; background: var(--accent-soft); color: var(--accent-strong); }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(260px, .75fr); gap: 16px; }
.panel { border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.order-panel, .identity-panel, .receipt-panel { padding: 27px; }
.panel-title, .receipt-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-index { color: var(--accent); font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.access-form { margin-top: 31px; }
.access-form label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 650; }
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
input {
  min-width: 0;
  height: 45px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 0 13px;
  outline: none;
  background: #fff;
  color: var(--ink);
}
input::placeholder { color: #a0aaae; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 139, 120, 0.11); }
button:not(.quiet-button) {
  min-height: 45px;
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
button:not(.quiet-button):hover { border-color: var(--accent-strong); background: var(--accent-strong); }
button:disabled { cursor: not-allowed; opacity: .55; }
.error { min-height: 18px; margin-top: 10px; color: var(--danger); font-size: 12px; }
.status-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 211px;
  padding: 27px;
  background: #edf5f4;
  box-shadow: none;
}
.status-panel .status-orb { display: grid; place-items: center; width: 40px; height: 40px; margin: 18px 0 12px; border: 1px solid #bfe0d7; border-radius: 50%; background: #f6fffc; }
.status-orb i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.status-panel strong { font-size: 15px; }
.workspace { display: grid; gap: 16px; }
.compact-title { align-items: center; }
.expiry { color: var(--muted); font-size: 12px; text-align: right; }
.identity-grid { display: grid; grid-template-columns: .8fr .95fr 1.5fr; gap: 0; margin: 26px 0 0; }
.identity-grid > div { min-width: 0; padding: 0 19px; border-left: 1px solid var(--line); }
.identity-grid > div:first-child { padding-left: 0; border-left: 0; }
dt { color: var(--muted); font-size: 11px; font-weight: 650; }
dd { min-width: 0; margin: 5px 0 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 700; }
.mono { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.receipt-panel { min-height: 308px; }
.request-status { margin-top: 3px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; color: var(--muted); }
.request-status.active { border-color: #9fd8ca; background: var(--accent-soft); color: var(--accent-strong); }
.request-status.done { border-color: #9fd8ca; background: var(--accent-soft); color: var(--accent-strong); }
.request-status.failed { border-color: #e9bec5; background: #fff2f3; color: var(--danger); }
.empty-state, .code-state { display: grid; justify-items: center; align-content: center; min-height: 139px; margin-top: 23px; text-align: center; }
.empty-state { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.pulse-dot {
  position: relative;
  width: 9px;
  height: 9px;
  margin-bottom: 11px;
  border-radius: 50%;
  background: var(--warning);
  animation: pulseCore 1.8s ease-in-out infinite;
}
.pulse-dot::before, .pulse-dot::after {
  position: absolute;
  inset: -4px;
  border: 1.5px solid rgba(170, 107, 23, .6);
  border-radius: 50%;
  content: "";
  opacity: 0;
  animation: receivePulse 2.2s ease-out infinite;
}
.pulse-dot::after {
  animation-delay: -1.1s;
}
@keyframes receivePulse {
  0% { opacity: .8; transform: scale(.7); }
  65% { opacity: .2; transform: scale(2.8); }
  100% { opacity: 0; transform: scale(3.35); }
}
@keyframes pulseCore {
  0%, 100% { box-shadow: 0 0 0 0 rgba(170, 107, 23, .12); transform: scale(.86); }
  50% { box-shadow: 0 0 0 5px rgba(170, 107, 23, .14); transform: scale(1.08); }
}
.code-state { border-top: 1px solid #c6e6df; border-bottom: 1px solid #c6e6df; background: #f5fcfa; }
.code-label { color: var(--muted); font-size: 12px; }
.code-state strong { margin: 7px 0 12px; color: var(--accent-strong); font: 700 36px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 2px; }
.receipt-panel .quiet-button { background: var(--surface); color: var(--ink); }
.receipt-panel .quiet-button:hover { border-color: #9fb0b3; background: var(--surface-soft); }
.actions { display: flex; align-items: center; gap: 9px; margin-top: 17px; }
.actions .quiet-button { min-height: 45px; padding: 0 15px; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .pulse-dot, .pulse-dot::before, .pulse-dot::after { animation: none; }
  .pulse-dot::before, .pulse-dot::after { opacity: .3; transform: scale(1.35); }
}

@media (max-width: 720px) {
  .app-header { min-height: 60px; padding: 0 16px; }
  .app-main { width: min(100% - 28px, 1040px); padding: 28px 0 42px; }
  .page-intro { align-items: flex-start; margin-bottom: 20px; }
  h1 { font-size: 25px; }
  .flow { display: none; }
  .entry-layout { grid-template-columns: 1fr; gap: 12px; }
  .status-panel { min-height: 144px; }
  .status-panel .status-orb { margin: 12px 0 9px; }
  .order-panel, .identity-panel, .receipt-panel { padding: 20px; }
  .identity-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 20px; }
  .identity-grid > div { padding: 0; border-left: 0; }
  .expiry { display: none; }
}

@media (max-width: 440px) {
  .brand-copy small { display: none; }
  .header-actions { gap: 8px; }
  .service-state { font-size: 11px; }
  .input-row { grid-template-columns: 1fr; }
  .input-row button { width: 100%; }
  .actions { display: grid; grid-template-columns: 1fr; }
  .actions button, .actions .quiet-button { width: 100%; }
}
