/* 画面の骨組み: 全体の段・本人用の帯・上部バー（作業のタブ・気象の資料の札・表示の切替・履歴）・知らせの帯・
   作業域の配置の3形（split・float・full）・設定の重ね・トースト・起動とログインの画面。部品は js/shell/・js/login/・js/app.js。 */

/* ---------------------------------------------------------------- 全体（行: 本人用の帯・上部バー・知らせの帯・作業域） */
.shell { position: relative; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); height: 100vh; height: 100dvh; min-height: 480px; }
.shell > .pre { grid-row: 1; grid-column: 1; }
.shell > .tb { grid-row: 2; grid-column: 1; }
.shell > .banners { grid-row: 3; grid-column: 1; }
.shell > .work, .shell > .overlay { grid-row: 4; grid-column: 1; }

/* 本人用のときは、上に帯・画面の縁に細い枠（地図を覆わない） */
.shell[data-mode="self"]::after { content: ""; position: fixed; inset: 0; z-index: 90; border: 3px solid var(--k5); pointer-events: none; }
.selfband { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 24px; background: var(--k5); color: var(--bg-1);
  font-size: var(--fs-label); font-weight: 700; line-height: 1.3; }
/* 知らせの帯（新しい版・ログインの期限切れ・つながりの途絶） */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; border-bottom: 1px solid var(--rule-1);
  background: var(--bg-2); font-size: var(--fs-label); }
/* 新しい版の札（store/release.js。読み直すまで残す・閉じられる）。字と［読み直す］は .relmsg の中で折り返し、閉じる（×）は右端 */
.banner.relnote { flex-wrap: nowrap; background: var(--sel-soft); }
.relmsg { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }

/* ---------------------------------------------------------------- 上部バー */
.tb { position: relative; z-index: 60; display: flex; align-items: stretch; gap: 4px; min-height: 52px; padding: 0 12px; min-width: 0;
  background: var(--bg-1); border-bottom: 1px solid var(--rule-1); }
.tb-brand { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 0 8px 0 0; border: 0; background: none; color: var(--fg-0);
  font-weight: 700; font-size: 16px; letter-spacing: .06em; white-space: nowrap; }
.tb-brand svg { width: 26px; height: 26px; flex: none; }
.lg-bg { fill: var(--k1); } .lg-sun { fill: var(--q-amber-hi); } .lg-b { fill: none; stroke: var(--k1-on); stroke-width: 1.6; }   /* 製品の印（上部バーとログイン） */
.tb-tabs { display: flex; align-items: stretch; gap: 2px; min-width: 0; margin-left: 8px; margin-right: 4px; overflow-x: auto; scrollbar-width: none; }
.tb-tabs::-webkit-scrollbar { display: none; }
.tb-tab { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none;
  color: var(--fg-1); font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.tb-tab .i { width: 16px; height: 16px; }
.tb-tab:hover { background: var(--bg-2); color: var(--fg-0); }
.tb-tab.on { color: var(--sel); border-bottom-color: var(--sel); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.tb-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px; }
.tb-btn .i { width: 16px; height: 16px; }
/* 気象の資料の時刻の札（点の色は遅れで変わる）と、表示の切替の札 */
.tchip { display: inline-flex; align-items: center; gap: 8px; min-width: 0; min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--r-pill);
  background: var(--bg-2); color: var(--fg-1); font-size: 13px; white-space: nowrap; overflow: hidden; }
.tchip:hover { background: var(--bg-3); }
.tchip .dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--fg-3); }
.tchip .dot.ok { background: var(--sel); }
.tchip .dot.warn { background: var(--k5); }
/* T21: 札は点・時計の印・時刻だけ（「気象の資料」の字を外した）。遅れは点の色と「!」 */
.tb-tm { display: inline-flex; align-items: center; gap: 4px; }
.tb-tm .i { width: 14px; height: 14px; }
.tb-late { margin-left: -4px; color: var(--k5); font-weight: 700; }
.tb-lim-m { display: none; }                           /* 利用期限の札の「〜」（スマホの幅だけ。T16 第2回 UI-8） */
.pill { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--bg-1); color: var(--fg-1); font-size: var(--fs-label); font-weight: 600; white-space: nowrap; }
.pill.self { border-color: var(--k5); color: var(--k5); }
.pill:hover { background: var(--bg-2); }
/* 履歴の一覧（小窓の中） */
.runs { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
/* T16 第3回 UI-3（g1.9）: 一覧が小窓の高さを超えると行が縮み、灰色の日時の行が釦の枠の外へはみ出した＝縮めない（flex 0 0 auto） */
.runbtn { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px; padding: 8px 4px; border: 0;
  border-bottom: 1px solid var(--rule-1); border-radius: var(--r-m); background: none; color: var(--fg-0); font-size: 13px; text-align: left; }
.runbtn:hover { background: var(--bg-2); }
.runbtn.cur { border-color: var(--sel); background: var(--sel-soft); }
.runbtn .t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.rwhen { color: var(--fg-1); }
.rtag { padding: 0 6px; border: 1px solid var(--rule-1); border-radius: var(--r-pill); font-size: 13px; font-weight: 400; color: var(--fg-2); }

/* ---------------------------------------------------------------- 作業域 */
.shell > .work { position: relative; min-height: 0; min-width: 0; }
.shell .lpane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg-1); position: relative; }
/* 左の欄の中身（作業の Left の根）: 自分で縦に巻き取る。T21（統合 J5・担当 trip の頼み）: 読み上げの字（.sr＝位置を外した 1px の箱）の置き場を、
   この巻く箱の中にする（前は外の .lpane が置き場で、巻いた先の .sr の分だけ幅 390 の頁が縦に巻けた＝T16 第7回 t9 の守りの試験。前は旅行だけ
   ws-trip.css の .trp.lbody に付けていた） */
.lbody { position: relative; flex: 1 1 auto; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* split: 左の欄｜つまみ｜右の器。左の幅（--split）は Shell が入れる（利用者のつまみの割合か、作業の決めた幅） */
.shell .work.split { display: grid; grid-template-columns: minmax(0, var(--split)) 9px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
/* 左右の境: 見た目は線1本（押せる所は 9px。つまみは触れたときだけ濃く） */
.splitter { position: relative; z-index: 5; background: linear-gradient(to right, var(--bg-1) 0 4px, var(--rule-1) 4px 5px, var(--bg-0) 5px); cursor: col-resize; touch-action: none; }
.splitter::after { content: ""; position: absolute; left: 2px; top: 50%; width: 5px; height: 36px; margin-top: -18px; border-radius: 3px; background: var(--line-strong); }
.splitter:hover::after, .splitter.on::after, .splitter:focus-visible::after { background: var(--sel); }
/* 作業が左の幅を決めていて動かせないとき（data-resizable="false"。Screen の split()）: つまみの列を無くし、境は線1本 */
@media (min-width: 900px) {
  .shell[data-resizable="false"] .work.split { grid-template-columns: minmax(0, var(--split)) 0 minmax(0, 1fr); }
  .shell[data-resizable="false"] .work.split > .splitter { visibility: hidden; }
  .shell[data-resizable="false"] .work.split > .lpane { border-right: 1px solid var(--rule-1); }
}

/* float: 右の器を全面に、左の欄は地図の上に浮く板 */
.shell .work.float { display: block; }
.shell .work.float > .stagepane { position: absolute; inset: 0; }
.shell .work.float > .lpane { position: absolute; z-index: 30; left: 16px; top: 16px; bottom: 16px; width: min(372px, calc(100% - 32px));
  border: 1px solid var(--rule-1); border-radius: var(--r-xl); box-shadow: var(--sh-2); overflow: hidden; }
.floattg { position: absolute; z-index: 31; left: calc(16px + min(372px, 100% - 32px)); top: 50%; width: 28px; height: 56px; margin-top: -28px; padding: 0;
  display: grid; place-items: center; border: 1px solid var(--rule-1); border-left: 0; border-radius: 0 var(--r-m) var(--r-m) 0; background: var(--bg-1);
  color: var(--fg-1); box-shadow: var(--sh-1); }
.floattg .i { width: 16px; height: 16px; }
.shell[data-float="shut"] .work.float > .lpane { display: none; }
.shell[data-float="shut"] .floattg { left: 0; }
/* 浮く板の分だけ、地図の左上の物（探す欄）を右へ寄せる */
.shell[data-float="open"] .work.float .msrch { left: calc(16px + 372px + 16px); }

/* full: 作業が全面を描く */
.shell .work.full { display: flex; flex-direction: column; overflow: hidden; background: var(--bg-0); }

/* ---------------------------------------------------------------- 設定の重ね（上部バーの下の全面） */
.overlay { position: relative; z-index: 55; display: flex; flex-direction: column; padding: 16px; background: var(--scrim); min-height: 0; min-width: 0; }
.overlay > * { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; background: var(--bg-1); border-radius: var(--r-xl);
  box-shadow: var(--sh-3); overflow: hidden; }
/* 重ねている間、下の作業域は見えない・押せない・Tab で行けない */
.shell[data-overlay]:not([data-overlay=""]) > .work { visibility: hidden; }

/* ---------------------------------------------------------------- トースト（操作の結果を短く。下の真ん中） */
.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 100; max-width: min(560px, calc(100% - 32px)); padding: 9px 18px;
  border-radius: var(--r-pill); background: var(--fg-0); color: var(--bg-1); box-shadow: var(--sh-3); font-size: 13.5px; line-height: 1.5;
  /* 知らせは字だけ（押す所が無い）。下の物の押しを止めない（T12: スマホで「下の表で時刻を押して」の知らせが、押す行を覆っていた） */
  pointer-events: none; }

/* ---------------------------------------------------------------- 起動・つながらない時の画面（.boot）とログインの画面（login/Login.js） */
.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 100vh; min-height: 100dvh; padding: 16px;
  background: var(--bg-0); font-size: 15px; text-align: center; }
.boot > span:first-child { font-size: 18px; font-weight: 700; letter-spacing: .06em; }
.login { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 16px; background: var(--bg-0); overflow: auto; }
.login-card { display: flex; flex-direction: column; gap: 12px; width: min(400px, 100%); padding: 20px; border: 1px solid var(--rule-1); border-radius: var(--r-l); background: var(--bg-1); }
/* デモ版の利用条件の画面（login/Terms.js。T15 の点検 A2）: ログインの後・作業の画面の前。本文は素の字の段落。長い本文はこの中で巻く
   （body は overflow hidden なので、高さを画面に合わせる） */
.terms { display: grid; justify-items: center; align-content: start; height: 100vh; height: 100dvh; padding: 24px 16px; background: var(--bg-0); overflow: auto; }
.terms-card { display: flex; flex-direction: column; gap: 14px; width: min(720px, 100%); padding: 20px; border: 1px solid var(--rule-1); border-radius: var(--r-l); background: var(--bg-1); }
.terms-card h1 { font-size: 20px; line-height: 1.4; }
.terms-body { display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.terms-body h2 { margin-top: 6px; font-size: 16px; line-height: 1.5; }
.terms-body ul { display: flex; flex-direction: column; gap: 4px; margin: 0; padding-left: 1.4em; }
.terms-note { align-self: flex-start; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); color: var(--fg-1); font-size: 13.5px; }
.terms-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.terms-acts .btn { min-height: 44px; padding: 0 18px; font-size: 15px; }
@media (max-width: 599px) { .terms-acts .btn { flex: 1 1 100%; } }
.brand { display: flex; align-items: center; gap: 10px; flex: none; margin-right: 10px; color: var(--fg-0); font-size: 15px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.brand svg { width: 34px; height: 34px; }
.brand h1 { font-size: 20px; }
.fld { display: flex; flex-direction: column; gap: 4px; font-size: 13.5px; }
.fld > span { color: var(--fg-1); font-size: 13px; }
.fld input { min-width: 0; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg-1); font-size: 15px; }
.fld input:focus { outline: 0; border-color: var(--sel); box-shadow: 0 0 0 3px var(--sel-ring); }

/* ================================================================ 幅 900px 未満: 縦に積む（上＝右の器・下＝左の欄） */
@media (max-width: 899px) {
  /* 右の器の高さ。報告書（data-stage="sheet"）の間は高くする（紙を読むため） */
  .shell { --map-h: clamp(240px, 38dvh, 460px); }
  .shell[data-bp="tab"] { --map-h: clamp(260px, 42dvh, 520px); }
  .shell[data-stage="sheet"] { --map-h: clamp(360px, 64dvh, 900px); }
  /* 右の器の高さの釦（T16 第2回 UT-12。stage/StagePane.js の .stsize）: たたむ＝細い帯（左の欄を広く）・広げる＝画面のほとんど（報告書・地図を広く）。
     作業ごとの高さ（ws-*.css の「.shell[data-ws][data-stage]:not([data-run])」）に勝つよう、骨組みの class と属性を重ねる */
  .app.shell.shell[data-stagesize="fold"][data-bp] { --map-h: 132px; }
  .app.shell.shell[data-stagesize="big"][data-bp] { --map-h: max(360px, calc(100dvh - 150px)); }
  .shell .work.split, .shell .work.float { display: grid; grid-template-columns: 100%; grid-template-rows: var(--map-h) minmax(0, 1fr);
    grid-template-areas: "stage" "left"; }
  .shell .work.split > .lpane, .shell .work.float > .lpane { grid-area: left; display: flex; position: relative; left: auto; top: auto; bottom: auto; width: auto;
    border: 0; border-radius: 0; box-shadow: none; }
  .shell .work.split > .stagepane, .shell .work.float > .stagepane { grid-area: stage; position: relative; inset: auto; border-bottom: 1px solid var(--rule-1); }
  .shell[data-float="shut"] .work.float > .lpane { display: flex; }
  .splitter, .floattg { display: none; }
  .shell[data-float="open"] .work.float .msrch { left: 12px; }
  .overlay { padding: 0; }
  .overlay > * { border-radius: 0; }
  /* T47 の 10/28 の直し（全体管理の決め V20・点検 N1）: 横向きのスマホ（幅 640〜899・高さ 480 未満）で作業が左右の形を頼んだ間（骨組みの data-side＝
     store/index.js の landSide。赤外線の結果だけ・報告書の間は除く）は、縦に積まずに左の欄｜右の器の 2 列（左は 55%。ただし右の器に 3D の視点の釦 6 つ〈44px〉の列が入る
     294px を残し、340px より狭めない＝幅 653 から上はカレンダーの升が 44px 残る 360px 以上）。右の器は畳まない・高さの釦を出さない＝StagePane.js。縦に積むと、上の帯（約 90px）と
     右の器と下の帯・断りで、左の欄の中身が 844×390 で 53px・667×375 で 28px しか見えなかった。2 列で 185px・141px（記録 T47_int.md の V） */
  .app.shell[data-side] .work.split { grid-template-columns: minmax(0, max(340px, min(55%, calc(100% - 294px)))) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
    grid-template-areas: "left stage"; }
  .app.shell[data-side] .work.split > .stagepane { border-bottom: 0; border-left: 1px solid var(--rule-1); }
}

/* ================================================================ 幅 1100〜1339px（タブが1段の、狭めの幅）: 余白を詰める（T9。タブが5つに
   なり、そのままでは 1100〜1255px 辺りでタブの列が右の札の左で切れる。列は自分の中で横に流れて棒も出ないので、切れた事に気づきにくい）。
   右の釦（履歴・設定）は T21 からどの幅も印だけ */
@media (min-width: 1100px) and (max-width: 1339px) {
  .tb { gap: 2px; }
  .tb-brand { padding-right: 4px; font-size: 15px; letter-spacing: 0; }
  .tb-tabs { gap: 0; margin-left: 0; margin-right: 6px; }      /* T30 F1: 列が横に巻く時も、右の札との間を 8px（.tb の gap 2px と。左の 2px を右へ回した） */
  .tb-tab { gap: 5px; padding: 0 8px; font-size: 14px; }
  .tb-tab .i { width: 15px; height: 15px; }
}

/* ================================================================ 幅 1100px 未満: タブを2段目の横に流れる列に
   （1段では、タブが右の札〈気象の資料・表示の切替〉の下に隠れる） */
@media (max-width: 1099px) {
  .tb { flex-wrap: wrap; row-gap: 0; }
  .tb-brand { min-height: 48px; order: 1; }
  .tb-right { order: 2; }
  .tb-tabs { order: 3; flex: 1 0 100%; margin: 0 -12px; padding: 0 8px; border-top: 1px solid var(--rule-1); }
  .tb-tab { min-height: 40px; }
}
/* スマホ 〜767: 押す所 44px */
@media (max-width: 767px) {
  .tb { padding: 0 8px; }
  .tb-tabs { margin: 0 -8px; padding: 0 4px; }
  .tb-tab { min-height: 44px; padding: 0 12px; font-size: 14px; }
  .tb-btn { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; }
  .tb-brand { gap: 6px; padding-right: 4px; }
  .tb-brand .nm { font-size: 14px; letter-spacing: 0; }
  .tb-right { gap: 2px; }
  .tb .tchip { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; background: none; }
  .tb-lim-m { display: inline; }
  .pill { min-width: 44px; min-height: 44px; padding: 0 8px; justify-content: center; }
  .toast { bottom: 120px; }
  .fld input { min-height: 44px; }
}
@media (max-width: 420px) {
  .tb-brand .nm { font-size: 14.5px; letter-spacing: .02em; }
}
