/* 整備予定表ボード。1280×720 の盤面を組み、画面の大きさに合わせて拡大する（倍率は board.js が --scale に入れる） */

:root {
  --frame: #aeb3b8;
  --board: #f7f7f5;
  --ink: #1f2433;
  --line: #1f2433;
  --muted: #555b69;
  --rule: #b9bcc4;
  --alert: #c62828;
  --blue: #1f5fbf;
  --tag-parts: #f2c230;
  --tag-wash: #7cc882;
  --tag-call: #f29a9a;
  --tag-keep: #9cc2f2;
  --tag-ins: #d0b0f2;
  --tag-other: #d5d8de;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  overflow: hidden;
  background: var(--frame);
  color: var(--ink);
  font-family: "Noto Sans JP", "Noto Sans CJK JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", Meiryo, sans-serif;
  font-weight: 500;
}

.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  grid-template-rows: auto auto;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  row-gap: 14px;
  width: 1280px;
  height: 720px;
  padding: 14px 24px 18px;
  border: 10px solid var(--frame);
  background: var(--board);
  transform: translate(-50%, -50%) scale(var(--scale, 1));
}

/* 見出し */
.head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.date {
  font-size: 46px;
  font-weight: 500;
  line-height: 1.1;
}

.head-side {
  text-align: right;
}

.name {
  font-size: 20px;
  color: var(--muted);
}

.status {
  font-size: 14px;
  color: var(--muted);
}

.status.is-error {
  color: var(--alert);
  font-weight: 700;
}

/* 本体：左に予定表、右に BP とメモ（高さは表に合わせる）。
   右の列は長い1行のメモで広がらないよう、どの段でも最小幅を 0 にする */
.main {
  display: grid;
  grid-template-columns: 887px minmax(0, 1fr);
  column-gap: 25px;
}

.sched {
  width: 887px;
  border: 3px solid var(--line);
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 21px;
}

.c-cat { width: 46px; }
.c-client { width: 145px; }
.c-car { width: 134px; }
.c-contact { width: 90px; }
.c-work { width: 201px; }
.c-in { width: 90px; }
.c-out { width: 90px; }
.c-loaner { width: 91px; }

.sched th,
.sched td {
  overflow: hidden;
  padding: 0 6px;
  border: 2px solid var(--line);
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

/* 文字の入れ物。高さを決めておき、board.js が収まるまで文字を縮める */
.cell,
.work {
  display: flex;
  overflow: hidden;
  align-items: center;
  justify-content: center;
  height: 42px;
}

.cell-text {
  overflow: hidden;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.cell-text.is-wrapped {
  line-height: 1.15; /* board.js の WRAP_LINE_HEIGHT と同じ */
  overflow-wrap: anywhere;
  white-space: normal;
}

/* 最小の大きさでも入らないときだけ、末尾を「…」にする（行数は board.js が入れる） */
.cell-text.is-clamped {
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.sched thead th {
  height: 38px;
  font-size: 19px;
}

.sched tbody th,
.sched tbody td {
  height: 46px;
}

.sched tbody + tbody > tr:first-child > * {
  border-top-width: 3px;
}

.sched .cat {
  padding: 0;
  font-size: 27px;
}

.cat > span {
  display: inline-block;
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.15em;
}

.sched td[data-contact="要"] {
  background: var(--alert);
  color: #fff;
}

.sched .loaner {
  color: var(--blue);
}

.sched .more {
  color: var(--muted);
  font-size: 17px;
}

/* 内容のセル：札が多いときは board.js が札を縮め、それでも無理なら後ろから「+N」にまとめる */
.sched .work-cell {
  padding: 0 4px;
}

.work {
  gap: 4px;
}

.tag {
  flex: none;
  padding: 3px 4px;
  border-radius: 4px;
  background: var(--tag-other);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.tag[data-tag="部品待ち"] { background: var(--tag-parts); }
.tag[data-tag="洗車済"] { background: var(--tag-wash); }
.tag[data-tag="要連絡"] { background: var(--tag-call); }
.tag[data-tag="預かり"] { background: var(--tag-keep); }
.tag[data-tag="保険"] { background: var(--tag-ins); }

/* 右側の欄 */
.side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  grid-template-columns: minmax(0, 1fr);
  row-gap: 16px;
}

.panel {
  min-height: 0;
  padding: 8px 20px;
  border: 3px solid var(--line);
}

.panel h2 {
  padding-bottom: 2px;
  border-bottom: 3px solid var(--line);
  font-size: 27px;
  font-weight: 500;
  line-height: 1.3;
}

.panel-memo h2 {
  border-bottom-color: transparent;
  color: var(--muted);
}

.lines li {
  display: flex;
  overflow: hidden;
  align-items: center;
  height: 40px;
  border-bottom: 2px dashed var(--rule);
  font-size: 20px;
  line-height: 38px; /* 高さ 40px から下の点線 2px を引いた分 */
  list-style: none;
  white-space: nowrap;
}

/* メモは折り返して出す（1件 48px の高さに収まるまで board.js が縮める） */
.lines-memo li {
  height: 56px; /* 文字 48px＋上下の余白 6px＋点線 2px */
  padding: 3px 0;
  font-size: 18px;
}

.lines .more {
  color: var(--muted);
  font-size: 17px;
}

.vh {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  white-space: nowrap;
}
