/* ===== Shireru — 公式一次情報プラットフォーム / 行政向け堅実トーン ===== */

:root {
  /* Blues — 公共機関標準に近い落ち着いた青 */
  --blue-700: #144a9c;
  --navy: #163d6b;
  --blue-600: #1a66cc;   /* primary (会員登録) */
  --blue-500: #2f7ae0;
  --blue-100: #d7e6fb;
  --blue-band: #e8f1fc;  /* hero band */
  --blue-50:  #f3f8fe;

  /* Ink / neutrals — わずかに冷たいニュートラル */
  --ink:    #1b1f24;
  --ink-2:  #4b535c;
  --ink-3:  #79828c;
  --line:   #d3d9e0;
  --line-soft: #e7ebf0;
  --label-bg: #f4f6f9;
  --bg:     #ffffff;
  --bg-2:   #f6f8fb;
  --bg-3:   #eef1f5;

  /* Status / category — muted, 落ち着いた彩度 */
  --c-kosodate: #1f8a5b;   /* 子育て */
  --c-bosai:    #c2492f;   /* 防災・安全 */
  --c-kanko:    #2f6fb0;   /* 観光・シティPR */
  --c-kurashi:  #6b6f76;   /* くらし・手続き */
  --c-event:    #7a5ca8;   /* イベント */
  --c-sangyo:   #b07a1f;   /* 産業・経済 */

  --ok:   #1f8a5b;
  --warn: #b07a1f;
  --read: #1a66cc;
  --unread: #b9434f;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-1: 0 1px 2px rgba(20,30,50,.06), 0 1px 3px rgba(20,30,50,.05);
  --shadow-2: 0 4px 16px rgba(20,30,50,.10);
  --shadow-pop: 0 12px 40px rgba(20,30,50,.18);

  --maxw: 1120px;
  --header-h: 76px;

  --sans: "Noto Sans JP", system-ui, sans-serif;
  --serif: "Noto Serif JP", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg-2);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

.app-root { min-height: 100vh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* ===================== Header ===================== */
.hdr {
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 40;
}
.hdr-in {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: flex-start; gap: 0; cursor: pointer; user-select: none; }
.brand-tag { font-size: 11px; color: var(--ink-3); letter-spacing: .02em; line-height: 1.2; margin-bottom: 1px; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 27px; letter-spacing: .04em; color: var(--ink); line-height: 1; }
.brand-name .zen { font-size: 22px; }
.brand-name .en { letter-spacing: .02em; }

.hdr-nav { display: flex; align-items: center; gap: 26px; }
.hdr-link {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ink); font-size: 15px; font-weight: 500;
  padding: 8px 2px; border: none; background: none; position: relative;
}
.hdr-link:hover { color: var(--blue-600); text-decoration: none; }
.hdr-link.active { color: var(--blue-700); }
.hdr-link.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px;
  background: var(--blue-600); border-radius: 3px;
}

.hdr-actions { display: flex; align-items: center; gap: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 700; border: 1.5px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.pill-primary { background: var(--blue-600); color: #fff; }
.pill-primary:hover { background: var(--blue-700); text-decoration: none; }
.pill-outline { background: #fff; color: var(--blue-600); border-color: var(--blue-600); }
.pill-outline:hover { background: var(--blue-50); text-decoration: none; }
.pill-quiet { background: var(--ink-2); color: #fff; }
.pill-quiet:hover { background: var(--ink); text-decoration: none; }

/* user chip when logged in */
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
}
.user-chip .u-name { font-size: 14px; font-weight: 600; line-height: 1.1; }
.user-chip .u-role { font-size: 11px; color: var(--ink-3); line-height: 1.1; }

/* role-mode strip (記者 / 自治体) */
.mode-strip {
  background: var(--blue-700); color: #fff;
}
.mode-strip-in { height: 40px; display: flex; align-items: center; justify-content: space-between; }
.mode-strip .m-left { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.mode-strip .m-tag { background: rgba(255,255,255,.18); padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 12px; }
.mode-nav { display: flex; gap: 4px; }
.mode-nav button, .mode-nav a {
  display: inline-flex; align-items: center; text-decoration: none;
  color: #fff; background: none; border: none; font-size: 13.5px; font-weight: 600;
  padding: 6px 14px; border-radius: 7px; opacity: .82;
}
.mode-nav button:hover, .mode-nav a:hover { background: rgba(255,255,255,.12); opacity: 1; text-decoration: none; }
.mode-nav button.on, .mode-nav a.on { background: rgba(255,255,255,.22); opacity: 1; }

/* ===================== Hero band ===================== */
.hero-band { background: var(--blue-band); border-bottom: 1px solid #d7e3f2; }
.hero-band-in { padding: 42px 0 46px; text-align: center; }
.hero-city { font-size: 40px; font-weight: 700; letter-spacing: .04em; color: var(--ink); margin: 0; }
.hero-sub { margin: 10px 0 0; color: var(--ink-2); font-size: 16px; }

/* breadcrumb */
.crumb { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ink-3); padding: 18px 0 0; }
.crumb a { color: var(--ink-2); }
.crumb .sep { color: var(--ink-3); }
.crumb .cur { color: var(--ink); font-weight: 600; }

/* ===================== Tabs (portal) ===================== */
.tabs { display: flex; gap: 6px; margin: 26px 0 0; align-items: flex-end; position: relative; z-index: 1; }
.tab {
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
  background: #fff; border: 1.5px solid var(--line); border-bottom: none;
  border-radius: 10px 10px 0 0; padding: 14px 16px; font-size: 14px; font-weight: 600;
  color: var(--ink-2); position: relative; top: 1px; transition: background .12s;
}
.tabs .tab { color: var(--ink-2); }
.tabs .tab:hover { color: var(--blue-600); }
.tabs .tab.active { color: var(--blue-700); border-color: var(--line); background: #fff; box-shadow: 0 -3px 0 var(--blue-600) inset; }
.tabs .tab.active .tab-ic { color: var(--blue-600); }
.tab-ic { color: var(--ink-3); display: inline-flex; }
.tab-body { background: #fff; border: 1.5px solid var(--line); border-radius: 0 12px 12px 12px; padding: 30px 32px 36px; }

/* ===================== Generic card / panel ===================== */
.panel { background: #fff; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.section-title { font-size: 20px; font-weight: 700; margin: 0 0 4px; letter-spacing: .02em; }
.section-note { color: var(--ink-2); font-size: 14px; margin: 0 0 18px; }

/* ===================== Tags ===================== */
.tag {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px;
  border-radius: 6px; font-size: 12.5px; font-weight: 700; color: #fff; white-space: nowrap;
}
.tag-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tag-dot::before { content:""; width: 10px; height: 10px; border-radius: 3px; background: var(--c, #999); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.chip.on { background: var(--blue-600); color: #fff; border-color: var(--blue-600); }
.chip:hover:not(.on) { border-color: var(--blue-500); color: var(--blue-600); }

.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.badge-read { background: #e8f0fc; color: var(--read); }
.badge-unread { background: #fbe9eb; color: var(--unread); }
.badge-press { background: #efe9f7; color: var(--c-event); }
.badge-gray { background: var(--bg-3); color: var(--ink-2); }
.badge-ok { background: #e5f3ec; color: var(--ok); }

/* ===================== Buttons ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap;
  height: 48px; padding: 0 24px; border-radius: 10px; font-size: 16px; font-weight: 700;
  border: 1.5px solid transparent; transition: background .12s, border-color .12s, color .12s;
}
.btn-lg { height: 56px; padding: 0 32px; font-size: 17px; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; border-radius: 8px; gap: 7px; }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); text-decoration: none; }
.btn-outline { background: #fff; color: var(--blue-700); border-color: var(--line); }
.btn-outline:hover { border-color: var(--blue-500); color: var(--blue-600); background: var(--blue-50); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-3); }
.btn-saved { background: var(--blue-50); color: var(--blue-700); border-color: var(--blue-100); }
.btn-saved:hover { background: var(--blue-100); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ===================== Tables ===================== */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 14px 18px; text-align: left; vertical-align: top; }
.tbl th { background: var(--label-bg); font-weight: 600; color: var(--ink-2); width: 190px; white-space: nowrap; }
.tbl td { color: var(--ink); }

/* data list table (rows) */
.list { display: flex; flex-direction: column; }
.list-row {
  display: grid; grid-template-columns: 124px 1fr auto; gap: 18px; align-items: center;
  padding: 18px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer;
  transition: background .1s;
}
.list-row:hover { background: var(--blue-50); }
.list-row:first-child { border-top: 1px solid var(--line-soft); }
.list-date { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.list-date .y { display: block; font-size: 12px; color: var(--ink-3); }
.list-main { min-width: 0; }
.list-title { font-size: 16.5px; font-weight: 600; color: var(--ink); margin: 4px 0 0; line-height: 1.5; }
.list-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.list-src { font-size: 13px; color: var(--ink-3); }
.list-right { display: flex; align-items: center; gap: 16px; white-space: nowrap; }
.eye { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ===================== Search ===================== */
.search-card { background: #fff; border-radius: 16px; box-shadow: var(--shadow-2); padding: 8px; display: flex; gap: 8px; align-items: stretch; }
.search-field { flex: 1; display: flex; align-items: center; gap: 12px; padding: 0 18px; }
.search-field input { border: none; outline: none; font-size: 17px; width: 100%; height: 56px; color: var(--ink); background: transparent; }
.search-field input::placeholder { color: var(--ink-3); }
.search-div { width: 1px; background: var(--line-soft); margin: 10px 0; }
.search-sel { display: flex; align-items: center; gap: 10px; padding: 0 16px; }
.search-sel select { border: none; outline: none; font-size: 16px; height: 56px; background: transparent; font-weight: 600; color: var(--ink); cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 13px 15px; font-size: 16px;
  font-family: inherit; color: var(--ink); background: #fff; outline: none; width: 100%;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px var(--blue-100); }
/* 時刻の入力欄は、ブラウザ既定の高さがセレクトより2pxほど低い。
   「1日の収集回数」と横に並ぶため、高さをそろえる */
.scrape-time { min-height: 54px; }
.textarea { resize: vertical; min-height: 110px; line-height: 1.7; }

/* 入力パネル（.panel の display:grid）はグリッド項目の既定が min-width:auto の
   ため、折り返せないチップなど「中身の最小幅」に合わせて列が広がり、画面が
   狭いときにテキストボックスがパネルからはみ出す。項目を縮められるようにする。 */
.panel > .field, .panel > .row { min-width: 0; }

/* 選択チップは通常どおり1行に収める。収まらない幅のときだけ折り返して、
   チップ自身がパネルをはみ出さないようにする。 */
.field .chip { max-width: 100%; height: auto; min-height: 30px; padding: 2px 13px; line-height: 1.25; white-space: normal; }

/* ===================== Calendar ===================== */
.cal { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); background: var(--bg-2); }
.cal-title { font-size: 19px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow { text-align: center; padding: 10px 0; font-size: 13px; font-weight: 700; color: var(--ink-2); border-bottom: 1px solid var(--line-soft); background: var(--label-bg); }
.cal-dow.sun { color: var(--unread); }
.cal-dow.sat { color: var(--blue-600); }
.cal-cell { min-width: 0; min-height: 108px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); padding: 8px; position: relative; overflow: hidden; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell.out { background: var(--bg-2); }   /* 当月外の日のみ淡いグレー */
.cal-cell.today { background: var(--blue-50); }
.cal-num { font-size: 13.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-num { background: var(--blue-600); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.cal-ev { display: block; max-width: 100%; font-size: 12px; padding: 3px 7px; border-radius: 5px; margin-top: 5px; font-weight: 600; line-height: 1.35; cursor: pointer; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===================== Admin console (濃紺サイドバー + ツリー) ===================== */
.admin-shell { display: flex; min-height: 100vh; align-items: stretch; }

/* 左：濃紺サイドバー（全高、上部にブランド） */
.admin-side {
  flex: 0 0 240px; width: 240px; background: var(--navy); color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-side .side-brand { padding: 16px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.10); }
.admin-side .side-brand .brand-tag { color: rgba(255,255,255,.55); font-size: 10px; letter-spacing: .02em; }
.admin-side .side-brand .brand-name { color: #fff; font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: .04em; line-height: 1.1; margin-top: 2px; }
.admin-side .side-brand .brand-name .zen { font-size: 18px; }

.admin-nav { flex: 1; overflow-y: auto; padding: 10px 0 20px; }
.nav-solo, .nav-parent {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 13px 20px; background: none; border: none; color: #fff;
  font-size: 14.5px; font-weight: 700; transition: background .12s; cursor: pointer;
}
.nav-parent { justify-content: space-between; }
.nav-solo:hover, .nav-parent:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav-solo.on { background: #e4eef8; color: var(--navy); }
.nav-parent .np-left { display: flex; align-items: center; gap: 10px; }
.nav-parent .np-ic { color: rgba(255,255,255,.65); transition: transform .15s; }
.nav-parent.open .np-ic { transform: rotate(90deg); }
/* バックエンド(Smarty)は <details>/<summary> で開閉（JS不要） */
.nav-group > summary.nav-parent { list-style: none; }
.nav-group > summary.nav-parent::-webkit-details-marker { display: none; }
.nav-group[open] > summary.nav-parent .np-ic { transform: rotate(90deg); }
.nav-children { display: flex; flex-direction: column; background: rgba(0,0,0,.16); }
.nav-child {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 11px 20px 11px 46px; background: none; border: none;
  color: rgba(255,255,255,.82); font-size: 13.5px; font-weight: 500; transition: background .12s, color .12s; cursor: pointer;
}
.nav-child:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-child.on { background: #e4eef8; color: var(--navy); font-weight: 700; }

/* 右：コンテンツ列（黒トップバー + 明灰コンテンツ） */
.admin-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 56px; background: #1c2531; color: #fff; display: flex; align-items: center;
  justify-content: flex-end; gap: 16px; padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.admin-topbar .tb-user { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.admin-topbar .tb-logout {
  display: inline-flex; align-items: center; gap: 7px; background: #fff; color: #1c2531;
  border: none; border-radius: 7px; padding: 8px 16px; font-size: 13px; font-weight: 700;
}
.admin-topbar .tb-logout:hover { background: var(--bg-3); }
.admin-content { flex: 1; min-width: 0; background: #eef1f4; }
.admin-wrap { width: 100%; margin: 0; padding: 28px 36px 60px; }
.admin-wrap .stat-grid { grid-template-columns: repeat(4, 1fr); }

/* 管理テーブル（濃色ヘッダー） */
/* 横に長い一覧は、画面を狭めても崩れないよう枠の中で横スクロールさせる */
.tbl-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.tbl-scroll > table { min-width: 880px; }

.mtbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-1); }
.mtbl thead th { background: #3a4250; color: #fff; text-align: left; font-size: 13.5px; font-weight: 700; padding: 14px 20px; white-space: nowrap; }
.mtbl tbody td { padding: 15px 20px; border-bottom: 1px solid var(--line-soft); font-size: 14.5px; vertical-align: middle; }
.mtbl tbody tr:last-child td { border-bottom: none; }
.mtbl tbody tr:hover td { background: var(--blue-50); }
.btn-del { background: #5b6472; color: #fff; border: none; border-radius: 999px; padding: 8px 20px; font-size: 13px; font-weight: 700; white-space: nowrap; display: inline-block; }
.btn-del:hover { background: #454d59; }

@media (max-width: 1100px) {
  .admin-side { flex-basis: 210px; width: 210px; }
  .admin-wrap { padding: 22px 22px 48px; }
}

/* ===================== Admin console: mobile (スマホ) ===================== */
.nav-toggle-cb { display: none; }
.nav-hamburger { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 900px) {
  .admin-shell { display: block; }
  .admin-side {
    position: fixed; top: 0; left: 0; height: 100vh; width: 260px; flex-basis: 260px;
    z-index: 60; transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 8px 0 24px rgba(0,0,0,.18);
  }
  .nav-toggle-cb:checked ~ .admin-shell .admin-side { transform: translateX(0); }
  .nav-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(15,20,30,.42); z-index: 55;
    opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .nav-toggle-cb:checked ~ .nav-backdrop { opacity: 1; pointer-events: auto; }
  .admin-col { width: 100%; }
  .nav-hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px; color: #fff; cursor: pointer; margin-right: auto;
  }
  .nav-hamburger:hover { background: rgba(255,255,255,.12); }
  .admin-topbar { justify-content: space-between; padding: 0 14px; gap: 10px; }
  .admin-topbar .tb-user { font-size: 12.5px; }
  .admin-wrap { padding: 16px 14px 40px; }
  .admin-wrap h1.section-title { font-size: 21px !important; }
  .month-picker .mp-panel { width: min(88vw, 300px); right: -8px; }
}

@media (max-width: 560px) {
  /* ユーザー名は残り幅いっぱいまで使い、入り切らない分だけ「…」にする。
     ボタン2つは縮めずに枠内へ収める（以前は固定幅で名前が途中で切れ、ボタンがはみ出していた）。 */
  .admin-topbar { padding: 0 10px; gap: 8px; }
  .admin-topbar .tb-user {
    display: block; flex: 1 1 auto; min-width: 0; max-width: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px;
  }
  .admin-topbar .tb-logout {
    flex: 0 0 auto; padding: 7px 10px; font-size: 12px; gap: 4px; white-space: nowrap;
  }
}



/* タイル型 日本地図 */
.jpmap-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.jpmap { display: grid; grid-template-columns: repeat(11, 40px); grid-auto-rows: 40px; gap: 4px; }
.jp-tile {
  border: 1px solid var(--line); background: #fff; border-radius: 7px; color: var(--ink-2);
  font-size: 9.5px; font-weight: 700; letter-spacing: -.03em; cursor: pointer; padding: 0 2px;
  display: grid; place-items: center; transition: background .1s, color .1s, border-color .1s, transform .08s;
}
.jp-tile:hover { border-color: var(--blue-500); color: var(--blue-700); transform: translateY(-1px); }
.jp-tile.live { background: var(--blue-band); border-color: var(--blue-100); color: var(--blue-700); }
.jp-tile.live:hover { background: var(--blue-100); }
.jp-tile.on { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }
.jpmap-legend { display: flex; gap: 18px; font-size: 12.5px; color: var(--ink-2); }
.jpmap-legend .lg { display: inline-flex; align-items: center; gap: 7px; }
.jpmap-legend .sw { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); background: #fff; display: inline-block; }
.jpmap-legend .sw.live { background: var(--blue-500); border-color: var(--blue-500); }

/* 市区町村タイル（地図ドリルダウン） */
.muni-tile { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s, transform .08s; }
.muni-tile:hover:not(:disabled) { border-color: var(--blue-500); background: var(--blue-50); transform: translateY(-1px); }
.muni-tile:disabled { cursor: not-allowed; color: var(--ink-3); background: var(--bg-2); }
.jpmap-panel > summary { list-style: none; }
.jpmap-panel > summary::-webkit-details-marker { display: none; }

/* 自前SVG（shireru_assets/maps/）による日本地図 */
/* 幅・高さの両方に上限をかける。--ar（横/縦比）はSVG側が持っている。
   片方だけで制限すると、縦長の県（長野など）が画面外まで伸び、
   横長の県（北海道・東京など）は小さいままになるため。 */
.geomap-svg {
  --map-max-w: 900px; --map-max-h: 900px;
  display: block; width: 100%; height: auto; margin: 0 auto;
  max-width: min(var(--map-max-w), calc(var(--map-max-h) * var(--ar, 1)));
}
.geo-pref, .geo-muni { fill: var(--bg-3); stroke: #fff; stroke-width: .7; stroke-linejoin: round; transition: fill .12s; }
.geo-pref { cursor: pointer; }
.geo-pref.live, .geo-muni.live { fill: var(--blue-500); cursor: pointer; }
.geo-pref:hover, .geo-pref.live:hover, .geo-muni.live:hover { fill: var(--blue-700); }
.geo-muni.sel { fill: var(--blue-700); }
.geo-pref.hit, .geo-muni.hit { fill: var(--warn); }
.geo-labels { pointer-events: none; }
.geo-label { font-size: 12.5px; font-weight: 600; fill: var(--ink-2); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.geo-label.live { fill: var(--blue-700); font-weight: 700; }
.geo-label.soon { fill: var(--ink-3); font-weight: 500; }
.geo-label.hide { display: none; }

/* リリース詳細の発信元（クリックでその自治体のページへ） */
.release-issuer { border-radius: 10px; transition: background .12s; }
.release-issuer:hover { background: var(--bg-2); }

/* 県庁（都道府県庁の所在地） */
.geomap-stage { position: relative; }
.geo-capital-pin .pin-body { fill: var(--c-bosai); }
.geo-capital-pin .pin-hole { fill: #fff; }
.geomap-capital {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 10px 9px; background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow-1); text-decoration: none; color: inherit; z-index: 2;
}
a.geomap-capital:hover { border-color: var(--blue-500); box-shadow: var(--shadow-2); }
.geomap-capital.soon { opacity: .85; }
.geomap-capital .cap-name { font-size: 12.5px; font-weight: 700; color: var(--blue-700); }
.geomap-capital.soon .cap-name { color: var(--ink-2); }
.geomap-capital .cap-soon { font-size: 9.5px; color: var(--ink-3); background: var(--bg-3); border-radius: 4px; padding: 1px 5px; }
.geomap-mini .mini-shape path { fill: var(--bg-3); stroke: #fff; stroke-width: .7; }
.geo-inset rect { fill: none; stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 3; }
.geo-inset-cap { font-size: 13px; font-weight: 700; fill: var(--ink-3); }
.geomap-loading, .geomap-error { padding: 60px 20px; text-align: center; color: var(--ink-2); font-size: 13.5px; }
.geomap-outliers { margin-top: 12px; padding: 12px 14px; background: var(--bg-2); border-radius: 10px; }
.geomap-outliers .lbl { font-size: 12px; color: var(--ink-2); font-weight: 700; margin-bottom: 8px; }
.geomap-outliers .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.geomap-outliers .chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: default; }
.geomap-outliers .chip.live { cursor: pointer; border-color: var(--blue-100); color: var(--blue-700); background: var(--blue-50); }
.geomap-outliers .chip.live:hover { background: var(--blue-100); }
.geomap-outliers .chip.sel { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* 地図の下に出す「公開中の自治体」チップ（ラベルが重なって地図に出ない分の受け皿） */
.jpmap-livelist:empty { display: none; }
.jpmap-livelist { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-soft); text-align: left; }
.jpmap-livelist .ttl { font-size: 12.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; margin-bottom: 8px; }
.jpmap-livelist .chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mchip { display: inline-flex; align-items: center; border: 1px solid var(--blue-100); background: var(--blue-50); color: var(--blue-700); border-radius: 999px; padding: 5px 13px; font-size: 13px; font-weight: 700; cursor: pointer; }
.mchip:hover { background: var(--blue-100); }
.mchip.sel { background: var(--blue-600); border-color: var(--blue-600); color: #fff; }

/* 自治体名フリーワード検索の候補 */
.search-shell { position: relative; }
.muni-sugg { display: none; position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-2); overflow: hidden; z-index: 40; text-align: left; }
.muni-sugg.open { display: block; }
.muni-sugg .sugg-head { padding: 9px 16px; font-size: 12px; font-weight: 700; color: var(--ink-3); background: var(--label-bg); border-bottom: 1px solid var(--line-soft); letter-spacing: .04em; }
.muni-sugg .sugg-list { max-height: 328px; overflow-y: auto; }
.muni-sugg .sugg-item { display: flex; align-items: center; gap: 10px; padding: 11px 16px; cursor: pointer; border-bottom: 1px solid var(--line-soft); }
.muni-sugg .sugg-item:last-child { border-bottom: none; }
.muni-sugg .sugg-item:hover, .muni-sugg .sugg-item.cur { background: var(--blue-50); }
.muni-sugg .sugg-item .nm { font-weight: 700; font-size: 15px; }
.muni-sugg .sugg-item .nm mark { background: #fdf0c3; color: inherit; padding: 0 1px; border-radius: 2px; }
.muni-sugg .sugg-item .pf { font-size: 12.5px; color: var(--ink-3); }
.muni-sugg .sugg-item .st { margin-left: auto; font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.muni-sugg .sugg-item .st.live { background: #e6f3ec; color: var(--ok); }
.muni-sugg .sugg-item .st.soon { background: var(--bg-3); color: var(--ink-3); }
.muni-sugg .sugg-empty { padding: 18px 16px; color: var(--ink-3); font-size: 14px; }

/* 地域選択ツリー（カレンダーの地域絞り込み） */
.area-search { position: relative; margin-bottom: 10px; }
.area-search svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.area-search input { width: 100%; padding: 8px 10px 8px 30px; border: 1px solid var(--line); border-radius: 8px; font-size: 12.5px; background: var(--bg-2); }
.area-tree { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
/* 地方（エリア）＞ 都道府県 ＞ 市区町村 の3階層 */
.region-row { display: flex; align-items: center; gap: 6px; padding: 7px 4px; border-radius: 6px; cursor: pointer; }
.region-row:hover { background: var(--bg-2); }
.region-name { flex: 1; font-size: 13px; font-weight: 700; color: var(--ink); }
.region-name.dim { color: var(--ink-3); font-weight: 600; }
.region-block.open > .region-row .area-toggle { transform: rotate(90deg); }
.region-prefs { display: none; flex-direction: column; gap: 1px; padding-left: 18px; margin-bottom: 2px; }
.region-block.open > .region-prefs { display: flex; }
.pref-row { display: flex; align-items: center; gap: 6px; padding: 6px 4px; border-radius: 6px; cursor: pointer; }
.pref-row:hover { background: var(--bg-2); }
.area-toggle { width: 16px; height: 16px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 5px; color: var(--ink-3); transition: transform .15s; }
.pref-block.open .area-toggle { transform: rotate(90deg); }
.area-toggle.leaf { visibility: hidden; }
.pref-name { font-weight: 600; }
.pref-name.dim { color: var(--ink-3); font-weight: 500; }
.area-count-badge { font-size: 10px; font-weight: 700; color: var(--blue-700); background: var(--blue-100); border-radius: 999px; padding: 1px 7px; }
.area-munis { display: none; flex-direction: column; gap: 1px; padding-left: 24px; margin-bottom: 2px; }
.pref-block.open .area-munis { display: flex; }
.muni-row { display: flex; align-items: center; gap: 7px; padding: 5px 4px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.muni-row:hover { background: var(--bg-2); }
.muni-row .name { flex: 1; color: var(--ink-2); }
.muni-row .name.live { color: var(--ink); font-weight: 600; }
.muni-row .badge-soon { font-size: 9.5px; color: var(--ink-3); background: var(--bg-3); border-radius: 4px; padding: 1px 5px; }
/* 県庁の行：県の行（地域）と区別するため、枠付きの「県」「都」などの印を付け、下に区切り線を引く */
.muni-row.office { border-bottom: 1px dashed var(--line); border-radius: 6px 6px 0 0; margin-bottom: 3px; padding-bottom: 7px; }
.muni-row .office-mark { width: 18px; height: 18px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700; line-height: 1; color: var(--blue-700); border: 1.5px solid var(--blue-700); border-radius: 4px; }
/* 地図に表示中の都道府県 */
.pref-block.current > .pref-row { background: var(--blue-100); }
.pref-block.current > .pref-row .pref-name { color: var(--blue-700); }
/* 地域の絞り込み・一括既読のチェックボックスは、標準（約13px）だと見つけにくいので大きくする */
.pref-row input[type=checkbox], .muni-row input[type=checkbox], .bulk-cb, #bulkAll { width: 20px; height: 20px; flex: 0 0 auto; margin: 0; cursor: pointer; }
.geomap-tooltip { position: fixed; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 5px 9px; border-radius: 6px; opacity: 0; transition: opacity .1s; z-index: 200; }
.jpmap-panel { text-align: center; }

/* uploader (企業：添付アップロード) */
.uploader {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px;
  border: 1.5px dashed var(--line); border-radius: 12px; background: var(--bg-2);
  transition: border-color .12s, background .12s;
}
.uploader:hover { border-color: var(--blue-500); background: var(--blue-50); }
/* ドラッグ中は、ここに落とせることが分かるよう枠を強調する */
.uploader.on { border-color: var(--blue-600); background: var(--blue-50); box-shadow: 0 0 0 3px var(--blue-100); }
.uploader .up-ic { width: 44px; height: 44px; border-radius: 10px; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; color: var(--blue-600); flex: 0 0 auto; }

/* 入力方法の選択カード */
.entry-card { padding: 26px; text-align: left; border: 1.5px solid var(--line); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .08s; }
.entry-card:hover { border-color: var(--blue-500); box-shadow: var(--shadow-2); transform: translateY(-2px); }
.entry-ic { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; }

/* AI読み取り中 */
.ai-reading { display: flex; align-items: center; gap: 16px; background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 12px; padding: 18px 20px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--blue-100); border-top-color: var(--blue-600); animation: spin .8s linear infinite; flex: 0 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Stats ===================== */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-grid-5 { grid-template-columns: repeat(5, 1fr); }
.stat { background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; padding: 20px 22px; box-shadow: var(--shadow-1); }
.stat .s-label { font-size: 13.5px; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.stat .s-val { font-size: 34px; font-weight: 800; letter-spacing: .01em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat .s-val .u { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-left: 4px; }
.stat .s-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }
.stat .s-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; }

/* progress */
.prog { height: 8px; border-radius: 999px; background: var(--bg-3); overflow: hidden; }
.prog > span { display: block; height: 100%; background: var(--blue-600); border-radius: 999px; }

/* ===================== Admin table ===================== */
.atbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.atbl th { text-align: left; font-size: 12.5px; font-weight: 700; color: var(--ink-2); padding: 12px 16px; border-bottom: 2px solid var(--line); background: var(--label-bg); white-space: nowrap; }
.atbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.atbl tr:hover td { background: var(--blue-50); }
.th-sort { cursor: pointer; user-select: none; white-space: nowrap; }
.th-sort:hover { color: var(--blue-700); }
.th-arrow { color: var(--blue-600); font-size: 11px; }
.reporter-cell { display: flex; align-items: center; gap: 11px; }
.reporter-cell .r-name { font-weight: 600; white-space: nowrap; }
.reporter-cell .r-org { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* ===================== Modal ===================== */
.overlay { position: fixed; inset: 0; background: rgba(18,26,40,.45); backdrop-filter: blur(2px); z-index: 100; display: grid; place-items: center; padding: 24px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: #fff; border-radius: 16px; box-shadow: var(--shadow-pop); width: 100%; max-width: 520px; max-height: 90vh; overflow: auto; animation: pop .18s cubic-bezier(.2,.9,.3,1.1); }
.modal.wide { max-width: 720px; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 24px 28px 0; }
.modal-title { font-size: 22px; font-weight: 700; margin: 0; }
.modal-body { padding: 20px 28px 8px; }
.modal-foot { padding: 18px 28px 26px; display: flex; gap: 12px; }
.modal-close { position: absolute; }

/* Googleカレンダー風「他N件」ポップアップ */
.cal-more { font-size: 11px; color: var(--blue-700); font-weight: 700; cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.cal-more:hover { background: var(--blue-50); }
.daypop-overlay { position: fixed; inset: 0; background: rgba(18,26,40,.45); backdrop-filter: blur(2px); z-index: 200; display: grid; place-items: center; padding: 24px; animation: fade .15s ease; }
.daypop { background: #fff; border-radius: 14px; box-shadow: var(--shadow-pop); width: 100%; max-width: 420px; max-height: 78vh; overflow: hidden; display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.2,.9,.3,1.1); }
.daypop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); font-weight: 700; font-size: 15px; flex: 0 0 auto; }
.daypop-close { border: none; background: none; font-size: 22px; line-height: 1; color: var(--ink-3); cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.daypop-close:hover { background: var(--bg-2); }
.daypop-body { padding: 10px 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.daypop-body .cal-ev { font-size: 13px; padding: 6px 10px; border-radius: 6px; }

/* drawer (reporter list) */
.drawer-wrap { position: fixed; inset: 0; z-index: 90; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(18,26,40,.4); animation: fade .15s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 560px; max-width: 92vw; background: var(--bg-2); box-shadow: -12px 0 40px rgba(20,30,50,.2); animation: slide .22s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; }
@keyframes slide { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { padding: 22px 26px; background: #fff; border-bottom: 1px solid var(--line-soft); display: flex; align-items: flex-start; justify-content: space-between; }
.drawer-body { padding: 22px 26px; overflow: auto; flex: 1; }

.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--bg-3); color: var(--ink); }

/* ===================== Footer ===================== */
.ftr { background: var(--bg-3); border-top: 1px solid var(--line-soft); margin-top: auto; }
.ftr-in { padding: 32px 0; text-align: center; }
.ftr-link { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; font-size: 14.5px; }
.ftr-copy { margin-top: 14px; font-size: 12.5px; color: var(--ink-3); }

/* utilities */
.row { display: flex; align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; } .gap16 { gap: 16px; } .gap24 { gap: 24px; }
.between { justify-content: space-between; }
.wrapf { flex-wrap: wrap; }
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px;margin-bottom:24px;}.mt32{margin-top:32px}.mt40{margin-top:40px}
.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}
.muted { color: var(--ink-2); }
.muted3 { color: var(--ink-3); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.divider { height: 1px; background: var(--line-soft); margin: 24px 0; }
.page-pad { padding: 36px 0 64px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.tnum { font-variant-numeric: tabular-nums; }

/* helper notice (やさしい案内) */
.notice {
  display: flex; gap: 13px; align-items: flex-start;
  background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: 12px;
  padding: 16px 18px; color: var(--ink-2); font-size: 14.5px; line-height: 1.65;
}
.notice .n-ic { color: var(--blue-600); flex: 0 0 auto; margin-top: 1px; }
.notice strong { color: var(--ink); }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }

@media (max-width: 860px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hdr-nav { display: none; }
  .hero-city { font-size: 30px; }
}

@media (max-width: 700px) {
  .stat-grid, .stat-grid-5 { grid-template-columns: repeat(2, 1fr) !important; }
  .mtbl, .atbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .mtbl thead, .atbl thead, .mtbl tbody, .atbl tbody, .mtbl tr, .atbl tr { display: table; width: 100%; table-layout: auto; }
  .reporter-cell .r-name, .reporter-cell .r-org { white-space: normal; }
  .mode-strip-in { flex-wrap: wrap; height: auto; padding: 8px 0; gap: 8px; }
  .mode-nav { flex-wrap: wrap; }
  .side-panel-grid, [style*="grid-template-columns:1.4fr 1fr"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
  .stat-grid, .stat-grid-5 { grid-template-columns: 1fr !important; }
}

/* ===================== 公開サイト / 記者・企業画面：スマホ対応 ===================== */
.hdr-nav-toggle-cb { display: none; }
.hdr-hamburger { display: none; }

@media (max-width: 860px) {
  .wrap { padding: 0 16px; }
  .hero-band-in { padding: 28px 0 32px; }
  .hero-city { font-size: 26px; }
  .hero-sub { font-size: 14px; }
  .page-pad { padding: 22px 0 48px; }

  .hdr-hamburger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 8px; color: var(--ink-2); cursor: pointer;
  }
  .hdr-hamburger:hover { background: var(--bg-3); }
  .hdr-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff;
    border-bottom: 1px solid var(--line); flex-direction: column; padding: 6px 16px 12px; box-shadow: 0 8px 20px rgba(0,0,0,.08); z-index: 39;
  }
  .hdr-nav .hdr-link { padding: 12px 4px; border-bottom: 1px solid var(--line-soft); }
  .hdr-nav-toggle-cb:checked ~ .hdr-nav { display: flex; }
  .hdr-in { position: relative; flex-wrap: wrap; }
  .user-chip .u-role { display: none; }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 2px; }
  .tabs .tab { white-space: nowrap; flex: 0 0 auto; }

  .two-col { grid-template-columns: 1fr !important; }
  .two-col.two-col-narrow { grid-template-columns: 1fr !important; }
  .entry-card-grid { grid-template-columns: 1fr !important; }

  .jpmap { grid-template-columns: repeat(11, 26px) !important; grid-auto-rows: 26px !important; gap: 3px !important; }
  .jp-tile { font-size: 9px !important; }
  .jpmap-wrap { max-width: 100%; overflow-x: auto; }

  .cal-cell { min-height: 74px; padding: 5px; }
  .cal-ev { font-size: 10.5px; padding: 2px 5px; }
  .cal-title { font-size: 16px; }
}

@media (max-width: 480px) {
  .muni-card-grid { grid-template-columns: 1fr !important; }
  .hero-city { font-size: 22px; }
  .cal-cell { min-height: 60px; }
  .cal-dow { font-size: 11px; padding: 6px 0; }
}


