/* =========================================================
   通告 — 静的サイト
   ========================================================= */

:root {
  --bg:      #080a0d;
  --panel:   #101419;
  --panel-2: #0d1116;
  --line:    #212831;
  --line-2:  #2e3844;
  --fg:      #dbe2ea;
  --fg-2:    #949fac;
  --muted:   #5b6572;
  --green:   #4ade80;
  --blue:    #38bdf8;
  --amber:   #fbbf24;
  --red:     #f87171;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP",
          "Yu Gothic UI", "Meiryo", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 880px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--sans); font-size: 15px; line-height: 1.9;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; color: var(--fg-2); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.wrap.wide { max-width: 1180px; }

/* ---------- header ---------- */
.hdr { border-bottom: 1px solid var(--line); background: var(--panel); position: sticky; top: 0; z-index: 20; }
.hdr .wrap { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 11px; padding-bottom: 11px; }
.brand { color: var(--green); font-family: var(--mono); font-size: 11.5px; font-weight: 700; letter-spacing: .1em; display: flex; align-items: center; gap: 7px; }
.brand:hover { text-decoration: none; }
.hdr nav { display: flex; gap: 15px; margin-left: auto; flex-wrap: wrap; font-family: var(--mono); }
.hdr nav a { color: var(--fg-2); font-size: 12px; }
.hdr nav a:hover { color: var(--fg); text-decoration: none; }
.hdr nav a.on { color: var(--green); }

.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dot.live { background: var(--red); animation: pulse 1.5s infinite; }
.dot.red { background: var(--red); }
.dot.amber { background: var(--amber); }
@keyframes pulse { 50% { opacity: .2; } }

/* ---------- layout ---------- */
main { padding-top: 26px; padding-bottom: 60px; }

.ascii { color: var(--line-2); font-family: var(--mono); font-size: 10.5px; line-height: 1.4; margin: 0 0 18px; white-space: pre; overflow-x: auto; }

h1 { font-size: 21px; line-height: 1.55; margin: 0 0 8px; letter-spacing: -.01em; }
.sub { color: var(--muted); font-size: 12.5px; line-height: 1.85; margin: 0 0 26px; }

h2 { font-family: var(--mono); font-size: 11.5px; color: var(--fg-2); letter-spacing: .14em; margin: 32px 0 13px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

p { margin: 0 0 13px; }
strong, b { color: #f0f5fa; font-weight: 700; }

/* ---------- status / stats ---------- */
.status { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.status li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.status li .dot { margin-top: 9px; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.stat { border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px; background: var(--panel); }
.stat b { display: block; font-size: 19px; color: #f0f5fa; font-family: var(--mono); letter-spacing: -.02em; }
.stat span { font-size: 11.5px; color: var(--muted); }

/* ---------- boxes ---------- */
.box { border: 1px solid var(--line); border-left: 2px solid var(--line-2); border-radius: 6px; padding: 14px 16px; background: var(--panel); margin: 0 0 15px; }
.box p:last-child { margin-bottom: 0; }
.box.amber { border-left-color: var(--amber); background: #16130a; }
.box.red { border-left-color: var(--red); background: #170f0f; }

/* ---------- timeline ---------- */
.tl { border-left: 1px solid var(--line); margin: 0; padding: 0 0 0 18px; list-style: none; }
.tl li { position: relative; padding: 0 0 20px; }
.tl li::before { content: ""; position: absolute; left: -23px; top: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.tl li.hot::before { background: var(--red); box-shadow: 0 0 0 3px rgba(248,113,113,.18); }
.tl time { display: block; color: var(--muted); font-family: var(--mono); font-size: 11.5px; }
.tl p { margin: 3px 0 0; }
.tl .note { color: var(--fg-2); font-size: 13px; }
.tl .link { font-size: 12.5px; margin-top: 5px; }

/* ---------- lists ---------- */
.plain { padding-left: 22px; margin: 0 0 15px; }
.plain li { margin: 4px 0; }

.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.links li { border: 1px solid var(--line); border-radius: 6px; padding: 12px 15px; background: var(--panel); }
.links a { font-weight: 700; }
.links span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ---------- screenshots ---------- */
.shots { display: grid; gap: 18px; }
.shot { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.shot.warn { border-color: #4a2a2a; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 11px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--fg-2); }
.shot figcaption time { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.shot.is-missing img { display: none; }
.shot.is-missing::before {
  content: "画像未設置   " attr(data-file);
  display: grid; place-items: center; height: 170px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  background: repeating-linear-gradient(45deg, #0d1116, #0d1116 10px, #10151b 10px, #10151b 20px);
}

/* ---------- accounts panel ---------- */
.panel { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; margin-bottom: 22px; }
.panel-bar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; padding: 11px 13px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.panel-bar .grow { flex: 1; }
.panel-bar input[type=search] { flex: 1; min-width: 200px; }

.file { position: relative; overflow: hidden; display: inline-block; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file span, .btn {
  display: inline-block; font-family: var(--mono); font-size: 12px;
  padding: 7px 13px; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--panel); color: var(--fg-2); cursor: pointer;
}
.file:hover span, .btn:hover { border-color: var(--green); color: var(--green); }

input[type=search] {
  font-family: var(--mono); font-size: 12.5px; padding: 7px 11px;
  border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--panel); color: var(--fg);
}
input[type=search]:focus { outline: none; border-color: var(--green); }

.dropzone { padding: 11px 14px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); text-align: center; }
.dropzone.over { background: #0f1a14; color: var(--green); }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 9px 13px; border-bottom: 1px solid var(--line); }
.tabs:empty { display: none; }
.tabs button {
  font-family: var(--mono); font-size: 11.5px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 5px; background: var(--panel-2);
  color: var(--fg-2); cursor: pointer;
}
.tabs button.on { border-color: var(--green); color: var(--green); }

.summary { display: flex; gap: 20px; flex-wrap: wrap; padding: 11px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 12px; color: var(--fg-2); }
.summary b { color: var(--green); }

.table-wrap { overflow: auto; max-height: 72vh; }
table.data { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
table.data th, table.data td { padding: 6px 11px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.data thead th {
  position: sticky; top: 0; z-index: 2; background: #12171e; color: var(--fg-2);
  cursor: pointer; user-select: none; font-weight: 700;
}
table.data thead th:hover { color: var(--green); }
table.data tbody tr:hover { background: #12171e; }
table.data td.num { text-align: right; color: var(--green); }
table.data th .arrow { color: var(--green); }
.muted { color: var(--muted); padding: 16px 14px; }

/* ---------- pager / footer ---------- */
.pager { margin: 36px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.ftr { border-top: 1px solid var(--line); background: var(--panel); padding: 18px 0 26px; color: var(--muted); font-size: 12px; }
.ftr p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .grid { grid-template-columns: 1fr; }
  .hdr nav { margin-left: 0; width: 100%; gap: 12px; }
  h1 { font-size: 19px; }
  .table-wrap { max-height: none; }
}

@media print {
  .hdr { position: static; }
  body { background: #fff; color: #111; }
  .box, .stat, .links li, .panel { background: #fff; }
}

/* ---------- 電話履歴 ---------- */
table.calls {
  width: 100%; border-collapse: collapse;
  font-family: var(--mono); font-size: 12.5px;
}
table.calls th {
  text-align: left; padding: 6px 11px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 10.5px; font-weight: 400; letter-spacing: .08em;
}
table.calls td { padding: 6px 11px; border-bottom: 1px solid var(--line); }
table.calls td:nth-child(1) { color: var(--fg-2); white-space: nowrap; width: 92px; }
table.calls td:nth-child(3) { color: var(--muted); text-align: right; white-space: nowrap; width: 70px; }
table.calls code { background: none; padding: 0; color: var(--fg); font-size: 12.5px; }
table.calls tr.hot td { color: var(--red); }
table.calls tr.hot code { color: var(--red); font-weight: 700; }
table.calls tr:last-child td { border-bottom: 0; }
/* ---------- 合計列の選択 ---------- */
.pick {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11.5px; color: var(--muted);
}
.pick select {
  font-family: var(--mono); font-size: 11.5px;
  padding: 6px 9px; border: 1px solid var(--line-2); border-radius: 6px;
  background: var(--panel); color: var(--fg); max-width: 220px;
}
.pick select:focus { outline: none; border-color: var(--green); }
table.data thead th.is-amount { color: var(--green); }

.notice {
  border: 1px solid var(--line); border-left: 2px solid var(--green);
  border-radius: 6px; padding: 10px 14px; margin: 0 0 14px;
  background: #0f1a14; color: var(--fg-2); font-size: 12.5px;
}
.dropzone.need { background: #0f1a14; color: var(--green); border-bottom-color: var(--green); font-weight: 700; }
.dropzone { cursor: pointer; }

/* ---------- 複数テーブル ---------- */
.src { margin-bottom: 40px; }
.src:last-child { margin-bottom: 0; }

.src-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  border-bottom: 2px solid var(--line); padding-bottom: 9px; margin-bottom: 11px;
}
.src-title {
  font-family: var(--mono); font-size: 13px; color: var(--green);
  margin: 0; letter-spacing: .02em; border: 0; padding: 0;
}
.src-title .sheet { color: var(--muted); }
.src-meta {
  margin-left: auto; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  font-family: var(--mono); font-size: 11.5px; color: var(--fg-2);
}
.src-meta b { color: var(--green); }
.src .table-wrap { max-height: 60vh; }

/* 目次 */
.summary a {
  color: var(--fg-2); padding: 3px 9px; border: 1px solid var(--line);
  border-radius: 5px; text-decoration: none;
}
.summary a:hover { border-color: var(--green); color: var(--green); }
.summary .tot { color: var(--fg); font-weight: 700; margin-left: 6px; }
.summary .tot b { color: var(--amber); }
/* ===== 更新タイムライン ===== */
.tl {
  list-style: none;
  margin: 0 0 28px;
  padding: 0 0 0 22px;
  border-left: 2px solid rgba(255,255,255,.14);
}
.tl li { position: relative; padding: 0 0 18px 0; }
.tl li::before {
  content: ""; position: absolute; left: -28px; top: 7px;
  width: 10px; height: 10px; border-radius: 50%; background: #6b7280;
}
.tl li.now::before {
  background: #e63946;
  box-shadow: 0 0 0 4px rgba(230,57,70,.18);
}
.tl time {
  display: block; font-size: 12px; letter-spacing: .06em;
  color: #9aa0a6; margin-bottom: 2px;
}
.tl a { font-weight: 700; }
.tl .desc { display: block; font-size: 13px; color: #9aa0a6; margin-top: 2px; }

.badge {
  display: inline-block; font-size: 11px; line-height: 1;
  padding: 4px 7px; border-radius: 999px; vertical-align: middle;
}
.badge.new { background: #e63946; color: #fff; }

h3 time { font-size: .8em; color: #9aa0a6; margin-right: .5em; font-weight: 400; }
.figs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.figs .fig { margin: 0; display: flex; flex-direction: column; }
.figs .fig a { display: block; }
.figs img {
  width: 100%; height: auto; display: block;
  border: 1px solid rgba(255,255,255,.16); border-radius: 8px;
}
.figs figcaption {
  font-size: 12px; color: #9aa0a6;
  margin-top: 8px; line-height: 1.5;
}
