:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --positive: #0f766e;
  --negative: #b91c1c;
  --unknown: #92400e;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #ffffff 0, var(--bg) 45%);
  color: var(--text);
}

.page {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0;
}

.card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 20px;
  backdrop-filter: blur(14px);
}

.hero {
  padding: 36px;
}

.eyebrow {
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

h1, h2, p {
  margin-top: 0;
}

h1 {
  font-size: clamp(34px, 7vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  margin-bottom: 18px;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}

p, li, small, label {
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  gap: 10px;
}

input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: #111827;
}

button {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
  font-size: 15px;
}

.primary, #saveConfigButton {
  background: #111827;
  color: #ffffff;
}

.secondary {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid var(--line);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.status-item {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: #fafafa;
}

.status-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.status-item strong {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
}

.status-item.positive strong {
  color: var(--positive);
}

.status-item.negative strong {
  color: var(--negative);
}

.status-item.unknown strong {
  color: var(--unknown);
}

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

.apple-pay-button-wrap {
  display: none;
  min-width: 220px;
  height: 44px;
}

apple-pay-button {
  --apple-pay-button-width: 220px;
  --apple-pay-button-height: 44px;
  --apple-pay-button-border-radius: 14px;
}

.hint {
  margin-top: 12px;
  font-size: 14px;
}

code {
  color: #111827;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 6px;
}

.log {
  min-height: 140px;
  white-space: pre-wrap;
  background: #0b1020;
  color: #d1d5db;
  border-radius: 18px;
  padding: 18px;
  overflow: auto;
  margin-top: 16px;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 22px, 980px);
    padding: 22px 0;
  }

  .card, .hero {
    padding: 22px;
    border-radius: 22px;
  }

  .input-row, .actions, .section-title-row {
    flex-direction: column;
    align-items: stretch;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .apple-pay-button-wrap, apple-pay-button {
    width: 100%;
    --apple-pay-button-width: 100%;
  }
}
