:root {
  color-scheme: light;
  --primary: #1677ff;
  --primary-dark: #0b5fdb;
  --primary-soft: #eaf3ff;
  --ink: #172033;
  --muted: #738096;
  --line: #e7ebf2;
  --surface: #ffffff;
  --canvas: #f5f7fb;
  --success: #19a974;
  --success-soft: #eaf9f3;
  --warning: #e49a19;
  --warning-soft: #fff7e6;
  --danger: #df4d5c;
  --danger-soft: #fff0f1;
  --violet: #7658e8;
  --shadow-sm: 0 6px 20px rgba(30, 51, 84, 0.06);
  --shadow-lg: 0 24px 70px rgba(27, 45, 77, 0.18);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

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

button,
input,
select,
textarea {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: var(--primary);
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 30px 18px 22px;
  color: #dce8ff;
  background:
    radial-gradient(circle at 25% 8%, rgba(70, 134, 255, 0.34), transparent 28%),
    linear-gradient(180deg, #11294c 0%, #0d213e 66%, #0b1b33 100%);
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 10px;
}

.brand-mark,
.brand-badge {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: white;
  font-size: 23px;
  font-weight: 800;
  border-radius: 12px;
  background: linear-gradient(145deg, #2b91ff, #1268ee);
  box-shadow: 0 10px 24px rgba(16, 102, 232, 0.34);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  color: #fff;
  font-size: 17px;
  letter-spacing: 0.04em;
}

.brand-copy small {
  color: #7f9bc4;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main-nav {
  display: grid;
  gap: 7px;
  margin-top: 42px;
}

.nav-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  color: #9fb4d2;
  text-align: left;
  border: 0;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  transition: 160ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(35, 126, 255, 0.28), rgba(35, 126, 255, 0.08));
  box-shadow: inset 3px 0 0 #3c98ff;
}

.nav-icon {
  color: #6faeff;
  font-size: 18px;
  font-weight: 700;
}

.sidebar-foot {
  margin-top: auto;
  padding: 18px 12px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-foot p {
  margin: 10px 0 0;
  color: #7189aa;
  font-size: 11px;
  line-height: 1.7;
}

.mode-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #b7cdf0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.mode-pill span,
.health-chip span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #42d39c;
  box-shadow: 0 0 0 5px rgba(66, 211, 156, 0.12);
}

.workspace {
  min-width: 0;
  padding: 0 34px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 105px;
  gap: 24px;
}

.topbar h1,
.section-hero h2,
.panel h2,
.modal h2,
.flow-app h1,
.flow-app h2,
.flow-app h3 {
  margin: 0;
}

.topbar h1 {
  margin-top: 5px;
  font-size: 27px;
  line-height: 1.2;
}

.eyebrow {
  margin: 0;
  color: #8c98ab;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.health-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 13px;
  color: #506078;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, #2588ff, #1269ef);
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.2);
}

.button-primary:hover:not(:disabled) {
  box-shadow: 0 12px 26px rgba(22, 119, 255, 0.28);
}

.button-secondary {
  color: #556277;
  border-color: var(--line);
  background: #fff;
}

.button-danger-soft {
  color: var(--danger);
  background: var(--danger-soft);
}

.text-button {
  padding: 4px 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.mobile-only {
  display: none;
}

.safety-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 58px;
  margin-bottom: 24px;
  padding: 10px 18px;
  color: #8c6014;
  border: 1px solid #f7ddb0;
  border-radius: 14px;
  background: linear-gradient(90deg, #fff8e9, #fffdf8);
}

.safety-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  background: #efa82b;
}

.safety-banner div {
  display: flex;
  gap: 8px;
  min-width: 0;
  font-size: 12px;
}

.safety-banner div span {
  color: #9b783c;
}

.safety-banner a {
  margin-left: auto;
  color: #a36e13;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.page {
  display: none;
  animation: page-in 180ms ease;
}

.page.is-active {
  display: block;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric-card {
  position: relative;
  min-height: 145px;
  padding: 21px;
  overflow: hidden;
  border: 1px solid rgba(225, 230, 239, 0.9);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.metric-card::after {
  position: absolute;
  right: -26px;
  bottom: -36px;
  width: 100px;
  height: 100px;
  content: "";
  border-radius: 50%;
  background: var(--metric-soft);
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #68758a;
  font-size: 12px;
}

.metric-top i {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--metric-color);
  font-style: normal;
  font-weight: 800;
  border-radius: 9px;
  background: var(--metric-soft);
}

.metric-card > strong {
  display: block;
  margin: 12px 0 5px;
  font-size: 28px;
  letter-spacing: -0.04em;
}

.metric-card > small {
  position: relative;
  z-index: 1;
  color: #9aa4b4;
  font-size: 11px;
}

.metric-blue { --metric-color: #1677ff; --metric-soft: #e9f3ff; }
.metric-amber { --metric-color: #dc941c; --metric-soft: #fff5df; }
.metric-green { --metric-color: #159a6b; --metric-soft: #e8f8f1; }
.metric-violet { --metric-color: #7658e8; --metric-soft: #f0ecff; }

.content-grid {
  display: grid;
  gap: 18px;
}

.overview-grid {
  grid-template-columns: 1fr;
  margin-top: 18px;
}

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

.panel {
  padding: 23px;
  border: 1px solid rgba(225, 230, 239, 0.9);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-head h2,
.section-hero h2 {
  margin-top: 5px;
  font-size: 18px;
}

.panel-head p:not(.eyebrow),
.section-hero p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.step-progress {
  color: #778398;
  font-size: 11px;
  font-weight: 700;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.flow-step {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 95px;
  padding: 15px;
  text-align: left;
  border: 1px solid #edf0f5;
  border-radius: 14px;
  background: #fbfcfe;
  cursor: pointer;
  transition: 150ms ease;
}

.flow-step:hover {
  border-color: #cfe3ff;
  background: #f7fbff;
  transform: translateY(-2px);
}

.step-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  border-radius: 9px;
  background: var(--primary-soft);
}

.flow-step > span:nth-child(2) {
  display: grid;
  gap: 6px;
}

.flow-step strong {
  font-size: 13px;
}

.flow-step small {
  color: #8b96a8;
  font-size: 10px;
  line-height: 1.45;
}

.flow-step i {
  color: #b3bdcb;
  font-style: normal;
}

.readiness-panel {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.readiness-panel .panel-head {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.readiness-ring {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 40%, #e9eef5 40% 100%);
}

.readiness-ring::before {
  grid-area: 1 / 1;
  width: 78px;
  height: 78px;
  content: "";
  border-radius: 50%;
  background: #fff;
}

.readiness-ring span {
  z-index: 1;
  grid-area: 1 / 1;
  font-size: 23px;
  font-weight: 800;
}

.readiness-ring small {
  font-size: 12px;
}

.check-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  color: #7e899b;
  font-size: 11px;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.45;
}

.check-list li span {
  color: #aab3c1;
}

.check-list .done {
  color: #4d5a6e;
}

.check-list .done span {
  color: var(--success);
}

.table-panel {
  margin-top: 18px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th {
  padding: 11px 12px;
  color: #939dad;
  font-size: 10px;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: #fafbfd;
}

.data-table td {
  padding: 15px 12px;
  color: #465267;
  font-size: 12px;
  border-bottom: 1px solid #f0f2f6;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr {
  transition: background 130ms ease;
}

.data-table tbody tr:hover {
  background: #fafcff;
}

.table-primary {
  display: grid;
  gap: 4px;
}

.table-primary strong {
  color: #273247;
  font-size: 12px;
}

.table-primary small {
  color: #98a2b2;
  font-size: 10px;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 28px;
  text-align: center;
}

.empty-state i {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #7facf0;
  font-size: 25px;
  font-style: normal;
  border-radius: 18px;
  background: #edf5ff;
}

.empty-state strong {
  margin-top: 14px;
  font-size: 14px;
}

.empty-state p {
  max-width: 380px;
  margin: 7px 0 16px;
  color: #8c97a8;
  font-size: 11px;
  line-height: 1.6;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  font-size: 10px;
  font-weight: 750;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-success { color: #14865f; background: var(--success-soft); }
.badge-warning { color: #a86d0f; background: var(--warning-soft); }
.badge-danger { color: #be3947; background: var(--danger-soft); }
.badge-neutral { color: #667287; background: #f0f3f7; }
.badge-blue { color: #126de5; background: var(--primary-soft); }

.badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.section-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 120px;
  margin-bottom: 18px;
  padding: 24px 28px;
  border: 1px solid #deebfb;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 93% 15%, rgba(22, 119, 255, 0.13), transparent 26%),
    linear-gradient(120deg, #ffffff, #f7fbff);
}

.section-hero h2 {
  font-size: 23px;
}

.section-hero p:not(.eyebrow) {
  max-width: 700px;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-chip {
  min-height: 32px;
  padding: 0 13px;
  color: #758095;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.filter-chip.is-active {
  color: #126ee8;
  border-color: #cbe1ff;
  background: #eff6ff;
}

.stack-form,
.batch-form {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
}

label > span,
.locked-field > span {
  color: #606c80;
  font-size: 11px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  color: #273246;
  outline: 0;
  border: 1px solid #dfe5ee;
  border-radius: 9px;
  background: #fff;
  transition: 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #80b5ff;
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

textarea {
  min-height: 180px;
  padding: 12px;
  line-height: 1.55;
  resize: vertical;
}

.locked-field {
  display: grid;
  gap: 7px;
  padding: 14px;
  border: 1px dashed #d9e0ea;
  border-radius: 11px;
  background: #fafbfd;
}

.locked-field strong {
  color: #526076;
  font-size: 12px;
}

.locked-field small {
  color: #949eae;
  font-size: 10px;
  line-height: 1.5;
}

.boundary-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  counter-reset: boundary;
  list-style: none;
}

.boundary-list li {
  position: relative;
  padding: 13px 14px 13px 48px;
  color: #59667a;
  font-size: 11px;
  line-height: 1.65;
  border: 1px solid #f0e5d3;
  border-radius: 11px;
  background: #fffaf1;
  counter-increment: boundary;
}

.boundary-list li::before {
  position: absolute;
  top: 13px;
  left: 14px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #b17410;
  font-size: 10px;
  font-weight: 800;
  content: counter(boundary, decimal-leading-zero);
  border-radius: 7px;
  background: #ffedca;
}

.docs-panel,
.architecture-panel {
  margin-top: 18px;
}

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

.doc-link {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px;
  color: #435067;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfcfe;
}

.doc-link:hover {
  border-color: #bfdaff;
  background: #f6faff;
}

.doc-link > span:first-child {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--primary);
  font-weight: 800;
  border-radius: 9px;
  background: var(--primary-soft);
}

.doc-link strong {
  font-size: 11px;
  line-height: 1.45;
}

.doc-link i {
  color: #a5afbe;
  font-style: normal;
}

.architecture-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 15px;
}

.architecture-flow > div {
  display: grid;
  gap: 6px;
  min-height: 100px;
  padding: 16px;
  border: 1px solid #e4e9f1;
  border-radius: 13px;
  background: #fafbfd;
}

.architecture-flow > div.locked {
  border-color: #f0d9dc;
  background: #fff7f8;
}

.architecture-flow span {
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
}

.architecture-flow strong {
  font-size: 13px;
}

.architecture-flow small {
  color: #8a95a7;
  font-size: 10px;
  line-height: 1.5;
}

.architecture-flow > i {
  color: #a5afbd;
  font-style: normal;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 27, 49, 0.54);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(860px, 100%);
  max-height: calc(100vh - 48px);
  padding: 26px;
  overflow: auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  animation: modal-in 180ms ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.98) translateY(8px); }
  to { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #7d889a;
  font-size: 23px;
  border: 0;
  border-radius: 10px;
  background: #f1f4f8;
  cursor: pointer;
}

.modal-heading {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-right: 46px;
  margin-bottom: 24px;
}

.modal-heading h2 {
  margin-top: 4px;
  font-size: 20px;
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  font-size: 20px;
  font-weight: 800;
  border-radius: 13px;
}

.modal-icon.blue { color: var(--primary); background: var(--primary-soft); }
.modal-icon.green { color: var(--success); background: var(--success-soft); }

.qr-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

.qr-frame {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(40, 58, 89, 0.08);
}

.qr-frame img {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-copy {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.qr-copy h3 {
  margin: 5px 0 0;
  font-size: 20px;
}

.qr-copy > p {
  margin: 0;
  color: #748096;
  font-size: 12px;
  line-height: 1.75;
}

.mini-steps {
  display: grid;
  gap: 8px;
  width: 100%;
}

.mini-steps span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #58667b;
  font-size: 11px;
}

.mini-steps b {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  color: var(--primary);
  font-size: 9px;
  border-radius: 7px;
  background: var(--primary-soft);
}

.modal-foot-note {
  margin-top: 22px;
  padding: 12px 14px;
  color: #8c97a8;
  font-size: 10px;
  line-height: 1.6;
  border-radius: 10px;
  background: #f7f8fa;
}

.form-grid.two-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.recipient-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 5px;
}

.recipient-head > div:first-child {
  display: grid;
  gap: 5px;
}

.recipient-head strong {
  font-size: 13px;
}

.recipient-head small {
  color: #929cad;
  font-size: 10px;
}

.recipient-head > div:last-child {
  display: flex;
  gap: 15px;
}

.recipient-rows {
  display: grid;
  gap: 9px;
  max-height: 290px;
  padding-right: 3px;
  overflow-y: auto;
}

.recipient-row {
  display: grid;
  grid-template-columns: 34px 1fr 1.2fr 0.65fr 32px;
  align-items: center;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e7ebf2;
  border-radius: 12px;
  background: #fafbfd;
}

.recipient-row > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #708096;
  font-size: 10px;
  font-weight: 800;
  border-radius: 8px;
  background: #edf1f6;
}

.recipient-row input {
  min-height: 38px;
  background: #fff;
}

.remove-recipient {
  width: 30px;
  height: 30px;
  color: #b46a74;
  border: 0;
  border-radius: 8px;
  background: #fff0f2;
  cursor: pointer;
}

.batch-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  color: #768398;
  font-size: 11px;
  border-radius: 11px;
  background: #f4f7fb;
}

.batch-total strong {
  color: #47556a;
}

.batch-total em {
  margin-left: 5px;
  color: var(--primary);
  font-size: 18px;
  font-style: normal;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.detail-card {
  width: min(760px, 100%);
}

.detail-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
  padding: 20px;
  color: #fff;
  border-radius: 17px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.2), transparent 25%),
    linear-gradient(135deg, #1677ff, #0a5fd8);
}

.detail-summary p {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.detail-summary h2 {
  font-size: 19px;
}

.detail-summary strong {
  font-size: 30px;
  letter-spacing: -0.04em;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.detail-meta div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fafbfd;
}

.detail-meta span {
  color: #8f99aa;
  font-size: 9px;
}

.detail-meta strong {
  color: #475368;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-orders {
  display: grid;
  gap: 8px;
}

.detail-order {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 11px;
  border: 1px solid #edf0f4;
  border-radius: 11px;
}

.avatar-placeholder {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #7c93b5;
  font-size: 12px;
  font-weight: 800;
  border-radius: 10px;
  background: #eaf1fa;
}

.detail-order div:nth-child(2) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.detail-order strong {
  font-size: 12px;
}

.detail-order small {
  color: #9aa4b3;
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-amount {
  font-size: 13px;
  font-weight: 750;
}

.detail-pay-area {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #dceafa;
  border-radius: 15px;
  background: #f7fbff;
}

.detail-pay-area .qr-frame {
  padding: 8px;
  border-radius: 12px;
}

.detail-pay-copy {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.detail-pay-copy h3,
.detail-pay-copy p {
  margin: 0;
}

.detail-pay-copy h3 {
  font-size: 15px;
}

.detail-pay-copy p {
  color: #768398;
  font-size: 10px;
  line-height: 1.6;
}

.detail-success {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-top: 18px;
  padding: 15px;
  color: #26755b;
  border: 1px solid #ccebdd;
  border-radius: 13px;
  background: #effbf6;
}

.detail-success > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  font-weight: 800;
  border-radius: 50%;
  background: var(--success);
}

.detail-success div {
  display: grid;
  gap: 3px;
}

.detail-success strong {
  font-size: 12px;
}

.detail-success small {
  font-size: 10px;
}

.toast-region {
  position: fixed;
  z-index: 300;
  top: 20px;
  right: 20px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
}

.toast {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid #dfe5ed;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 16px 45px rgba(21, 37, 63, 0.18);
  animation: toast-in 180ms ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}

.toast > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff;
  font-weight: 800;
  border-radius: 8px;
  background: var(--success);
}

.toast.error > span {
  background: var(--danger);
}

.toast strong,
.toast p {
  margin: 0;
}

.toast strong {
  font-size: 11px;
}

.toast p {
  margin-top: 3px;
  color: #7b8799;
  font-size: 10px;
  line-height: 1.5;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-content: center;
  justify-items: center;
  color: #fff;
  background: rgba(14, 27, 48, 0.46);
  backdrop-filter: blur(2px);
}

.loading-overlay span {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.loading-overlay p {
  margin: 11px 0 0;
  font-size: 11px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Mobile authorization and payment simulation */
.flow-app {
  min-height: 100vh;
  background: #f4f5f7;
}

.phone-flow {
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  color: #222;
  background: #f5f5f5;
  box-shadow: 0 0 50px rgba(25, 38, 59, 0.12);
}

.phone-status {
  display: flex;
  justify-content: space-between;
  height: 42px;
  padding: 14px 25px 0;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
}

.phone-status span:last-child {
  letter-spacing: 0.08em;
}

.phone-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
  padding: 0 82px;
  background: #fff;
}

.phone-nav strong {
  font-size: 18px;
}

.phone-nav button,
.phone-nav a {
  position: absolute;
  left: 18px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #242424;
  font-size: 28px;
  border: 0;
  background: transparent;
}

.phone-nav .nav-right {
  right: 18px;
  left: auto;
  width: auto;
  color: #333;
  font-size: 13px;
}

.auth-brand-band {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  height: 136px;
  color: #fff;
  background: linear-gradient(135deg, #148ce8, #087ad4);
}

.provider-logo,
.alipay-logo {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff;
  font-size: 27px;
  font-weight: 800;
  border: 3px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  background: linear-gradient(145deg, #ff9d22, #24b879 52%, #2489f0 53%);
}

.alipay-logo {
  background: #1587e9;
}

.brand-link-symbol {
  font-size: 32px;
  font-weight: 300;
  opacity: 0.7;
}

.auth-consent {
  padding: 20px 18px 14px;
  background: #fff;
}

.auth-consent p {
  margin: 0;
  color: #717171;
  font-size: 13px;
  line-height: 1.7;
}

.auth-consent p strong {
  color: #222;
}

.auth-consent small {
  display: block;
  margin-top: 4px;
  color: #a0a0a0;
  font-size: 12px;
}

.permission-row {
  padding: 20px 18px;
  color: #555;
  font-size: 13px;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.permission-row::before {
  margin-right: 6px;
  color: #9a9a9a;
  content: "•";
}

.phone-form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.phone-form label > span {
  color: #777;
  font-size: 12px;
}

.phone-form input {
  min-height: 48px;
  border-color: #eee;
  border-radius: 8px;
}

.phone-agreement {
  padding: 0 18px 14px;
  color: #999;
  font-size: 11px;
}

.phone-primary-button {
  width: calc(100% - 36px);
  min-height: 50px;
  margin: 0 18px;
  color: #fff;
  font-size: 16px;
  border: 0;
  border-radius: 4px;
  background: #168eea;
}

.phone-link-button {
  display: block;
  width: 100%;
  padding: 17px;
  color: #168eea;
  font-size: 13px;
  text-align: center;
  border: 0;
  background: transparent;
}

.flow-demo-warning {
  margin: 16px 18px;
  padding: 10px 12px;
  color: #906318;
  font-size: 10px;
  line-height: 1.55;
  border: 1px solid #f1d39c;
  border-radius: 8px;
  background: #fff9eb;
}

.service-open-body {
  padding: 14px 16px 30px;
}

.service-card {
  padding: 24px 17px 17px;
  border-radius: 14px;
  background: #fff;
}

.document-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 17px;
  color: #1d7df0;
  font-size: 32px;
  border-radius: 13px;
  background: #edf4ff;
}

.service-card h1 {
  font-size: 19px;
  line-height: 1.5;
  text-align: center;
}

.service-company {
  margin: 8px 0 26px;
  color: #aaa;
  font-size: 13px;
  text-align: center;
}

.service-detail-grid {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  gap: 15px;
  font-size: 13px;
  line-height: 1.65;
}

.service-detail-grid span {
  color: #999;
}

.service-detail-grid strong {
  font-weight: 400;
}

.service-account-row,
.service-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 54px;
  gap: 14px;
  margin-top: 18px;
  padding-top: 15px;
  font-size: 14px;
  border-top: 1px solid #eee;
}

.service-account-row span,
.service-option-row em {
  color: #999;
  font-style: normal;
}

.service-options {
  margin-top: 12px;
  padding: 0 15px;
  border-radius: 13px;
  background: #fff;
}

.service-option-row {
  margin: 0;
  padding: 0;
}

.service-option-row + .service-option-row {
  border-top: 1px solid #eee;
}

.agreement-line {
  margin: 24px 2px 20px;
  font-size: 12px;
}

.agreement-line a {
  color: #087fd9;
}

.round-primary-button {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 52px;
  color: #fff;
  font-size: 16px;
  border: 0;
  border-radius: 999px;
  background: #1677ff;
  text-align: center;
}

.open-success {
  padding: 28px 16px;
}

.success-card {
  padding: 44px 18px 38px;
  text-align: center;
  border-radius: 15px;
  background: #fff;
}

.success-check {
  display: grid;
  place-items: center;
  width: 65px;
  height: 65px;
  margin: 0 auto 24px;
  color: #fff;
  font-size: 34px;
  border-radius: 50%;
  background: #1677ff;
}

.success-card h1 {
  font-size: 23px;
}

.success-card p {
  margin: 14px 0 0;
  color: #707070;
  font-size: 14px;
  line-height: 1.65;
}

.success-actions {
  display: grid;
  gap: 14px;
  margin-top: 34px;
}

.success-actions .round-primary-button,
.success-actions .round-secondary-button {
  min-height: 52px;
}

.round-secondary-button {
  display: grid;
  place-items: center;
  width: 100%;
  color: #333;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 999px;
  background: #fff;
  text-align: center;
}

.pay-flow {
  background: #f3f4f6;
}

.merchant-platform {
  min-height: calc(100vh - 100px);
  padding-bottom: 28px;
  background: #f5f7fa;
}

.merchant-brand-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  color: #556276;
  border-bottom: 1px solid #e8edf4;
  background: #fff;
}

.merchant-brand-row strong {
  color: #1b2a43;
  white-space: nowrap;
}

.merchant-brand-row strong span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 5px;
  color: #fff;
  border-radius: 6px;
  background: #1677ff;
}

.merchant-brand-row em,
.merchant-brand-row small,
.merchant-brand-row b {
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
}

.merchant-brand-row b {
  padding-bottom: 7px;
  color: #1677ff;
  border-bottom: 3px solid #1677ff;
}

.gateway-order-card {
  margin: 18px;
  padding: 22px;
  border: 1px solid #e8edf4;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 35px rgba(25, 48, 79, 0.06);
}

.gateway-order-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eef1f5;
}

.gateway-order-title span {
  font-size: 17px;
  font-weight: 750;
}

.gateway-order-title small {
  padding: 4px 8px;
  color: #a06900;
  border-radius: 999px;
  background: #fff3cf;
}

.gateway-data {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px 16px;
  width: min(100%, 390px);
  margin: 0 auto;
}

.gateway-data dt,
.gateway-data dd {
  margin: 0;
  font-size: 14px;
}

.gateway-data dt {
  color: #7d8899;
  text-align: right;
}

.gateway-data dd {
  min-width: 0;
  color: #303b4e;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gateway-data .gateway-ok {
  color: #17834c;
  font-weight: 700;
}

.gateway-pay-button {
  display: block;
  min-width: 150px;
  min-height: 46px;
  margin: 46px auto 22px;
  padding: 0 26px;
  color: #fff;
  font-size: 16px;
  border: 0;
  border-radius: 5px;
  background: #1677ff;
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.22);
}

.gateway-warning {
  margin: 0;
  color: #8a6470;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.pay-summary {
  padding: 36px 20px 32px;
  text-align: center;
  background: #fff;
}

.pay-summary p {
  margin: 0 0 12px;
  color: #999;
  font-size: 15px;
}

.pay-summary strong {
  font-size: clamp(44px, 12vw, 62px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.pay-remark {
  margin-top: 12px;
  padding: 17px 20px;
  font-size: 14px;
  background: #fff;
}

.pay-order-list {
  margin-top: 1px;
  background: #fff;
}

.pay-order-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 12px 20px;
  border-top: 1px solid #eee;
}

.pay-order-row .avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 4px;
}

.pay-order-row div:nth-child(2) {
  display: grid;
  gap: 5px;
}

.pay-order-row small {
  color: #aaa;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-order-row > strong {
  font-size: 17px;
}

.pay-sticky-action {
  position: sticky;
  bottom: 0;
  margin-top: max(180px, 25vh);
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  background: #fff;
}

.pay-sticky-action button {
  width: 100%;
  min-height: 52px;
  color: #fff;
  font-size: 17px;
  border: 0;
  border-radius: 3px;
  background: #168eea;
}

.payment-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(0, 0, 0, 0.48);
}

.payment-sheet {
  position: fixed;
  z-index: 11;
  right: 0;
  bottom: 0;
  left: 0;
  max-width: 560px;
  max-height: calc(100vh - 12px);
  min-height: 65vh;
  margin: 0 auto;
  padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: #f4f7fb;
  overflow-y: auto;
  animation: sheet-in 220ms ease;
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
  to { transform: none; }
}

.sheet-close {
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 28px;
  border: 0;
  background: transparent;
}

.sheet-title {
  margin: 20px 0 4px;
  font-size: 16px;
  text-align: center;
}

.sheet-amount {
  margin: 0 0 34px;
  font-size: 42px;
  font-weight: 700;
  text-align: center;
}

.payment-method-card {
  margin-bottom: 12px;
  padding: 18px;
  border-radius: 14px;
  background: #fff;
}

.payment-method-card > span {
  color: #888;
  font-size: 12px;
}

.payment-method {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 17px;
}

.payment-method i {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  font-style: normal;
  border-radius: 50%;
  background: #72aef7;
}

.payment-method div {
  display: grid;
  gap: 4px;
}

.payment-method small {
  color: #999;
}

.payment-method b {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  color: #fff;
  font-size: 11px;
  border-radius: 50%;
  background: var(--primary);
}

.payment-method.disabled {
  opacity: 0.38;
}

.mock-confirm-check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: flex-start;
  gap: 9px;
  margin: 18px 4px;
  color: #7a8597;
  font-size: 11px;
  line-height: 1.5;
}

.mock-confirm-check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.sheet-pay-button {
  width: calc(100% - 80px);
  min-height: 52px;
  margin: 24px 40px 0;
  color: #fff;
  font-size: 17px;
  border: 0;
  border-radius: 999px;
  background: #1677ff;
}

.sheet-pay-button:disabled {
  background: #9dc4fa;
}

.bill-success {
  padding: 20px 16px 40px;
}

.bill-card {
  padding: 28px 20px;
  text-align: center;
  border-radius: 15px;
  background: #fff;
}

.bill-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  color: #fff;
  font-size: 23px;
  border-radius: 50%;
  background: #4bb2e7;
}

.bill-card p {
  margin: 0;
  font-size: 14px;
}

.bill-card h1 {
  margin: 10px 0 4px;
  font-size: 38px;
  font-weight: 500;
}

.bill-card > strong {
  font-size: 14px;
  font-weight: 500;
}

.bill-details {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 12px;
  margin-top: 26px;
  padding-top: 20px;
  font-size: 12px;
  text-align: left;
  border-top: 1px solid #eee;
}

.bill-details span {
  color: #999;
}

.bill-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.flow-error {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 30px;
  text-align: center;
  background: #fff;
}

.flow-error span {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  color: #fff;
  font-size: 30px;
  border-radius: 50%;
  background: var(--danger);
}

.flow-error h1 {
  margin-top: 20px;
}

.flow-error p {
  max-width: 360px;
  color: #7e8999;
  line-height: 1.7;
}

/* Printable Demo receipt */
.receipt-page {
  min-height: 100vh;
  padding: 36px 18px;
  background: #edf1f6;
}

.receipt-paper {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 42px;
  border: 1px solid #dce2ea;
  background: #fff;
  box-shadow: 0 16px 50px rgba(25, 42, 69, 0.12);
}

.receipt-demo-mark {
  margin: -16px 0 28px;
  padding: 10px;
  color: #b64250;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  border: 1px solid #efc3c8;
  background: #fff4f5;
}

.receipt-paper header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 24px;
  border-bottom: 2px solid #172033;
}

.receipt-paper header h1,
.receipt-paper header p {
  margin: 0;
}

.receipt-paper header h1 {
  font-size: 23px;
}

.receipt-paper header p {
  margin-top: 4px;
  color: #8b96a7;
  font-size: 11px;
}

.receipt-amount {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 35px 0;
  border-bottom: 1px solid #e4e8ee;
}

.receipt-amount span {
  color: #8d98a8;
  font-size: 12px;
}

.receipt-amount strong {
  font-size: 38px;
}

.receipt-amount em {
  color: var(--success);
  font-size: 11px;
  font-style: normal;
}

.receipt-grid {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 0;
  margin: 28px 0;
  font-size: 12px;
}

.receipt-grid dt,
.receipt-grid dd {
  min-height: 46px;
  margin: 0;
  padding: 14px;
  border-bottom: 1px solid #e7ebf0;
}

.receipt-grid dt {
  color: #788499;
  background: #f7f9fb;
}

.receipt-grid dd {
  color: #344056;
  word-break: break-all;
}

.receipt-paper footer {
  padding: 14px;
  color: #a03e49;
  font-size: 10px;
  line-height: 1.7;
  border: 1px dashed #e8b8bd;
  background: #fff8f8;
}

.live-auth-panel {
  margin-bottom: 18px;
  border: 1px solid #cfe1ff;
  background: linear-gradient(145deg, #fff 0%, #f5f9ff 100%);
}

.credential-panel {
  margin-bottom: 18px;
  border-color: #dbe7f5;
  background: linear-gradient(145deg, #fff 0%, #f8fbff 100%);
}

.credential-form {
  display: grid;
  gap: 18px;
}

.credential-top-grid,
.credential-key-grid {
  display: grid;
  gap: 16px;
}

.credential-top-grid { grid-template-columns: 1fr; }
.credential-key-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.credential-form label > small {
  color: #8c97a8;
  font-size: 10px;
  line-height: 1.55;
}

.credential-key-grid textarea {
  color: #26364f;
  font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  word-break: break-all;
  background: #fff;
}

.credential-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checkbox-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #e3e8f0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.82);
  cursor: pointer;
}

.checkbox-row input {
  width: 17px;
  min-height: 17px;
  margin: 2px 0 0;
}

.checkbox-row span,
.checkbox-row strong,
.checkbox-row small {
  display: block;
}

.checkbox-row strong {
  color: #47546a;
  font-size: 11px;
}

.checkbox-row small {
  margin-top: 5px;
  color: #8e98a8;
  font-size: 10px;
  line-height: 1.55;
}

.checkbox-row.is-disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.credential-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.callback-config {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #cfe0f5;
  border-radius: 12px;
  background: #f5f9ff;
}

.callback-config > span {
  color: #243550;
  font-size: 12px;
  font-weight: 700;
}

.callback-config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.callback-config-row input {
  color: #245f9f;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  background: #fff;
}

.callback-config small {
  color: #6f7f94;
  font-size: 10px;
  line-height: 1.6;
}

.credential-result {
  padding: 14px 16px;
  color: #176d4a;
  font-size: 12px;
  line-height: 1.7;
  border: 1px solid #bce7d2;
  border-radius: 12px;
  background: #f1fff8;
}

.credential-result.error {
  color: #9c3542;
  border-color: #f0c5cb;
  background: #fff5f6;
}

.credential-result strong,
.credential-result span {
  display: block;
}

.credential-security-note {
  margin: 0;
  padding: 11px 13px;
  color: #80626a;
  font-size: 10px;
  line-height: 1.65;
  border-left: 3px solid #e9b0b8;
  background: rgba(255, 255, 255, 0.72);
}

.connection-checks {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.connection-check {
  min-height: 92px;
  padding: 14px;
  border: 1px solid #e2e9f3;
  border-radius: 12px;
  background: #fff;
}

.connection-check span,
.connection-check small {
  display: block;
  color: #8894a5;
  font-size: 11px;
}

.connection-check strong {
  display: block;
  margin: 8px 0 5px;
  color: #26364f;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.connection-check.ok strong { color: var(--success); }
.connection-check.locked strong { color: #b64250; }
.connection-check.callback-check { grid-column: 1 / -1; }

.real-auth-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.real-auth-actions small {
  max-width: 520px;
  color: #7f8b9c;
  line-height: 1.6;
}

.auth-test-result {
  margin-top: 20px;
  padding: 14px 16px;
  color: #66758b;
  font-size: 12px;
  line-height: 1.7;
  border: 1px solid #e1e8f2;
  border-radius: 12px;
  background: #f8faff;
}

.auth-test-result.success {
  color: #176d4a;
  border-color: #bce7d2;
  background: #f1fff8;
}

.auth-test-result.error {
  color: #9c3542;
  border-color: #f0c5cb;
  background: #fff5f6;
}

.auth-method-list {
  max-height: 180px;
  margin: 10px 0 0;
  padding: 10px 12px 10px 30px;
  overflow: auto;
  color: #43536b;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.auth-method-list li { margin: 4px 0; overflow-wrap: anywhere; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-grid { grid-template-columns: 1fr; }
  .flow-steps { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
  .docs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connection-checks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -260px;
    width: 244px;
    transition: left 180ms ease;
  }
  .sidebar.is-open { left: 0; box-shadow: 20px 0 50px rgba(11, 27, 51, 0.28); }
  .workspace { padding: 0 18px 45px; }
  .mobile-only { display: inline-grid; }
  .topbar { min-height: 88px; }
  .topbar .eyebrow, .health-chip { display: none; }
  .topbar h1 { font-size: 22px; margin: 0; }
  .topbar-actions .button { display: none; }
  .integration-grid { grid-template-columns: 1fr; }
  .credential-top-grid,
  .credential-key-grid,
  .credential-options { grid-template-columns: 1fr; }
  .architecture-flow { grid-template-columns: 1fr; }
  .architecture-flow > i { transform: rotate(90deg); text-align: center; }
  .qr-layout { grid-template-columns: 1fr; justify-items: center; }
  .qr-copy { justify-items: center; text-align: center; }
  .qr-frame { width: min(300px, 100%); }
}

@media (max-width: 620px) {
  .workspace { padding: 0 12px 35px; }
  .topbar { gap: 10px; }
  .safety-banner { align-items: flex-start; padding: 12px; }
  .safety-banner div { display: grid; gap: 2px; }
  .safety-banner a { display: none; }
  .metric-grid { gap: 10px; }
  .metric-card { min-height: 126px; padding: 16px; }
  .metric-card > strong { font-size: 23px; }
  .metric-card > small { font-size: 9px; }
  .panel { padding: 17px; border-radius: 15px; }
  .flow-steps { grid-template-columns: 1fr; overflow: visible; }
  .flow-step { min-height: 80px; }
  .readiness-panel { grid-template-columns: 90px minmax(0, 1fr); }
  .readiness-ring { width: 86px; height: 86px; }
  .readiness-ring::before { width: 64px; height: 64px; }
  .section-hero { align-items: flex-start; padding: 20px; }
  .section-hero .button { padding: 0 12px; white-space: nowrap; }
  .docs-grid { grid-template-columns: 1fr; }
  .modal { align-items: end; padding: 0; }
  .modal-card { max-height: 92vh; padding: 20px; border-radius: 22px 22px 0 0; }
  .auth-code-card .qr-frame { width: 220px; }
  .form-grid.two-cols { grid-template-columns: 1fr; }
  .recipient-head { align-items: flex-start; }
  .recipient-head > div:last-child { display: grid; justify-items: end; gap: 4px; }
  .recipient-row { grid-template-columns: 28px 1fr 30px; }
  .recipient-row input:nth-of-type(1),
  .recipient-row input:nth-of-type(2),
  .recipient-row input:nth-of-type(3) { grid-column: 2; }
  .recipient-row > span { grid-row: 1 / 4; }
  .remove-recipient { grid-column: 3; grid-row: 1 / 4; }
  .detail-summary { grid-template-columns: 1fr; }
  .detail-summary strong { font-size: 27px; }
  .detail-meta { grid-template-columns: 1fr; }
  .detail-pay-area { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .detail-pay-copy { justify-items: center; }
  .detail-order { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .detail-order .badge { display: none; }
  .receipt-paper { padding: 22px; }
  .receipt-grid { grid-template-columns: 95px 1fr; }
  .connection-checks { grid-template-columns: 1fr; }
  .real-auth-actions { align-items: stretch; flex-direction: column; }
  .credential-actions { align-items: stretch; flex-direction: column; }
  .callback-config-row { grid-template-columns: 1fr; }
  .merchant-brand-row { grid-template-columns: auto 1fr auto; gap: 8px; padding: 14px; }
  .merchant-brand-row small { display: none; }
  .gateway-order-card { margin: 12px; padding: 18px 14px; }
  .gateway-data { grid-template-columns: 105px minmax(0, 1fr); gap: 16px 12px; }
}

@media print {
  .receipt-page { padding: 0; background: #fff; }
  .receipt-paper { width: 100%; padding: 24px; border: 0; box-shadow: none; }
}
