:root {
  --board-bg: #173d2c;
  --board-bg-dark: #102c20;
  --board-panel: rgba(255, 255, 255, 0.025);
  --board-line: #d4b24c;
  --board-line-strong: #d4b24c;
  --board-text: #f5f7f3;
  --board-muted: #c8d3cb;
  --board-alert: #ffd7d7;
  --board-alert-bg: rgba(126, 28, 28, 0.34);
  --toolbar-height: 50px;
  --footer-height: 27px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(
      circle at 50% 10%,
      #22563e 0,
      var(--board-bg) 42%,
      #123222 100%
    );
  color: var(--board-text);
  font-family:
    "Yu Gothic",
    "Meiryo",
    sans-serif;
}

[hidden] {
  display: none !important;
}

.board-toolbar {
  height: var(--toolbar-height);
  display: grid;
  grid-template-columns:
    auto
    minmax(180px, 1fr)
    auto;
  align-items: center;
  gap: 12px;
  padding: 5px 10px;
  background: var(--board-bg-dark);
  border-bottom:
    1px solid
    var(--board-line-strong);
}

.toolbar-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.toolbar-title strong {
  font-size: 20px;
}

.toolbar-title span {
  color: #d5e2d8;
  font-size: 12px;
  font-weight: 700;
}

.toolbar-date {
  text-align: center;
  font-size: 18px;
  font-weight: 900;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.toolbar-actions button,
.toolbar-actions input,
.toolbar-actions a {
  min-height: 32px;
  border: 1px solid var(--board-line);
  border-radius: 4px;
  background: #edf4ef;
  color: #153423;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.toolbar-actions button,
.toolbar-actions a {
  padding: 4px 8px;
  cursor: pointer;
  text-decoration: none;
}

.toolbar-actions input {
  width: 128px;
  padding: 3px 5px;
}

.blackboard-shell {
  height:
    calc(
      100vh -
      var(--toolbar-height) -
      var(--footer-height)
    );
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

body[data-screen="2"]
.blackboard-shell {
  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);
}

.work-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );
}

body[data-screen="2"]
.work-area {
  grid-template-columns:
    minmax(0, 1fr);
}

.work-column {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-right:
    1px solid
    var(--board-line-strong);
  background:
    rgba(0, 0, 0, 0.035);
}

#workColumn1,
#workColumn3 {
  box-shadow:
    inset -3px 0 0
    var(--board-line-strong);
}

.column-content {
  height: 100%;
  overflow: hidden;
}

.department-heading {
  min-height: 27px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 3px 9px;
  border-top:
    1px solid
    var(--board-line-strong);
  border-bottom:
    1px solid
    var(--board-line-strong);
  background:
    rgba(238, 245, 239, 0.1);
  color: #ffffff;
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.department-heading-name {
  min-width: 0;
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.department-heading-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.department-heading-meta .is-shortage {
  color: #fecaca;
}
.column-content
.department-heading:first-child {
  border-top: 0;
}

.project-row {
  min-height: 49px;
  display: grid;
  grid-template-columns:
    minmax(0, 6fr)
    minmax(0, 4fr)
    64px;
  border-bottom:
    1px solid
    var(--board-line);
}

.project-row.shortage {
  background:
    var(--board-alert-bg);
}

.project-name-cell,
.worker-cell,
.count-cell {
  min-width: 0;
  padding: 4px 6px;
}

.project-name-cell,
.worker-cell {
  border-right:
    1px solid
    var(--board-line);
}

.project-name-cell {
  overflow: hidden;
}

.project-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
  line-height: 1.1;
  font-weight: 900;
}

.today-work,
.hazard-line,
.dispatch-line {
  margin-top: 2px;
  color: #d5dfd7;
  font-size: 10px;
  line-height: 1.25;
}

.today-work {
  font-size: 12px;
  line-height: 1.3;
}

.daily-board-danger-work {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  min-width: 0;
  font-size: 10px;
  line-height: 1.2;
}

.daily-board-danger-work-label {
  flex: 0 0 auto;
  color: #fde68a;
  font-weight: 900;
  white-space: nowrap;
}

.daily-board-danger-work-chip-list {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}

.daily-board-danger-work-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.daily-board-danger-work-chip.is-electric-shock {
  background: #f3e8ff;
  border-color: #c4b5fd;
  color: #5b21b6;
}

.daily-board-danger-work-chip.is-fall {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.daily-board-danger-work-chip.is-falling-object {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #c2410c;
}

.daily-board-danger-work-chip.is-other {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.worker-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  overflow: visible;
}

.worker-line {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.3;
}

.worker-line.dispatch-line .worker-name-list {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: baseline;
  min-width: 0;
}

.worker-line.dispatch-line .worker-name-item {
  flex: 0 0 auto;
  white-space: nowrap;
}

.partner-worker-display {
  display: inline-flex;
  align-items: baseline;
  gap: 0.18em;
  white-space: nowrap;
}

.partner-worker-name {
  font-size: 1em;
  font-weight: inherit;
}

.partner-worker-company {
  font-size: 0.68em;
  font-weight: 500;
  opacity: 0.78;
}

.segment-label {
  color: #d0ddd4;
  font-size: 10px;
}

.unassigned {
  color: #ffcbcb;
  font-weight: 900;
}

.count-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.count-cell strong {
  font-size: 15px;
}

.count-cell span {
  color: var(--board-muted);
  font-size: 9px;
}

.shortage .count-cell strong {
  color: var(--board-alert);
}

.loading,
.empty-column {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  color: var(--board-muted);
  font-size: 13px;
}

.fixed-panel {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background:
    rgba(0, 0, 0, 0.08);
}

.fixed-section {
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  border-bottom:
    1px solid
    var(--board-line-strong);
}

.fixed-section:last-child {
  border-bottom: 0;
}

.fixed-section h2 {
  min-height: 27px;
  padding: 3px 9px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom:
    1px solid
    var(--board-line-strong);
  background:
    rgba(0, 0, 0, 0.17);
  font-size: 23px;
  line-height: 1;
  font-weight: 900;
}

.fixed-section-body {
  height: auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 4px 9px;
  padding: 5px 10px;
}

.fixed-item {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.absence-section {
  cursor: pointer;
}

.absence-section:focus-visible {
  outline:
    2px solid
    currentColor;
  outline-offset: -2px;
}

.event-section .fixed-section-body {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 3px;
}

.announcement-section .fixed-section-body {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0;
  padding: 2px 10px 2px;
}

.announcement-section .fixed-item {
  padding: 0;
}

.announcement-item {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 12px;
  row-gap: 0;
  align-items: start;
  margin: 0;
}

.announcement-subject {
  white-space: nowrap;
  font-weight: 700;
  line-height: 1.18;
}

.announcement-body {
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.18;
}

.announcement-item + .announcement-item {
  margin-top: 2px;
  padding-top: 4px;
  border-top:
    1px dashed
    var(--board-line-strong);
}

.fixed-empty,
.fixed-panel-loading {
  color: var(--board-muted);
  font-size: 16px;
}

.fixed-panel-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.error-box {
  position: fixed;
  z-index: 100;
  top:
    calc(
      var(--toolbar-height) +
      6px
    );
  left: 50%;
  width:
    min(
      780px,
      calc(100vw - 24px)
    );
  transform:
    translateX(-50%);
  padding: 8px 12px;
  border:
    1px solid
    #e79b9b;
  border-radius: 5px;
  background:
    rgba(95, 10, 10, 0.94);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  box-shadow:
    0 4px 16px
    rgba(0, 0, 0, 0.35);
}

#scaleStatus {
  display: none;
}

.board-footer {
  height: var(--footer-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 9px;
  background: var(--board-bg-dark);
  border-top:
    1px solid
    var(--board-line-strong);
  color: #b9c7bd;
  font-size: 10px;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .board-toolbar {
    height: auto;
    grid-template-columns: 1fr;
  }

  .toolbar-date {
    text-align: left;
  }

  .toolbar-actions {
    flex-wrap: wrap;
  }

  .blackboard-shell,
  body[data-screen="2"]
  .blackboard-shell {
    height: auto;
    min-height: 100vh;
    grid-template-columns: 1fr;
  }

  .work-area {
    grid-template-columns: 1fr;
  }

  .work-column {
    min-height: 480px;
  }

  .fixed-panel {
    min-height: 600px;
  }

  .board-footer {
    height: auto;
    min-height: var(--footer-height);
    flex-wrap: wrap;
  }
}
/* =========================================================
   PROTOTYPE EXISTING MORNING BOARD DISPATCH STYLE
   既存朝礼の配車表示デザインを試作版へ反映
========================================================= */

.worker-cell {
  justify-content: flex-start;
  text-align: left;
}

.worker-line.dispatch-line {
  display: flex;
  align-items: flex-start;
  width: 100%;
  margin-top: 1px;
  color: #ffffff;
  font-weight: 900;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
}

.worker-line.dispatch-line .segment-label {
  flex: 0 0 auto;
  color: #fff8dc;
  font-size: 1em;
  font-weight: 900;
  margin-right: 3px;
  white-space: nowrap;
}

.worker-line.dispatch-line.is-undispatched {
  color: #fecaca;
}

.worker-line.dispatch-line.is-undispatched .segment-label {
  color: #fecaca;
}


.reflow-warning {
  position: fixed;
  top:
    calc(
      var(--toolbar-height) +
      6px
    );
  left: 50%;
  z-index: 1000;
  transform:
    translateX(-50%);
  max-width:
    calc(100vw - 32px);
  padding:
    7px 14px;
  border:
    2px solid #ffffff;
  border-radius:
    4px;
  background:
    #8b1e1e;
  color:
    #ffffff;
  font-weight: 700;
  text-align: center;
}

.reflow-measure-column {
  position: fixed !important;
  top: 0 !important;
  left: -100000px !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  visibility: hidden !important;
  pointer-events: none !important;
  z-index: -1 !important;
}


/* 朝礼案件 → 既存配車設定 */
.project-row.project-dispatch-link {
  cursor: pointer;
  transition:
    filter 120ms ease,
    box-shadow 120ms ease;
}

.project-row.project-dispatch-link:hover {
  filter: brightness(0.985);
  box-shadow:
    inset 0 0 0 1px
    rgba(37, 99, 235, 0.16);
}

.project-row.project-dispatch-link:focus-visible {
  outline:
    2px solid #2563eb;
  outline-offset: -2px;
}
