:root {
  font-family: Aptos, 'Segoe UI', system-ui, sans-serif;
  color: #192d3b;
  background: #edf4f8;
  color-scheme: light;
  --marine: #14344a;
  --ink: #192d3b;
  --muted: #536a78;
  --line: #cbdbe3;
  --teal: #086c62;
  --focus: #087e9a;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 0; margin: 0; line-height: 1.45; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.shell { width: min(100% - 28px, 1060px); margin-inline: auto; }
.masthead { background: var(--marine); color: #fff; border-bottom: 4px solid #78c5b6; }
.masthead-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-block: 18px 15px; }
.identity { display: flex; align-items: center; gap: 11px; }
.identity-mark { flex: 0 0 auto; }
.identity h1 { font-size: clamp(1.55rem, 4vw, 2.25rem); font-weight: 730; line-height: 1.1; letter-spacing: -.045em; }
.identity p { margin-top: 4px; color: #d1e1e9; font-size: .88rem; }
.connection { display: inline-flex; align-items: center; gap: 7px; color: #e0edf2; font-size: .82rem; font-weight: 650; }
.connection::before { width: 8px; height: 8px; background: #e9c98e; border-radius: 50%; content: ''; }
.connection[data-state='online']::before { background: #9ce0cd; }
.connection[data-state='offline']::before { background: #f6a99b; }

.layout { display: grid; gap: 27px; padding-block: 20px 40px; }
.access-note { grid-column: 1 / -1; padding: 12px 14px; border: 1px solid #dbc698; border-radius: 9px; color: #603e18; background: #fff4d9; overflow-wrap: anywhere; }
.setup { padding: 17px 15px; border: 1px solid var(--line); border-top: 3px solid #377586; border-radius: 12px; background: white; }
.access-panel { grid-column: 1 / -1; width: min(100%, 560px); }
.access-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.access-controls input { min-width: 0; width: 100%; padding: 8px 10px; border: 1px solid #9ab1be; border-radius: 8px; background: #f9fcfd; color: var(--ink); }
.access-panel .help { margin-bottom: 0; }
h2 { color: var(--marine); font-size: 1.24rem; font-weight: 730; line-height: 1.2; letter-spacing: -.025em; }
.setup h2 { margin-bottom: 18px; }
fieldset { min-width: 0; margin: 0 0 17px; padding: 0; border: 0; }
legend, .field-label { display: block; margin-bottom: 7px; padding: 0; font-size: .89rem; font-weight: 690; }
.providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(91px, 100%), 1fr)); gap: 6px; }
.providers:has(.provider-option:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.providers > p { grid-column: 1 / -1; }
.provider-option { position: relative; display: grid; align-content: center; gap: 2px; min-height: 57px; padding: 7px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.provider-option:has(:checked) { border-color: var(--teal); background: #e6f5f0; box-shadow: inset 0 0 0 1px var(--teal); }
.provider-option:has(:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.provider-option:has(:disabled) { cursor: default; }
.provider-option[data-available='false'] { color: var(--muted); background: #f3f7f9; }
.provider-option input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.provider-name { font-size: .88rem; font-weight: 700; overflow-wrap: anywhere; }
.provider-note { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.provider-setup { margin-top: 7px; overflow-wrap: anywhere; }
.account-field { margin-bottom: 17px; }

select, textarea { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; border: 1px solid #9ab1be; border-radius: 8px; color: var(--ink); background: #f9fcfd; font-size: 1rem; }
textarea { min-height: 62px; resize: vertical; }
textarea::placeholder { color: #5e7482; }
select:disabled, textarea:disabled { background: #edf4f8; }
.help, .muted { color: var(--muted); font-size: .82rem; }
.help { margin-block: 6px 14px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 13px; border: 1px solid transparent; border-radius: 8px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer; }
.primary { width: 100%; border-color: var(--teal); color: #fff; background: var(--teal); }
.primary:hover { background: #075b53; }
.button:disabled { border-color: #c8d6dd; color: #526771; background: #e5edf1; cursor: default; }
.feedback { margin-top: 7px; color: #a12e32; font-size: .86rem; overflow-wrap: anywhere; }
.feedback[data-tone='success'] { color: #116253; }

.requests { min-width: 0; }
.requests-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.request-count { min-width: 24px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 10px; color: var(--marine); background: #e5eff4; font-size: .78rem; font-variant-numeric: tabular-nums; text-align: center; }
.empty { padding: 19px 16px; border: 1px dashed #aebfc8; border-radius: 10px; color: var(--muted); background: #f5f9fb; font-size: .91rem; }
.request-list { display: grid; gap: 11px; margin: 0; padding: 0; list-style: none; }
.request { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.request-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: 7px 12px; }
.request-head > div { min-width: 0; }
.request-provider { color: var(--muted); font-size: .82rem; font-weight: 680; overflow-wrap: anywhere; }
.request-amount { margin-top: 2px; color: var(--marine); font-size: 1.67rem; font-weight: 760; font-variant-numeric: tabular-nums; line-height: 1.12; letter-spacing: -.03em; overflow-wrap: anywhere; }
.status-pill { max-width: 100%; padding: 4px 8px; border-radius: 6px; color: #375263; background: #e7f0f4; font-size: .76rem; font-weight: 700; overflow-wrap: anywhere; }
.status-pill[data-tone='good'] { color: #075749; background: #dff3ec; }
.status-pill[data-tone='warn'] { color: #71480c; background: #fff0d1; }
.status-pill[data-tone='bad'] { color: #852f31; background: #fbe7e5; }
.request-status { margin-top: 7px; color: var(--muted); font-size: .86rem; overflow-wrap: anywhere; }
.request-status:empty { display: none; }

.checkout { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #9bb3bd; }
.checkout-main { display: grid; align-items: center; gap: 12px; }
.qr-slot { display: grid; align-items: center; justify-items: center; min-height: 96px; padding: 7px; border: 1px solid var(--line); border-radius: 10px; }
.qr { display: block; width: min(100%, 176px); height: auto; aspect-ratio: 1; object-fit: contain; }
.qr-loading { color: var(--muted); font-size: .83rem; text-align: center; }
.checkout-instructions { display: grid; gap: 7px; min-width: 0; }
.countdown { color: var(--marine); font-size: .88rem; font-variant-numeric: tabular-nums; font-weight: 690; }
.payee, .scan-instruction { color: var(--muted); font-size: .81rem; overflow-wrap: anywhere; }
.payee { white-space: pre-line; }
.scan-instruction { text-align: center; }
.request-controls { margin-top: 9px; }
.request-controls:has(.stop[hidden]):has(.stop-error[hidden]) { display: none; }
.quiet { padding-inline: 9px; color: #395566; background: transparent; font-size: .83rem; }
.quiet:hover { background: #edf4f8; }

@media (min-width: 420px) {
  .checkout-main { grid-template-columns: minmax(105px, 182px) minmax(0, 1fr); }
  .checkout-instructions { grid-area: 1 / 2; }
  .qr-slot { grid-area: 1 / 1; min-height: 130px; }
  .masthead-inner { justify-content: space-between; }
  .setup, .request { padding-inline: 19px; }
}

@media (min-width: 760px) {
  .shell { width: min(100% - 44px, 1060px); }
  .masthead-inner { padding-block: 24px; }
  .layout { grid-template-columns: minmax(310px, 370px) minmax(0, 1fr); align-items: start; gap: 25px 27px; padding-top: 29px; }
  .setup { padding-block: 21px; }
  .request { padding: 17px 20px; }
}
