:root {
  --radius: 0.625rem;
  --sab: env(safe-area-inset-bottom, 0px);
  --background: #eef0f3; --foreground: #1a1d24;
  --surface: #f6f7f9; --card: #ffffff; --card-foreground: #1a1d24;
  --popover: #ffffff; --popover-foreground: #1a1d24;
  --text-heading: #0d0f14; --text-body: #3a3e47;
  --text-secondary: #4e5360; --text-tertiary: #6b7080; --text-placeholder: #9ca0ac;
  --primary: #20a2c7; --primary-foreground: #ffffff;
  --secondary: #eef0f3; --secondary-foreground: #3a3e47;
  --muted: #e4e7eb; --muted-foreground: #6b7080;
  --accent: #e4e7eb; --accent-foreground: #3a3e47;
  --destructive: #ef4444; --destructive-foreground: #ffffff;
  --border: #e0e3e7; --border-subtle: #e9ecef; --border-strong: #d2d6db;
  --input: #dce0e4; --input-background: #eef0f3; --ring: #20a2c7;
  --sidebar: #e4e7eb; --sidebar-foreground: #1a1d24;
  --sidebar-primary: #20a2c7; --sidebar-primary-foreground: #ffffff;
  --sidebar-accent: rgba(32,162,199,0.08); --sidebar-accent-foreground: #1a1d24;
  --sidebar-border: #dce0e4; --sidebar-ring: #20a2c7;
}
.dark {
  --background: #191a1e; --foreground: #d4d4d8;
  --surface: #1c1d21; --card: #1f2024; --card-foreground: #d4d4d8;
  --popover: #1f2024; --popover-foreground: #d4d4d8;
  --text-heading: #f4f4f5; --text-body: #d4d4d8;
  --text-secondary: #a1a1aa; --text-tertiary: #71717a; --text-placeholder: #52525b;
  --primary: #20a2c7; --primary-foreground: #ffffff;
  --secondary: #2d2e33; --secondary-foreground: #d4d4d8;
  --muted: #2d2e33; --muted-foreground: #71717a;
  --accent: #2d2e33; --accent-foreground: #d4d4d8;
  --destructive: #ef4444; --destructive-foreground: #ffffff;
  --border: #2d2e33; --border-subtle: #252629; --border-strong: #3a3c42;
  --input: #3a3b40; --input-background: #1f2024; --ring: #20a2c7;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--background); color: var(--text-body);
  font-family: Inter, "Geist Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; touch-action: manipulation; overflow-x: hidden;
}
.wrap { width: 100%; max-width: 40rem; margin: 0 auto; padding: 1rem 1rem calc(1.5rem + var(--sab)); animation: enter 220ms ease-out; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 2.75rem; margin-bottom: 0.5rem; }
h1 { margin: 0; font-size: 1.25rem; line-height: 1.3; color: var(--text-heading); font-weight: 600; overflow-wrap: anywhere; }
h2 { margin: 0 0 0.5rem; font-size: 0.95rem; color: var(--text-heading); font-weight: 600; }
p { margin: 0 0 0.75rem; overflow-wrap: anywhere; }
.lead { color: var(--text-secondary); margin-bottom: 1rem; }
.muted { color: var(--text-tertiary); font-size: 0.875rem; }
.card {
  background: var(--card); color: var(--card-foreground); border: 1px solid var(--border);
  border-radius: 0.75rem; padding: 1rem; margin-bottom: 0.75rem; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}
.dark .card { box-shadow: none; background: rgba(31, 32, 36, 0.6); }
.card > :last-child { margin-bottom: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; min-height: 2.75rem;
  padding: 0 1.1rem; border-radius: 0.5rem; border: 1px solid transparent; font: inherit; font-size: 0.95rem;
  font-weight: 500; text-decoration: none; cursor: pointer; transition: transform 100ms, background 150ms;
  background: var(--primary); color: var(--primary-foreground);
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; flex-shrink: 0;
  border-radius: 0.5rem; color: var(--text-secondary); text-decoration: none;
}
.icon-btn:active { transform: scale(0.97); }
.icon-btn svg { width: 1.25rem; height: 1.25rem; }
.back { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--primary); text-decoration: none; font-weight: 500; }
.status { display: flex; align-items: flex-start; gap: 0.6rem; margin: 0; }
.dot { width: 0.6rem; height: 0.6rem; border-radius: 999px; margin-top: 0.45rem; flex-shrink: 0; background: var(--text-placeholder); }
.dot-ok { background: var(--primary); }
.dot-wait { background: var(--border-strong); }
.field { margin-bottom: 1rem; }
.label { display: block; font-weight: 600; color: var(--text-heading); margin-bottom: 0.4rem; font-size: 0.95rem; }
.option {
  display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem; min-height: 2.75rem; border: 1px solid var(--border);
  border-radius: 0.6rem; margin-bottom: 0.5rem; cursor: pointer; background: var(--card);
}
.option:has(input:checked) { border-color: var(--primary); background: var(--sidebar-accent); }
.option input { margin-top: 0.3rem; accent-color: var(--primary); width: 1.1rem; height: 1.1rem; flex-shrink: 0; }
.option b { color: var(--text-heading); font-weight: 600; display: block; }
.option span { color: var(--text-tertiary); font-size: 0.875rem; }
textarea {
  width: 100%; min-height: 7rem; resize: vertical; font: inherit; font-size: 16px; color: var(--foreground);
  background: var(--input-background); border: 1px solid var(--input); border-radius: 0.5rem; padding: 0.65rem 0.75rem;
}
textarea::placeholder { color: var(--text-placeholder); }
textarea:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px rgba(32, 162, 199, 0.2); }
.ok-line { color: var(--primary); font-weight: 500; margin-bottom: 0.75rem; }
.kv { display: flex; justify-content: space-between; gap: 1rem; padding: 0.35rem 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.9rem; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--text-tertiary); }
.kv span:last-child { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.events { list-style: none; margin: 0; padding: 0; }
.events li { padding: 0.4rem 0; border-bottom: 1px solid var(--border-subtle); font-size: 0.875rem; display: flex; gap: 0.6rem; }
.events li:last-child { border-bottom: 0; }
.events time { color: var(--text-tertiary); flex-shrink: 0; font-variant-numeric: tabular-nums; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
