/* 報告書サイトと同じトンマナ。<body data-theme="blue|red"> で色を切り替える */
:root {
  --bg:#eef5fc; --card:#ffffff; --text:#1d2b3a; --muted:#5f7184; --line:#d8e6f5;
  --accent:#2f80d1; --accent-strong:#1f63ad; --accent-soft:#dcebfa;
  --shadow:rgba(31,99,173,.08); --shadow-strong:rgba(31,99,173,.14);
  --line-green:#06C755;
}
body[data-theme="red"] {
  --bg:#fdf1f1; --text:#3a1f1f; --muted:#8a6666; --line:#f5dcdc;
  --accent:#e0393e; --accent-strong:#bf242a; --accent-soft:#fde2e2;
  --shadow:rgba(191,36,42,.07); --shadow-strong:rgba(191,36,42,.13);
}

* { box-sizing:border-box; }
html, body { margin:0; }
body { background:var(--bg); color:var(--text);
       font-family:"Zen Maru Gothic","Hiragino Maru Gothic ProN","Hiragino Sans",system-ui,sans-serif;
       font-weight:500; line-height:1.6; -webkit-font-smoothing:antialiased; }
a { color:inherit; text-decoration:none; }
button { font:inherit; border:0; border-radius:10px; padding:8px 16px; cursor:pointer;
         background:var(--accent); color:#fff; font-weight:700; white-space:nowrap; }
button:hover { background:var(--accent-strong); }
button.ghost { background:var(--card); color:var(--muted); border:1px solid var(--line); font-weight:500; }
button.ghost:hover { background:var(--accent-soft); }
button:disabled { opacity:.5; cursor:default; }

/* ロゴの7色を使った帯 */
.rainbow { height:5px; background:linear-gradient(90deg,
  #d7141a 0 14.3%, #e8920f 0 28.6%, #f2e520 0 42.9%, #1f9446 0 57.1%,
  #1565ad 0 71.4%, #1e2a78 0 85.7%, #8a1a7e 0); }

/* ---- ヘッダー ---- */
.top { position:sticky; top:0; z-index:5; }
header { background:var(--card); border-bottom:3px solid var(--accent); padding:10px 16px;
         display:flex; gap:10px; align-items:center; }
header .logo-link { display:block; flex:none; }
header .logo { height:34px; width:auto; display:block; }
header h1 { font-size:18px; margin:0; flex:1; letter-spacing:.04em; white-space:nowrap;
            min-width:0; overflow:hidden; text-overflow:ellipsis; }
h1 span { color:var(--accent); }
main { max-width:820px; margin:0 auto; padding:16px 16px 60px; }

/* エリア切り替えタブ */
.tabs { display:flex; gap:6px; margin-bottom:14px; border-bottom:2px solid var(--line);
        overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar { display:none; }
.tabs a { color:var(--muted); border-radius:10px 10px 0 0; padding:8px 18px; font-weight:700;
          border-bottom:3px solid transparent; margin-bottom:-2px; white-space:nowrap; flex:none; }
.tabs a:hover { background:var(--accent-soft); }
.tabs a.active { color:var(--accent-strong); border-bottom-color:var(--accent); }

.view-note { color:var(--muted); font-size:13px; margin:0 0 14px; padding:10px 14px;
             background:var(--card); border-radius:10px; border:1px solid var(--line); white-space:pre-line; }

/* ---- セクション見出し ---- */
.section-title { display:flex; align-items:center; gap:10px; margin:26px 2px 10px;
                 font-size:16px; letter-spacing:.04em; color:var(--accent-strong); }
.section-title::before { content:""; width:5px; height:1.2em; border-radius:3px; background:var(--accent); flex:none; }
.section-title::after { content:""; flex:1; height:1px; background:var(--line); }
main > .section-title:first-child, .view-note + .section-title, .tabs + .section-title { margin-top:6px; }

/* ---- リンクのカード ---- */
.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(250px, 1fr)); gap:10px; }
.grid + .grid { margin-top:10px; }
.item { background:var(--card); border-radius:14px; padding:14px 16px; box-shadow:0 2px 8px var(--shadow);
        border-left:4px solid var(--accent); display:flex; align-items:center; gap:12px; min-height:64px;
        transition:background .15s, transform .15s, box-shadow .15s; }
a.item:hover { background:var(--accent-soft); transform:translateY(-1px); box-shadow:0 4px 12px var(--shadow-strong); }
.item-label { flex:1; min-width:0; display:flex; flex-direction:column; }
.item-title { font-weight:700; font-size:15px; line-height:1.45; white-space:pre-line; word-break:break-word; }
.item-sub { color:var(--muted); font-size:12px; white-space:pre-line; }
.arrow { color:var(--accent); font-weight:700; flex:none; }
.tag { font-size:11px; padding:1px 9px; border-radius:99px; background:var(--accent-soft);
       color:var(--accent-strong); font-weight:700; flex:none; }

/* リンクなし（準備中） */
div.item { border-left-color:var(--line); }
div.item .item-title { color:var(--muted); }
div.item .tag { background:#eef0f3; color:var(--muted); }

/* LINE */
.item.line { border-left-color:var(--line-green); }
.item.line .tag { background:#e2f8ea; color:#05a346; }
.item.line .arrow { color:var(--line-green); }

/* 画像カード */
.item.card { flex-direction:column; align-items:stretch; padding:0; gap:0; overflow:hidden; }
.card-img { width:100%; aspect-ratio:var(--ratio, 16 / 9); object-fit:cover; display:block; background:var(--accent-soft); }
.card-foot { display:flex; align-items:center; gap:12px; padding:12px 16px 14px; }

/* 文章 */
.text { grid-column:1 / -1; color:var(--muted); font-size:14px; margin:4px 2px; white-space:pre-line; }

/* ---- 開閉 ---- */
.fold { grid-column:1 / -1; background:var(--card); border:1px solid var(--line); border-radius:14px;
        box-shadow:0 2px 8px var(--shadow); }
.fold summary { cursor:pointer; padding:14px 16px; font-weight:700; color:var(--accent-strong);
                list-style:none; display:flex; align-items:center; gap:10px; }
.fold summary::-webkit-details-marker { display:none; }
.fold summary .item-label { color:var(--accent-strong); }
.fold summary .item-sub { color:var(--muted); }
.fold summary::after { content:"▼ 開く"; font-size:12px; font-weight:500; color:var(--muted); flex:none; }
.fold[open] summary::after { content:"▲ 閉じる"; }
.fold summary:hover { background:var(--accent-soft); border-radius:14px; }
.fold[open] summary:hover { border-radius:14px 14px 0 0; }
.fold-body { padding:12px; border-top:1px dashed var(--line); }
.fold-body .item { box-shadow:none; border:1px solid var(--line); border-left:4px solid var(--accent); }
.fold-body .item.line { border-left-color:var(--line-green); }
.fold-body .item:not(.card) { align-self:start; }

/* ---- TOP のエリアカード ---- */
.areas { display:grid; grid-template-columns:repeat(auto-fill, minmax(260px, 1fr)); gap:14px; }
.area { background:var(--card); border-radius:14px; overflow:hidden; box-shadow:0 2px 8px var(--shadow);
        border-left:4px solid var(--accent); transition:transform .15s, box-shadow .15s; display:block; }
.area:hover { transform:translateY(-2px); box-shadow:0 6px 16px var(--shadow-strong); }
.area-img { width:100%; aspect-ratio:var(--ratio, 3 / 2); object-fit:cover; display:block; background:var(--accent-soft); }
.area-foot { display:flex; align-items:center; gap:8px; padding:12px 16px 14px; }
.area-name { font-size:20px; font-weight:700; }
.area-sub { color:var(--muted); font-size:13px; flex:1; }

/* ---- ログイン ---- */
.login { max-width:360px; margin:12vh auto 0; background:var(--card); padding:32px 28px;
         border-radius:18px; box-shadow:0 6px 24px var(--shadow-strong); text-align:center; }
.login .logo { width:220px; max-width:80%; height:auto; margin:0 auto 10px; display:block; }
.login h1 { font-size:22px; margin:0 0 4px; }
.login p { color:var(--muted); font-size:13px; margin:0 0 18px; }
.login input { font:inherit; color:var(--text); width:100%; padding:9px 12px; border:1px solid var(--line);
               border-radius:10px; background:#fff; }
.login input:focus { outline:2px solid var(--accent-soft); border-color:var(--accent); }
.login button { width:100%; margin-top:12px; padding:10px; }
.error { color:#d93a2b; font-size:14px; min-height:1.4em; margin-top:8px; }

.loading { text-align:center; color:var(--muted); padding:60px 0; }
.spinner { width:28px; height:28px; margin:0 auto 10px; border-radius:50%;
           border:3px solid var(--accent-soft); border-top-color:var(--accent); animation:spin 1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

@media (max-width:600px) {
  header { padding:8px 12px; gap:8px; }
  header h1 { font-size:15px; }
  header .logo { height:26px; }
  header .ghost { padding:6px 10px; font-size:13px; }
  main { padding:12px 12px 48px; }
  .grid, .areas { grid-template-columns:1fr; }
  .tabs a { padding:8px 14px; }
}
