:root {
  --navy: #1b2a6b;
  --gold: #e8a400;
  --pink: #ec407a;
  --line: #d7e3f4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Maru Gothic ProN", "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--navy);
  background: linear-gradient(160deg, #a8d8f5 0%, #f6c9e0 55%, #fad1e4 100%);
  min-height: 100vh;
}
.site-head { padding: 18px 16px 4px; max-width: 860px; margin: 0 auto; }
.site-head h1 { font-size: 22px; margin: 0 0 4px; }
.badge-proto { background: var(--pink); color: #fff; font-size: 12px; border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.sub { margin: 0 0 8px; font-size: 14px; opacity: .85; }
.auth-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.auth-state { font-size: 13px; }
.note { font-size: 12px; opacity: .75; margin: 6px 0 0; }
.reg-count { font-size: 12px; color: #8a93a5; margin: 4px 0 0; }
main { max-width: 860px; margin: 0 auto; padding: 10px 12px 24px; }
.card {
  background: #fff; border-radius: 14px; padding: 16px;
  margin: 12px 0; box-shadow: 0 2px 10px rgba(27,42,107,.12);
}
.card h2 { font-size: 17px; margin: 0 0 12px; }
.count { font-size: 13px; color: #fff; background: var(--gold); border-radius: 999px; padding: 1px 10px; vertical-align: middle; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.grid-memo { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
label { font-size: 13px; font-weight: 700; display: block; }
textarea {
  width: 100%; padding: 9px 10px; font-size: 14px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy);
  font-family: inherit;
}
select, input[type="text"] {
  width: 100%; margin-top: 4px; padding: 9px 10px; font-size: 15px;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff; color: var(--navy);
}
html { scroll-behavior: smooth; }
#own-card { scroll-margin-top: 12px; }
.own-link-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 2px 4px 14px; font-size: 14px;
}
.own-link { color: var(--pink); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.own-current { font-size: 13px; font-weight: 700; margin: 10px 0 0; }
.own-current a { color: var(--pink); }
.own-x-link { font-size: 13px; margin: 6px 0 0; min-height: 1em; }
.own-x-link a { color: var(--pink); font-weight: 700; }
#own-pr-wrap { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.own-pr-label { font-size: 13px; font-weight: 800; margin: 0 0 6px; }
#own-pr { width: 100%; box-sizing: border-box; border: 1.5px solid var(--line); border-radius: 8px; background: #f4f9ff; color: var(--navy); padding: 8px; font-size: 13px; line-height: 1.6; resize: vertical; }
.pub-x { color: var(--pink); font-weight: 700; font-size: 12px; white-space: nowrap; }
.own-entries { list-style: none; margin: 8px 0 0; padding: 0; }
.own-entries li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; font-weight: 700; margin-top: 6px; }
.own-entries li .del { flex: none; }
.day-tabs { display: flex; gap: 6px; padding: 0 10px; margin: 16px 0 -9px; position: relative; z-index: 2; }
.day-tab {
  border: none; cursor: pointer; font-family: inherit;
  background: rgba(255,255,255,.55); color: #46608c;
  font-size: 14px; font-weight: 700; white-space: nowrap;
  padding: 8px 14px 16px; border-radius: 12px 12px 0 0;
  display: flex; align-items: center; gap: 6px;
}
.day-tab:active { transform: translateY(1px); }
.day-tab .day-date { font-size: 11px; font-weight: 700; opacity: .75; white-space: nowrap; }
.day-tab.on { background: #fff; color: var(--navy); font-weight: 800; box-shadow: 0 -3px 8px rgba(27,42,107,.10); }
.day-count { background: var(--gold); color: #fff; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 0 8px; line-height: 18px; white-space: nowrap; }
.day-count.zero { background: #b9c6de; }
#reg-card { margin-top: 0; position: relative; z-index: 1; }
.day-select-label { display: none; }
@media (max-width: 560px) {
  .day-tab { padding: 8px 10px 16px; font-size: 13px; gap: 5px; }
  .day-tabs { padding: 0 6px; gap: 4px; }
  .day-tab .day-date { display: none; }
}
.prio-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.prio-label { font-size: 13px; font-weight: 700; }
.prio-seg { display: flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.prio-seg button {
  border: none; background: #fff; padding: 7px 14px; font-size: 13px; font-weight: 700;
  color: var(--navy); cursor: pointer; display: flex; align-items: center; gap: 5px;
}
.prio-seg button.on { background: var(--navy); color: #fff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-gold { background: radial-gradient(circle at 35% 35%, #ffe98a, #e8a400); box-shadow: 0 0 4px #e8a400; }
.dot-silver { background: radial-gradient(circle at 35% 35%, #ffffff, #9aa7bd); }
.dot-bronze { background: radial-gradient(circle at 35% 35%, #f3c39a, #b87333); }
.prio-hint { font-size: 12px; opacity: .7; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; border-radius: 50%; font-size: 12px; font-weight: 800; color: #fff; flex: none;
}
.badge-3 { background: radial-gradient(circle at 35% 35%, #ffe98a, #e8a400); color: #6b4e00; box-shadow: 0 0 6px rgba(232,164,0,.8); }
.badge-2 { background: radial-gradient(circle at 35% 35%, #ffffff, #9aa7bd); color: #40506e; }
.badge-1 { background: radial-gradient(circle at 35% 35%, #f3c39a, #b87333); color: #5f3410; }
.row-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn {
  border: 1.5px solid var(--navy); background: #fff; color: var(--navy);
  border-radius: 999px; padding: 9px 18px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn-main { background: var(--navy); color: #fff; }
.btn-ghost { border-color: #b9c6de; color: #5a6b96; }
.btn-small { padding: 5px 14px; font-size: 13px; }
.btn:active { transform: translateY(1px); }
.reg-msg { font-size: 13px; color: var(--pink); font-weight: 700; }
.paste-help { margin-top: 12px; background: #fff7e6; border: 1.5px solid var(--gold); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.paste-help .ph-title { font-weight: 800; margin: 0 0 6px; }
.paste-help ul { margin: 0 0 6px; padding-left: 18px; }
.paste-help li { margin: 2px 0; }
.paste-help .ph-note { margin: 0; opacity: .85; }
.circle-list { list-style: none; margin: 0; padding: 0; }
.circle-list li {
  display: flex; align-items: center; gap: 8px; padding: 9px 8px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.circle-list li:last-child { border-bottom: none; }
.circle-list li.visited { opacity: .55; }
.circle-list li.last-visited { opacity: 1; background: #e2f4e9; border-radius: 8px; }
.circle-list .visit-check { width: 21px; height: 21px; accent-color: #2e9e62; flex: none; margin: 0 2px 0 0; cursor: pointer; }
.cl-space { font-weight: 800; font-size: 15px; white-space: nowrap; }
button.cl-space { background: none; border: none; font-family: inherit; color: inherit; padding: 0; }
.post-link { cursor: pointer; text-decoration: underline dotted var(--pink) 2px; text-underline-offset: 3px; }
.post-badge { background: var(--navy); color: #fff; font-size: 10px; font-weight: 800; border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; text-decoration: none; display: inline-block; }
.pub-badge { background: radial-gradient(circle at 35% 35%, #ffe98a, #e8a400); color: #6b4e00; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px; white-space: nowrap; box-shadow: 0 0 5px rgba(232,164,0,.7); }
.circle-list li.pub-owner { background: #fff7dd; box-shadow: inset 3px 0 0 #e8a400; border-radius: 8px; }
.circle-list li.res-got { background: #eefaf1; border-radius: 8px; }
.circle-list li.res-out { background: #f1f2f5; border-radius: 8px; }
.res-btn { border: 1px solid #c9d4e8; background: #fff; color: #40609c; border-radius: 999px; padding: 3px 9px; font-size: 12px; font-weight: 700; cursor: pointer; }
.res-btn.on-got { background: #2e9e62; border-color: #2e9e62; color: #fff; }
.res-btn.on-out { background: #6b7280; border-color: #6b7280; color: #fff; }
.board-member { border-top: 1px solid #e3e9f4; padding: 8px 0 4px; }
.board-mhead { margin: 0 0 4px; font-size: 14px; }
.board-items { list-style: none; margin: 0; padding: 0 0 4px; font-size: 13px; line-height: 1.8; }
.board-res { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; color: #fff; }
.board-res.got { background: #2e9e62; }
.board-res.out { background: #6b7280; }
.board-res.went { background: #9aa7bd; }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(27,42,107,.5); }
.modal-box { position: relative; background: #fff; border-radius: 14px; padding: 16px; margin: 5vh 12px 12px; width: min(560px, calc(100vw - 24px)); max-height: 88vh; overflow: auto; box-shadow: 0 8px 30px rgba(27,42,107,.35); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; font-size: 15px; margin-bottom: 10px; }
.modal-body iframe { width: 100%; height: 560px; border: none; border-radius: 10px; background: #f4f9ff; display: block; }
.cl-memo { font-size: 13px; opacity: .85; word-break: break-all; }
.cl-btns { margin-left: auto; display: flex; gap: 6px; }
.cl-btns button {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1.2px solid #b9c6de; background: #fff; color: var(--navy); font-weight: 700;
}
.cl-btns button.del { border-color: #f0b7c8; color: #c2265c; }
.empty { font-size: 13px; opacity: .7; }
.result-summary { font-size: 14px; font-weight: 700; margin: 0 0 10px; }
.map-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.map-wrap { width: 100%; overflow-x: auto; background: #f4f9ff; border: 1.5px solid var(--line); border-radius: 10px; }
.map-wrap svg { display: block; width: 100%; height: auto; }
.map-wrap.zoomed { overflow: auto; max-height: 72vh; }
.map-wrap.zoomed svg { width: 190%; max-width: none; }
.isle-label { paint-order: stroke; stroke: #fff; stroke-width: 3.5px; }
.pin-label, .band-label { paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.route-list { margin: 12px 0 0; padding-left: 4px; list-style: none; }
.route-list li { padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.route-list li:last-child { border-bottom: none; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-top: 8px; align-items: center; }
.lg {
  display: inline-flex; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px;
  margin-right: 4px; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; color: #fff; font-style: normal;
}
.lg-s { background: #e8a400; }
.lg-3 { background: radial-gradient(circle at 35% 35%, #ffe98a, #e8a400); }
.lg-2 { background: radial-gradient(circle at 35% 35%, #ffffff, #9aa7bd); }
.lg-1 { background: radial-gradient(circle at 35% 35%, #f3c39a, #b87333); }
.lg-0 { background: #1b2a6b; }
.lg-line { display: inline-block; width: 22px; height: 4px; border-radius: 2px; background: var(--pink); vertical-align: middle; margin-right: 4px; }
.leg { font-size: 12px; color: #5a6b96; margin-left: 6px; white-space: nowrap; }
.route-list li[data-pin] { cursor: pointer; }
.route-list li[data-pin]:hover { background: #f2f7ff; }
.site-foot { max-width: 860px; margin: 0 auto; padding: 0 16px 28px; font-size: 12px; opacity: .75; }
#own-card h2 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.own-toggle {
  flex: 0 0 auto; border: 1px solid #b9cfea; background: #fff; color: #2c4a73;
  border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700; cursor: pointer;
}
.site-foot .foot-circle { margin: 0 0 10px; font-size: 12.5px; opacity: 1; color: #1b2a6b; }
.site-foot .foot-circle a { color: #1b2a6b; font-weight: 700; }
.site-foot .history { margin-top: 12px; opacity: 1; }
.site-foot .history summary { cursor: pointer; font-weight: 700; color: #1b2a6b; font-size: 12px; }
.site-foot .history ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.7; }
.site-foot .history time { font-weight: 700; margin-right: 6px; }
.site-foot .sister { margin-bottom: 12px; opacity: 1; }
.site-foot .sister-label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; margin-bottom: 6px; color: #1b2a6b; }
.site-foot .sister-links { display: flex; flex-wrap: wrap; gap: 7px; }
.site-foot .sister-links a {
  display: inline-block; padding: 4px 12px; border-radius: 999px; background: #fff;
  border: 1px solid #b9cfea; color: #2c4a73; font-weight: 700; font-size: 12px;
  text-decoration: none; box-shadow: 0 2px 5px rgba(27, 42, 107, .08);
}

@media (max-width: 700px) {
  .pin-label, .band-label { display: none; }
}
@media (min-width: 861px) {
  main, .site-head, .site-foot { max-width: 1180px; }
  .result-grid { display: grid; grid-template-columns: 1.9fr 1fr; gap: 18px; align-items: start; }
  .route-list { margin-top: 0; }
}

.print-only { display: none; }
@media print {
  body { background: #fff; }
  .site-head, #paste-card, #reg-card, #list-card, #own-card, #route-card, .site-foot, .row-actions, .map-tools, .day-tabs, .modal { display: none !important; }
  #result-card { box-shadow: none; margin: 0; border: none; }
  main { max-width: none; }
  .result-grid { display: block; }
  .map-wrap, .map-wrap.zoomed { overflow: visible; max-height: none; }
  .map-wrap svg { width: 100%; }
  .print-only { display: block; }
  .print-list-title {
    page-break-before: always; break-before: page;
    font-size: 17px; margin: 0 0 10px; color: var(--navy);
  }
  #result-card, .route-list li, .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
