:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --ink: #1b1f2a;
  --muted: #667085;
  --line: #e4e7ec;
  --brand: #1a73e8;
  --brand-2: #34a853;
  --warn: #f29900;
  --danger: #d93025;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .08);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1219; --surface: #171b24; --ink: #e8eaf0; --muted: #98a2b3; --line: #2a3140;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
fieldset { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: 6px; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.7 system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}
h1, h2, h3 { line-height: 1.35; margin: 0 0 .6em; }
a { color: var(--brand); }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.narrow { max-width: 560px; }
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.muted { color: var(--muted); }
.btn {
  display: inline-flex; align-items: center; gap: .4em; border: 0; border-radius: 999px; cursor: pointer;
  padding: .7em 1.4em; font: inherit; font-weight: 600; background: var(--brand); color: #fff;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(26, 115, 232, .35); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: inset 0 0 0 1.5px var(--brand); }
.btn.danger { background: var(--danger); }
.btn.small { padding: .35em .9em; font-size: .9em; }
label.field { display: block; margin: 0 0 18px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 6px; }
label.field > small { display: block; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=time], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 10px; padding: .6em .8em;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(26, 115, 232, .15); }
textarea { min-height: 96px; resize: vertical; }
.check { display: flex; gap: .6em; align-items: flex-start; margin: 0 0 12px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block; padding: .45em 1em; border-radius: 999px; border: 1.5px solid var(--line);
  transition: all .25s var(--ease);
}
.chips input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.04); }
.chips input:focus-visible + span { box-shadow: 0 0 0 4px rgba(26, 115, 232, .25); }
.badge { display: inline-block; font-size: .78em; font-weight: 700; padding: .15em .7em; border-radius: 999px; background: var(--line); }
.badge.ok { background: rgba(52, 168, 83, .15); color: var(--brand-2); }
.badge.warn { background: rgba(242, 153, 0, .16); color: var(--warn); }
.badge.danger { background: rgba(217, 48, 37, .14); color: var(--danger); }
.toast-host { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; }
.toast {
  background: var(--ink); color: var(--bg); padding: .7em 1.2em; border-radius: 12px; box-shadow: var(--shadow);
  animation: toast-in .35s var(--ease);
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
