/* ============ 宇宙学会レーダー ============ */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #1a2233;
  --muted: #5b6478;
  --border: #dde2ee;
  --accent: #2456d6;
  --accent-soft: #e8eefc;
  --hero-bg: linear-gradient(135deg, #0b1026 0%, #1b2a5e 60%, #24438f 100%);
  --danger: #d6303f;
  --danger-soft: #fdeaec;
  --warn: #b26a00;
  --warn-soft: #fff3df;
  --ok: #1e7b46;
  --ok-soft: #e5f5ec;
  --shadow: 0 2px 10px rgba(15, 30, 80, .07);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --card: #161d2b;
    --text: #e7ecf7;
    --muted: #94a0b8;
    --border: #2a3550;
    --accent: #6f9bff;
    --accent-soft: #1d2a4a;
    --danger: #ff7a86;
    --danger-soft: #3a1b22;
    --warn: #ffb75c;
    --warn-soft: #3a2c14;
    --ok: #5fd394;
    --ok-soft: #14311f;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  letter-spacing: .015em;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- header ---- */
.app-header {
  background: var(--hero-bg);
  color: #fff;
  padding: 0 16px;
}
.header-inner { max-width: 860px; margin: 0 auto; padding-top: 24px; }
.app-title { display: flex; align-items: center; gap: 9px; }
.brand-mark { color: #8db0ff; flex: none; }
.app-title h1 { margin: 0; font-size: 1.28rem; font-weight: 700; letter-spacing: .1em; }
.brand-en { font-size: .62rem; font-weight: 600; letter-spacing: .34em; opacity: .5; margin-top: 4px; }
.subtitle { margin: 6px 0 16px; font-size: .8rem; opacity: .68; letter-spacing: .03em; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: none; cursor: pointer;
  padding: 9px 18px 12px;
  font-size: .92rem; font-weight: 600; letter-spacing: .06em; white-space: nowrap;
  color: rgba(255, 255, 255, .6);
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: color .15s;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: #8db0ff; }

main { max-width: 860px; margin: 0 auto; padding: 20px 14px 48px; }
.view { display: none; }
.view.active { display: block; }
.section-title {
  font-size: .98rem; font-weight: 700; letter-spacing: .05em;
  margin: 30px 0 12px; padding-left: 10px;
  border-left: 3px solid var(--accent);
  line-height: 1.4;
}

/* ---- hero (next deadline) ---- */
#next-deadline-hero .hero-card {
  background: var(--hero-bg);
  color: #fff;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
#next-deadline-hero .hero-label { font-size: .75rem; opacity: .75; letter-spacing: .08em; }
#next-deadline-hero .hero-main { font-size: 1.1rem; font-weight: 700; margin: 4px 0 2px; }
#next-deadline-hero .hero-days { font-size: 1.7rem; font-weight: 800; }
#next-deadline-hero .hero-days small { font-size: .85rem; font-weight: 600; opacity: .8; }

/* ---- deadline timeline ---- */
.dl-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  margin-bottom: 6px;
  cursor: pointer;
}
.dl-row:hover { border-color: var(--accent); }
.dl-date { min-width: 84px; font-weight: 700; font-size: .9rem; }
.dl-what { flex: 1; font-size: .9rem; }
.dl-what .dl-conf { color: var(--muted); font-size: .8rem; display: block; }
.badge {
  padding: 3px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.badge.due-soon { background: var(--danger-soft); color: var(--danger); }
.badge.due-mid  { background: var(--warn-soft); color: var(--warn); }
.badge.due-far  { background: var(--ok-soft); color: var(--ok); }
.badge.due-past { background: var(--border); color: var(--muted); }

/* ---- filters ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 5px 14px; font-size: .85rem; cursor: pointer;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.toggle { font-size: .83rem; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.access-tag {
  display: inline-block; font-size: .72rem; padding: 2px 8px; border-radius: 6px;
  background: var(--bg); border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
#conf-access-filters, #ev-access-filters { margin-top: -4px; }

/* ---- conference cards ---- */
.conf-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.conf-card:hover { border-color: var(--accent); }
.conf-top { display: flex; align-items: flex-start; gap: 8px; }
.conf-name { font-weight: 700; font-size: .98rem; flex: 1; }
.cat-tag {
  font-size: .7rem; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap;
}
.cat-kenkyukai { background: var(--accent-soft); color: var(--accent); }
.cat-domestic { background: var(--ok-soft); color: var(--ok); }
.cat-international { background: var(--warn-soft); color: var(--warn); }
.conf-meta { color: var(--muted); font-size: .83rem; margin: 4px 0 8px; }
.conf-deadlines { display: flex; flex-wrap: wrap; gap: 6px; }
.conf-dl {
  display: inline-flex; gap: 6px; align-items: center;
  font-size: .78rem; border-radius: 8px; padding: 3px 9px;
  background: var(--bg); border: 1px solid var(--border);
}
.conf-card.is-past { opacity: .6; }
.status-live { color: var(--ok); font-weight: 700; font-size: .8rem; }
details#past-confs { margin-top: 14px; }
details#past-confs summary { cursor: pointer; color: var(--muted); font-size: .88rem; }

/* ---- calendar ---- */
.cal-header { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.cal-header h2 { margin: 0; font-size: 1.15rem; flex: 1; text-align: center; }
.cal-nav {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-size: .9rem;
}
.cal-nav:hover { border-color: var(--accent); }
.today-btn { font-size: .8rem; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .75rem; color: var(--muted); margin-bottom: 6px; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-toggle { margin-bottom: 8px; display: inline-flex; }

#calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: transparent;
}
.cal-dow {
  text-align: center; font-size: .72rem; color: var(--muted); font-weight: 700; padding: 4px 0;
}
.cal-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 88px;
  padding: 4px;
  font-size: .72rem;
  overflow: hidden;
  cursor: pointer;
}
.cal-cell.other-month { opacity: .38; }
.cal-cell.today { border: 2px solid var(--accent); }
.cal-daynum { font-weight: 700; margin-bottom: 2px; }
.cal-cell.sun .cal-daynum { color: var(--danger); }
.cal-cell.sat .cal-daynum { color: var(--accent); }
.cal-pill {
  border-radius: 4px;
  padding: 1px 4px;
  margin-bottom: 2px;
  font-size: .67rem; line-height: 1.3;
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  color: #fff; font-weight: 600;
  word-break: break-all;
}
.cal-pill.dim { opacity: .38; }
.cal-pill.conf-pill {
  background: transparent !important;
  border: 1.5px dashed var(--accent);
  color: var(--accent);
}
.cal-more { color: var(--muted); }
.pill-expo { background: #7c4fd0; }
.pill-misc { background: #5a6b8c; }

/* 今後のイベント・長期開催リストのカテゴリ表示 */
.ev-cat {
  font-size: .68rem; font-weight: 700; color: #fff;
  padding: 2px 8px; border-radius: 6px; white-space: nowrap;
}
.ev-row.row-expo { border-left: 4px solid #7c4fd0; }
.ev-row.row-conference { border-left: 4px solid #d0722a; }
.ev-row.row-seminar { border-left: 4px solid #2b8a5f; }
.ev-row.row-open { border-left: 4px solid #2265c9; }
.ev-row.row-misc { border-left: 4px solid #5a6b8c; }
.pill-conference { background: #d0722a; }
.pill-seminar { background: #2b8a5f; }
.pill-open { background: #2265c9; }

/* ---- month event list / tbd ---- */
.ev-row {
  display: flex; gap: 12px; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer;
  font-size: .88rem;
}
.ev-row:hover { border-color: var(--accent); }
.ev-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.ev-date { min-width: 110px; font-weight: 700; font-size: .82rem; }
.ev-name { flex: 1; }
.ev-venue { color: var(--muted); font-size: .78rem; display: block; }
.empty-note { color: var(--muted); font-size: .85rem; padding: 8px 2px; }
.ev-row.dim { opacity: .42; }
.section-note { font-size: .72rem; font-weight: 400; color: var(--muted); }

/* ---- modal ---- */
#modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 10, 30, .55);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  padding: 16px;
}
#modal-backdrop[hidden] { display: none; }
#modal {
  background: var(--card); color: var(--text);
  border-radius: 16px; max-width: 560px; width: 100%;
  max-height: 82vh; overflow-y: auto;
  padding: 22px 24px; position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}
#modal-close {
  position: absolute; top: 12px; right: 12px;
  border: none; background: var(--bg); color: var(--muted);
  border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: .9rem;
}
#modal h3 { margin: 0 40px 10px 0; font-size: 1.1rem; }
.modal-meta { margin: 0 0 12px; padding: 0; list-style: none; font-size: .88rem; }
.modal-meta li { margin-bottom: 5px; }
.modal-meta .label { color: var(--muted); margin-right: 6px; }
.modal-dl-list { margin: 8px 0 0; padding: 0; list-style: none; }
.modal-dl-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: .88rem;
}
.modal-actions { margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--border); background: var(--bg); color: var(--text);
  padding: 8px 14px; border-radius: 9px; font-size: .85rem; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 600;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

footer { max-width: 860px; margin: 0 auto; padding: 0 14px 30px; color: var(--muted); font-size: .75rem; }

@media (max-width: 560px) {
  .cal-cell { min-height: 58px; }
  .dl-date { min-width: 70px; font-size: .82rem; }
  .ev-date { min-width: 88px; }
}

/* ============ ニュースタブ ============ */
.news-toolbar { margin-top: -4px; }
.news-select, .news-search {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 9px; padding: 7px 10px; font-size: .85rem; font-family: inherit;
}
.news-search { flex: 1; min-width: 160px; }
.news-search:focus, .news-select:focus { outline: none; border-color: var(--accent); }
.news-card {
  display: block; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.news-card:hover { border-color: var(--accent); }
.news-title { font-weight: 700; font-size: .95rem; line-height: 1.5; }
.news-overview {
  color: var(--muted); font-size: .82rem; line-height: 1.6; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.news-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 7px; font-size: .72rem; color: var(--muted);
}
.news-src { font-weight: 700; }
.news-tag {
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 7px; border-radius: 5px; font-weight: 600; font-size: .68rem;
}
.news-tag-ai { background: var(--warn-soft); color: var(--warn); }
.news-disclaimer { display: block; margin-top: 14px; }

/* ============ 政策・委員会タブ ============ */
.gov-row {
  display: flex; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 14px; margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.gov-date { min-width: 128px; font-weight: 700; font-size: .85rem; line-height: 1.5; }
.gov-date .badge { display: inline-block; margin-top: 4px; }
.gov-body { flex: 1; min-width: 0; }
.gov-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gov-committee { font-weight: 700; font-size: .92rem; }
.gov-round { color: var(--muted); font-size: .8rem; font-weight: 600; }
.gov-agenda {
  color: var(--muted); font-size: .8rem; line-height: 1.6; margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gov-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.gov-link {
  font-size: .75rem; font-weight: 700; text-decoration: none;
  color: var(--accent); background: var(--accent-soft);
  padding: 3px 10px; border-radius: 6px;
}
.gov-link:hover { text-decoration: underline; }
.ministry-tag {
  font-size: .68rem; font-weight: 700; color: #fff;
  padding: 2px 8px; border-radius: 5px; white-space: nowrap;
}
.m-cao { background: #2456d6; }
.m-mext { background: #177a45; }
.m-meti { background: #b26a00; }
.m-soumu { background: #6d47c4; }
.m-mlit { background: #1b7898; }
.m-other { background: #5a6b8c; }
#policy-more-wrap { text-align: center; margin: 12px 0; }
.policy-more { font-size: .85rem; }

/* ============ 運営情報タブ ============ */
.about-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 18px; margin-bottom: 6px;
  box-shadow: var(--shadow); font-size: .88rem; line-height: 1.75;
}
.about-card p { margin: 6px 0; }
.about-card ul { margin: 6px 0; padding-left: 20px; }
.about-card li { margin-bottom: 4px; }
.about-card a { color: var(--accent); }
.about-note { color: var(--muted); font-size: .8rem; }

/* ============ フッター ============ */
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--muted); text-decoration: underline; }
.footer-links a:hover { color: var(--text); }

@media (max-width: 560px) {
  .gov-row { flex-direction: column; gap: 4px; }
  .gov-date { min-width: 0; }
  .gov-date .badge { margin-top: 0; margin-left: 6px; }
}

/* ============ 運営情報（正式文書スタイル） ============ */
.about-doc {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 30px clamp(20px, 5vw, 44px) 26px;
  box-shadow: var(--shadow);
  font-size: .88rem; line-height: 1.95; letter-spacing: .02em;
}
.about-doc h2 {
  font-size: 1rem; font-weight: 700; letter-spacing: .06em;
  margin: 34px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.about-doc h2:first-child { margin-top: 0; }
.about-doc p { margin: 10px 0; }
.about-ol { margin: 10px 0; padding-left: 26px; }
.about-ol li { margin-bottom: 8px; }
.about-dl { margin: 10px 0; }
.about-dl dt { font-weight: 700; margin-top: 14px; }
.about-dl dd { margin: 4px 0 0 0; padding-left: 14px; border-left: 2px solid var(--border); }
.about-date { text-align: right; color: var(--muted); font-size: .8rem; margin-top: 30px; }

.tab:focus { outline: none; }
.tab:focus-visible { outline: 2px solid #8db0ff; outline-offset: -2px; border-radius: 6px; }

/* ============ お問い合わせフォーム ============ */
.contact-form { margin: 14px 0 6px; max-width: 560px; }
.cf-label { display: block; font-size: .82rem; font-weight: 700; margin: 14px 0 5px; }
.cf-required { color: var(--danger); font-size: .72rem; font-weight: 700; margin-left: 4px; }
.cf-input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text);
  padding: 9px 11px; font-size: .88rem; font-family: inherit; line-height: 1.6;
}
.cf-input:focus { outline: none; border-color: var(--accent); }
textarea.cf-input { resize: vertical; }
.cf-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.cf-status { font-size: .84rem; color: var(--muted); }
.cf-status.ok { color: var(--ok); font-weight: 700; }
.cf-status.err { color: var(--danger); font-weight: 700; }

/* 出典元へ遷移することを明示する導線（当サイトに留めず原文へ案内する） */
.news-goto {
  margin-left: auto; font-weight: 700; color: var(--accent); white-space: nowrap;
}
.news-goto::after { content: " ↗"; }
