:root {
  --font: -apple-system, "Inter", system-ui, sans-serif;
  --bg: #fcfbf9;
  --surface: #ffffff;
  --text: #292826;
  --muted: #6b6863;
  --border: #ddd9d3;
  --primary-bg: #292826;
  --primary-text: #f8f7f5;
  --secondary-bg: #e8e5e0;
  --brass: #8a5a0b;
  --danger: #a4321f;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1b1a;
    --surface: #262523;
    --text: #f0eeea;
    --muted: #a8a49d;
    --border: #3a3835;
    --primary-bg: #f0eeea;
    --primary-text: #1c1b1a;
    --secondary-bg: #3a3835;
    --brass: #d9a54a;
    --danger: #f08a75;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.top {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 20px 0;
}
.brand { font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 20px 48px;
}

h1 { font-size: 28px; line-height: 1.2; font-weight: 650; margin: 8px 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 600; margin: 0 0 12px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.stack > * + * { margin-top: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.section { margin-top: 24px; }

button, .button {
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  min-height: 48px;
  min-width: 44px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { opacity: 0.45; cursor: default; }
.primary { background: var(--primary-bg); color: var(--primary-text); width: 100%; }
.secondary { background: var(--secondary-bg); color: var(--text); }
.text-button {
  background: none;
  color: var(--muted);
  font-weight: 500;
  padding: 10px 12px;
  min-height: 44px;
}
.danger-text { color: var(--danger); }
button:focus-visible, input:focus-visible, .choice:focus-within {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}

.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

label.field { display: block; margin-top: 16px; }
label.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
input[type="text"], input[type="tel"], input[type="password"] {
  font: inherit;
  font-size: 16px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  -webkit-appearance: none;
  appearance: none;
}
.field-row { display: flex; gap: 12px; }
.field-row > * { flex: 1; min-width: 0; }

.private {
  border-left: 2px solid var(--brass);
  padding-left: 14px;
  margin-top: 20px;
}
.private-note { font-size: 13px; color: var(--brass); margin: 6px 0 0; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.list > li:first-child { border-top: 0; }
.list .primary-line { font-weight: 600; }
.list .secondary-line { font-size: 14px; color: var(--muted); }

.notice {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
}
.notice.error { border-color: var(--danger); color: var(--danger); }

/* Approve page */
/* Never truncate or ellipsize the store hostname: it wraps anywhere instead. */
.store { font-size: 34px; line-height: 1.15; margin: 8px 0 4px; overflow-wrap: anywhere; white-space: normal; overflow: visible; text-overflow: clip; letter-spacing: -0.02em; }
.store-sub { font-weight: 400; color: var(--muted); }
.store-domain { font-weight: 700; }
.store-name { color: var(--muted); margin: 0 0 16px; }
.amount { font-size: 28px; font-weight: 600; margin: 0 0 4px; font-variant-numeric: tabular-nums; }
.description { color: var(--muted); margin: 0 0 8px; }
.group { border: 0; margin: 24px 0 0; padding: 0; min-width: 0; }
.group > legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.choice + .choice { margin-top: 8px; }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--primary-bg); flex: none; }
.choice:has(input:checked) { border-color: var(--text); }
.scope { font-size: 14px; color: var(--muted); margin-top: 20px; }
.timer { font-variant-numeric: tabular-nums; }
.done { text-align: center; padding-top: 40px; }
