/* ワールド会の色：ロゴの紺 #2150A4 と、LINE 背景の空色グラデーション #86C8FB → #3F93E3 */
:root {
  color-scheme: light;
  --navy: #2150a4;
  --navy-deep: #18397a;
  --navy-ink: #1d3263;
  --sky-1: #a9d8fc;
  --sky-2: #86c8fb;
  --sky-3: #5fb3f9;
  --sky-4: #3f93e3;
  --bg: #f2f7fc;
  --paper: #ffffff;
  --ink: #1a2740;
  --muted: #5b6b86;
  --line: #d9e5f2;
  --ocean: #fbfdff;
  --ocean-edge: #ffffff;
  --land: #d3e2f3;
  --land-hl: #79b6f1;
  --land-sel: #2150a4;
  --pin-sel: #f08a3c;
  --ok: #138a63;
  --ok-bg: #e0f4ec;
  --warn: #b0600c;
  --warn-bg: #fdf0dd;
  --grey-bg: #edf2f8;
  --a: #0b7f88;
  --a-bg: #dcf1f2;
  --b: #c4531f;
  --b-bg: #fbe6db;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(26, 39, 64, .05), 0 6px 18px rgba(33, 80, 164, .07);
  --tabbar-h: 62px;
  --latin: Futura, "Avenir Next", "Century Gothic", "Trebuchet MS", sans-serif;
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  line-break: strict;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
h1, h2, h3, .uname { word-break: auto-phrase; text-wrap: balance; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--navy); }
[hidden] { display: none !important; }
svg.ico { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ph { display: inline-block; }
.latin { font-family: var(--latin); letter-spacing: .22em; font-weight: 500; }

.shell { max-width: 760px; margin: 0 auto; padding: 0 14px; }

/* ヘッダー（空色グラデーション） */
.top {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, var(--sky-2), var(--sky-3));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 2px 10px rgba(33, 80, 164, .12);
}
.top .shell.bar { display: flex; align-items: center; gap: 10px; padding-top: 9px; padding-bottom: 8px; }
.brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.brand img { width: 44px; height: auto; flex: none; }
.brand-text { min-width: 0; }
.brand .org { margin: 0; font-size: 11px; color: var(--navy-ink); font-weight: 600; letter-spacing: .04em; line-height: 1.3; }
.brand h1 { font-size: 19px; line-height: 1.25; margin: 0; color: var(--navy-deep); letter-spacing: .04em; }
.score-btn {
  border: 0; background: rgba(255, 255, 255, .92); border-radius: 999px; color: var(--navy);
  padding: 7px 13px; font-size: 13px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(33, 80, 164, .18);
}
.score-btn.on { background: var(--navy); color: #fff; }

.seg { display: flex; gap: 6px; padding: 0 0 10px; }
body[data-view="fav"] .seg { display: none; }
.seg button {
  flex: 1; border: 0; background: rgba(255, 255, 255, .55); border-radius: 10px; color: var(--navy-ink);
  padding: 6px 4px; line-height: 1.25; font-size: 13.5px; font-weight: 700;
}
.seg button small { display: block; font-size: 10.5px; font-weight: 500; white-space: nowrap; opacity: .85; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: 0 2px 6px rgba(24, 57, 122, .3); }

/* 地図の見出し帯 */
.hero { position: relative; margin: 0 -14px; padding: 38px 14px 0; background: linear-gradient(180deg, var(--sky-3) 0%, var(--sky-2) 46%, var(--bg) 100%); overflow: hidden; }
.hero-deco { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-deco .grid { stroke: rgba(255, 255, 255, .45); stroke-width: 1.2; fill: none; }
.hero-deco .route { stroke: rgba(255, 255, 255, .85); stroke-width: 2; fill: none; stroke-dasharray: 1 7; stroke-linecap: round; }
.hero-deco .plane { fill: #fff; }
.hero-deco .spot { fill: #fff; }
.hero-deco .spot-ring { fill: none; stroke: #fff; stroke-width: 1.6; }
.tagline { position: relative; margin: 0; text-align: center; color: #fff; font-size: 13px; text-shadow: 0 1px 6px rgba(24, 57, 122, .25); }
.lead { position: relative; margin: 4px 0 0; text-align: center; color: var(--navy-deep); font-size: 13px; font-weight: 600; }

.notice {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 12px;
  background: var(--paper); color: var(--ink); font-size: 12.5px; line-height: 1.6;
  border-left: 4px solid var(--sky-4); box-shadow: var(--shadow);
}
.notice button { background: none; border: 0; padding: 0; color: var(--navy); text-decoration: underline; font-weight: 700; font-size: inherit; }

/* 地球儀 */
.globe-wrap { position: relative; margin: 4px 0 0; }
#globe { display: block; width: 100%; touch-action: none; cursor: grab; position: relative; }
#globe:active { cursor: grabbing; }
.zoom { position: absolute; right: 0; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.zoom button {
  width: 40px; height: 40px; border-radius: 12px; border: 0; color: var(--navy);
  background: rgba(255, 255, 255, .95); box-shadow: var(--shadow);
  display: grid; place-items: center;
}
.hint { position: absolute; left: 0; bottom: 10px; margin: 0; font-size: 11.5px; color: var(--navy-ink); background: rgba(255, 255, 255, .85); padding: 3px 9px; border-radius: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--muted); margin: 8px 0 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.legend .dot-navy { background: var(--navy); }
.legend .dot-ok { background: var(--ok); }

/* 行き先チップ */
.section-title { font-size: 16px; margin: 22px 0 2px; color: var(--navy-deep); display: flex; align-items: baseline; gap: 10px; }
.section-title .latin { font-size: 10.5px; color: var(--sky-4); }
.section-sub { font-size: 12px; color: var(--muted); margin: 0 0 10px; }
.region { margin: 0 0 12px; }
.region h3 { font-size: 12px; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 5px 6px 5px 12px; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px;
}
.chip b { font-size: 11.5px; background: var(--grey-bg); color: var(--navy-ink); border-radius: 999px; padding: 0 8px; min-width: 24px; text-align: center; }
.chip.has-ok b { background: var(--ok-bg); color: var(--ok); }

/* 大学カード */
.card {
  background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 13px 14px 12px; margin: 0 0 12px; border: 1px solid transparent; position: relative;
}
.card.is-fav { border-color: var(--sky-3); }
.card-head { display: flex; gap: 10px; align-items: flex-start; }
.card-title { flex: 1; min-width: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.badge { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 1px 7px; background: var(--grey-bg); color: var(--muted); }
.badge.g-A { background: var(--a-bg); color: var(--a); }
.badge.g-B { background: var(--b-bg); color: var(--b); }
.badge.new { background: #fff2c4; color: #725300; }
.uname { font-size: 16.5px; line-height: 1.4; margin: 0; color: var(--navy-ink); }
.uname small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.35; margin-top: 1px; }

/* 「行きたい」ボタン */
.want {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  border: 1.5px solid var(--sky-3); background: var(--paper); color: var(--navy);
  border-radius: 999px; padding: 6px 12px 6px 9px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.want svg.ico { width: 18px; height: 18px; }
.want[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.want[aria-pressed="true"] svg.ico { fill: currentColor; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 10px 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 11px; color: var(--muted); }
.facts dd { margin: 0; font-size: 13.5px; font-weight: 600; overflow-wrap: anywhere; }

.req { margin: 10px 0 0; }
.req-label { font-size: 11px; color: var(--muted); margin: 0 0 4px; }
.pills { display: flex; flex-wrap: wrap; gap: 5px; }
.pill { font-size: 12.5px; border-radius: 8px; padding: 2px 8px; background: var(--grey-bg); white-space: nowrap; }
.pill b { font-weight: 700; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.ng { background: var(--warn-bg); color: var(--warn); }
.pill.lang { white-space: normal; }
.pill.caution { background: #fff; border: 1px dashed #c9d6e6; color: var(--muted); }

.verdict { margin: 9px 0 0; font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 8px; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.short { background: var(--warn-bg); color: var(--warn); }
.verdict.none { background: var(--grey-bg); color: var(--muted); font-weight: 600; }

details.more { margin: 8px 0 0; border-top: 1px solid var(--line); padding-top: 6px; }
details.more summary { font-size: 13px; color: var(--navy); font-weight: 600; cursor: pointer; padding: 4px 0; }
.more-body { font-size: 13px; }
.more-body h4 { font-size: 11.5px; color: var(--muted); margin: 10px 0 2px; font-weight: 600; }
.more-body p { margin: 0; white-space: pre-line; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.links a {
  font-size: 12.5px; text-decoration: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 3px 10px; background: #f8fbff; font-weight: 600;
}

/* 一覧 */
.list-head { margin: 14px 0 8px; }
.search { display: flex; gap: 8px; margin: 8px 0 8px; }
.search input {
  flex: 1; font: inherit; font-size: 16px; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper);
}
.toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 12px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--navy); }
.country-head { position: sticky; top: var(--sticky-top, 110px); z-index: 5; background: var(--bg); padding: 8px 0 6px; margin: 6px 0 4px; font-size: 15px; display: flex; align-items: baseline; gap: 8px; color: var(--navy-deep); }
.country-head small { color: var(--muted); font-weight: 500; font-size: 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 14px; }
.count-line { font-size: 12.5px; color: var(--muted); margin: 0 0 8px; }

/* 持ち物カード（搭乗券ふう） */
.howto { font-size: 13px; color: var(--ink); background: var(--paper); border-radius: 12px; padding: 12px 14px; margin: 14px 0; box-shadow: var(--shadow); }
.howto strong { color: var(--navy-deep); }
.howto ol { margin: 4px 0 0; padding-left: 1.3em; }
.ticket { margin: 0 0 12px; border-radius: 18px; background: var(--paper); box-shadow: 0 10px 30px rgba(33, 80, 164, .14); overflow: hidden; }
.ticket-head { position: relative; padding: 16px 16px 14px; background: linear-gradient(135deg, var(--navy) 0%, var(--sky-4) 100%); color: #fff; }
.ticket-head .latin { font-size: 10.5px; margin: 0; opacity: .9; }
.ticket-head h2 { margin: 3px 0 0; font-size: 19px; letter-spacing: .04em; }
.ticket-head .meta { margin: 3px 0 0; font-size: 11.5px; opacity: .9; }
.ticket-head img { position: absolute; right: 14px; top: 14px; width: 46px; height: auto; background: rgba(255, 255, 255, .92); border-radius: 12px; padding: 5px; }
.ticket-scores { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 12px 16px 14px; }
.ticket-scores .lbl { font-size: 11px; color: var(--muted); margin-right: 4px; }
.perf { position: relative; height: 0; border-top: 2px dashed var(--line); margin: 0 14px; }
.perf::before, .perf::after { content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); }
.perf::before { left: -25px; }
.perf::after { right: -25px; }
.leg { display: flex; gap: 12px; padding: 13px 16px 12px; border-top: 1px solid var(--line); }
.leg:first-of-type { border-top: 0; }
.leg-dest { flex: none; width: 66px; text-align: center; padding-top: 2px; }
.leg-dest .to { display: block; font-family: var(--latin); font-size: 9.5px; letter-spacing: .2em; color: var(--muted); }
.leg-dest .country { display: block; font-size: 15px; font-weight: 800; color: var(--navy-deep); line-height: 1.3; word-break: keep-all; }
.leg-dest .en { display: block; font-family: var(--latin); font-size: 8.5px; letter-spacing: .08em; color: var(--sky-4); line-height: 1.3; margin-top: 2px; text-transform: uppercase; }
.leg-body { flex: 1; min-width: 0; }
.leg-body .uname { font-size: 15px; }
.leg-line { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.leg .verdict { margin-top: 7px; font-size: 12.5px; padding: 3px 9px; }
.leg-remove { flex: none; align-self: flex-start; border: 1px solid var(--line); background: var(--paper); color: var(--muted); border-radius: 8px; padding: 3px 8px; font-size: 11.5px; font-weight: 600; }
.ticket-foot { padding: 10px 16px 14px; font-size: 11px; color: var(--muted); line-height: 1.55; background: #f8fbff; border-top: 1px solid var(--line); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.btn {
  border: 1px solid var(--navy); background: var(--navy); color: #fff; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 700;
}
.btn.ghost { background: var(--paper); color: var(--navy); }

/* タブバー */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tabbar .shell { display: flex; padding: 0 4px; }
.tabbar button {
  flex: 1; height: var(--tabbar-h); background: none; border: 0; font-size: 11.5px; font-weight: 600;
  color: #8a98ae; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  position: relative;
}
.tabbar button svg.ico { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--navy); }
.tabbar button[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--sky-3), var(--navy));
}
.tab-badge {
  position: absolute; top: 6px; left: calc(50% + 9px); min-width: 18px; height: 18px; border-radius: 9px;
  background: var(--pin-sel); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; padding: 0 5px;
}

/* ダイアログ（下から出るシート） */
html.lock, html.lock body { overflow: hidden; }
dialog.sheet {
  border: 0; padding: 0; width: 100%; max-width: 760px; margin: auto auto 0;
  max-height: 86vh; max-height: 86dvh; border-radius: 18px 18px 0 0; background: var(--bg); color: var(--ink);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
}
dialog.sheet[open] { display: flex; flex-direction: column; animation: up .22s ease-out; }
dialog.sheet::backdrop { background: rgba(16, 34, 70, .42); }
@keyframes up { from { transform: translateY(40px); } to { transform: none; } }
.sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px;
  background: linear-gradient(180deg, var(--sky-2), var(--sky-3)); border-radius: 18px 18px 0 0; color: var(--navy-deep);
}
.sheet-head h2 { flex: 1; margin: 0; font-size: 18px; line-height: 1.35; }
.sheet-head h2 small { display: block; font-size: 12px; color: var(--navy-ink); font-weight: 500; }
.sheet-head .close { border: 0; background: rgba(255, 255, 255, .92); color: var(--navy); border-radius: 10px; padding: 7px 13px; font-size: 13px; font-weight: 700; }
.sheet-body { overflow-y: auto; padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-grid label { font-size: 12.5px; font-weight: 600; display: flex; flex-direction: column; gap: 3px; }
.form-grid label small { font-weight: 500; color: var(--muted); font-size: 11px; }
.form-grid input {
  font: inherit; font-size: 16px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); width: 100%;
}
.form-grid input[aria-invalid="true"] { border-color: var(--warn); background: var(--warn-bg); }
.privacy { font-size: 12px; color: var(--muted); margin: 12px 0; }
.notes-list { font-size: 13px; padding-left: 1.1em; margin: 0; }
.notes-list li { margin: 0 0 8px; white-space: pre-line; }
.sheet-body h3 { font-size: 14px; margin: 16px 0 6px; color: var(--navy-deep); }
.sheet-body h3:first-child { margin-top: 0; }

/* トースト */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 60; background: var(--navy-deep); color: #fff; border-radius: 12px; padding: 9px 10px 9px 14px;
  font-size: 13.5px; display: flex; align-items: center; gap: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  max-width: calc(100% - 28px);
}
.toast button { background: #fff; color: var(--navy-deep); border: 0; border-radius: 8px; padding: 5px 10px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.offscreen { position: fixed; left: -9999px; top: 0; }

/* フッター */
.site-foot { margin: 28px 0 18px; padding: 16px 0 0; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.foot-brand { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.foot-brand img { width: 40px; height: auto; }
.foot-brand strong { display: block; color: var(--navy-deep); font-size: 13px; }
.foot-brand .latin { font-size: 9.5px; color: var(--sky-4); }

@media (min-width: 700px) {
  .hero { margin: 0; border-radius: 0 0 24px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open] { animation: none; }
}
