/* 画面のデザイン：上のタブ（船）・左の画面の一覧・右の作業領域。色と文字は、参考のデザイン（チャンネル管理）に合わせた。 */
:root {
  --bg: #f6f6f8;
  --side: #ececf0;
  --card: #ffffff;
  --fg: #23232a;
  --muted: #6c6c78;
  --line: #d9d9e0;
  --accent: #2f6fe0;
  --ok: #1d7a43;
  --warn: #9a6400;
  --bad: #c0362c;
  --spare: #0e7490;
  --font: "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18181c;
    --side: #202026;
    --card: #26262d;
    --fg: #e8e8ee;
    --muted: #9a9aa8;
    --line: #3a3a44;
    --accent: #6b9bf2;
    --ok: #6fd39a;
    --warn: #f1c26a;
    --bad: #ff8a80;
    --spare: #5fd4e6;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 13px/1.55 var(--font); }
#app { height: 100%; }
.app { display: grid; grid-template-rows: 35px 1fr; height: 100%; }

/* ---- 上のタブ ---- */
.topbar { display: flex; align-items: stretch; background: var(--side); border-bottom: 1px solid var(--line); min-width: 0; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; border: 0; background: transparent; color: var(--muted); cursor: pointer; margin: 0; border-radius: 0; min-height: 0; }
.iconbtn:hover { color: var(--fg); }
.ctabs { display: flex; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ctab { position: relative; border: 0; border-right: 1px solid var(--line); border-radius: 0; margin: 0; background: transparent; color: var(--muted); padding: 0 14px; white-space: nowrap; cursor: pointer; }
.ctab:hover { color: var(--fg); }
.ctab.on { background: var(--bg); color: var(--fg); }
.ctab.on::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--accent); }
.ctab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--bg); }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 0 12px; color: var(--muted); white-space: nowrap; }
.chip { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; }
.chip.ok { color: var(--ok); }
.chip.warn { color: var(--warn); }
button.link { border: 0; background: none; color: var(--accent); padding: 0; min-height: 0; margin: 0; cursor: pointer; }

/* ---- 左の画面の一覧 ---- */
.frame { display: grid; grid-template-columns: 232px 1fr; min-height: 0; }
.side { display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); min-height: 0; }
.nav { flex: 1; overflow-y: auto; padding: 6px; }
/* 左の一覧の見出し（海務部のメニュー。プロジェクト管理のサイトと同じ形） */
.ngroup { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding: 12px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; }
.ngroup:first-child { border-top: 0; margin-top: 0; padding-top: 4px; }
.nrow { position: relative; display: flex; gap: 10px; align-items: flex-start; width: 100%; padding: 7px 8px 7px 10px; margin: 0 0 1px; border: 0; border-radius: 5px; background: transparent; color: var(--fg); text-align: left; cursor: pointer; min-height: 0; }
.nrow svg { flex: none; margin-top: 2px; color: var(--muted); }
.nrow:hover { background: color-mix(in srgb, var(--card) 55%, transparent); }
.nrow.on { background: var(--card); }
.nrow.on::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px; background: var(--accent); border-radius: 1px; }
.nrow.on svg { color: var(--accent); }
.ntext { display: flex; flex-direction: column; min-width: 0; }
.nname { font-weight: 600; }
.nsub { font: 11px/1.5 var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidefoot { border-top: 1px solid var(--line); padding: 8px 12px; font: 11px var(--mono); color: var(--muted); }
.scrim { display: none; }

/* ---- 右の作業領域 ---- */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.main.solo { overflow-y: auto; padding: 16px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.toolbar .search { width: 170px; }
/* その日で見る画面の、日付の欄（画面の中の見出しの下。2026-10-29） */
.daybar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 12px; }
.daybar .search { width: 170px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.seg button { border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--muted); padding: 3px 10px; margin: 0; min-height: 0; font-size: 12px; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--card); color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
/* 日付のボタン（前日・当日・翌日・模擬データの日）：選んでいる日だけ青、ほかは灰色（2026-10-28） */
.seg.dayseg button { background: var(--bg); color: var(--muted); }
.seg.dayseg button.on { background: var(--accent); color: #fff; box-shadow: none; }
.stats { margin-left: auto; display: flex; gap: 14px; color: var(--muted); white-space: nowrap; }
.stats b { font-family: var(--mono); color: var(--fg); }
.content { flex: 1; overflow-y: auto; padding: 12px; }

/* ---- 各画面（カード） ---- */
section { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin: 0 0 12px; max-width: 1100px; }
h2 { font-size: 14px; margin: 0 0 8px; }
h3 { font-size: 13px; margin: 12px 0 4px; }
p { margin: 6px 0; }
.hint { color: var(--muted); font-size: 12px; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.message { background: color-mix(in srgb, var(--accent) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 6px; padding: 8px 12px; margin: 0 0 12px; max-width: 1100px; }
.badge { font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; font-weight: 400; }
.badge.online { color: var(--ok); }
.badge.offline, .badge.warn { color: var(--warn); }
.alerts { margin: 4px 0; padding-left: 18px; }
.alerts .violation, td.violation { color: var(--bad); }
.alerts .warning { color: var(--warn); }

input, select, button, textarea { font: inherit; font-size: 13px; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 3px 10px; min-height: 28px; }
input:focus, select:focus, button:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 0; border-color: var(--accent); }
button { cursor: pointer; margin: 2px 4px 2px 0; }
button:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

table.labor { border-collapse: collapse; width: 100%; }
table.labor th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); padding: 4px 6px; }
table.labor td { border-bottom: 1px solid var(--line); padding: 4px 6px; vertical-align: top; }
.form { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin: 6px 0; }
.form label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
/* 入力欄の横のボタン：入力欄の高さにそろえる（見出しの高さにそろうと、ずれて見える。2026-10-24 田中さんの指摘） */
.form > .formbtns { display: flex; gap: 6px; align-items: center; align-self: end; }
.dr { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.ob { padding: 4px 0; }
.ob.conflict, .ob.rejected { color: var(--bad); }
.date { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inbox { list-style: none; padding: 0; margin: 0; }
.inbox li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.inbox li:last-child { border-bottom: 0; }
.inbox li.unread strong::before { content: "● "; color: var(--accent); }
.inbox li.read { color: var(--muted); }
.scroll { overflow-x: auto; }
.scroll td input { width: 7.5em; }
.scroll td:first-child, .scroll th:first-child { min-width: 11em; }
.login { max-width: 560px; }

/* ---- 狭い画面：画面の一覧は、左のボタンで開く ---- */
@media (max-width: 760px) {
  .frame { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; top: 35px; bottom: 0; left: 0; width: 260px; transform: translateX(-100%); transition: transform 0.15s ease; }
  .side.open { transform: none; box-shadow: 0 0 24px rgba(0, 0, 0, 0.2); }
  .scrim { display: block; position: fixed; inset: 35px 0 0 0; z-index: 10; background: rgba(0, 0, 0, 0.25); }
  .who > span:not(.chip) { display: none; }
  .stats { margin-left: 0; width: 100%; }
  .content { padding: 10px 8px; }
  section { padding: 10px; }
  .scroll table.labor thead { display: table-header-group; }
  table.labor thead { display: none; }
  table.labor tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 6px 0; border-bottom: 1px solid var(--line); }
  table.labor td { border: 0; }
  .scroll table.labor tr { display: table-row; }
  .scroll table.labor td { border-bottom: 1px solid var(--line); }
}
td.violation input { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.message.impersonation { background: color-mix(in srgb, var(--warn) 12%, var(--card)); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }

/* ---- 管理者のダッシュボード ---- */
section.wide { max-width: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 8px; }
.kpi { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: var(--bg); }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .num { font: 600 24px/1.3 var(--mono); }
.kpi .sub { color: var(--muted); font-size: 12px; }
.kpi.warn .num { color: var(--warn); }
.kpi.bad .num { color: var(--bad); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 12px; }
.legend .lg { display: inline-flex; align-items: center; gap: 4px; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); }
table.matrix { border-collapse: separate; border-spacing: 3px; font-size: 11px; }
table.matrix th { font-weight: 600; color: var(--muted); white-space: nowrap; padding: 2px 4px; text-align: center; }
table.matrix th.vname { text-align: left; color: var(--fg); min-width: 7em; }
table.matrix th.today { color: var(--accent); }
table.matrix td.c { min-width: 66px; border-radius: 4px; padding: 4px 6px; vertical-align: top; line-height: 1.4; white-space: nowrap; }
table.matrix td.today { box-shadow: inset 0 0 0 2px var(--accent); }
table.matrix td .short { color: var(--warn); }
table.matrix td .violation { color: var(--bad); }
.c.approved { background: color-mix(in srgb, var(--ok) 16%, var(--card)); }
.c.pending { background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
.c.open { background: color-mix(in srgb, var(--warn) 12%, var(--card)); }
.c.draft { background: color-mix(in srgb, var(--warn) 28%, var(--card)); }
.c.rejected { background: color-mix(in srgb, var(--bad) 20%, var(--card)); }
.c.empty { background: color-mix(in srgb, var(--line) 30%, transparent); color: var(--muted); }
.dash2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.dash2 section { max-width: none; margin: 0; }

/* ---- DR の打刻（「今」ボタン） ---- */
.stamp { display: flex; gap: 4px; align-items: center; }
.stamp input { flex: 1; min-width: 0; }
.stamp button { margin: 0; min-width: 4.2em; white-space: nowrap; }

/* ---- 船上 DailyReport 入力（上：計画DRの一覧、下：実績入力） ---- */
.drhead { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 16px; margin: 8px 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.drhead > div { display: flex; flex-direction: column; }
.drhead b { font-family: var(--mono); font-weight: 600; }
table.drlist td, table.drlist th { white-space: nowrap; }
table.drlist td.num { font-family: var(--mono); text-align: right; }
table.drlist tr.drrow { cursor: pointer; }
table.drlist tr.drrow:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
table.drlist tr.sel { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.drdetail .plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); margin-bottom: 10px; }
.drdetail .ro { display: flex; flex-direction: column; }
.drdetail .ro span, .drdetail .times label > span, .drdetail .tugs > span { font-size: 12px; color: var(--muted); }
.drdetail .times { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 12px; margin: 6px 0; }
.drdetail .times label { display: flex; flex-direction: column; gap: 2px; }
.drdetail .times b { color: var(--fg); }
.drdetail output.hours { font: 600 18px/28px var(--mono); }
.drdetail .tugs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; }
.drdetail .tugs input { width: 6em; }
/* PILOT の表と、港区・動静・待機場所・代理店（As-Is 画面 TSDR0011 の並び。2026-10-28） */
.drdetail .drextra { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 8px 16px; align-items: start; margin: 8px 0; }
@media (max-width: 760px) { .drdetail .drextra { grid-template-columns: 1fr; } }
.drdetail .drextra .form { margin: 0; }
.drdetail table.pilottable { border-collapse: collapse; width: 100%; }
.drdetail table.pilottable th, .drdetail table.pilottable td { border: 1px solid var(--line); padding: 4px 8px; text-align: left; font-size: 13px; }
.drdetail table.pilottable thead th { font-size: 12px; color: var(--muted); font-weight: normal; background: var(--bg); }
.drdetail table.pilottable tbody th { font-size: 12px; color: var(--muted); font-weight: normal; white-space: nowrap; }
.drdetail table.pilottable td.c { text-align: center; width: 3.5em; }
.form label.wide { grid-column: 1 / -1; }
td.pilotcell { white-space: nowrap; }
td.pilotcell .chip { margin-left: 4px; font-size: 10px; padding: 0 5px; }
.drdetail .actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
textarea { width: 100%; font-family: var(--mono); }
.scroll table.drlist td:first-child, .scroll table.drlist th:first-child { min-width: 0; }
/* チェックボックスは、入力欄の高さ・余白を使わず、隣の文字と縦の中心を合わせる */
input[type="checkbox"] { min-height: 0; padding: 0; margin: 0; width: 16px; height: 16px; vertical-align: middle; accent-color: var(--accent); }
.drdetail .pilot label { display: inline-flex; align-items: center; gap: 4px; line-height: 1; }
.fromdr { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 6px 0 12px; background: color-mix(in srgb, var(--accent) 4%, var(--card)); }
.fromdr h3 { margin-top: 2px; }

/* ---- タイムチャート（現行の TransCrew の出力の色と形に寄せる） ---- */
.act-SB_SHIMAI { --act: #1f8fff; --act-fg: #fff; }
.act-KAIKOU { --act: #a7b51f; --act-fg: #fff; }
.act-TUG_WORK { --act: #ff3ec9; --act-fg: #fff; }
.act-EV_WATCH { --act: #3cb52f; --act-fg: #fff; }
.act-MAINTENANCE { --act: #f06a68; --act-fg: #fff; }
.act-OTHER_WORK { --act: #1fb3a8; --act-fg: #fff; }
.act-BASE_STANDBY { --act: #d9dd8e; --act-fg: #4b4b2a; }
.act-OFFSHORE_STANDBY { --act: #9fd3e6; --act-fg: #20404d; }
.act-REST { --act: transparent; --act-fg: var(--muted); }
.tlegend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 6px 0 8px; font-size: 12px; }
.tlegend .lg { display: inline-flex; align-items: center; gap: 4px; }
.tlegend .chip { display: inline-block; width: 14px; height: 12px; border-radius: 2px; background: var(--act); border: 0; padding: 0; }
.tbar { position: relative; height: 22px; min-width: 720px; border: 1px solid var(--line); border-radius: 3px; background-color: var(--card);
  background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / 24 - 1px), var(--line) calc(100% / 24 - 1px), var(--line) calc(100% / 24)); }
.tbar .act { position: absolute; top: 1px; bottom: 1px; background: var(--act); color: var(--act-fg); font-size: 10px; line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: clip; padding-left: 2px; border-radius: 2px; }
.tscale { display: grid; grid-template-columns: repeat(24, 1fr); min-width: 720px; font: 10px var(--mono); color: var(--muted); }
.tscale span { padding-left: 1px; }
table.tchart { border-collapse: collapse; width: 100%; }
table.tchart th, table.tchart td { border-bottom: 1px solid var(--line); padding: 3px 6px; vertical-align: middle; }
table.tchart th { font-size: 11px; color: var(--muted); font-weight: 600; text-align: left; }
table.tchart thead th { background: color-mix(in srgb, var(--fg) 6%, var(--card)); }
table.tchart .tleft { white-space: nowrap; }
table.tchart .ttrack { width: 100%; min-width: 720px; }
table.tchart .tnum { text-align: right; font-family: var(--mono); white-space: nowrap; }
/* 右の数字の列は、帯に押されて細くならないように幅を確保する（見出しが1文字ずつ折り返さないように）。入りきらない分は、表ごと横にスクロールする。2026-10-20 画面への指摘を取り込み */
table.tchart .tnum { min-width: 6em; }
table.tchart th.tnum { white-space: normal; max-width: 7em; text-align: center; }
table.tchart td.violation { color: var(--bad); font-weight: 600; }
table.tchart .sun { color: var(--bad); }
table.tchart .sat { color: var(--accent); }
.daychart { margin: 6px 0 10px; overflow-x: auto; }
.scroll table.tchart td:first-child, .scroll table.tchart th:first-child { min-width: 0; }

/* DR の下書き（保存していない入力）。赤で「未完成」 */
.chip.bad { color: var(--bad); margin-left: 6px; font-weight: 700; }
.draftnote { color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 50%, var(--line)); background: color-mix(in srgb, var(--bad) 6%, var(--card)); border-radius: 6px; padding: 6px 10px; margin: 0 0 10px; font-weight: 600; }

/* ---- 文字の大きさ（右上の「中」「大」）。プロジェクト管理のサイトと同じ作り。大は左の一覧と作業領域を拡大する（表・タイムチャートも同じ割合で大きくなる） ---- */
.sizeSwitch { display: flex; align-items: center; gap: 2px; white-space: nowrap; font-size: 12px; color: var(--muted); }
.sizeSwitch span { margin-right: 4px; }
.sizeSwitch button { min-height: 22px; padding: 0 9px; margin: 0; font-size: 12px; background: transparent; color: var(--fg); }
.sizeSwitch button.on { background: var(--fg); color: var(--bg); border-color: var(--fg); font-weight: 700; }
html[data-size="l"] .app { grid-template-rows: 44px 1fr; }
html[data-size="l"] .topbar { font-size: 15px; }
@media (min-width: 761px) { html[data-size="l"] .frame { grid-template-columns: 270px 1fr; } }
html[data-size="l"] .side, html[data-size="l"] .main { zoom: 1.2; }
@media (max-width: 760px) {
  .sizeSwitch span { display: none; }
  /* zoom は位置にもかかるため、帯の高さ 44px を倍率で割っておく */
  html[data-size="l"] .side { top: calc(44px / 1.2); }
  html[data-size="l"] .scrim { inset: 44px 0 0 0; }
}

/* 船上入力の流れ（DR 入力 → 勤怠入力 → 労務入力）のタブ */
.steps { display: flex; flex-wrap: wrap; gap: 0; margin: 4px 0 12px; border-bottom: 2px solid var(--line); }
.steps button { border: 1px solid var(--line); border-bottom: none; border-radius: 6px 6px 0 0; background: var(--bg); color: inherit; padding: 6px 14px; margin-right: 4px; cursor: pointer; }
.steps button.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.steps button:disabled { cursor: not-allowed; opacity: .45; }

/* 船ごとのスケジュール（全船×0〜24時の DR の帯） */
.sbar { height: 26px; background-image: repeating-linear-gradient(to right, transparent 0, transparent calc(100% / 24 - 1px), color-mix(in srgb, var(--line) 70%, transparent) calc(100% / 24 - 1px), color-mix(in srgb, var(--line) 70%, transparent) calc(100% / 24)); }
.sch { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; overflow: hidden; --sch: var(--accent); background: color-mix(in srgb, var(--sch) 30%, var(--card)); border: 1px solid color-mix(in srgb, var(--sch) 70%, var(--card)); }
.sch.sch-draft { --sch: var(--warn); border-style: dashed; }
.sch.sch-plan { --sch: var(--muted); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--sch) 22%, var(--card)) 0 4px, var(--card) 4px 8px); }
.sch.cont-l { border-left-width: 3px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.sch.cont-r { border-right-width: 3px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.sch .sch-work { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--sch) 75%, var(--card)); }
.sch em { position: relative; font: 10px/20px var(--font); font-style: normal; color: var(--fg); padding-left: 3px; white-space: nowrap; }
.sch-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--bad); }
.sch-chip { display: inline-block; width: 14px; height: 10px; border-radius: 2px; position: relative; }
.sch-chip.sch-done { background: color-mix(in srgb, var(--accent) 75%, var(--card)); }
.sch-chip.sch-draft { background: color-mix(in srgb, var(--warn) 75%, var(--card)); }
.sch-chip.sch-plan { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--muted) 40%, var(--card)) 0 3px, var(--card) 3px 6px); border: 1px solid var(--line); }
.sch-chip.sch-nowchip { width: 2px; background: var(--bad); }
table.tchart th.tmid, table.tchart td.tmid { text-align: center; }

/* 受注・配船と請求・入金（2026-10-23） */
.subform { border: 1px solid var(--line); border-radius: 6px; padding: 8px 12px; margin: 8px 0; background: var(--card); }
.subform h4 { margin: 0 0 6px; }
table.labor tr.cancelled td { color: var(--muted); }
table.labor tr.cancelled td b { text-decoration: line-through; }
table.labor tr.warnrow td { background: color-mix(in srgb, var(--warn) 7%, transparent); }
table.labor tr.detail > td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
table.labor td.num { text-align: right; white-space: nowrap; }
table.labor td.actions { white-space: nowrap; }
table.labor td.actions button { margin: 0 2px 2px 0; }
.tugpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 4px 16px; margin: 6px 0; font-size: 13px; }
/* チェックボックスを縦にそろえる（2026-10-24 田中さんの指摘）：どの列も、行の頭にチェックボックス */
.tugpick label { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.tugpick label input { margin: 0; flex: none; }
.cancelfee { margin-top: 4px; }
.cancelfee button { margin: 4px 4px 0 0; }
.kpis { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; }
.kpis .kpi { border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; min-width: 120px; background: var(--card); }
.invoice { border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; background: var(--card); max-width: 900px; }
.invoice-head { display: flex; justify-content: space-between; align-items: baseline; }
.invoice-head h3 { margin: 0; letter-spacing: .08em; }
.invoice table.totals { width: auto; margin: 8px 0 8px auto; min-width: 260px; }
.invoice table td, table.billing td { white-space: nowrap; }
table.billing { min-width: 1100px; }
/* 予定表は、画面の幅に収める（右端の操作が切れないように。POC 改善点レポートの 6）。操作のボタンは2列に並べる */
table.orders { min-width: 0; }
table.orders td.actions { white-space: normal; width: 1%; }
table.orders .actbtns { display: grid; grid-template-columns: repeat(2, auto); gap: 4px; margin-top: 4px; }
table.orders .actbtns button { margin: 0; padding-left: 6px; padding-right: 6px; white-space: nowrap; }
.invoice { overflow-x: auto; }
.tugpick label.clash { color: var(--warn); }
.tugpick .chip { margin-left: 4px; }
table.labor tr.sub > td { border-top: none; padding-top: 0; }
.time24 { font-size: 12px; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.invoice-parties { display: flex; justify-content: space-between; gap: 16px; }
.invoice-sender { text-align: right; }
@media print {
  body.printing * { visibility: hidden; }
  body.printing .print-target, body.printing .print-target * { visibility: visible; }
  body.printing .print-target { position: absolute; left: 0; top: 0; width: 100%; max-width: none; border: none; box-shadow: none; }
  body.printing .print-target .noprint { display: none; }
}
.chip { white-space: nowrap; display: inline-block; }
.helpbtn { display: inline-flex; align-items: center; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--accent); text-decoration: none; background: var(--card); }
.helpbtn:hover { border-color: var(--accent); }
/* POC の中のヘルプ（2026-10-24） */
.helpdoc .md img.shot { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 6px; margin: 8px 0 16px; cursor: zoom-in; box-shadow: 0 1px 4px rgb(0 0 0 / 8%); }
.helpdoc .md table { border-collapse: collapse; margin: 6px 0; }
.helpdoc .md th, .helpdoc .md td { border: 1px solid var(--line); padding: 4px 8px; vertical-align: top; text-align: left; }
.helpdoc .md h1 { font-size: 20px; } .helpdoc .md h2 { font-size: 17px; margin-top: 26px; border-left: 5px solid var(--accent); padding-left: 8px; } .helpdoc .md h3 { font-size: 15px; margin-top: 18px; }
.helpdoc .tabs button.tab { margin-right: 6px; }
.helpdoc .tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.helpdoc .tab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 3px 12px; font-size: 13px; cursor: pointer; }
.helpdoc .tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 操作ヘルプ（別のタブ。2026-10-24）。業務画面と地色・差し色を変える */
body.help-mode { --help-accent: #1f7a5c; --help-accent-strong: #145440; background: #f6f8f4; }
.help-banner { position: sticky; top: 0; z-index: 20; background: var(--help-accent, #1f7a5c); border-bottom: 1px solid var(--help-accent-strong, #145440); }
.help-banner-in { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px; }
.help-home { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 600; text-decoration: none; }
.help-badge { background: rgba(255,255,255,.92); color: var(--help-accent-strong, #145440); border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.help-out { color: rgba(255,255,255,.9); font-size: 14px; text-decoration: none; }
.help-out:hover { color: #fff; text-decoration: underline; }
.help-main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 60px; }
.help-main.narrow { max-width: 860px; }
.help-main h1 { font-size: 22px; margin: 6px 0 12px; }
.help-search { width: 100%; max-width: 520px; padding: 8px 12px; border: 1px solid #c9d6cc; border-radius: 8px; margin: 8px 0 16px; font-size: 14px; }
.help-group h2 { color: var(--help-accent, #1f7a5c); font-size: 14px; margin: 18px 0 8px; }
.help-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.help-cards a { display: flex; flex-direction: column; gap: 3px; padding: 12px 16px; border: 1px solid #d7e3da; border-radius: 10px; background: #fff; color: inherit; text-decoration: none; height: 100%; }
.help-cards a:hover { border-color: var(--help-accent, #1f7a5c); box-shadow: 0 1px 6px rgb(0 0 0 / 8%); }
.help-id, .help-meta { font-family: var(--mono, monospace); font-size: 12px; color: var(--help-accent, #1f7a5c); }
.help-back { color: var(--help-accent, #1f7a5c); font-size: 14px; }
.help-open { display: inline-block; margin: 6px 0 14px; padding: 8px 16px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; text-decoration: none; }
.help-body h2 { font-size: 17px; margin-top: 26px; padding-left: 8px; border-left: 5px solid var(--help-accent, #1f7a5c); }
.help-body h3 { font-size: 15px; margin-top: 18px; }
.help-body strong { color: #0d3d2e; background: #e3f1e8; padding: 0 3px; border-radius: 3px; }
.help-body img.shot { display: block; max-width: 100%; border: 1px solid #ccd; border-radius: 6px; margin: 8px 0 18px; cursor: zoom-in; box-shadow: 0 1px 4px rgb(0 0 0 / 8%); }
.help-body table { border-collapse: collapse; margin: 8px 0; }
.help-body th, .help-body td { border: 1px solid #ccd; padding: 4px 8px; text-align: left; vertical-align: top; }
.help-body li { margin: 4px 0; }
.help-pager { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0 10px; border-top: 1px solid #d7e3da; padding-top: 12px; font-size: 14px; }
.help-pager a { color: var(--help-accent, #1f7a5c); }
.help-right { display: flex; align-items: center; gap: 14px; }
.help-size { display: flex; align-items: center; gap: 4px; color: rgba(255,255,255,.9); font-size: 13px; }
.help-size button { border: 1px solid rgba(255,255,255,.6); background: transparent; color: #fff; border-radius: 6px; padding: 2px 10px; font-size: 13px; cursor: pointer; }
.help-size button.on { background: #fff; color: var(--help-accent-strong, #145440); font-weight: 700; }
html[data-size="l"] .help-main { zoom: 1.25; }
.help-body .shot-cap { display: block; margin: -12px 0 18px; font-size: 13px; color: #475569; }
.help-body .shot-cap.step { font-size: 15px; font-weight: 700; color: #b42318; }
.help-body img.shot[data-help^="step-"] { border: 2px solid #e5484d33; }
.filterchips button.chip { cursor: pointer; background: var(--card); margin-right: 6px; }
.filterchips button.chip:hover { box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 25%, transparent); }
.filterchips button.chip.active { background: currentColor; }
.filterchips button.chip.active { color: var(--accent); }
.filterchips button.chip.active, .filterchips button.chip.active * { -webkit-text-fill-color: #fff; }
/* DR の時刻の欄（2026-10-24 田中さんの指摘：右のフォームと時間が見えづらい）：入力欄を広くし、24時間の書き方は欄の下に大きく出す */
.drdetail .times { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px 16px; }
.drdetail .stamp { flex-wrap: wrap; }
.drdetail .stamp input { flex: 1 1 190px; min-width: 190px; font-size: 15px; padding: 6px 8px; }
.drdetail .stamp button { min-height: 34px; }

/* 保存の結果（保存ボタンの横） */
.savenote { margin-left: 8px; font-size: 13px; }
.savenote.bad { color: var(--bad); }
.savenote.ok { color: var(--ok); }
.hm { white-space: nowrap; }

/* 配乗管理（2026-10-24 追加） */
.monthbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.monthbar .month { font-size: 16px; min-width: 8em; text-align: center; }
.vtabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.vtabs button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(40px, 64px)); gap: 4px; margin: 8px 0 12px; }
.cal-h { font-size: 12px; color: var(--muted); text-align: center; }
.cal-d { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 48px; padding: 2px; }
.cal-d small { font-size: 10px; }
.cal-d.on { background: var(--warn); color: #fff; border-color: var(--warn); }
label.check { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--fg); flex-direction: row; }
.rowops { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rowops input { min-width: 140px; }
input.num { width: 5em; }
table.roster { border-collapse: collapse; font-size: 12px; }
table.roster th, table.roster td { border: 1px solid var(--line); padding: 2px 3px; text-align: center; min-width: 24px; }
table.roster th.who { text-align: left; white-space: nowrap; min-width: 9em; position: sticky; left: 0; background: var(--card); z-index: 1; }
table.roster th.we { color: var(--bad); }
table.roster th.short { background: color-mix(in srgb, var(--bad) 18%, transparent); }
table.roster th small { display: block; font-weight: 400; color: var(--muted); }
.rc.on_board { background: color-mix(in srgb, var(--ok) 16%, transparent); }
.rc.holiday { background: color-mix(in srgb, var(--warn) 30%, transparent); }
.rc.paid_leave { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.rc.absent { background: color-mix(in srgb, var(--bad) 22%, transparent); }
.rc.other { color: var(--muted); }
.rc.captain { font-weight: 700; color: var(--card); background: var(--ok); }
.rc.spare { color: var(--spare); background: color-mix(in srgb, var(--spare) 22%, transparent); }
table.roster tr.grouprow th { text-align: left; font-weight: 700; background: var(--side); }
table.roster th.who button.linklike { min-height: 0; margin: 0; }
table.roster th.nocap { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.rc.click { cursor: pointer; }
.rc.sel { outline: 2px solid var(--accent); outline-offset: -2px; }
.legend .rc { display: inline-block; min-width: 1.6em; text-align: center; border: 1px solid var(--line); }
table.roster tr.shortrow td.bad { color: var(--bad); font-weight: 700; }
table.roster tr.shortrow td.ok { color: var(--ok); }
.steps-list { padding-left: 1.4em; }
.steps-list li { margin: 0 0 12px; }
.steps-list li.done > div:first-child strong { color: var(--ok); }
.card-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; background: var(--card); }
.col-list { list-style: none; padding: 0; margin: 6px 0; display: grid; gap: 4px; }
.col-list li { display: flex; gap: 6px; align-items: center; }
.col-list li span { min-width: 12em; }
.chipbtn { font-size: 12px; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 999px; }
label.check input { width: auto; flex: 0 0 auto; }
.rowops label.check { margin-right: 10px; }
td.tags { min-width: 240px; }
td .since { display: flex; align-items: center; gap: 6px; }
td .since input { width: 12em; min-width: 12em; }
td.tags .tag { display: inline-flex; align-items: center; gap: 2px; margin: 2px 4px 2px 0; padding: 1px 4px 1px 8px; border: 1px solid var(--accent, #2f6fd6); border-radius: 999px; font-size: 12px; color: var(--accent, #2f6fd6); background: transparent; }
td.tags .tag.base { padding-right: 8px; background: var(--accent, #2f6fd6); color: #fff; }
td.tags .tag button { border: 0; background: none; padding: 0 4px; color: inherit; cursor: pointer; font-size: 12px; line-height: 1; min-height: 0; }
td.tags select { width: auto; font-size: 12px; padding: 1px 4px; }
.threads { list-style: none; padding: 0; }
.threads li { margin: 6px 0; }
button.linklike { background: none; border: 0; color: var(--accent); padding: 0; cursor: pointer; text-decoration: underline; font: inherit; }
.mono { font-family: var(--mono); }
table.roster th.click, table.roster td.click { cursor: pointer; }
table.roster th.picked, table.roster td.picked { outline: 2px solid var(--accent); outline-offset: -2px; }
.reason-box.bad { border-color: var(--bad); }
.topbar .brand { font-weight: 700; font-size: 14px; white-space: nowrap; margin: 0 10px 0 4px; align-self: center; }
@media (max-width: 760px) { .topbar .brand { display: none; } }

/* 船上勤怠の入力：作業（作業名は固定）・特殊作業報告・備考・確認事項（As-Is SDR012E の下の段。2026-10-28） */
.attextra table.tasks th { white-space: nowrap; }
.attextra table.tasks tbody th { text-align: left; font-weight: 600; }
.attextra table.tasks input[type="date"] { width: 11.5em; }
.attextra table.tasks input[type="time"] { width: 9em; }
.attextra .form textarea { font-family: inherit; }
.attextra fieldset.checks { border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px 8px; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.attextra fieldset.checks legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.attextra fieldset.checks label { display: inline-flex; align-items: center; gap: 4px; }

/* 日付を変えた直後の読み込み中（2026-10-28）：前回の内容を薄く出し、押せないようにする */
.content.loading { opacity: .5; pointer-events: none; transition: opacity .12s; }
.loadingnote { font-size: 12px; color: var(--accent); }

/* 画面への指摘（管理者だけ）。プロジェクト管理のサイトと同じく、上の帯に置く */
.who .rv-tools { flex-wrap: nowrap; gap: 8px; }
.who .rv-toggle { min-height: 26px; padding: 1px 10px; }
.who .rv-show { font-size: 12px; }
@media (max-width: 760px) { .who .rv-show { display: none; } .who .rv-tools { width: auto; } }

/* 消す操作のボタン（ユーザーの削除など。2026-10-29） */
button.danger { color: var(--bad); border-color: var(--bad); }

/* ---- 勤怠・労務入力のアプリのログイン（~/dockers/linux のメールのログインに合わせる。2026-11-01） ---- */
.login-only { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; box-sizing: border-box; background: var(--bg); }
.email-login { width: 100%; max-width: 500px; margin: 0 auto; padding: 40px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-sizing: border-box; }
.email-login-icon { display: inline-flex; padding: 14px; background: color-mix(in srgb, var(--accent) 10%, var(--card)); color: var(--accent); border-radius: 14px; margin-bottom: 16px; }
.email-login .eyebrow { color: var(--accent); font-weight: 600; font-size: 12px; margin: 0 0 13px; }
.email-login h1 { font-size: 28px; margin: 12px 0; color: var(--fg); }
.email-login-description { color: var(--muted); line-height: 1.9; overflow-wrap: anywhere; }
.email-login-description strong { color: var(--fg); }
.email-login form, .email-login form > label:not(.check) { display: grid; gap: 12px; }
.email-login form > label:not(.check) { font-size: 14px; font-weight: 600; color: var(--fg); }
.email-login input:not([type="checkbox"]) { width: 100%; min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 400; box-sizing: border-box; background: var(--card); color: var(--fg); }
.email-login input:not([type="checkbox"]):focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.email-login .otp-input { font-size: 28px; letter-spacing: 0.35em; text-align: center; }
.email-login button.primary { display: inline-flex; justify-content: center; align-items: center; gap: 10px; min-height: 46px; width: 100%; margin: 4px 0 0; border-radius: 7px; font-weight: 600; font-size: 15px; }
.email-login button.primary:disabled { opacity: 0.55; cursor: default; }
.email-login .otp-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.login-steps { display: flex; list-style: none; padding: 0; gap: 16px; margin: 24px 0; color: var(--muted); font-size: 13px; }
.login-steps li { padding-bottom: 10px; border-bottom: 2px solid var(--line); flex: 1; }
.login-steps .active { color: var(--accent); border-color: var(--accent); font-weight: 700; }
.email-login .notice.error { border-radius: 6px; padding: 12px 16px; margin: 0 0 16px; font-size: 13px; line-height: 1.7; background: color-mix(in srgb, var(--bad) 10%, var(--card)); color: var(--bad); border: 1px solid color-mix(in srgb, var(--bad) 35%, var(--line)); }
.login-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 22px; font-size: 13px; }
.login-actions button { background: none; border: none; padding: 0; margin: 0; min-height: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 13px; }
.login-actions button:disabled { opacity: 0.5; cursor: default; }
.login-actions p { color: var(--muted); line-height: 1.7; margin: 4px 0 0; flex-basis: 100%; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 600px) { .email-login { padding: 24px 18px; } .login-only { justify-content: flex-start; padding-top: 16px; } }
/* 勤怠・労務入力のアプリ：管理者が代理操作の相手を選ぶ一覧（狭い画面でも1人1行のカード） */
.pick-field { display: grid; gap: 4px; margin: 8px 0; font-size: 13px; color: var(--muted); max-width: 480px; }
.pick-field input { width: 100%; box-sizing: border-box; }
.crew-pick { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.crew-pick li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.crew-pick .who-pick { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.crew-pick .who-pick .hint { margin: 0; }
.crew-pick button { flex: 0 0 auto; margin: 0; white-space: nowrap; }
@media (max-width: 760px) { .crew-pick li { flex-direction: column; align-items: stretch; } .crew-pick button { width: 100%; } }
