:root {
  --canvas: #f6f7f5;
  --surface: #ffffff;
  --ink: #202521;
  --muted: #68716a;
  --line: #dde3dc;
  --primary: #176c46;
  --primary-pressed: #105338;
  --danger: #b4382d;
  --danger-surface: #fff7f5;
  --success-surface: #f1faf4;
  --shadow: 0 10px 32px rgba(27, 43, 31, .08);
}

* { box-sizing: border-box; }
html { background: var(--canvas); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif; }
button { font: inherit; }

.app-shell { width: min(100%, 560px); min-height: 100svh; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.app-header { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px 2px 20px; }
.mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: var(--primary); font-size: 31px; font-weight: 700; box-shadow: 0 7px 16px rgba(23, 108, 70, .2); }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 6vw, 30px); line-height: 1.12; letter-spacing: -.035em; text-wrap: balance; }
h2 { margin: 0 0 5px; font-size: 16px; line-height: 1.3; letter-spacing: -.01em; }
.secure-badge { padding: 7px 9px; border: 1px solid #cce7d7; border-radius: 999px; color: var(--primary); background: var(--success-surface); font-size: 12px; font-weight: 650; }

.status-card, .request-card { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.status-card { display: flex; gap: 12px; align-items: flex-start; padding: 18px; }
.status-dot { width: 10px; height: 10px; flex: none; margin-top: 5px; border-radius: 999px; background: #d69a2d; box-shadow: 0 0 0 4px #fff5df; }
.status-card[data-tone="success"] { border-color: #cce7d7; background: var(--success-surface); }
.status-card[data-tone="success"] .status-dot { background: var(--primary); box-shadow: 0 0 0 4px #dcefe2; }
.status-card[data-tone="error"] { border-color: #f0c7c1; background: var(--danger-surface); }
.status-card[data-tone="error"] .status-dot { background: var(--danger); box-shadow: 0 0 0 4px #fde5e1; }
#state { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; text-wrap: pretty; }

.button { min-height: 54px; width: 100%; border: 1px solid transparent; border-radius: 16px; padding: 13px 18px; cursor: pointer; font-size: 16px; font-weight: 700; line-height: 1.25; transition-property: transform, background-color, border-color, box-shadow, opacity; transition-duration: 150ms; transition-timing-function: ease-out; }
.button:focus-visible { outline: 3px solid #79b79a; outline-offset: 3px; }
.button:active:not(:disabled) { transform: scale(.98); }
.button:disabled { cursor: not-allowed; opacity: .52; }
.button-primary, .button-approve { color: #fff; background: var(--primary); box-shadow: 0 8px 16px rgba(23, 108, 70, .18); }
.button-primary:hover:not(:disabled), .button-approve:hover:not(:disabled) { background: var(--primary-pressed); }
.button-reject { color: var(--danger); border-color: #edc8c3; background: var(--danger-surface); }
.button-reject:hover:not(:disabled) { border-color: #de9e96; background: #fff0ed; }

.request-card { padding: 20px; }
.request-card h2 { font-size: 20px; text-wrap: balance; }
.device { margin: 14px 0 20px; padding: 12px 14px; border-radius: 13px; color: #38433b; background: #f3f5f2; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.actions { display: grid; gap: 10px; }
.privacy-note { margin: auto 4px 0; padding-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.45; text-align: center; text-wrap: pretty; }
.overview-card { padding: 19px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.state-badge, .count { padding: 7px 9px; border-radius: 999px; color: var(--muted); background: #f0f3ef; font-size: 12px; font-weight: 700; white-space: nowrap; }
.state-badge[data-active="true"] { color: var(--primary); background: var(--success-surface); }
.details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 17px 0 0; }
.details div { min-width: 0; padding: 10px; border-radius: 12px; background: #f4f6f3; }
dt { margin-bottom: 5px; color: var(--muted); font-size: 11px; font-weight: 650; } dd { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.data-list { display: grid; gap: 8px; margin: 15px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.data-list li { padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }

@media (prefers-color-scheme: dark) {
  :root { --canvas: #151917; --surface: #1e2420; --ink: #edf3ed; --muted: #b4beb5; --line: #374239; --success-surface: #1a2b20; --danger-surface: #32201f; --shadow: 0 12px 34px rgba(0, 0, 0, .24); }
  .device { color: #dbe5dd; background: #29312b; }
  .details div, .state-badge, .count { background: #29312b; }
  .button-reject { color: #ffb5aa; border-color: #73433e; background: #352220; }
}

@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
