/* 高速道路の緑の案内標識をモチーフにした配色。
   緑 = 進む・情報、赤 = 止まる・取り消し、で信号と同じ意味に揃えている。
   外部フォントは読み込まない（CSP を script/style とも 'self' に閉じるため）。 */

:root {
  color-scheme: light dark;

  --sign: #0c6e43;
  --sign-strong: #0a5b38;
  --sign-ink: #ffffff;
  --stop: #b3151f;

  --ink: #14181b;
  --muted: #59635d;
  --paper: #f2f4f0;
  --card: #ffffff;
  --rule: #dcdfd8;
  --focus: #0c6e43;

  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Yu Gothic Medium", "Noto Sans JP", "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Yu Gothic", monospace;

  --measure: 44rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sign: #128a56;
    --sign-strong: #0f7548;
    --stop: #e2606a;
    --ink: #e7ebe6;
    --muted: #97a19a;
    --paper: #101312;
    --card: #181c1a;
    --rule: #2a302c;
    --focus: #35c98a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

/* ---- 骨格 ---------------------------------------------------------- */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.25rem;
  padding: 0.9rem 1.25rem;
  background: var(--card);
  border-bottom: 1px solid var(--rule);
}

.masthead__mark {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
}

.masthead__mark span {
  font-weight: 500;
  color: var(--muted);
}

.masthead__nav {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  font-size: 0.85rem;
}

.masthead__home {
  color: var(--muted);
  text-decoration: none;
}

.masthead__home:hover {
  color: var(--sign);
  text-decoration: underline;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 3rem;
}

.colophon {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ---- 見出しと本文 --------------------------------------------------- */

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.65rem, 1.2rem + 2vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--sign);
}

.lede {
  margin: 0 0 1.5rem;
  font-size: 1.02rem;
  color: var(--muted);
}

.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.9rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--rule);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.hint {
  color: var(--muted);
  font-size: 0.85rem;
}

a {
  color: var(--sign);
}

/* ---- 経路プレート（この画面の看板） --------------------------------- */

.plate {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 3vw, 1.4rem);
  margin: 1.75rem 0 0.5rem;
  padding: clamp(0.9rem, 3vw, 1.3rem) clamp(1rem, 4vw, 1.75rem);
  background: var(--sign);
  color: var(--sign-ink);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.8);
  font-size: clamp(1rem, 0.75rem + 1.4vw, 1.4rem);
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.plate__side {
  flex: 1 1 0;
  min-width: 0;
}

.plate__side--to {
  text-align: right;
}

/* 案内標識の矢羽根。CSS だけで描いて画像を持たない。 */
.plate__arrow {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 0.5em solid transparent;
  border-bottom: 0.5em solid transparent;
  border-left: 0.75em solid var(--sign-ink);
}

.plate__caption {
  margin: 0 0 2rem;
}

/* ---- ボタン --------------------------------------------------------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

.button {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border: 1px solid var(--sign);
  border-radius: 6px;
  background: var(--sign);
  color: var(--sign-ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.button:hover {
  background: var(--sign-strong);
  border-color: var(--sign-strong);
}

.button--quiet {
  background: transparent;
  color: var(--sign);
  border-color: var(--rule);
}

.button--quiet:hover {
  background: transparent;
  border-color: var(--sign);
}

.button--stop {
  background: transparent;
  color: var(--stop);
  border-color: var(--stop);
}

.button--stop:hover {
  background: var(--stop);
  border-color: var(--stop);
  color: #fff;
}

:where(a, button, input, select):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---- 道のり（本当に順序がある3手順だけ番号を振る） ------------------ */

.route__steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.route__steps li {
  position: relative;
  padding: 0.85rem 0 0.85rem 2.75rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9rem;
  counter-increment: step;
}

.route__steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sign);
  color: var(--sign-ink);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.route__steps strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.route {
  margin-top: 3rem;
}

/* ---- フォーム ------------------------------------------------------- */

form {
  margin: 0;
}

.fields {
  margin: 0 0 2rem;
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.field + .field,
.field + .switch {
  margin-top: 1.5rem;
}

.field > label,
.field__group-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  font-weight: 700;
}

input[type="text"],
input[type="date"],
input[type="url"],
select {
  width: 100%;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 1rem;
}

input[aria-invalid="true"] {
  border-color: var(--stop);
}

input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.field__hint {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.field__error {
  margin: 0.45rem 0 0;
  color: var(--stop);
  font-size: 0.85rem;
  font-weight: 700;
}

.pair {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pair__part {
  flex: 1 1 11rem;
}

.pair__part span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
}

.switch {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.switch input {
  margin: 0.3rem 0 0;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--sign);
  flex: 0 0 auto;
}

.switch em {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 400;
}

.submit {
  margin-bottom: 3rem;
}

form.danger {
  padding: 1.4rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
}

form.danger .hint {
  margin: 0 0 1rem;
}

/* ---- 通知メッセージ ------------------------------------------------- */

.notice {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.1rem;
  border-left: 4px solid var(--rule);
  border-radius: 0 6px 6px 0;
  background: var(--card);
  font-size: 0.9rem;
}

.notice ul {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}

.notice--go {
  border-left-color: var(--sign);
}

.notice--stop {
  border-left-color: var(--stop);
}

.notice--warn {
  border-left-color: var(--stop);
  margin: 1.25rem 0 0;
}

/* ---- 編集リンクの控え ----------------------------------------------- */

.ticket {
  margin-top: 1.5rem;
  padding: 1.4rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.ticket__url {
  margin: 0;
  padding: 0.85rem 1rem;
  background: var(--paper);
  border: 1px dashed var(--rule);
  border-radius: 6px;
}

.ticket__url code {
  font-family: var(--mono);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.ticket__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.9rem 0 0;
}

/* ---- 掲載状況の一覧 ------------------------------------------------- */

.boards {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.board ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.board__unit {
  font-weight: 400;
  letter-spacing: 0;
}

.board__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.2rem;
  border-bottom: 1px solid var(--rule);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
}

.board__row:hover .board__name {
  color: var(--sign);
  text-decoration: underline;
}

.board__name {
  overflow-wrap: anywhere;
}

.board__count {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--sign);
}

.board__empty {
  padding: 0.6rem 0.2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
