:root {
  --c-key: #4c1d95;
  --c-key-strong: #3b0764;
  --c-key-soft: #ede9fe;
  --c-text: #1a1a1c;
  --c-text-sub: #4d4d57;
  --c-bg: #f6f5fa;
  --c-surface: #ffffff;
  --c-border: #8e8e99;
  --c-border-soft: #dcdbe3;
  --c-good: #1b7f3b;
  --c-ok: #1d4ed8;
  --c-warn: #a35200;
  --c-bad: #b3261e;
  --c-error-bg: #fdecea;
  --radius: 12px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  font-size: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.7;
}

.wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--space-2);
}

.site-header {
  background: var(--c-key);
  color: #fff;
  padding: var(--space-3) 0 var(--space-3);
}
.site-header__venue { margin: 0; font-size: 1rem; opacity: 0.92; }
.site-header__title { margin: 0; font-size: 1.75rem; line-height: 1.4; }
.site-header__lead { margin: var(--space-1) 0 0; font-size: 1rem; }

main { padding-top: var(--space-2); padding-bottom: var(--space-3); }

.card {
  background: var(--c-surface);
  border-radius: var(--radius);
  padding: var(--space-2);
  margin-bottom: var(--space-2);
  border: 1px solid var(--c-border-soft);
}
.card--soft { background: #fbfaff; }
.card__title {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0 0 var(--space-2);
  font-size: 1.25rem;
  line-height: 1.4;
}
.card__title svg { width: 24px; height: 24px; color: var(--c-key); flex: none; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--c-key);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: var(--space-2);
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span {
  display: block;
  text-align: center;
  padding: 10px 8px;
  font-weight: 700;
  color: var(--c-key);
  cursor: pointer;
}
.segmented input:checked + span { background: var(--c-key); color: #fff; }
.segmented input:focus-visible + span { outline: 4px solid #000; outline-offset: -4px; box-shadow: inset 0 0 0 8px #ffd43d; }

.field { display: block; margin-bottom: var(--space-2); }
.field__label { display: block; font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.field input, .field select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: 8px;
  background: #fff;
  color: var(--c-text);
  min-height: 48px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-1); }
.field-row .field { margin-bottom: var(--space-2); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 100%;
  min-height: 52px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: var(--c-key);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: var(--space-2);
}
.button:hover { background: var(--c-key-strong); }
.button svg { width: 20px; height: 20px; }

/* DADS：フォーカスは Yellow-300 と Black の二重 */
:where(a, button, input, select, textarea, canvas, svg):focus-visible {
  outline: 4px solid #000;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #ffd43d;
}

.form-error {
  background: var(--c-error-bg);
  color: var(--c-bad);
  border-radius: 8px;
  padding: var(--space-1) 12px;
  margin: 0 0 var(--space-2);
}

.help {
  display: flex;
  gap: var(--space-1);
  align-items: flex-start;
  background: var(--c-key-soft);
  border-radius: 8px;
  padding: 12px;
  margin: 0 0 var(--space-2);
}
.help svg { width: 20px; height: 20px; flex: none; margin-top: 3px; color: var(--c-key); }

.seat-summary { margin: 0 0 var(--space-2); font-weight: 700; font-size: 1.125rem; line-height: 1.5; }

.view { position: relative; margin-bottom: var(--space-1); }
.view canvas {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  background: #0b1020;
  touch-action: none;
  cursor: grab;
}
.view__hint { margin: 4px 0 0; color: var(--c-text-sub); font-size: 0.875rem; }

.toggle { display: flex; align-items: center; gap: var(--space-1); margin: var(--space-1) 0 var(--space-2); min-height: 44px; }
.toggle input { width: 22px; height: 22px; accent-color: var(--c-key); }

.metrics { list-style: none; padding: 0; margin: 0 0 var(--space-2); display: grid; gap: var(--space-1); }
.metric {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 4px 12px;
  align-items: start;
  border: 1px solid var(--c-border-soft);
  border-radius: 10px;
  padding: 12px;
}
.metric__icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--c-key-soft); color: var(--c-key);
}
.metric__icon svg { width: 22px; height: 22px; }
.metric__name { margin: 0; color: var(--c-text-sub); font-size: 0.875rem; line-height: 1.5; }
.metric__value { margin: 0; font-size: 1.125rem; font-weight: 700; line-height: 1.5; }
.metric__sub { margin: 0; grid-column: 2; color: var(--c-text-sub); font-size: 0.9375rem; line-height: 1.6; }
.metric--good .metric__value { color: var(--c-good); }
.metric--ok .metric__value { color: var(--c-ok); }
.metric--warn .metric__value { color: var(--c-warn); }
.metric--bad .metric__value { color: var(--c-bad); }

.notes { margin: 0; padding-left: 1.25em; color: var(--c-text-sub); }
.notes:empty { display: none; }

.map { display: block; width: 100%; max-width: 520px; margin: 0 auto; aspect-ratio: 1; }
.map.is-pickable { cursor: crosshair; }
.m-lower { fill: #c9d1f2; stroke: none; }
.m-field { fill: #eceef3; stroke: #8e8e99; stroke-width: 0.4; }
.m-alpha { fill: #a5b2ea; stroke: none; }
.m-upper { fill: none; stroke: #2f6b72; stroke-width: 0.7; stroke-dasharray: 2 1.5; }
.m-stage { fill: #2b2440; }
.m-screen { fill: #c026d3; }
.m-label { font-size: 6px; text-anchor: middle; dominant-baseline: middle; fill: #1a1a1c; font-weight: 700; }
.m-label--soft { fill: #4d4d57; font-weight: 400; font-size: 5px; }
.m-label--stage { fill: #fff; font-size: 4.5px; }
.m-sightline { stroke: #b3261e; stroke-width: 0.8; stroke-dasharray: 2 1.2; }
.m-seat { fill: #b3261e; stroke: #fff; stroke-width: 1; }
.m-dist { font-size: 6px; font-weight: 700; fill: #b3261e; paint-order: stroke; stroke: #fff; stroke-width: 1.5px; }
.map__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 0.875rem; color: var(--c-text-sub); margin: var(--space-1) 0 0; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 2px; vertical-align: -2px; }
.lg--lower { background: #c9d1f2; }
.lg--alpha { background: #a5b2ea; }
.lg--upper { border: 2px dashed #2f6b72; }
.lg--seat { background: #b3261e; border-radius: 50%; }

.about { margin: 0; padding-left: 1.25em; }
.about li { margin-bottom: 4px; }

.site-footer { color: var(--c-text-sub); font-size: 0.875rem; padding-bottom: var(--space-3); }

@media (max-width: 380px) {
  .field-row { grid-template-columns: 1fr 1fr; }
}
