body {
  font-family: 'Segoe UI', 'Hiragino Kaku Gothic ProN', sans-serif;
  font-size: 14px;
  margin: 0;
}
.container {
  display: flex;
  flex-direction: column;
  width: 640px;
  margin-left: 3px;
  margin-top: 1px;
}
.container.is-info {
  width: fit-content;
  max-width: 640px;
  margin-bottom: 20px;
}

.btn-external {
  display: inline-flex;
  align-items: center;
}

/* afterでBase64画像を表示 */
.btn-external::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 4px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  vertical-align: middle;
  background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAoUlEQVR4nO2VMQ7DIAxF3yWMeqScOwwZ2qkZstODECFlQFFwTKBT8iUPSOa/L1sCeFSpAfgBsVA+6/WFnkkDBMU8AqMBkKqo04YDCfD9F8AB83Zn7g2QLPkCvHoC5MCcXgC3G0s654sfWwBSSG6WBpBWcw3glLGwG5GvBUhF8ktLfhuSNwEm4GMwvwyo0Q0A4eS5joZKHuqH0wIJm8cjzFoBlbCPZdUo6dUAAAAASUVORK5CYII=');
}

/* ヘッダー */
.header .title_label {
  background: linear-gradient(to bottom,
    #CCE5FF 0%,
    #E9F3FF 70%,
    #FFFFFF 100%
  );
  /* border-bottom: 1px solid #B8D3F2; */
  border-bottom: 1px solid rgba(184, 211, 242, 0.2);
  padding: 8px 12px;
  height: 42px;
  font-weight: bold;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  font-size: 18px;
}

.header .control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 3px 0;
}

.header .control button { 
  font-size: 13px;
}

.left-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 4px;
}


.last-updated {
  font-size: 1rem;
  border-left: 1px solid #cbd5e1;
  padding-left: 12px;
}

/* スイッチ（チェックボックスベース） */
.switch { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.switch input { position: absolute; left: -9999px; } /* 画面外へ */
.switch .slider {
  width: 40px; height: 22px; border-radius: 9999px; background: #cbd5e1; position: relative; transition: background .2s;
}
.switch .slider:after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.15); transition: left .2s;
}
.switch input:checked + .slider { background: #006cd8; }
.switch input:checked + .slider:after { left: 21px; }
.switch .label { color: #334155; }





/* ボディ */
.image-wrapper {
  position: relative;
  width: 640px;
  height: 480px;
  background: #f3f3f3;
  overflow: hidden;
}
.image-wrapper #lgtImg {
  /* width: 560px;
  height: 420px; */
  display: block;
}

/* 共通プレースホルダー */
.placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  color: #666;
  pointer-events: none;
}

/* 状態別表示制御 */
.image-wrapper[data-state="loading"] .placeholder[data-type="loading"],
.image-wrapper[data-state="error"] .placeholder[data-type="error"] {
  display: flex;
}
.image-wrapper[data-state="error"] #lgtImg {
  display: none;
}

/* 成功時は何も出さない */
.image-wrapper[data-state="success"] .placeholder {
  display: none;
}

/* フッター */
.footer {
  position: relative;
  margin-top: 4px;
  padding-left: 2px;
}
.footer .info {
  font-size: 14px;
}
.footer .copyright {
  font-size: 12px;
  color: #666;
}


/* 判例 */
.legend {
  margin-top: 1px;
  background-color: #6f6f6f;
  color: #fff;
  padding: 8px 12px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 14px;
  box-sizing: border-box;
}

.legend-inner{
  display: grid;
  /* gap: 5px; */
  margin: 0 auto;
  width: fit-content;
}

.legend .row{
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 10px;
	height: fit-content;
  overflow: hidden;
}
.legend .row.echo-row {
  margin-top: 5px;
}
.legend .row.is-hidden {
  pointer-events:none;
  height: 0;
  margin: 0;
  /* visibility: hidden; */
  /* display:none; */
}

.legend .label{
  font-weight: bold;
  letter-spacing: .02em;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
}
.legend .unit{
  font-weight: normal;
  font-size: 12px;
  opacity: .95;
}

.legend .strike{
  display: inline-flex;
  gap: 16px;
  align-items: center;
}
.legend .strike .item{
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* バツマーカー */
.marker-x{
  width: 14px;
  height: 14px;
  fill: none;
  stroke-width: 4;
  filter: drop-shadow(0 0 1px #ffffff) drop-shadow(0 0 1px rgba(0,0,0,0.7));
 }
.age10 line{ stroke:#ff3aa1; }
.age20 line{ stroke:#ff6a2b; }
.age30 line{ stroke:#ffb12a; }

.legend .echo{ display: grid; gap: 3px; }

.legend{ --sw: 18px; }
.legend .swatches
{
  display: grid;
  grid-template-columns: repeat(14, var(--sw));
  column-gap: 4px;
  align-items: center;
}
.legend .ticks{
    display: grid;
    grid-template-columns: repeat(13, var(--sw));
    column-gap: 4px;
    justify-content: center;
}

/* 色チップ */
.sw{ width: var(--sw); height: 15px; border-radius: 2px;
     box-shadow: inset 0 0 0 1px rgb(255 255 255 / 70%); }
.c00{ background:#45FBF9; } .c01{ background:#239DFB; } .c02{ background:#0202F2; }
.c04{ background:#BBF797; } .c08{ background:#38EC99; } .c12{ background:#34F420; }
.c16{ background:#38B01C; } .c24{ background:#F6E911; } .c32{ background:#F7CB33; }
.c40{ background:#F87912; } .c48{ background:#E14E26; } .c56{ background:#FA0505; }
.c64{ background:#871A04; } .c80{ background:#3E0101; }

/* 目盛 */
.ticks{ font-size: 13px; text-align: center; }


/* 更新タイマー */
:root{
  --bar-width: 103px;           /* バーの全長 */
  --bar-height: 8px;           /* バーの厚み */
  --bar-bg: rgba(255,255,255,.25); /* 背景トラック色 */
  --bar-fill: #00e0ff;         /* 進行部分の色 */
}

.legend-timer{
    display: inline-flex;
    gap: 2px;
    font-size: 12px;
    white-space: nowrap;
    flex-direction: column;

    position: absolute;
    top: 0;
    right: 0;
}

/* バー全体 */
.progress-bar{
  width: var(--bar-width);
  height: var(--bar-height);
  background: var(--bar-bg);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 1px rgba(255,255,255,0.5);
  border : 1px solid rgba(0,0,0,.35);
}

/* 進行部分（左→右に伸びる） */
.bar-fill{
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--bar-fill), #00b0e0);
  border-radius: 2px;
  /* transition: width 1s linear; */
  transition: none;
}




/* 過去情報用 */
.time-controls{margin-top:5px; padding:5px; border-bottom:1px solid #e5e7eb}
.time-controls .row{display:flex; gap:4px; align-items:center; flex-wrap:wrap}
.time-controls label{display:flex; align-items:center; gap:6px}
.time-controls select, .time-controls button, .time-controls input[type=range]{font-size:14px}
.time-controls .group{margin-left: 2px;}
.time-controls .range{display:flex; align-items:center; gap:6px; width: 100%;}
.time-controls #scrub{flex:1;}
.time-controls #btn-prev, #btn-next{padding-top:0; padding-bottom:0;}

.overlay{
  position:absolute; top:20px; right:20px; padding:6px 10px;
  background:rgba(0,0,0,.6); color:#fff; border-radius:8px; font-size:.9rem
}
.hidden{display:block}
.copyright{color:#6b7280; font-size:.85rem; line-height:1.4}


.close-btn{
  margin-top: 10px;
  text-align: center;
}
.close-btn>button{
  width: 340px;
}


/**
 * info.html 用スタイル
 */

.info-control-sample {
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 20px;
  align-items: center;
  justify-content: center;
  border: 1px solid #ccc;
  margin: 20px;
  padding: 20px 0;
}

.info-body p {
  margin-left: 20px;
  margin-right: 20px;
}

.info-body section {
  padding: 0 10px;
}
.info-body section:not(:first-child) {
  margin-top: 40px;
}

.info-body .legend {
  margin: 0px 20px;
}

.info-legend-timer-sample {
  border: 1px solid #ccc;
  margin: 0 20px;
  padding: 20px;
}
.info-legend-timer-sample .legend-timer {
  position: static;
  right: auto;
  top: auto;
}
.info-legend-timer-sample .bar-fill {
  width: 25%;
}