/* 汎用（workspaces/general。デザイン案 start/18「押した所の1日を先に見る」）。左は地図の上に浮く板（css/shell.css の float）、
   地図の右上に下見の札、下に凡例の帯。縦に積む幅（900px 未満）では、札と凡例の帯は左の欄（.gen-side）の中に出る。
   class の頭は .gen-。照合の状態は .st-in（○ 合う＝緑）・.st-edge（△ 境目＝オレンジ）・.st-out（× 外れる＝濃い茶）。色は tokens.css の変数だけ。 */

/* ---------------------------------------------------------------- 左の板 */
.gen-side { background: var(--bg-1); }
.gen-side > * { flex: none; }
.gen-head { padding: 12px 14px 12px; border-bottom: 1px solid var(--rule-1); }
.gen-date { font-size: 20px; font-weight: 700; letter-spacing: .02em; line-height: 1.3; }
/* T16 第3回 UI-9（g1.3）: 標準の条件を直す前の下見の1行 */
.gen-old { margin: 0 0 6px; padding: 6px 8px; border-left: 3px solid var(--part-bar); border-radius: var(--r-s); background: var(--bg-2); font-size: 13px; color: var(--fg-0); }
/* T16 第5回（g1）: 前に計算した結論・照らし直した事の1行（照らし直している間は回る印） */
.gen-re { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 6px; font-size: 13px; line-height: 1.5; color: var(--fg-1); }
.gen-old.gen-re { color: var(--fg-0); }
.gen-re .i { width: 14px; height: 14px; }
.gen-head .pweek { margin-top: 10px; }

.gen-peek { padding: 12px 14px 6px; border-bottom: 1px solid var(--rule-1); }
.gen-peek h3, .gen-std h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 4px; font-size: 13.5px; color: var(--fg-1); }
.gen-peek h3 span { font-size: 13px; font-weight: 400; color: var(--fg-2); }
.gen-empty { margin: 0; padding: 4px 0 10px; font-size: 13px; line-height: 1.6; color: var(--fg-2); }
.gen-pvs-list { list-style: none; margin: 0; padding: 0; }
.gen-pv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; padding: 8px 0 10px; border-top: 1px solid var(--rule-1); }
.gen-pv:first-child { border-top: 0; }
.gen-pvh { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 36px; padding: 2px 0; border: 0; background: none; color: var(--fg-0); text-align: left; }
.gen-mk { display: grid; place-items: center; flex: none; width: 26px; height: 26px; border: 2px solid var(--fg-1); border-radius: 50%; background: var(--bg-1); color: var(--fg-1);
  font-size: 13px; font-weight: 700; line-height: 1; }
.gen-pv.on .gen-mk { border-color: var(--sel); background: var(--sel); color: var(--on-sel); }
.gen-pv.bld .gen-mk { border-style: dashed; }
.gen-pvn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14.5px; font-weight: 700; }
.gen-pvh:hover .gen-pvn { color: var(--sel); }
.gen-pvd { flex: none; font-size: 13px; color: var(--fg-2); white-space: nowrap; }
.gen-pva { display: flex; align-items: center; gap: 2px; }
.gen-pva .btn { min-height: 36px; padding: 0 12px; font-size: 13px; font-weight: 700; }
.gen-pv.on .gen-pva .btn { border-color: var(--sel); color: var(--sel); }
.gen-pva .ibtn .i { width: 14px; height: 14px; }
.gen-pv > .gen-mini, .gen-pv > .gen-pvs { grid-column: 1 / -1; margin-left: 34px; }
.gen-mini { width: auto; }
.gen-pvs { display: flex; align-items: baseline; gap: 4px; margin-top: 2px; font-size: 13px; line-height: 1.45; color: var(--fg-1); }
.gen-pvs .i { width: 14px; height: 14px; align-self: center; }
.gen-pvs.st-out { color: var(--no-bar); }
.gen-pvs.st-in { color: var(--ok-bar); }
.gen-pvs.st-edge { color: var(--fg-0); }

.gen-std { padding: 12px 14px 16px; }
.gen-conds { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.gen-conds span { padding: 2px 8px; border-radius: var(--r-s); background: var(--bg-2); color: var(--fg-1); font-size: 13px; white-space: nowrap; }
.gen-conds span b { color: var(--fg-0); }
.gen-set { min-height: 36px; font-size: 13px; }

/* ---------------------------------------------------------------- 下見の札（地図の右上。縦に積む幅では左の欄の中） */
.gen-card { position: absolute; z-index: 5; top: 62px; right: 12px; width: min(492px, calc(100% - 372px - 56px)); max-height: calc(100% - 62px - 78px); overflow-y: auto;
  padding: 12px 16px 14px; border: 1px solid var(--rule-1); border-radius: var(--r-l); background: var(--bg-1); box-shadow: var(--sh-3);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.shell[data-float="shut"] .gen-card { width: min(492px, calc(100% - 100px)); }
.gen-ck { display: flex; align-items: center; justify-content: space-between; min-height: 28px; font-size: 13px; color: var(--fg-2); }
.gen-x { margin: -2px -8px -2px 0; }
.gen-cn { font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.gen-cm { font-size: 13px; line-height: 1.5; color: var(--fg-2); }
.gen-wait, .gen-fail { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: var(--r-m); background: var(--bg-2); font-size: 13.5px; color: var(--fg-1); }
.gen-fail .i { color: var(--no-bar); }

/* 升（時刻の見出し・条件ごとの行）と、選んだ時間の帯 */
.gen-strip { position: relative; --lab: 76px; --gap: 2px; --cw: calc((100% - var(--lab) - var(--n) * var(--gap)) / var(--n)); margin-top: 8px; user-select: none; }
.gen-sr { display: grid; grid-template-columns: var(--lab) repeat(var(--n), minmax(0, 1fr)); gap: var(--gap); margin-bottom: 2px; }
.gen-hh span { font-size: 13px; line-height: 1.5; color: var(--fg-2); text-align: center; font-variant-numeric: tabular-nums; }
.gen-hh span.on { color: var(--sel); font-weight: 700; }
/* 行の名前は語の途中で折らない（T21 の歩きの直し W5: 幅 390 で「瞬間風／速」「発雷確／率」「降水確／率」と折れた）。語が欄に入らない時だけ字の間で折る */
.gen-lab { display: flex; flex-direction: column; justify-content: center; min-width: 0; font-size: 13px; font-weight: 700; line-height: 1.25; color: var(--fg-0);
  word-break: keep-all; overflow-wrap: anywhere; }
.gen-lab small { font-size: 13px; font-weight: 400; color: var(--fg-2); white-space: nowrap; }
/* T16 第3回 UI-7: 1時間の雨の条件を3時間の量で照らした時間がある行の添え */
.gen-lab .gen-v3 { white-space: normal; }
/* T28: 行の名前の下の確からしさの小さな数（「2/2」「10/51」。記号と数だけ・本文の灰の字。赤外線の列の頭と同じ字。語は行の読み上げと title） */
.gen-lab .gen-cf { display: flex; flex-wrap: wrap; gap: 0 5px; color: var(--fg-1); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.gen-lab .gen-cf i { font-style: normal; }
.gen-c { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 40px; min-width: 0; border-radius: 4px; background: var(--bg-2); color: var(--fg-1);
  line-height: 1.15; font-variant-numeric: tabular-nums; overflow: hidden; }
.gen-c b, .gen-v { font-size: 13px; }
.gen-v { letter-spacing: -.03em; }
.gen-c.st-in { background: var(--ok-bg); color: var(--ok-bar); }
.gen-c.st-edge { background: var(--part-bg); color: var(--fg-0); box-shadow: inset 0 0 0 1px var(--part-bar); }
.gen-c.st-out { background: var(--no-bg); color: var(--no-bar); box-shadow: inset 0 0 0 1px var(--no-bar); }
.gen-c.st-unknown, .gen-c.st-split { background: var(--unk-bg); color: var(--unk-fg); }      /* T28: 値なし（？）は灰の無地。前の結果の分かれるも同じ */
/* T16 第5回（d2）: いま発表中の気象庁の警報・注意報の引用（文のまま） */
.gen-warn { margin: 6px 0 0; padding: 6px 8px 6px 24px; border-left: 3px solid var(--part-bar); border-radius: var(--r-s); background: var(--bg-2); font-size: 13px; line-height: 1.5; color: var(--fg-0); }
/* 海の上の格子点の値（T16 第2回。札の場所の行の下） */
.gen-sea { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--fg-1); }
.gen-wide { grid-column: 2 / -1; display: flex; align-items: center; justify-content: center; min-height: 32px; padding: 2px 8px; border-radius: 4px; background: var(--bg-2);
  color: var(--fg-1); font-size: 13px; line-height: 1.4; text-align: center; }
.gen-sel { position: absolute; top: 0; bottom: 0; left: calc(var(--lab) + var(--gap) + var(--a) * (var(--cw) + var(--gap))); width: calc(var(--k) * (var(--cw) + var(--gap)) - var(--gap));
  border-top: 4px solid var(--sel); border-radius: 3px; background: var(--sel-ring); pointer-events: none; }
.gen-drag { position: absolute; top: 0; bottom: 0; left: calc(var(--lab) + var(--gap)); right: 0; cursor: col-resize; touch-action: pan-y; }

/* 立ち寄る時間の欄・選んだ時間の値・まとめ・釦 */
.gen-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; font-size: 13px; color: var(--fg-1); }
.gen-pk { font-weight: 700; }
.gen-pick .sel select { height: 36px; min-width: 6.2em; font-variant-numeric: tabular-nums; }
.gen-vals { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 6px; font-size: 13px; }
.gen-vk { margin-right: 2px; color: var(--fg-2); }
.gen-val { padding: 1px 8px; border-radius: var(--r-s); background: var(--bg-2); color: var(--fg-1); white-space: nowrap; }
.gen-val b { color: var(--fg-0); }
.gen-val.st-out { background: var(--no-bg); }
.gen-val.st-out b { color: var(--no-bar); }
.gen-val.st-edge { background: var(--part-bg); }
.gen-val.st-unknown, .gen-val.st-split { background: var(--unk-bg); }
.gen-acts { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; margin-top: 10px; }
.gen-acts .btn { min-height: 44px; padding: 0 12px; font-size: 13px; font-weight: 700; }
.gen-acts .gen-main { font-size: 14px; white-space: normal; line-height: 1.3; }
.gen-acts .gen-ir { grid-column: 1 / -1; }

/* ---------------------------------------------------------------- 凡例の帯（地図の下。浮く板の右）。T21: 案内の文を外し、出ている記号の見本と 1 語だけ */
.gen-hint { position: absolute; z-index: 5; left: 404px; bottom: 16px; max-width: calc(100% - 404px - 64px); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding: 8px 14px; border: 1px solid var(--rule-1); border-radius: var(--r-l); background: var(--bg-1); box-shadow: var(--sh-2); font-size: 13px; line-height: 1.5; color: var(--fg-1); }
.shell[data-float="shut"] .gen-hint { left: 44px; max-width: calc(100% - 44px - 64px); }
.gen-lg { display: flex; flex-wrap: wrap; gap: 4px 10px; white-space: nowrap; }
.gen-lg span { display: inline-flex; align-items: center; gap: 4px; }
.gen-lg i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; font-style: normal; font-weight: 700; font-size: 13px; }
.gen-lg .st-in { background: var(--ok-bg); color: var(--ok-bar); }
.gen-lg .st-edge { background: var(--part-bg); color: var(--fg-0); box-shadow: inset 0 0 0 1px var(--part-bar); }
.gen-lg .st-out { background: var(--no-bg); color: var(--no-bar); box-shadow: inset 0 0 0 1px var(--no-bar); }
/* T28: ？（値なし）は灰の無地（前の結果の分かれるも同じ見本＝凡例は 1 つにまとめる。前の斜めの縞はやめた） */
.gen-lg .st-unknown, .gen-lg .st-split { background: var(--unk-bg); color: var(--unk-fg); }

/* ---------------------------------------------------------------- 縦に積む幅: 札と案内の帯は左の欄の中（流れの中に置く） */
.gen-side .gen-card { position: static; width: auto; max-height: none; overflow: visible; margin: 12px 12px 0; box-shadow: none; border-color: var(--line-strong); }
.gen-side .gen-hint { position: static; max-width: none; margin: 12px 14px 0; box-shadow: none; }
/* 値の出どころの札（T16 d3。components/Provenance.js。T21: 札だけ＝添えの文は触れた時の字。気象庁の発表の欄は出さない） */
.gen-srcw { margin-top: 10px; }

/* ---------------------------------------------------------------- スマホ 〜767: 押す所 44px・升は記号だけ */
@media (max-width: 767px) {
  .gen-head, .gen-peek, .gen-std { padding-left: 16px; padding-right: 16px; }
  .gen-side .gen-card { margin: 12px 12px 0; padding: 12px 12px 14px; }
  .gen-side .gen-hint { margin: 12px 16px 0; }
  .gen-x, .gen-pva .ibtn { width: 44px; height: 44px; }
  .gen-pvh { min-height: 44px; }
  .gen-pva .btn { min-height: 44px; min-width: 56px; }
  .gen-set { min-height: 44px; }
  .gen-strip { --lab: 56px; --gap: 1px; }      /* 名前の欄は 4 字の語（瞬間風速・発雷確率・降水確率＝13px の太字で 52px）が 1 行に入る幅（W5） */
  .gen-lab small, .gen-v { display: none; }
  /* T28 点検の後の直し（DECISIONS §4b「汎用の狭い幅は数を隠す」）: 確からしさの数も条件の字と一緒に隠す（.gen-lab .gen-cf の
     display:flex〈詳細度 0,2,0〉が上の small の隠しに勝っていた） */
  .gen-lab .gen-cf { display: none; }
  .gen-c { height: 34px; }
  .gen-pick .sel select { height: 44px; }
  .gen-acts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gen-acts .gen-main { grid-column: 1 / -1; }
}
