:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --text-1: #17202f;
  --text-2: #5f6b7a;
  --text-3: #8a95a5;
  --line: #dfe5ee;
  --primary: #146c94;
  --primary-strong: #0e4f72;
  --ok: #16785f;
  --warning: #9a6514;
  --error: #b42318;
  --shadow: 0 18px 50px rgba(23, 32, 47, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(20, 108, 148, .08), transparent 280px),
    var(--bg);
  color: var(--text-1);
}
button, input {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
}
button:disabled {
  cursor: wait;
  opacity: .58;
}
.shell {
  width: min(1040px, calc(100vw - 36px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.brand-panel,
.work-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.brand-panel {
  position: sticky;
  top: 24px;
  min-height: 420px;
  padding: 28px;
  border-radius: 14px;
  display: grid;
  align-content: space-between;
}
.work-panel {
  min-height: 520px;
  padding: 26px;
  border-radius: 14px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(145deg, #146c94, #20a39e);
  display: grid;
  place-items: center;
}
.brand-mark span {
  width: 25px;
  height: 25px;
  border: 3px solid rgba(255, 255, 255, .9);
  border-left-color: transparent;
  border-radius: 50%;
}
h1, h2, h3, p {
  margin: 0;
}
h1 {
  font-size: 28px;
  line-height: 1.1;
}
.brand-lockup p,
.panel-head p,
.action-band p,
.app-note {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
}
.balance-hero {
  display: grid;
  gap: 9px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.balance-hero span,
label span {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 780;
}
.balance-hero strong {
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0;
}
.balance-hero em {
  color: var(--text-2);
  font-size: 12px;
  font-style: normal;
}
.toast {
  min-height: 20px;
  margin-bottom: 14px;
  color: var(--text-2);
  font-size: 13px;
}
.toast.error { color: var(--error); }
.toast.ok { color: var(--ok); }
.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 22px;
}
.panel-head h2 {
  font-size: 22px;
  line-height: 1.2;
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.seg {
  height: 30px;
  min-width: 76px;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 760;
}
.seg.on {
  background: var(--surface);
  color: var(--text-1);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
label {
  display: grid;
  gap: 7px;
}
input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-1);
  outline: none;
}
input:focus {
  border-color: rgba(20, 108, 148, .7);
  box-shadow: 0 0 0 3px rgba(20, 108, 148, .12);
}
.full { grid-column: 1 / -1; }
.hidden { display: none !important; }
.code-row,
.redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.primary,
.secondary,
.ghost {
  height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}
.primary {
  background: var(--primary);
  color: white;
}
.primary:hover { background: var(--primary-strong); }
.secondary {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-1);
}
.ghost {
  background: transparent;
  color: var(--text-2);
}
.ghost:hover,
.secondary:hover {
  background: var(--surface-2);
  color: var(--text-1);
}
.small {
  height: 30px;
  padding: 0 9px;
  font-size: 12px;
}
.actions {
  display: grid;
  gap: 14px;
}
.action-band,
.records {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.action-band {
  display: grid;
  gap: 14px;
}
.action-band h3,
.records h3 {
  font-size: 15px;
}
.stripe-buttons {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.stripe-tools {
  display: grid;
  gap: 8px;
  justify-items: start;
}
.stripe-form {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  gap: 10px;
  align-items: end;
  width: 100%;
}
.stripe-buttons .secondary {
  height: 30px;
  min-width: 56px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 760;
}
.records {
  margin-top: 14px;
}
.records-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.orders {
  display: grid;
  gap: 8px;
}
.order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.order:first-child { border-top: 0; }
.order strong {
  display: block;
  font-size: 13px;
}
.order span,
.order time {
  color: var(--text-3);
  font-size: 11px;
}
.badge {
  align-self: start;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 780;
}
.badge.success { color: var(--ok); }
.badge.pending { color: var(--warning); }
.app-note {
  margin-top: 16px;
}
.inline-note {
  margin-top: 0;
}

@media (max-width: 820px) {
  .shell {
    width: min(100vw - 24px, 560px);
    padding: 18px 0;
    grid-template-columns: 1fr;
  }
  .brand-panel {
    position: static;
    min-height: 0;
    gap: 24px;
  }
  .work-panel { padding: 20px; }
  .form-grid,
  .code-row,
  .redeem-row,
  .stripe-form {
    grid-template-columns: 1fr;
  }
  .stripe-tools {
    justify-items: stretch;
  }
  .panel-head {
    align-items: stretch;
    flex-direction: column;
  }
}
