/* 構造審査状況モニター（Web版）スタイル。1 画面固定・モニター用 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%;
  background: #1f1f1f;                  /* モニターの黒い縁（PNG の下地は白） */
  overflow: hidden;
  font-family: "Yu Gothic", "Meiryo", sans-serif;
  color: #eee;
}
.screen { width: 100vw; height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---------- 上部バー（題名・凡例・操作） ---------- */
#topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 18px;
  padding: 6px 14px;
  background: #15151c; border-bottom: 1px solid #2c2c3a;
  min-height: 46px;
}
#title { font-size: 17px; font-weight: bold; letter-spacing: 1px; white-space: nowrap; }
#legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 12px; color: #ccd; flex: 1 1 auto; }
.lg-group { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.lg-label { color: #99a; margin-right: 2px; }
.lg-item { display: inline-flex; align-items: center; gap: 4px; }
.lg-box { display: inline-block; width: 14px; height: 12px; border: 1px solid #808080; }
.lg-redframe { background: #fff; border: 2px solid #ff0000; }
.lg-badge { display: inline-block; padding: 0 5px; border-radius: 2px; color: #fff; font-weight: bold; font-size: 11px; line-height: 16px; }
.lg-plain { color: #c9a0f5; border: 1px solid #7030A0; background: #fff; color: #7030A0; }
.lg-keihen { color: #ff5050; font-weight: bold; }
#controls { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.ctl-row { display: flex; align-items: center; gap: 10px; }
#meta { font-size: 11px; color: #99a; }
#stamp { font-size: 12px; color: #aab; }
#refresh-btn {
  padding: 6px 14px; font-size: 13px; font-weight: bold; cursor: pointer;
  color: #fff; background: #3f63c4; border: 1px solid #5b86e5; border-radius: 6px;
}
#refresh-btn:hover { background: #4f8ff7; }
#refresh-btn:disabled { opacity: 0.6; cursor: default; }
#refresh-btn.regen-waiting { background: #555; border-color: #777; }

/* ---------- 画像 ---------- */
#chart-wrap { flex: 1 1 auto; position: relative; min-height: 0; background: #1f1f1f; }
#chart { width: 100%; height: 100%; object-fit: contain; display: block; }
/* 最大化ヒント（SDA と同じ: 画像の上部中央にオレンジのピル。表示直後に 1.5s×10 回点滅して消える） */
#fs-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  padding: 8px 16px; font-size: 14px; font-weight: bold; cursor: pointer; z-index: 5;
  color: #1a1a2e; background: rgba(217, 130, 43, 0.95); border: 1px solid #a5641a; border-radius: 20px;
  opacity: 1;
}
#fs-hint:hover { background: rgba(184, 106, 30, 0.98); }
#fs-hint.fs-attention { animation: fs-blink 1.5s ease 10 forwards; }
@keyframes fs-blink {
  0%,  66.67% { opacity: 1; box-shadow: 0 0 38px 10px rgba(96, 165, 250, 1); border-color: #d6e6ff; transform: translateX(-50%) scale(1.08); }
  72%, 100%   { opacity: 0; box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);       border-color: #a5641a; transform: translateX(-50%) scale(1); }
}
#banner {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 14px; text-align: center; font-size: 14px;
  color: #fff; background: rgba(60, 60, 90, 0.9);
}
#banner.stale-error { background: #b22222; }

/* ---------- メッセージ・バッジ・リンク ---------- */
#message {
  position: fixed; left: 50%; bottom: 70px; transform: translateX(-50%);
  max-width: 80vw; padding: 10px 18px; font-size: 14px; line-height: 1.6;
  color: #fff; background: rgba(40, 40, 60, 0.95); border: 1px solid #556; border-radius: 10px;
  z-index: 50; white-space: pre-wrap;
}
#message.msg-success { background: #1f6b3a; border-color: #2f9b55; }
#message.msg-waiting { background: #5a4a1a; border-color: #8a7a2a; }
#build-tag { font-size: 11px; color: #99a; opacity: 0.8; }
.env-badge { padding: 1px 8px; font-size: 11px; font-weight: bold; border-radius: 4px; color: #fff; background: #666; }
.env-badge.env-dev { background: #c0392b; }
.env-badge.env-local { background: #666; }
#portal-btn {
  padding: 2px 8px; font-size: 11px; color: #cde; text-decoration: none;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); border-radius: 6px;
}

/* ---------- ツールチップ ---------- */
#tooltip {
  position: fixed; z-index: 60; pointer-events: none;
  max-width: 420px; padding: 10px 14px;
  font-size: 15px; line-height: 1.6; white-space: pre-line;
  color: #111; background: #fffbe6; border: 1px solid #998; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

/* ---------- モーダル（パスワード） ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); }
.modal-box { width: 360px; padding: 24px; background: #24243e; border: 1px solid #3a3a55; border-radius: 12px; color: #eee; }
#pw-title { font-size: 18px; font-weight: bold; margin-bottom: 8px; }
.modal-hint { font-size: 13px; color: #bbc; margin-bottom: 12px; }
#pw-input { width: 100%; padding: 8px 10px; font-size: 15px; border: 1px solid #556; border-radius: 6px; background: #1a1a2e; color: #eee; }
.pw-show { display: block; margin: 8px 0; font-size: 12px; color: #bbc; }
#pw-error { margin: 6px 0; font-size: 13px; color: #ff8a80; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.modal-actions button { padding: 6px 16px; font-size: 14px; cursor: pointer; color: #fff; background: #3f63c4; border: 1px solid #5b86e5; border-radius: 6px; }

/* ---------- 運用お知らせバナー（notice.json） ----------
   画面下部の帯。暗いモニター画面の中で唯一の明色帯＝最も目立つ（SDA の notice-bar と同じ配色方針）。
   #banner（更新ボタンの進行・鮮度エラー）より手前、#message（bottom 70px）の下、モーダルより奥。 */
#notice-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px;
  font-size: 17px; font-weight: 700; line-height: 1.5;
  color: #3a2e05; background: #fff3b8;
  border-top: 2px solid #d9a406;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.45);
  animation: notice-rise 0.45s ease;
}
@keyframes notice-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
#notice-bar.hidden { display: none !important; }
#notice-bar::before {
  content: "お知らせ"; flex: none;
  padding: 4px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 800; letter-spacing: 1px;
  color: #fffbe8; background: #d9a406;
}
#notice-text { flex: 1 1 auto; min-width: 0; white-space: pre-wrap; }
#notice-bar button {
  flex: none; font-family: inherit; cursor: pointer;
  border-radius: 9px; border: 1px solid rgba(217, 164, 6, 0.55);
  background: rgba(217, 164, 6, 0.12); color: #4a3a06;
}
#notice-bar button:hover { background: rgba(217, 164, 6, 0.24); }
#notice-reload { padding: 8px 20px; font-size: 14px; font-weight: 700; color: #fffbe8; background: #d9a406; border-color: #d9a406; }
#notice-reload:hover { background: #c29205; }
#notice-reload.hidden { display: none !important; }
#notice-close { padding: 6px 13px; font-size: 17px; line-height: 1; }
