/* maddyポータル（WAS-2056）。使う端末はスマホ・iPad・PC（ステーションの方はiPadとスマホで開くことが多い）。
   11/11（WAS-2849）に見た目を作り直した。考え方は次のとおり。
   - 色: 上の帯は元の青、文字は墨色、本文で押せる所と「今」を示す所だけ青。ラベルの色は種類ごとに1色（文字と地の差は4.5以上）
   - 文字: 日本語の字形のフォントを名前で指定する（Appleの端末は数字・英字がSan Francisco、かなと漢字がヒラギノ角ゴ。Windowsは BIZ UDPゴシック か Yu Gothic UI）。本文16px、補足14px、いちばん小さい注記でも13px
   - 並べ方: スマホと狭い幅は1列。iPadの縦は日程を横の線で、PCとiPadの横（1024px以上）は右に件数と日程を固定して2列
   - 押す所: 指で押す画面では44px以上。入力欄の文字は16px（小さいとSafariが入力のときに画面を拡大する） */
:root {
  --ink: #1d2433; --ink-soft: #2b3445;
  --bar: #0077c7; /* 上の帯の青（11/11本人決定で元の青のまま。WAS-2849） */
  --main: #0b63ce; --main-dark: #0a53ad; --main-light: #e8f1fc; --main-line: #bcd6f5; --link: #0b63ce;
  --danger: #c2183f; --danger-bg: #fdeef2; --green: #0b6468;
  --text: #1d2433; --text-grey: #5a6472; --text-light: #98a1ae;
  --border: #e2e6ed; --border-strong: #8791a1; --bg: #f3f5f8; --soft: #f5f7fa; --white: #fff;
  --fs-xs: .8125rem; --fs-s: .875rem; --fs-m: 1rem; --fs-l: 1.125rem; --fs-xl: 1.5rem;
  --r-s: 6px; --r-m: 8px; --r-l: 12px;
  --layer1: 0 1px 2px rgba(29,36,51,.06), 0 1px 1px rgba(29,36,51,.04);
  --row: 34px;
}
* { box-sizing: border-box; }
/* 時刻の帯の下（ホーム画面から開いたとき）にはページの外側の色が出るので、見出しの帯と同じ青にする。新しいiOSは時刻の帯の設定を見ずに
   この色をぼかして出すため、薄い地の色のままだと上がもやのように見えた（10/29 WAS-2386）。本文は地の色で画面の高さいっぱいに敷く */
html { font-size: 16px; -webkit-text-size-adjust: 100%; background: var(--bar); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "BIZ UDPGothic", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  font-size: var(--fs-m); line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
/* iPadのSafariで、押した所に残る色の四角を出さない（押したことは開いた形とボタンの色で分かる） */
button, summary { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--main-line); outline-offset: 2px; }

/* 上の帯 */
.appbar { background: var(--bar); color: var(--white); padding-top: env(safe-area-inset-top); }
.appbar .in { max-width: 1120px; margin: 0 auto; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.logo { font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; display: flex; align-items: center; }
.logo span { font: inherit; letter-spacing: inherit; }
.signout { background: none; border: 1px solid rgba(255,255,255,.45); color: var(--white); border-radius: var(--r-s); font-size: var(--fs-xs); min-height: 32px; padding: 0 12px; }

main { max-width: 1120px; margin: 0 auto; padding: 32px 24px 96px; }
h1 { font-size: var(--fs-xl); line-height: 1.35; margin: 0; letter-spacing: .01em; }
.sub { color: var(--text-grey); font-size: var(--fs-s); margin-top: 6px; line-height: 1.7; }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-l); box-shadow: var(--layer1); }

/* ログイン */
.auth { max-width: 472px; padding-top: 48px; }
.auth .panel { padding: 32px 28px 28px; }
.auth h1 { font-size: 1.25rem; margin-bottom: 8px; }
.lead { color: var(--text-grey); font-size: var(--fs-s); margin: 0 0 24px; line-height: 1.8; line-break: strict; text-wrap: pretty; }
.auth form { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.auth h2 { font-size: var(--fs-m); line-height: 1.4; margin: 0 0 14px; }
.auth form p { margin: 0 0 14px; padding: 12px 14px; font-size: var(--fs-s); line-height: 1.7; background: var(--main-light); border-radius: var(--r-m); }
.auth label { display: block; font-size: var(--fs-s); font-weight: 700; margin: 0 0 6px; }
.auth input { width: 100%; min-height: 48px; font-size: 17px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--r-m); background: var(--white); }
.auth input:focus { outline: 3px solid var(--main-line); outline-offset: 0; border-color: var(--main); }
.auth input#login-code { letter-spacing: 6px; text-align: center; font-size: 22px; }
.wide { width: 100%; min-height: 48px; padding: 10px 16px; font-size: var(--fs-m); font-weight: 700; border: 1px solid var(--main); border-radius: var(--r-m); background: var(--main); color: var(--white); }
.wide:disabled { opacity: .6; cursor: default; }
/* メールアドレスの「確認コードを送る」は2つ目の入り口なので、枠だけのボタンにする（いちばん上の「Googleでログイン」と同じ強さにしない） */
#email-signin .wide { margin-top: 14px; background: var(--white); color: var(--main-dark); }
#email-code .wide { margin-top: 14px; }
#email-restart { display: block; margin: 10px auto 0; min-height: 44px; padding: 6px 8px; background: none; border: 0; color: var(--link); font-size: var(--fs-s); text-decoration: underline; text-underline-offset: 3px; }
.link { background: none; border: 0; color: var(--link); padding: 6px 0; font-size: var(--fs-s); text-decoration: underline; text-underline-offset: 3px; }
.error { color: var(--danger); font-size: var(--fs-s); margin: 14px 0 0; line-height: 1.7; min-height: 1em; }
.error:empty { margin: 0; min-height: 0; }
.auth .error:not(:empty) { background: var(--danger-bg); border-radius: var(--r-m); padding: 10px 14px; }
.error.banner { background: var(--danger-bg); border-radius: var(--r-m); padding: 12px 16px; margin: 16px 0 0; min-height: 0; }

/* マディの担当者として見ているとき */
#staff-view { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; margin: 0 0 20px; padding: 10px 16px; font-size: var(--fs-s);
  background: #fff6e0; border: 1px solid #ecd28a; border-radius: var(--r-m); color: #5c4200; }
#staff-view p { margin: 0; flex: 1 1 240px; font-weight: 700; }
#staff-view select { min-height: 36px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--r-s); background: var(--white); color: var(--text); }

/* 今のお願いの件数と、締めまでの日程（1つの枠） */
.overview { margin-top: 20px; padding: 18px 20px 14px; }
.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.ov-head .now { font-size: var(--fs-m); font-weight: 700; display: flex; align-items: baseline; gap: 4px; line-height: 1.2; }
.ov-head .now b { color: var(--main); font-size: 2.25rem; line-height: 1; margin: 0 2px 0 8px; font-feature-settings: "tnum"; }
.refresh { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--text-grey); }

/* 日程。狭い幅（スマホ）と、右の列に置くとき（PC）は縦に並べ、左の線の上に今日の丸を置く。
   今日の位置は app.js が --pos（点の番号。2.5 なら3つ目と4つ目の真ん中）で渡す。1行の高さは --row */
.steps { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.track { position: relative; }
.track::before { content: ""; position: absolute; left: 6px; top: calc(var(--row) / 2); bottom: calc(var(--row) / 2); width: 2px; border-radius: 1px; background: var(--border); }
.fill { position: absolute; left: 6px; top: calc(var(--row) / 2); width: 2px !important; height: calc(var(--pos, 0) * var(--row)); border-radius: 1px; background: var(--main); }
.pin { position: absolute; left: 0 !important; right: 0; top: calc(var(--row) / 2 + var(--pos, 0) * var(--row)); transform: translateY(-50%); z-index: 2; pointer-events: none;
  display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; }
.pin::after { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--main); border: 2px solid var(--white); box-shadow: 0 0 0 3px var(--main-line); }
/* 「今日」と日付は右端に2行で置く（同じ行のステップの文字と重ならない幅にする） */
.pin-label { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; color: var(--main-dark); font-weight: 700; line-height: 1.2; white-space: nowrap; }
.pin-label em { font-style: normal; font-size: .75rem; color: var(--white); background: var(--main); border-radius: 10000px; padding: 2px 8px; }
.pin-label span { font-size: .75rem; }
.stepper { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; }
.stepper li { position: relative; height: var(--row); display: flex; align-items: center; gap: 8px; padding: 0 0 0 28px; min-width: 0; }
.stepper .dot { position: absolute; left: 1px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; background: var(--white); border: 2px solid var(--text-light); z-index: 1; }
.stepper li.done .dot { background: var(--main); border-color: var(--main); }
.stepper li.next .dot { border-color: var(--main); border-width: 3px; }
.stepper li b { flex: none; font-size: var(--fs-s); color: var(--text); white-space: nowrap; font-feature-settings: "tnum"; min-width: 4.6em; }
.stepper .lbl { font-size: var(--fs-s); color: var(--text); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper li.done b, .stepper li.done .lbl { color: var(--text-grey); font-weight: 400; }
.stepper li.next b, .stepper li.next .lbl { color: var(--main-dark); font-weight: 700; }

.reload { display: inline-flex; align-items: center; gap: 6px; }
.reload.busy::before { content: ""; width: 12px; height: 12px; border: 2px solid var(--main-light); border-top-color: var(--main); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* 起動中の表示（ログインか一覧を出したら消す） */
.booting { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 96px 24px; color: var(--text-grey); font-size: var(--fs-s); }
.booting .spinner { width: 18px; height: 18px; border: 2px solid var(--main-line); border-top-color: var(--main); border-radius: 50%; animation: spin .8s linear infinite; }

/* お願いの一覧。期限ごとに見出しと1枚の枠（.group の中に見出し .sec と、お願いを並べた .cards） */
.todo { margin-top: 4px; background: none; border: 0; box-shadow: none; }
.todo:empty { display: none; }
.group { margin-top: 28px; }
.sec .h { display: flex; align-items: center; gap: 10px; }
.sec h2 { font-size: var(--fs-l); line-height: 1.4; margin: 0; letter-spacing: .01em; }
.sec .why { font-size: var(--fs-s); color: var(--text-grey); margin-top: 2px; }
.group > .sec { padding: 0 4px 10px; }
.cards { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-l); box-shadow: var(--layer1); overflow: hidden; }

.task { position: relative; }
.task + .task { border-top: 1px solid var(--border); }
.row { display: flex; gap: 12px; padding: 16px 20px; align-items: flex-start; width: 100%; min-height: 56px; background: none; border: 0; text-align: left; color: inherit; }
.row:focus-visible { outline-offset: -3px; }
.check { flex: none; width: 22px; height: 22px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--text-light);
  background: var(--white); display: grid; place-items: center; color: var(--text-light); }
.check::after { content: ""; width: 5px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, -1px); opacity: 0; }
/* 開いているお願いの左の線（行に乗せたときの地の色に隠れないよう、上に重ねて描く） */
.task.open::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--main); z-index: 1; }
.chev { flex: none; width: 10px; height: 10px; margin: 6px 4px 0 4px; border-right: 2px solid var(--text-grey); border-bottom: 2px solid var(--text-grey); transform: rotate(45deg); transition: transform .15s; }
.task.open .chev { transform: rotate(-135deg); margin-top: 12px; border-color: var(--main); }
.task.done .check { border-color: var(--green); background: var(--green); color: var(--white); }
.task.done .check::after { opacity: 1; }
.body { flex: 1; min-width: 0; }
.title { font-weight: 600; line-height: 1.55; overflow-wrap: anywhere; line-break: strict; }
.task.unread .title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--main); margin-right: 8px; vertical-align: 2px; }
.meta { display: flex; gap: 6px 8px; align-items: center; font-size: var(--fs-xs); color: var(--text-grey); margin-top: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 5px; min-height: 26px; padding: 0 10px 0 8px; border-radius: 10000px;
  font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; line-height: 1; }
.chip svg { width: 13px; height: 13px; fill: currentColor; flex: none; }
.chip small { font-size: .75rem; font-weight: 400; margin-left: 2px; color: var(--text-grey); }
.chip.who { background: var(--white); color: var(--text); box-shadow: inset 0 0 0 1px #cfd5de; }
.chip.who svg { color: var(--text-grey); }
.chip.to { background: #fdefd9; color: #7a4100; }
.chip.ibow { background: #efe9fb; color: #54378f; }
.chip.reply { background: #dff2f2; color: var(--green); }
.chip.plus { background: #e4f4e7; color: #17642a; }
.status { display: inline-flex; align-items: center; min-height: 26px; font-size: var(--fs-xs); font-weight: 700; color: var(--main-dark); background: var(--main-light); border-radius: 10000px; padding: 0 10px; line-height: 1; }
.status.green { color: var(--green); background: #dff2f2; }
.status.grey { color: var(--text-grey); background: #eceff3; }
.preview { font-size: var(--fs-s); color: var(--text-grey); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task.open .preview { display: none; }

/* 開いたお願いの中 */
.detail { display: none; padding: 0 20px 20px; font-size: var(--fs-s); }
.task.open .detail { display: block; }
.detail .whyp { margin: 0 0 14px; color: var(--text); font-size: .9375rem; line-height: 1.8; line-break: strict; }
.detail .duep { margin: 0 0 14px; color: var(--text-grey); font-size: var(--fs-xs); }
.choices { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn { min-height: 40px; padding: 0 16px; border-radius: var(--r-m); border: 1px solid var(--border-strong); background: var(--white);
  color: var(--text); font-size: var(--fs-s); font-weight: 700; line-height: 1.3; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--main); border-color: var(--main); color: var(--white); min-width: 96px; }
.btn.ghost { border-color: transparent; color: var(--link); font-weight: 400; background: none; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: var(--fs-xs); border-color: var(--main-line); color: var(--main-dark); }
.choices input, .choices select { min-height: 40px; border: 1px solid var(--border-strong); border-radius: var(--r-m); padding: 0 10px; font-size: var(--fs-s); background: var(--white); min-width: 0; }
.choices input:focus, .choices select:focus, .comment textarea:focus { outline: 3px solid var(--main-line); outline-offset: 0; border-color: var(--main); }
/* 入力の要る答え。入力欄を先に、送るボタンを後に見せる（部品の順はボタンが先なので、見た目の順だけ入れ替える） */
.choices .pair { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; width: 100%; max-width: 560px;
  background: var(--soft); border-radius: var(--r-m); padding: 12px 14px; }
.choices .pair > .btn { order: 3; }
.choices .pair > input { flex: 1 1 180px; }
.choices .pair > input[type="date"] { flex: 0 1 200px; }
.choices.stack { flex-direction: column; align-items: flex-start; }
.choices .pair-lbl { font-size: var(--fs-s); font-weight: 700; }
.choices label.pair-lbl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; }
.item-error { color: var(--danger); font-size: var(--fs-s); margin-top: 10px; background: var(--danger-bg); border-radius: var(--r-m); padding: 8px 12px; }

/* やり取り */
.thread { margin: 0 0 14px; }
.older { margin-bottom: 10px; }
.older summary { color: var(--link); cursor: pointer; font-size: var(--fs-s); margin-bottom: 8px; }
.msg { margin: 0 0 10px; max-width: 640px; }
.msg .from { font-size: var(--fs-xs); font-weight: 700; color: var(--text-grey); }
.msg .from.us { color: var(--main-dark); }
.msg .text { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border-radius: 2px 12px 12px 12px; padding: 10px 14px; margin-top: 4px; line-height: 1.75; line-break: strict; }
.msg .from.us + .text { background: var(--main-light); }
.msg.current .text { font-size: .9375rem; text-wrap: pretty; }
.comment { margin-top: 10px; font-size: var(--fs-xs); }
.btn.consult-open { padding: 0; min-height: 36px; font-size: var(--fs-s); font-weight: 400; color: var(--link); background: none; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.comment .box { display: grid; gap: 8px; margin-top: 4px; max-width: 640px; }
.comment textarea { width: 100%; min-height: 88px; border: 1px solid var(--border-strong); border-radius: var(--r-m); padding: 10px 12px; font-size: var(--fs-s); line-height: 1.7; resize: vertical; background: var(--white); }
.comment textarea::placeholder { color: #6d7684; }
.comment .note { color: var(--text-grey); line-height: 1.6; }
.comment .box .btn { justify-self: start; min-width: 96px; border-color: var(--main); color: var(--main-dark); }

/* 自分の答え */
.myanswer { margin-bottom: 14px; padding: 12px 14px; background: var(--soft); border-radius: var(--r-m); max-width: 640px; }
.myanswer .lbl { font-size: var(--fs-xs); color: var(--text-grey); font-weight: 700; }
.myanswer .val { color: var(--text); margin: 2px 0 0; overflow-wrap: anywhere; line-height: 1.7; }
.myanswer .acts { display: flex; gap: 12px; align-items: center; margin-top: 4px; }

/* マディから返信が届いています */
.replies { margin-top: 24px; overflow: hidden; border-color: var(--main-line); }
.replies .sec { padding: 12px 20px; background: var(--main-light); border-bottom: 1px solid var(--main-line); }
.replies .sec h2 { color: var(--main-dark); font-size: var(--fs-m); }
.replies .dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--main); }
.replies .task.open::before, .donelist .task.open::before { display: none; }

.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 10000px;
  background: var(--main); color: var(--white); font-size: var(--fs-xs); font-weight: 700; line-height: 1; font-feature-settings: "tnum"; }
.badge.grey { background: #e3e7ee; color: #454e5c; }

.empty { margin-top: 24px; padding: 20px; color: var(--text-grey); font-size: var(--fs-s); }
.empty p { margin: 0; }
/* 回答済み（たたんである） */
.donelist { margin-top: 28px; overflow: hidden; }
.donelist summary { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 20px; cursor: pointer; font-weight: 700; font-size: var(--fs-s); color: var(--text); list-style: none; }
.donelist summary::-webkit-details-marker { display: none; }
.donelist summary::after { content: ""; margin: -4px 6px 0 auto; width: 10px; height: 10px; border-right: 2px solid var(--text-grey); border-bottom: 2px solid var(--text-grey); transform: rotate(45deg); transition: transform .15s; }
.donelist details[open] summary::after { transform: rotate(-135deg); margin-top: 6px; }
.donelist details[open] summary { border-bottom: 1px solid var(--border); }
.donelist .task .title { color: var(--text-grey); font-weight: 400; }
.donelist .detail { padding-left: 54px; }
footer { margin-top: 28px; padding: 0 4px; font-size: var(--fs-s); color: var(--text-grey); line-height: 1.8; }

/* マウスのある画面（PC）だけ、乗せたときに色を変える。iPadでは押した後に色が残るので付けない */
@media (hover: hover) {
  .row:hover { background: #f8fafc; }
  .task:not(.done) .row:hover .title { color: var(--main-dark); }
  .btn:hover { background: var(--soft); }
  .btn.primary:hover, .wide:hover { background: var(--main-dark); border-color: var(--main-dark); }
  #email-signin .wide:hover { background: var(--main-light); }
  .btn.consult-open:hover { background: none; color: var(--main-dark); }
  .signout:hover { background: rgba(255,255,255,.12); }
  .donelist summary:hover { background: #f8fafc; }
}

/* 指で押す画面（スマホ・iPad）。押す所を44px以上にし、入力欄の文字を16pxにする（16pxより小さいと、入力のときにSafariが画面を拡大する） */
@media (pointer: coarse) {
  .btn { min-height: 48px; padding: 0 20px; font-size: var(--fs-m); }
  .choices input, .choices select { min-height: 48px; font-size: 16px; }
  .comment textarea { font-size: 16px; }
  .link { min-height: 44px; font-size: var(--fs-s); }
  .signout { min-height: 44px; padding: 0 14px; font-size: var(--fs-s); }
  .btn.small { min-height: 44px; padding: 0 14px; font-size: var(--fs-s); }
  .btn.consult-open { padding: 0; min-height: 44px; font-size: var(--fs-s); }
  .older summary { padding: 10px 0; }
  .toast { font-size: var(--fs-m); }
}

/* 答えた直後の通知（取り消せるときは「取り消す」） */
.toast { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10;
  background: var(--ink); color: var(--white); border-radius: var(--r-l); padding: 12px 18px; font-size: var(--fs-s);
  display: flex; gap: 14px; align-items: center; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(29,36,51,.28); }
.toast .link { color: #9ccbff; padding: 0; white-space: nowrap; font-weight: 700; }

/* iPadの縦など、中くらいの幅: 日程を横の線にして、線の上に今日の丸を置く（点 i は列 i の真ん中） */
@media (min-width: 640px) and (max-width: 1023.98px) {
  .overview { padding: 20px 24px; }
  .steps { margin-top: 18px; padding-top: 16px; }
  .track { padding-top: 54px; }
  .track::before { top: 59px; bottom: auto; left: calc(50% / var(--n)); right: calc(50% / var(--n)); width: auto; height: 3px; }
  .fill { top: 59px; left: calc(50% / var(--n)); height: 3px; width: calc(var(--pos, 0) / var(--n) * 100%) !important; }
  .pin { top: 0; right: auto; left: calc((var(--pos, 0) + .5) / var(--n) * 100%) !important; height: 68px; transform: translateX(-50%);
    flex-direction: column; justify-content: flex-end; align-items: center; }
  .pin-label { align-items: center; gap: 0; margin-bottom: 8px; background: var(--main-light); border-radius: 12px; padding: 4px 12px; }
  .pin-label em { background: none; color: inherit; padding: 0; font-size: var(--fs-xs); }
  .pin-label span { font-size: var(--fs-xs); }
  .stepper { grid-template-columns: repeat(var(--n, 5), 1fr); }
  .stepper li { height: auto; display: block; padding: 22px 4px 0; text-align: center; }
  .stepper .dot { top: -1px; left: 50%; transform: translateX(-50%); width: 13px; height: 13px; }
  .stepper li b { display: block; min-width: 0; }
  .stepper .lbl { display: block; font-size: .75rem; white-space: normal; text-wrap: balance; }
}

/* PCとiPadの横: 左にお願い、右に件数と日程（スクロールしても見える所に固定） */
@media (min-width: 1024px) {
  #panel-receipt { display: grid; grid-template-columns: minmax(0, 1fr) 352px; column-gap: 32px; align-items: start; padding-top: 40px; }
  #panel-receipt > * { grid-column: 1; }
  main#app { padding-top: 40px; }
  #panel-receipt > .overview { grid-column: 2; grid-row: 1 / span 12; margin-top: 0; position: sticky; top: 24px; padding: 24px; }
  .ov-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .ov-head .now b { font-size: 2.75rem; }
  .refresh { width: 100%; justify-content: space-between; }
  .steps { margin-top: 20px; padding-top: 16px; }
  :root { --row: 38px; }
}

/* スマホと狭い幅 */
@media (max-width: 639.98px) {
  main { padding: 24px 16px 96px; }
  .appbar .in { padding: 0 16px; }
  h1 { font-size: 1.375rem; }
  .auth { padding-top: 20px; }
  .auth .panel { padding: 24px 20px; }
  .overview { padding: 16px 16px 10px; }
  .row { padding: 16px; }
  .detail { padding: 0 16px 18px; }
  .donelist .detail { padding-left: 16px; }
  .replies .sec { padding: 12px 16px; }
  .donelist summary { padding: 0 16px; }
  .group { margin-top: 24px; }
  /* ボタンは横幅いっぱいに並べ、押しやすくする */
  .choices { flex-direction: column; align-items: stretch; }
  .choices > .btn { width: 100%; }
  .choices .pair { max-width: none; }
  .choices .pair > .btn { flex: 1 1 100%; }
  .choices .pair > input, .choices .pair > input[type="date"] { flex: 1 1 160px; }
  .choices.stack { align-items: stretch; }
}

/* PC・iPad・スマホの共通画面。390px幅でも入力欄を枠内に収める。 */
.consult-panel { padding: 20px 24px; }
.consult-panel label { display: block; margin-top: 12px; }
.consult-panel textarea { width: 100%; max-width: 100%; min-height: 90px; font-size: 16px; padding: 10px; border: 1px solid var(--border); border-radius: var(--r-s); resize: vertical; }
.consult-panel .btn { margin-top: 8px; min-height: 44px; }
.note { font-size: var(--fs-s); color: var(--text-grey); }
.consult-entry { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.consult-entry h2 { font-size: var(--fs-m); }
.consult-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.todo-heading { margin-top: 24px; }
@media (max-width: 640px) {
  .consult-panel { padding: 16px; }
  .choices .pair, .choices .pair-lbl { max-width: 100%; min-width: 0; }
  .choices input, .choices select { max-width: 100%; min-width: 0; }
  .chip { white-space: normal; overflow-wrap: anywhere; }
  .toast { width: calc(100% - 32px); }
}

/* 業務タブ。390pxでも3つを1行に収める */
.business-tabs { display: flex; gap: 4px; padding: 4px; background: var(--white); border-radius: var(--r-l); box-shadow: var(--layer1); }
.business-tabs [role="tab"] { flex: 1; min-width: 0; border: 0; border-radius: var(--r-m); padding: 12px 4px; background: transparent; color: var(--text-grey); font-size: var(--fs-s); font-weight: 700; cursor: pointer; white-space: nowrap; }
.business-tabs [aria-selected="true"] { color: var(--main); background: var(--main-light); }
.business-tabs .badge { margin-left: 4px; padding: 1px 5px; }
.business-tabs [role="tab"]:focus-visible { outline: 2px solid var(--main); outline-offset: -2px; }
.board-refresh { justify-content: flex-end; margin: 16px 0; }

.arrival-people .arrival-person { margin-bottom: 8px; }
.arrival-missing .status { color: #92400e; background: #fef3c7; }
.arrival-name_pending .status { color: #6b21a8; background: #f3e8ff; }
.arrival-received .status { color: #166534; background: #dcfce7; }

/* 提供票も期限ごとのお願いと同じ見出し・カードの構成を使う。 */
.arrival-icon { flex: none; width: 20px; height: 20px; margin-top: 2px; color: var(--text-light); }
.arrival-icon svg { width: 100%; height: 100%; fill: currentColor; }
.arrivals .detail { overflow-wrap: anywhere; }
.arrival-heading { font-size: inherit; font-weight: 700; margin: 12px 0 4px; }
.arrival-people { margin: 0 0 8px; padding-left: 1.5em; list-style-type: disc; }
.arrival-people li { line-height: 1.5; }
.arrivals .meta > span { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

/* チャット・やること・書類（WAS-3004） */
body { overflow-x: hidden; }
#app { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.portal-tabs { position:fixed; bottom:0; left:0; right:0; z-index:30; display:flex; background:#fff; border-top:1px solid #e2e6ed; padding:4px 3px max(4px,env(safe-area-inset-bottom)); }
.portal-tabs button { flex:1; min-width:0; min-height:58px; border:0; background:#fff; color:#5a6472; border-radius:6px; font-size:14px; }
.portal-tabs button[aria-selected="true"] { color:#0b63ce; background:#e8f1fc; font-weight:700; }
#panel-consult { background:#f3f5f8; }
.chat-active #app > footer { display:none; }
#consult-list { height:calc(100dvh - 300px - env(safe-area-inset-bottom)); min-height:150px; overflow:auto; overscroll-behavior:contain; padding:12px 10px; }
.chat-message { display:flex; flex-direction:column; align-items:flex-start; margin:0 0 18px; padding-right:35px; overflow-wrap:anywhere; }
.chat-message.own { align-items:flex-end; padding-left:35px; padding-right:0; }
.chat-bubble { background:white; border:1px solid #e2e6ed; border-radius:0 12px 12px 12px; padding:10px 13px; white-space:pre-wrap; margin:4px 0; max-width:100%; }
.own .chat-bubble { background:#e8f1fc; border-color:#caddf6; border-radius:12px 0 12px 12px; }
.consult-composer { position:fixed; bottom:calc(67px + env(safe-area-inset-bottom)); left:0; right:0; background:white; padding:8px 10px; border-top:1px solid #e2e6ed; z-index:25; }
.consult-composer .note { font-size:10px; margin:0 0 5px; }
.compose-row { display:flex; gap:8px; align-items:center; max-width:900px; margin:auto; }
.compose-row textarea { flex:1; min-width:0; width:0; resize:none; }
#consult-feedback { margin:2px 0; font-size:12px; }
#staff-switch { display:flex; gap:8px; padding:10px; }
#inbox { padding:0 10px; }
.inbox-card { overflow-wrap:anywhere; }
.inbox-actions { display:flex; gap:8px; flex-wrap:wrap; }
.reply-editor { margin-top:15px; }
.reply-editor textarea, .reply-editor input { display:block; width:100%; max-width:100%; margin-bottom:10px; }
.reply-preview { background:#e8f1fc; padding:12px; border-radius:8px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.inbox-card { padding:16px; margin:12px 0; }
.inbox-card h2 { font-size:18px; margin:0 0 8px; }
.inbox-card h3 { font-size:15px; margin:18px 0 8px; }
#staff-switch button { min-height:44px; border:1px solid var(--border); border-radius:6px; background:white; padding:8px 12px; }
.staff-mode .portal-tabs { position:static; border:1px solid var(--border); border-radius:8px; padding:4px; margin:0 0 12px; }
.staff-mode .consult-composer { display:none; }
.staff-mode #consult-list { height:calc(100dvh - 330px); }

#staff-switch button[aria-selected="true"] { color:var(--main); background:var(--main-light); border-color:var(--main); font-weight:700; }
#staff-switch .badge { margin-left:6px; }
.speaker-label { font-size:13px; font-weight:700; margin:12px 0 4px; }
.inbox-reply { margin:12px 0 12px 12px; padding:10px 12px; background:#f3f5f8; border-radius:8px; }
.inbox-reply .speaker-label { margin-top:0; }
.chat-active .board-refresh { position:relative; z-index:5; background:#fff; padding:8px 10px; margin:0; width:auto; }

/* PCを主にしたリモート事務とオペレーション。900px未満は下部ナビ。 */
.appbar .in { max-width:none; gap:12px; }
#station-identity { margin-left:auto; font-size:13px; }
.portal-tabs button { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; cursor:pointer; }
.portal-tabs svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.portal-tabs .badge { position:absolute; top:2px; right:calc(50% - 30px); margin:0; }
#inbox-summary { display:none; }
.compose-row { max-width:none; }
.chat-message:not(.own) { position:relative; padding-left:43px; }
.chat-message:not(.own)::before { content:"m"; position:absolute; left:0; top:0; width:34px; height:34px; border-radius:50%; background:var(--bar); color:white; display:grid; place-items:center; font-weight:700; }
.chat-bubble { max-width:min(85%, 660px); }
@media (min-width:900px) {
  :root { --nav-width:112px; }
  .appbar { position:sticky; top:0; z-index:40; }
  main#app { max-width:none; margin:0 0 0 var(--nav-width); padding:0 24px 24px; }
  .portal-tabs, #staff-switch { position:fixed; top:56px; bottom:0; left:0; right:auto; width:var(--nav-width); flex-direction:column; justify-content:flex-start; gap:6px; padding:12px 6px; border:0; border-right:1px solid var(--border); border-radius:0; background:white; margin:0; z-index:30; }
  .portal-tabs button, #staff-switch button { flex:none; min-height:76px; padding:10px 2px; font-size:12px; border:0; background:transparent; overflow-wrap:anywhere; }
  .portal-tabs .badge { top:3px; right:20px; }
  .staff-mode .portal-tabs { position:static; width:auto; flex-direction:row; border:1px solid var(--border); border-radius:8px; margin:12px auto; padding:4px; max-width:960px; }
  .staff-mode .portal-tabs button { flex:1; }
  #staff-switch button { display:flex; flex-direction:column; align-items:center; gap:6px; }
  #staff-switch .badge { margin:0; }
  #panel-receipt, #panel-teikyohyo, #staff-view, #app > footer { max-width:960px; margin-left:auto; margin-right:auto; }
  #panel-receipt { display:block; padding-top:16px; }
  #panel-receipt > .overview { position:static; margin:16px 0; }
  .board-refresh { max-width:960px; margin:0 auto; padding:12px 0; }
  .chat-active #app { height:calc(100dvh - 56px); display:flex; flex-direction:column; padding:0; overflow:hidden; }
  .chat-active .board-refresh { flex:none; max-width:none; width:100%; padding:8px 24px; }
  .chat-active #panel-consult { display:flex; flex:1; flex-direction:column; min-height:0; }
  #consult-list, .staff-mode #consult-list { flex:1; height:auto; min-height:0; padding:18px 24px; }
  .consult-composer { position:static; flex:none; padding:8px 24px; }
  .consult-composer .note { font-size:12px; }
  #inbox { padding:24px 0 0; }
  .inbox-workspace { display:grid; grid-template-columns:minmax(260px, 340px) minmax(0, 1fr); gap:24px; align-items:start; }
  #inbox-summary { display:flex; flex-direction:column; gap:8px; max-height:calc(100dvh - 160px); overflow:auto; position:sticky; top:80px; }
  .inbox-summary { display:flex; flex-direction:column; gap:5px; width:100%; min-width:0; text-align:left; border:1px solid var(--border); border-radius:8px; background:white; padding:14px; cursor:pointer; }
  .inbox-summary[aria-pressed="true"] { background:var(--main-light); border-color:var(--main); }
  .inbox-first-line { display:block; max-width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
  #inbox-list { min-width:0; }
  #inbox-list .inbox-card { display:none; margin-top:0; }
  #inbox-list .inbox-card.inbox-selected { display:block; }
  .staff-mode .board-refresh { margin-top:12px; }
}
@media (min-width:900px) {
  body { display:flow-root; }
  #staff-switch svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
}
@media (max-width:899.98px) {
  .logo { font-size:15px; white-space:nowrap; }
  #station-identity { font-size:11px; }
  .appbar .in { gap:8px; padding:0 10px; }
}
@media (max-width:899.98px) { #staff-switch svg { display:none; } }

.inbox-answered > summary { cursor:pointer; padding:12px 4px; color:var(--text-grey); }
.discard-confirm { margin-top:12px; padding:12px; border:1px solid var(--border); border-radius:8px; background:#fff8eb; }
.discard-confirm .btn { margin-right:8px; }
@media (min-width:900px) {
  #inbox-summary .inbox-answered .inbox-summary { margin-top:8px; }
  #inbox-list .inbox-answered > summary { display:none; }
}

/* 社内オペレーションの受信箱。ステーションのスタイルには適用しない。 */
.staff-mode .appbar .in { max-width:none; padding:0 18px; }
.staff-mode main#app { margin:0; padding:0; max-width:none; }
.staff-mode .board-refresh { position:fixed; top:9px; right:130px; z-index:41; margin:0; padding:0; }
.staff-mode #as-of { display:none; }
.staff-mode .board-refresh .btn { min-height:36px; background:white; }
.staff-mode #inbox { padding:0; }
.staff-mode .inbox-workspace { display:grid; grid-template-columns:300px minmax(300px,1fr) 280px; gap:0; height:calc(100dvh - 56px); align-items:stretch; background:white; }
.conversation-sidebar { display:flex; flex-direction:column; min-height:0; border-right:1px solid var(--border); background:#f8fafc; }
.conversation-sidebar h1 { font-size:20px; margin:20px 18px 14px; }
#inbox-search { width:calc(100% - 28px); margin:0 14px 12px; min-height:38px; border:1px solid var(--border); border-radius:6px; padding:8px; background:white; font-size:13px; }
#inbox-filters { display:flex; flex-wrap:wrap; gap:4px; padding:0 12px 12px; }
.inbox-filter { background:transparent; color:var(--text-grey); border:0; border-radius:5px; padding:8px 6px; font-size:12px; cursor:pointer; }
.inbox-filter[aria-pressed="true"] { color:var(--main); background:var(--main-light); font-weight:700; }
.staff-mode #inbox-summary { display:flex; flex-direction:column; gap:0; position:static; overflow-y:auto; max-height:none; flex:1; }
.conversation-row { display:flex; flex-direction:column; gap:7px; width:100%; text-align:left; border:0; border-top:1px solid #e8edf2; border-left:3px solid transparent; padding:16px 15px; background:transparent; cursor:pointer; min-height:108px; font:inherit; color:var(--text); }
.conversation-row[aria-pressed="true"] { background:#eaf3fc; border-left-color:var(--main); }
.conversation-row strong { font-size:14px; }
.conversation-preview { font-size:13px; white-space:nowrap; text-overflow:ellipsis; overflow:hidden; width:100%; color:var(--text-grey); }
.waiting-time { color:#a65b16; font-size:12px; }
.staff-mode #inbox-list { min-width:0; min-height:0; overflow:hidden; }
.conversation-panel { display:flex; height:100%; flex-direction:column; }
.conversation-heading { display:flex; align-items:center; gap:10px; padding:17px 22px; border-bottom:1px solid var(--border); flex:none; min-height:76px; }
.conversation-heading h2 { font-size:17px; margin:0; flex:1; overflow-wrap:anywhere; }
.conversation-status { font-size:12px; white-space:nowrap; border-radius:12px; padding:4px 9px; background:#edf3f8; }
.conversation-history { flex:1; min-height:0; overflow-y:auto; padding:24px; background:#fff; }
.operator-message { max-width:85%; margin-bottom:24px; overflow-wrap:anywhere; }
.operator-message.from-maddy { margin-left:auto; text-align:right; }
.operator-bubble { white-space:pre-wrap; text-align:left; border:1px solid #e5eaf0; border-radius:10px; padding:12px 14px; margin:7px 0; font-size:14px; line-height:1.7; background:#f5f7fa; }
.from-maddy .operator-bubble { background:#edf6ff; border-color:#dbeaf8; }
.reply-record { display:block; color:var(--text-grey); font-size:10px; }
.operator-composer { flex:none; padding:14px 20px; border-top:1px solid var(--border); background:#fff; max-height:52%; overflow-y:auto; }
.operator-draft:empty { display:none; }
.operator-draft { padding:12px 14px; background:#f5f7fc; border:1px solid #e1e7f0; border-radius:8px; margin-bottom:12px; font-size:12px; }
.operator-draft strong { font-size:12px; color:#59699b; }
.draft-text { margin:8px 0; white-space:pre-wrap; line-height:1.65; }
.operator-draft .note { display:block; margin-bottom:8px; }
.operator-reply, #inbox-info textarea { width:100%; min-height:84px; resize:vertical; border:1px solid var(--border-strong); border-radius:6px; padding:10px; font:inherit; font-size:14px; background:white; }
.operator-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; margin-top:8px; }
.operator-actions .btn:last-child { margin-left:auto; font-size:12px; }
.operator-composer input { margin:8px 0; padding:8px; max-width:100%; }
.operator-composer .error:empty { display:none; }
.operator-composer .error { font-size:12px; margin-bottom:0; }
.staff-mode #inbox-info { padding:22px 18px; overflow-y:auto; border-left:1px solid var(--border); background:#fbfcfe; overflow-wrap:anywhere; }
#inbox-info h2 { font-size:16px; margin:0 0 28px; }
#inbox-info h3 { font-size:13px; margin:26px 0 10px; }
#inbox-info .note { font-size:12px; }
#inbox-info .station-task, #inbox-info .station-document { padding:10px 0; border-bottom:1px solid var(--border); font-size:12px; line-height:1.6; margin:0; }
#inbox-info .btn { margin-top:8px; }
#inbox-info textarea { font-size:12px; }
.mobile-only { display:none; }
.inbox-empty { padding:20px; color:var(--text-grey); font-size:13px; }
#inbox-error:empty { display:none; }
#inbox-error { position:fixed; bottom:0; left:0; right:0; background:#fff0ee; padding:12px; margin:0; z-index:50; }
@media (min-width:1500px) { .staff-mode .inbox-workspace { grid-template-columns:340px minmax(300px,1fr) 320px; } }
@media (max-width:899.98px) {
  .staff-mode .inbox-workspace { display:block; height:calc(100dvh - 56px); }
  .staff-mode .conversation-sidebar, .staff-mode #inbox-list, .staff-mode #inbox-info { height:100%; }
  .staff-mode #inbox[data-mobile-panel="list"] #inbox-list, .staff-mode #inbox[data-mobile-panel="list"] #inbox-info,
  .staff-mode #inbox[data-mobile-panel="thread"] .conversation-sidebar, .staff-mode #inbox[data-mobile-panel="thread"] #inbox-info,
  .staff-mode #inbox[data-mobile-panel="info"] .conversation-sidebar, .staff-mode #inbox[data-mobile-panel="info"] #inbox-list { display:none; }
  .staff-mode .mobile-only { display:inline-block; font-size:12px; padding:6px 8px; min-height:36px; }
  .conversation-heading { padding:12px 10px; gap:6px; }
  .conversation-heading h2 { font-size:14px; }
  .conversation-status { font-size:10px; padding:3px 5px; }
  .conversation-history { padding:16px 12px; }
  .operator-composer { padding:12px; }
  .staff-mode .board-refresh { right:98px; top:10px; }
  .staff-mode .board-refresh .btn { font-size:11px; padding:5px; }
  .staff-mode .logo { font-size:13px; }
}

/* 担当者だけの工程表示。各帯のスクロールを画面全体から分離する。 */
.operations-tabs { display:flex; gap:24px; padding:0 24px; border-bottom:1px solid var(--border); background:white; }
.operations-tabs button { border:0; background:transparent; padding:16px 4px; font:inherit; color:#596675; border-bottom:3px solid transparent; cursor:pointer; }
.operations-tabs [aria-selected="true"] { color:#0077c7; border-bottom-color:#0077c7; font-weight:700; }
.staff-mode .inbox-workspace { height:calc(100dvh - 112px); }
#operations-progress { padding:24px; background:#f5f7fa; min-height:calc(100dvh - 112px); }
#operations-progress h1 { font-size:22px; margin:0 0 8px; }
#operations-progress h2 { font-size:17px; }
#operations-progress h3 { font-size:14px; }
.progress-summary { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:22px 0; }
.progress-metric { display:flex; flex-direction:column; gap:12px; border:1px solid var(--border); border-radius:10px; background:white; padding:18px; }
.progress-metric strong { font-size:22px; }
.progress-toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin:16px 0; }
.progress-toolbar input { padding:10px; font:inherit; border:1px solid var(--border); border-radius:6px; max-width:100%; }
.progress-toolbar [aria-pressed="true"] { background:#e5f1fc; border-color:#0077c7; color:#005a97; }
.progress-legend { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; font-size:12px; }
.progress-key { border-radius:4px; padding:5px 8px; }
.progress-layout { display:grid; grid-template-columns:minmax(0,1fr) 310px; align-items:start; gap:18px; }
.progress-stations { min-width:0; max-height:580px; overflow-y:auto; }
.progress-station { background:white; border:1px solid var(--border); border-radius:8px; padding:14px; margin-bottom:10px; scroll-margin:12px; }
.progress-station h3 { margin:0 0 12px; }
.progress-band { display:grid; grid-template-columns:repeat(23,minmax(28px,1fr)); gap:4px; overflow-x:auto; padding:4px 3px 10px; }
.progress-cell { white-space:pre-line; font:inherit; font-size:11px; line-height:1.8; border:1px solid #d5dce5; border-radius:4px; min-height:48px; cursor:pointer; }
#operations-progress .completed, .station-progress-band .completed { background:#e0f0e8; color:#216746; }#operations-progress .running, .station-progress-band .running { background:#ddecff; color:#185dad; }#operations-progress .waiting, .station-progress-band .waiting { background:#fff0cb; color:#805b10; }#operations-progress .overdue, .station-progress-band .overdue { background:#ffe1d5; color:#9b3f1d; }#operations-progress .blocked, .station-progress-band .blocked { background:#f9dce1; color:#a02037; }#operations-progress .pending, .station-progress-band .pending { background:#f0f2f5; color:#6b7480; }
.progress-cell.current { outline:2px solid #172e4c; outline-offset:1px; }
.progress-cell[aria-pressed="true"] { box-shadow:inset 0 0 0 2px #0077c7; }
.progress-detail { background:white; border:1px solid var(--border); border-radius:8px; padding:18px; overflow-wrap:anywhere; }
.progress-detail p { font-size:13px; line-height:1.7; }
.progress-decisions,.progress-processes { margin-top:28px; }
.progress-decision { padding:18px; margin:12px 0; background:white; border:1px solid var(--border); border-radius:8px; }
.progress-decision p { font-size:14px; line-height:1.7; white-space:pre-wrap; }
.progress-decision textarea { display:block; width:100%; max-width:600px; font:inherit; padding:10px; border:1px solid var(--border); border-radius:6px; }
.progress-process { display:flex; flex-wrap:wrap; gap:12px; padding:14px; border-bottom:1px solid var(--border); background:white; font-size:13px; }
.station-progress-summary .station-progress-band { grid-template-columns:repeat(23,minmax(0,1fr)); gap:2px; overflow:visible; padding:3px; }
.station-progress-band .progress-cell { display:block; min-width:0; min-height:16px; font-size:0; line-height:16px; text-align:center; cursor:default; }
.station-progress-problem { margin:8px 0; font-size:12px; }
.station-progress-link { display:inline-block; margin-top:4px; font-size:12px; }
@media(max-width:900px) { .progress-layout { grid-template-columns:minmax(0,1fr); }.progress-summary { grid-template-columns:repeat(2,minmax(0,1fr)); } #operations-progress { padding:16px; }.progress-metric { padding:12px; }.progress-metric strong { font-size:17px; }.progress-stations { max-height:420px; } }

/* 担当者の事務進行。ステーション向けのタブには適用しない。 */
.attention-list,.all-stations,.schedule-detail {margin:24px 0;padding:20px;background:#fff;border:1px solid #dbe3e9;border-radius:12px}
.attention-row {display:block;width:100%;text-align:left;padding:14px 12px;border:0;border-bottom:1px solid #eadbd4;background:#fff9f4;color:#63341c;line-height:1.8;cursor:pointer}
.work-station {display:grid;grid-template-columns:180px repeat(3,minmax(0,1fr));gap:12px;padding:18px 0;border-top:1px solid #dbe3e9;align-items:start}
.station-name {text-align:left;border:0;background:none;color:#185f78;font-weight:700;cursor:pointer;padding:10px}
.work-job {padding:14px;background:#f2f8f6;border-radius:8px;min-width:0}.work-job.behind {background:#fff4e7}
.work-job h3 {margin:0;font-size:15px}.work-job p {overflow-wrap:anywhere}.work-job progress {display:block;width:100%;height:9px;margin:12px 0;accent-color:#268375}
.schedule-scroll {overflow:auto;padding-bottom:16px}.schedule-chart {position:relative;min-width:1250px;margin-left:310px;margin-right:100px;padding-top:32px}
.schedule-axis {position:relative;height:28px}.schedule-axis span {position:absolute;font-size:10px;transform:rotate(-45deg);white-space:nowrap}
.schedule-row {position:relative;min-height:66px;border-top:1px solid #e8edef}.schedule-name {position:absolute;right:calc(100% + 14px);width:290px;font-size:12px;line-height:1.5}
.schedule-bar {position:absolute;top:8px;height:34px;min-width:8px;background:#dce5eb;border-radius:5px;font-size:10px;white-space:nowrap;padding:3px;color:#263b49}
.schedule-bar.completed {background:#b8e2d3}.schedule-bar.running {background:#bcd9f6}.schedule-bar.waiting {background:#ffd89c}
.schedule-today {position:absolute;top:0;bottom:0;border-left:2px solid #c04c4c;color:#a93030;z-index:1;pointer-events:none;font-size:12px}
@media(max-width:800px) {.work-station {grid-template-columns:1fr}.attention-list,.all-stations,.schedule-detail {padding:12px}.attention-row {overflow-wrap:anywhere}.schedule-scroll {max-width:100%}}
.schedule-bar.blocked,.schedule-bar.overdue {background:#f4b9b4}
@media(max-width:800px) {.work-job {grid-column:1 !important}}

.attention-scroll {overflow-x:auto}
.attention-table {width:100%;border-collapse:collapse;text-align:left}
.attention-table th,.attention-table td {padding:10px 12px;border-bottom:1px solid #eadbd4}
.attention-table .attention-row {display:table-row;line-height:1.5}
.attention-table th {white-space:nowrap}
.attention-row button {border:0;background:transparent;color:inherit;text-align:left;cursor:pointer}
.attention-detail {background:#fff9f4}

/* オペレーター・責任者共通。見本の幅と、業務を期日順に確認する配置。 */
.staff-mode {background:#f5f6f8;color:#1d232b;font-family:"Noto Sans JP","Hiragino Sans","Yu Gothic",sans-serif;font-size:15px}
.staff-mode .appbar {background:#fff;color:#1d232b;border-bottom:1px solid #e1e5ea;box-shadow:none}
.staff-mode .appbar .in {max-width:1112px;margin:auto;padding:0 16px}
.staff-mode .signout {color:#5f6b78;border-color:#e1e5ea}
.staff-mode .operations-tabs {max-width:1112px;margin:auto;padding:12px 16px;gap:8px;background:transparent;border:0}
.staff-mode .operations-tabs button {padding:10px 14px;border:1px solid #e1e5ea;border-radius:6px;background:#fff;color:#5f6b78;font-size:14px}
.staff-mode .operations-tabs [aria-selected="true"] {background:#1f5f99;color:#fff;border-color:#1f5f99}
.staff-mode #operations-progress, .staff-mode #operations-office-progress {padding:0 16px 56px;max-width:1112px;margin:auto;background:transparent;min-height:0}
.business-tabs {display:flex;gap:4px;flex-wrap:wrap;border-bottom:1px solid #e1e5ea;margin-bottom:24px}
.business-tabs button {font:inherit;font-size:14px;background:none;border:0;border-bottom:3px solid transparent;padding:8px 14px;color:#5f6b78;cursor:pointer}
.business-tabs [aria-selected="true"] {color:#1d232b;border-bottom-color:#1f5f99;font-weight:700}
.ops-content {display:grid;gap:32px}.ops-section {min-width:0}.ops-section h2 {font-size:17px;margin:0}.ops-lead,.ops-muted {font-size:13px;color:#5f6b78}.ops-lead {margin:2px 0 10px}.ops-none {padding:14px;border:1px solid #e1e5ea;border-radius:6px;background:#fff;color:#5f6b78}
.ops-table {width:100%;border-collapse:collapse;background:#fff;border:1px solid #e1e5ea;text-align:left;font-size:14px}
.ops-table th {background:#f8f9fb;font-size:12px;font-weight:500;color:#5f6b78;padding:8px 14px;white-space:nowrap;border-bottom:1px solid #e1e5ea}
.ops-table td {padding:12px 14px;border-bottom:1px solid #e1e5ea;vertical-align:top}.ops-table td:first-child {min-width:145px}.ops-pick {cursor:pointer}.ops-pick:hover,.ops-pick[aria-expanded="true"] {background:#eef1f4}.ops-over {color:#b42332}.ops-open {color:#1f5f99;white-space:nowrap;font-size:13px}
.station-link {font:inherit;font-weight:700;font-size:16px;color:#1f5f99;background:none;border:0;padding:0;text-align:left;cursor:pointer;overflow-wrap:anywhere}
.ops-detail>td {background:#eef1f4;padding:4px 14px 16px}.ops-box {background:#fff;border:1px solid #e1e5ea;border-radius:6px;padding:16px;display:grid;gap:12px}.ops-box dl {display:grid;grid-template-columns:7em minmax(0,1fr);gap:8px 14px;margin:0}.ops-box dt {color:#5f6b78;font-size:13px}.ops-box dd {margin:0;white-space:pre-wrap;overflow-wrap:anywhere}.ops-box a {color:#1f5f99}.ops-box textarea,.ops-section>label textarea {display:block;font:inherit;width:100%;padding:8px;border:1px solid #e1e5ea;border-radius:5px;background:#fff;resize:vertical;margin-top:6px}.ops-box label {font-size:13px}.ops-box .operator-actions .btn:last-child {margin-left:0;font-size:14px}.ops-section>label {display:block;margin:12px 0}.ops-box .btn:disabled {opacity:.45;cursor:default}
.staff-mode #inbox {max-width:1080px;margin:0 auto 32px}.staff-mode .inbox-workspace {grid-template-columns:240px minmax(0,1fr);border:1px solid #e1e5ea;border-radius:8px;overflow:hidden;min-height:640px;height:calc(100dvh - 165px)}
.staff-mode #inbox-info {display:none}.staff-mode .conversation-heading .mobile-only:last-child {display:none}.staff-mode .conversation-sidebar {background:#f8f9fb}.conversation-date {text-align:center;color:#5f6b78;font-size:12px;margin:4px 0 20px}.confirmation-stamp {display:inline-flex;align-items:center;gap:5px;border:1px solid #2c6e4f;border-radius:14px;padding:3px 10px;color:#2c6e4f;font-size:12px;margin:6px 0}.staff-mode .operator-draft {background:#f8f9fb;border-color:#e1e5ea}.staff-mode .operator-draft strong {color:#5f6b78}.staff-mode .operator-actions .btn:last-child {margin-left:0}.staff-mode .board-refresh {position:static;max-width:1080px;margin:0 auto 12px;padding:0 16px}.staff-mode .board-refresh .btn {font-size:12px}.staff-mode #station-identity {color:#5f6b78}
@media(max-width:640px){.staff-mode .operations-tabs {display:grid;grid-template-columns:1fr 1fr}.staff-mode .operations-tabs button {padding:10px 6px;font-size:13px}.business-tabs button {padding:8px 10px;font-size:13px}.ops-table thead {display:none}.ops-table,.ops-table tbody,.ops-table tr,.ops-table td {display:block;width:auto}.ops-table tr {border-bottom:1px solid #e1e5ea;padding:8px 0}.ops-table td {border:0;padding:3px 14px}.ops-table .ops-open {display:none}.ops-detail>td {padding:4px 8px 8px}.ops-box {padding:12px}.ops-box dl {grid-template-columns:1fr}.ops-box dd {margin-bottom:6px}.staff-mode #inbox {margin:0 16px 20px}.staff-mode .inbox-workspace {display:block;min-height:0;height:calc(100dvh - 180px)}.staff-mode .logo {font-size:13px}.staff-mode .operator-composer {max-height:60%}}

html.staff-mode {background:#f5f6f8}

.ops-compare {display:grid;grid-template-columns:1fr 1fr;gap:12px}.ops-compare section {padding:14px;border:1px solid #e1e5ea;border-radius:6px;background:#f8f9fb;min-width:0;overflow-wrap:anywhere}.ops-compare h3 {margin:0 0 8px;font-size:14px}.ops-compare p {white-space:pre-wrap}@media(max-width:640px){.ops-compare {grid-template-columns:1fr}}

/* hiddenはスマホの表レイアウトより優先する。 */
[hidden], .ops-table tr[hidden] {display:none!important}
.ops-plan-section {margin:12px 0}.ops-plan-section h3 {font-size:14px}.ops-plan-row {padding:10px 0;border-bottom:1px solid #e1e5ea}.ops-plan-row p {margin:4px 0;white-space:pre-wrap;overflow-wrap:anywhere}

.ops-empty {display:flex;align-items:baseline;gap:16px;flex-wrap:wrap}.ops-empty .ops-none {margin:0;padding:0;border:0;background:none}

.documents-section {margin:20px 0 28px;min-width:0}.documents-section h1 {font-size:23px}.document-upload {padding:28px 20px;border:2px dashed #99bdd4;border-radius:12px;text-align:center;background:#f4faff;margin:16px 0 24px}.document-upload h2 {font-size:18px;margin:0 0 16px}.document-upload.dragging {border-color:#0077c7;background:#e0f1fd}.document-row {padding:18px 20px;background:#fff;border:1px solid #dbe3e9;border-radius:8px;margin:12px 0;overflow-wrap:anywhere}.document-title {font-size:16px;margin:0 0 8px}.document-station {font-size:14px;font-weight:700;margin:0 0 8px}.document-classification {font-size:14px}.document-actions {display:flex;gap:8px;flex-wrap:wrap}.document-editor {display:flex;align-items:end;gap:12px;flex-wrap:wrap;border-top:1px solid #e1e5ea;margin-top:16px;padding-top:16px}.document-editor label {display:flex;flex-direction:column;gap:6px;font-size:13px;max-width:100%}.document-editor input,.document-editor select {font:inherit;padding:8px;min-height:40px;max-width:100%;border:1px solid #ccd6df;border-radius:5px;background:#fff}.document-editor .error {flex-basis:100%;margin:0}#documents {padding:0 16px}@media(max-width:640px){.document-upload {padding:20px 12px}.document-row {padding:16px}.document-editor label {width:100%}.document-editor input,.document-editor select {width:100%}}

/* 状態と業務の確認は共通の入れ物に置き、同じ左右余白を使う。 */
.staff-mode #operations-health {max-width:1112px;margin:auto;padding:16px 16px 0;overflow-wrap:anywhere}
.staff-mode #operations-health h2 {font-size:17px;margin:0}
.staff-mode #operations-health p {font-size:13px}
@media (min-width:900px) {
  body:not(.staff-mode):has(#app:not([hidden])) {background:linear-gradient(to right, #fff var(--nav-width), var(--bg) var(--nav-width))}
}

/* 事務の進み具合: 問題のない作業に状態色は付けない。 */
#operations-office-progress { min-width: 0; }
.office-progress-attention { padding: 14px; border: 1px solid #d9dce0; border-radius: 8px; margin: 12px 0; }
.office-progress-attention h3 { font-size: 15px; }
.office-progress-red { background: #fff0ef; border-left: 4px solid #c23934; color: #8c2420; }
.office-progress-yellow { background: #fff8df; border-left: 4px solid #b47c00; color: #765100; }
.office-progress-open { border: 0; background: transparent; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: 8px 0; }
.office-progress-detail { overflow-x: auto; padding: 12px; }
.office-progress-chart { position: relative; min-width: 720px; padding-top: 32px; }
.office-progress-axis { height: 28px; position: relative; margin-left: 140px; border-bottom: 1px solid #ccc; }
.office-progress-axis span { position: absolute; transform: translateX(-50%); font-size: 12px; white-space: nowrap; }
.office-progress-stage summary { display: flex; align-items: center; cursor: pointer; min-height: 44px; border-bottom: 1px solid #e6e6e6; }
.office-progress-stage-name { flex: 0 0 140px; }
.office-progress-track { flex: 1; position: relative; height: 24px; }
.office-progress-bar { position: absolute; height: 12px; top: 6px; background: #c6c9cc; border-radius: 3px; }
.office-progress-today { position: absolute; top: 28px; bottom: 0; width: 1px; background: #4c5157; pointer-events: none; z-index: 1; }
.office-progress-today span { position: absolute; top: -24px; font-size: 12px; white-space: nowrap; transform: translateX(-50%); }
.office-progress-steps { list-style: none; padding: 8px 0 8px 140px; }
.office-progress-steps li { padding: 10px; border-bottom: 1px solid #ddd; }
.office-progress-steps p { margin: 5px 0; }
@media(max-width: 600px) { .operations-tabs { overflow-x: auto; } .operations-tabs button { white-space: nowrap; } #operations-office-progress .ops-table { min-width: 620px; } #operations-office-progress .ops-section { overflow-x: auto; } }

.instruction-registration {min-width:0;overflow-wrap:anywhere}
.instruction-heading>h3,.instruction-heading>p {margin:0 0 8px}
.instruction-heading>p:last-child {margin-bottom:0}
.instruction-registration select {display:block;width:100%;min-width:0;max-width:100%;min-height:40px;margin-top:6px;padding:8px;border:1px solid #e1e5ea;border-radius:5px;background:#fff}
