:root {
  --color-bg: #f4f5f7;
  --color-panel: #ffffff;
  --color-border: #dcdfe4;
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-text: #1f2430;
  --color-muted: #6b7280;
  --color-danger: #dc2626;
  font-family: -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
}

.screen { height: 100%; }
.hidden { display: none !important; }

/* ログイン画面 */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-form {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 32px;
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.login-form h1 {
  font-size: 18px;
  margin: 0 0 8px;
  text-align: center;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--color-muted);
}

.login-form input {
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 14px;
}

.login-form button {
  margin-top: 8px;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 14px;
  cursor: pointer;
}

.login-form button:hover { background: var(--color-primary-dark); }

.error-text {
  color: var(--color-danger);
  font-size: 13px;
  min-height: 1em;
  margin: 0;
}

/* メイン画面 */
#main-screen {
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--color-panel);
  border-bottom: 1px solid var(--color-border);
}

.app-header h1 { font-size: 16px; margin: 0; }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--color-muted);
}

.header-right button {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.sidebar {
  width: 320px;
  overflow-y: auto;
  background: var(--color-panel);
  border-right: 1px solid var(--color-border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
}

.panel h2 {
  font-size: 13px;
  margin: 0 0 8px;
  color: var(--color-muted);
}

#map {
  flex: 1;
  min-width: 0;
}

.vehicle-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vehicle-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.vehicle-list li:hover { background: var(--color-bg); }
.vehicle-list li.selected { background: #e8edfc; }

.vehicle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
}

.vehicle-name { font-weight: 600; }
.vehicle-time { color: var(--color-muted); font-size: 11px; margin-left: auto; }
.vehicle-offline { color: var(--color-muted); font-size: 11px; }

.vehicle-status-badge {
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}

.history-form select,
.history-form input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.history-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.message-tts-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.message-log {
  list-style: none;
  margin: 0 0 8px;
  padding: 8px;
  max-height: 55vh;
  min-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-bg);
  border-radius: 8px;
}

.message-log li {
  max-width: 75%;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--color-panel);
  align-self: flex-start;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.message-log li.mine {
  align-self: flex-end;
  background: var(--color-primary);
  color: white;
}

.message-log li .meta {
  color: var(--color-muted);
  font-size: 11px;
  display: block;
  margin-top: 4px;
}

.message-log li.mine .meta { color: rgba(255, 255, 255, 0.85); }

.message-log li.empty-hint {
  align-self: center;
  max-width: none;
  background: transparent;
  box-shadow: none;
  color: var(--color-muted);
  padding: 24px 0;
}

.message-form {
  display: flex;
  gap: 6px;
}

.message-form button,
.history-buttons button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  cursor: pointer;
}

#message-ptt-button {
  min-width: 56px;
  min-height: 56px;
  font-size: 22px;
  padding: 0;
}

#message-ptt-button.active {
  background: var(--color-danger, #dc2626);
}

#message-ptt-button:disabled {
  background: var(--color-muted);
  cursor: not-allowed;
}

.message-ptt-error {
  color: #dc2626;
  font-size: 12px;
  margin: 4px 0;
}

.message-ptt-mic-info {
  color: var(--color-muted);
  font-size: 11px;
  margin: 2px 0 4px;
}

.hidden {
  display: none;
}

.tacho-assignment-picker,
.tacho-daily-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.tacho-assignment-picker select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 12px;
}

.tacho-daily-row label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--color-muted);
}

.tacho-daily-row input[type="date"] {
  padding: 5px 6px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 12px;
}

.tacho-assignment-picker button,
.tacho-daily-row button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.history-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.speed-chart-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
}

.speed-threshold-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 6px;
}

.speed-threshold-label input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

#speed-chart-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.speed-chart-modal-content {
  max-width: 800px;
}

#speed-chart-modal-container svg {
  width: 100%;
  height: auto;
  display: block;
}

.speed-chart-slider {
  width: 100%;
  margin-top: 12px;
}

.history-buttons button:hover,
.message-form button:hover { background: var(--color-primary-dark); }

.status-text {
  font-size: 12px;
  color: var(--color-muted);
  margin: 4px 0 0;
}

#settings-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--color-muted);
}

#settings-panel select {
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

#settings-panel h3 {
  font-size: 12px;
  color: var(--color-muted);
  margin: 12px 0 6px;
}

.status-config-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.status-config-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-config-row input[type="text"] {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.status-color-palette {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.status-color-tile {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}

.status-color-tile.selected {
  border-color: var(--color-text, #1f2430);
  box-shadow: 0 0 0 1px white inset;
}

#status-config-save,
#status-config-add {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  cursor: pointer;
  margin-right: 6px;
}

#status-config-save:hover,
#status-config-add:hover { background: var(--color-primary-dark); }

/* STATUS_KIND_PLAN.md S-3: 枠の並び替え・削除・kind未設定の警告 */
.status-config-order {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-order-button {
  width: 22px;
  height: 18px;
  line-height: 1;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-surface, white);
  cursor: pointer;
  font-size: 10px;
}

.status-order-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.status-delete-button {
  padding: 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: none;
  color: #b91c1c;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.status-delete-button:hover {
  background: #fee2e2;
}

.status-config-divider {
  font-size: 11px;
  color: var(--color-muted);
  padding: 4px 0;
  border-top: 1px dashed var(--color-border);
  margin-top: 2px;
}

.status-kind-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 8px;
}

.address-search-form {
  display: flex;
  gap: 6px;
}

.address-search-form input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.address-search-form button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  cursor: pointer;
}

.address-search-form button:hover { background: var(--color-primary-dark); }

.address-search-results {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.address-search-results li {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--color-bg);
  cursor: pointer;
}

.address-search-results li:hover { background: #e8edfc; }

.vehicle-popup-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.vehicle-popup-buttons button {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.vehicle-popup-buttons button:hover { background: var(--color-primary-dark); }

.vehicle-popup-buttons button:disabled {
  background: #b9bec7;
  cursor: not-allowed;
}

.car-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}

.car-icon-manual {
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.55);
  animation: manual-pulse 1.2s ease-in-out infinite;
}

@keyframes manual-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.55); }
  50% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0.25); }
}

.manual-badge {
  color: var(--color-danger);
  font-size: 11px;
  font-weight: 600;
}

#vehicle-admin-button,
#driver-admin-button {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--color-panel);
  border-radius: 10px;
  padding: 20px;
  width: min(920px, 92vw);
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  cursor: move;
  touch-action: none;
}

.modal-header h2 { margin: 0; font-size: 16px; }

.modal-header button {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.vehicle-create-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.vehicle-create-form input {
  flex: 1 1 140px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.vehicle-create-form input[type="color"] {
  flex: 0 0 44px;
  padding: 0;
  cursor: pointer;
}

.vehicle-create-form select {
  flex: 1 1 120px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.vehicle-create-form button {
  padding: 6px 14px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  cursor: pointer;
}

.vehicle-create-form button:hover { background: var(--color-primary-dark); }

.csv-import-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 12px;
}

.csv-import-row a { color: var(--color-primary); }

.csv-import-row input[type="file"] {
  font-size: 12px;
}

.csv-import-row button {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.csv-import-row button:hover { background: var(--color-primary-dark); }

.import-result {
  font-size: 12px;
  background: var(--color-bg);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.import-result .credential-row {
  font-family: monospace;
}

.import-result .error-row {
  color: var(--color-danger);
}

.vehicle-admin-table-wrap {
  overflow-x: auto;
}

.vehicle-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.vehicle-admin-table th,
.vehicle-admin-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  white-space: nowrap;
}

.vehicle-admin-table input {
  width: 100%;
  min-width: 70px;
  padding: 4px 6px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 12px;
}

.vehicle-admin-table tr.deleted {
  opacity: 0.5;
}

.vehicle-admin-table .row-actions {
  display: flex;
  gap: 4px;
}

.vehicle-admin-table .row-actions button {
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  background: var(--color-primary);
  color: white;
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
}

.vehicle-admin-table .row-actions button:hover { background: var(--color-primary-dark); }

.vehicle-admin-table .row-actions button.danger { background: var(--color-danger); }
.vehicle-admin-table .row-actions button.danger:hover { background: #b91c1c; }

/* OSM_TILE_SERVER_PLAN.md 案C: MapLibre GL JSへ移行(旧.leaflet-control-attributionを置き換え) */
.maplibregl-ctrl-attrib { font-size: 11px; }

/* 道路交通情報リンクボタン(MAP_OVERLAY_PLAN.md 4章)。旧leaflet-barの見た目を踏襲する。
   .maplibregl-ctrl-group自体が白背景・角丸・影を持つため、中身(リンク)だけ整える。 */
.road-traffic-info-control a {
  display: block;
  padding: 0 8px;
  font-size: 12px;
  line-height: 30px;
  color: var(--color-text, #1f2430);
  text-decoration: none;
  white-space: nowrap;
}
.road-traffic-info-control a:hover { background: rgba(0, 0, 0, 0.05); }

/* 基図・オーバーレイ切替コントロール(MapLibreにはLeafletのL.control.layers相当が無いため自前実装) */
.map-layer-switcher { position: relative; }
.map-layer-switcher-toggle {
  width: 30px;
  height: 30px;
  border: none;
  background: white;
  font-size: 16px;
  cursor: pointer;
  line-height: 30px;
}
.map-layer-switcher-toggle:hover { background: rgba(0, 0, 0, 0.05); }
.map-layer-switcher-panel {
  position: absolute;
  top: 0;
  right: 34px;
  background: white;
  border-radius: 4px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
  padding: 8px 10px;
  font-size: 13px;
  white-space: nowrap;
}
.map-layer-switcher-panel.hidden { display: none; }
.map-layer-switcher-panel hr { margin: 6px 0; border: none; border-top: 1px solid var(--color-border, #ddd); }
.map-layer-switcher-group { display: flex; flex-direction: column; gap: 4px; }
.map-layer-switcher-group label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* ---- 労務管理(P2) ---- */
#labor-admin-button {
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
}

.modal-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 14px;
}

.modal-tab {
  padding: 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--color-muted);
  font-size: 13px;
  cursor: pointer;
}

.modal-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.labor-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.labor-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.labor-card.alert { border-color: var(--color-danger); box-shadow: 0 0 0 1px var(--color-danger); }

.labor-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.labor-card-name { font-weight: 600; font-size: 14px; }

.labor-card-state {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.labor-card-state.working { background: #dcfce7; color: #166534; }
.labor-card-state.resting { background: #e5e7eb; color: #374151; }

.labor-warn-flag {
  font-size: 11px;
  color: var(--color-danger);
  font-weight: 600;
}

/* A-1: 24時間タイムライン帯 */
.timeline-mini {
  line-height: 0;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.timeline-large {
  line-height: 0;
  padding: 4px 2px 18px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.timeline-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--color-muted);
}

.timeline-legend-item i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

/* A-2: 要注意ドライバーのピックアップ */
.labor-attention-section {
  margin: 4px 0 14px;
  padding: 10px 12px;
  border: 1px solid #fde68a;
  border-radius: 10px;
  background: #fffbeb;
}

.labor-attention-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
}

.labor-attention-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.labor-attention-empty {
  margin: 0;
  font-size: 12px;
  color: #166534;
  font-weight: 600;
}

.labor-attention-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.labor-attention-item:hover { background: #fffdf5; border-color: #f59e0b; }

.labor-attention-name { font-size: 13px; font-weight: 600; color: var(--color-text); }

.labor-attention-badges { display: flex; flex-wrap: wrap; gap: 4px; }

.labor-attention-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.labor-attention-badge.sev4 { background: #fee2e2; color: #b91c1c; }
.labor-attention-badge.sev3 { background: #ffedd5; color: #c2410c; }
.labor-attention-badge.sev2 { background: #fef3c7; color: #92400e; }

/* A-3/B-1: 月間拘束時間管理表(業界標準の拘束時間管理表に準拠) */
.monthly-summary {
  font-size: 13px;
  color: var(--color-text);
  margin: 4px 0 10px;
}

.monthly-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

/* LABOR_INTERPRETATION_PLAN.md A-1/I-5: 業界標準の様式には無い追加列である旨の注記 */
.monthly-note {
  font-size: 11px;
  color: var(--color-muted);
  margin: 6px 2px 0;
}

/* LABOR_INTERPRETATION_PLAN.md A-6: 所定休日の既定パターン(曜日)チェックボックス群 */
.holiday-dow-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.holiday-dow-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 13px;
}

/* LABOR_INTERPRETATION_PLAN.md A-6・決定事項D-11: 所定休日カレンダーのミニ月表示 */
.holiday-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 8px 0;
  font-weight: 600;
}

.holiday-calendar-grid {
  overflow-x: auto;
}

.hc-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.hc-table th {
  font-size: 12px;
  color: var(--color-muted);
  padding: 4px 0;
  text-align: center;
}

.hc-table td {
  border: 1px solid var(--color-border);
  height: 52px;
  vertical-align: top;
  padding: 3px;
}

.hc-empty {
  background: transparent;
  border-color: transparent !important;
}

.hc-day {
  cursor: pointer;
}

.hc-day:hover {
  background: var(--color-hover, rgba(0, 0, 0, 0.04));
}

.hc-day-num {
  display: block;
  font-size: 12px;
  color: var(--color-text);
}

.hc-day-label {
  display: block;
  font-size: 10px;
  margin-top: 2px;
}

.hc-off {
  background: #fef3c7;
}
.hc-off .hc-day-label {
  color: #92400e;
}

.hc-legal {
  background: #dbeafe;
}
.hc-legal .hc-day-label {
  color: #1e40af;
}

.hc-workday {
  background: #e5e7eb;
}
.hc-workday .hc-day-label {
  color: #374151;
}

.hc-inherited {
  opacity: 0.55;
}

.monthly-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 12px;
}

.monthly-table th {
  position: sticky;
  top: 0;
  background: #374151;
  color: #fff;
  font-weight: 600;
  padding: 7px 6px;
  text-align: center;
  white-space: nowrap;
}

.monthly-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #eef0f3;
  text-align: center;
  white-space: nowrap;
}

.monthly-table tbody tr:last-child td { border-bottom: none; }

.mt-row.mt-notice td { background: #fef3c7; }
.mt-row.mt-over td { background: #fee2e2; }

.monthly-table td.mt-dow-sun { color: #dc2626; font-weight: 600; }
.monthly-table td.mt-dow-sat { color: #2563eb; font-weight: 600; }

.monthly-table td.mt-judge-notice { color: #92400e; font-weight: 700; }
.monthly-table td.mt-judge-over { color: #b91c1c; font-weight: 700; }

/* P-H(C-5): 修正・強制終了の見える化。監査時に「修正の透明性」を示す */
.monthly-table td.mt-correction-corrected { color: #92400e; font-weight: 600; }
.monthly-table td.mt-correction-forceEnded { color: #b91c1c; font-weight: 700; }

/* LABOR_CORRECTION_PLAN.md N-6: 適用除外業務の見える化(告示由来のアラート対象外である旨) */
.monthly-table td.mt-exempt { color: #6d28d9; font-weight: 600; }

/* B-3: 残業・深夜集計の注記 */
.labor-settings-note {
  font-size: 12px;
  color: #92400e;
  background: #fef3c7;
  padding: 6px 10px;
  border-radius: 6px;
  margin: 0 0 10px;
}

/* A-4: 年間拘束時間推移ビューの棒グラフ */
#annual-chart-container svg { width: 100%; height: auto; }
.an-bar-ok { fill: #2563eb; }
.an-bar-notice { fill: #d97706; }
.an-bar-over { fill: #dc2626; }
.an-bar-future { fill: #d1d5db; }
.an-bar-label { font-size: 9px; fill: #4b5563; }
.an-limit-line { stroke: #b91c1c; stroke-width: 1; stroke-dasharray: 4,3; }

/* 乗務中カードの強制終了UI(押し忘れ対応) */
.labor-force-end { display: flex; flex-direction: column; gap: 6px; }

.labor-force-end-toggle {
  align-self: flex-start;
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid var(--color-danger);
  border-radius: 6px;
  background: #fff;
  color: var(--color-danger);
  cursor: pointer;
}

.labor-force-end-toggle:hover { background: #fef2f2; }

.labor-force-end-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.labor-force-end-form input[type='datetime-local'] {
  font-size: 12px;
  padding: 3px 6px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

.labor-force-end-exec {
  font-size: 11px;
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: var(--color-danger);
  color: #fff;
  cursor: pointer;
}

.labor-force-end-cancel {
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
}

.labor-metric { display: flex; flex-direction: column; gap: 3px; }

.labor-metric-head {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-muted);
}

.labor-metric-head b { color: var(--color-text); font-weight: 600; }

.labor-bar {
  height: 8px;
  border-radius: 4px;
  background: #eef0f3;
  overflow: hidden;
}

.labor-bar-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.labor-bar-fill.ok { background: #22c55e; }
.labor-bar-fill.warn { background: #eab308; }
.labor-bar-fill.danger { background: var(--color-danger); }

.labor-card-foot {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  padding-top: 6px;
}

.labor-rest-short { color: var(--color-danger); font-weight: 600; }

/* P-B: 運転時間(N週平均・2日平均)セクション。
   拘束時間とは別系統の規制なので、区切り線と見出しで独立したまとまりに見せる。
   情報量は多めに出し、状態は色で優先順位を付ける(COMPLIANCE_AND_HARDENING_PLAN.md Q-13)。 */
.driving-section {
  border-top: 1px dashed var(--color-border);
  margin-top: 8px;
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.driving-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-muted);
  letter-spacing: 0.06em;
}

.labor-bar-fill.driving-ok { background: #22c55e; }
.labor-bar-fill.driving-notice { background: #eab308; }
.labor-bar-fill.driving-warning { background: #f97316; }
.labor-bar-fill.driving-violation { background: var(--color-danger); }

.driving-sub { font-size: 11px; color: var(--color-muted); }
.driving-sub b { color: var(--color-text); }
.driving-sub-dim { opacity: 0.75; }

.driving-day2 { display: flex; flex-direction: column; gap: 3px; }
.driving-day2-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--color-muted);
}

.driving-chip {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  color: #fff;
}
.driving-chip-ok { background: #22c55e; }
.driving-chip-notice { background: #eab308; }
.driving-chip-warning { background: #f97316; }
.driving-chip-violation { background: var(--color-danger); }

/* P-L: ログイン画面の法的リンク(位置情報の取扱い)。目立ちすぎず、必ず見える位置に置く */
.login-legal-links { margin-top: 6px; text-align: center; font-size: 11px; }
.login-legal-links a { color: var(--color-muted); }
.login-legal-links a:hover { color: #2563eb; }

/* P-J: 設定ヘルプ。各項目のラベル横に ⓘ を出し、クリックで説明を開く。
   文言は src/help/laborHelp.js が唯一のソース(CSSはここ、文言はあちら)。 */
.labor-settings-form label { position: relative; }

.help-icon {
  align-self: flex-start;
  border: none;
  background: none;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  margin-left: 4px;
  cursor: pointer;
  border-radius: 3px;
}
.help-icon:hover { color: #2563eb; background: #eff6ff; }
.help-icon.open { color: #2563eb; background: #dbeafe; }

.help-popover {
  position: absolute;
  z-index: 40;
  top: 100%;
  left: 0;
  width: min(360px, 90vw);
  margin-top: 4px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.16);
  font-weight: 400;
}

.help-popover-title { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.help-popover p { margin: 0 0 6px; font-size: 11.5px; line-height: 1.6; }
.help-popover p:last-child { margin-bottom: 0; }
.help-popover-summary { color: var(--color-text); }
.help-popover-detail { color: var(--color-muted); }
.help-popover-warning {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 6px 8px;
}
.help-popover-ref { color: var(--color-muted); font-size: 10.5px; }

/* LABOR_INTERPRETATION_PLAN.md §4: 判定根拠ドキュメント。文言は src/help/laborBasis.js が
   唯一のソース。confidence(confirmed/inferred/pending)で色分けし、確定していない解釈を
   利用者に隠さない。 */
.labor-basis-accordion {
  margin-top: 16px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0 12px;
}
.labor-basis-accordion > summary {
  cursor: pointer;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}
.labor-basis-accordion > summary::-webkit-details-marker { display: none; }
.labor-basis-accordion > summary::before { content: '▶ '; color: var(--color-muted); }
.labor-basis-accordion[open] > summary::before { content: '▼ '; }
.labor-basis-list { padding: 4px 0 12px; }

.labor-basis-item {
  border-top: 1px solid var(--color-border);
  padding: 10px 0;
}
.labor-basis-item:first-child { border-top: none; }
.labor-basis-item-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.labor-basis-title { font-size: 12.5px; font-weight: 700; }
.labor-basis-ref { font-size: 10.5px; color: var(--color-muted); }
.labor-basis-item dl { margin: 6px 0 0; font-size: 11.5px; line-height: 1.6; }
.labor-basis-item dt { font-weight: 600; color: var(--color-muted); margin-top: 4px; }
.labor-basis-item dd { margin: 0 0 0 0; color: var(--color-text); }
.labor-basis-limitation {
  margin-top: 4px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
}

.labor-basis-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
}
.labor-basis-badge-confirmed { background: #dcfce7; color: #15803d; }
.labor-basis-badge-inferred { background: #fef3c7; color: #b45309; }
.labor-basis-badge-pending { background: #fee2e2; color: #b91c1c; }

/* LABOR_INTERPRETATION_PLAN.md §3: 営業所・ドライバー別の労務設定の上書き */
.labor-override-form { display: flex; flex-direction: column; gap: 10px; }
.labor-override-field {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(180px, 1.4fr) minmax(90px, 0.7fr);
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--color-border);
}
.labor-override-field-label { font-size: 12.5px; font-weight: 600; }
.labor-override-inherit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--color-muted);
}
.labor-override-field .lo-value:disabled { background: var(--color-bg-muted, #f1f5f9); color: var(--color-muted); }
.labor-override-warnings {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  margin-bottom: 10px;
}
.labor-override-warnings p { margin: 0 0 4px; }
.labor-override-warnings p:last-child { margin-bottom: 0; }

/* 旧設定(後方互換のため残しているもの)。現行の設定と見分けが付くよう控えめに見せる */
.labor-settings-legacy { opacity: 0.7; }
.labor-settings-legacy small { display: block; font-size: 10px; color: var(--color-muted); }

/* 月間管理表: N週平均のブロック境界。累計の起算がどこかを一目で分かるようにする */
.monthly-table tr.mt-week-block-start > td {
  border-top: 2px solid #64748b;
}

/* 「このあと何分まで運転できるか」。片側超過のときに最も行動に直結する情報なので目立たせる */
.driving-remain {
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 4px 6px;
}

/* 2026-08-08: 労務設定タブのサブタブ(カテゴリ分け)。外側の.modal-tabsとは別の見た目にして
   「モーダルのタブ」と「その中のさらに細かい分類」を視覚的に区別する(ピル型・小さめ)。 */
.labor-settings-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.labor-settings-subtab {
  padding: 5px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-muted);
  font-size: 12px;
  cursor: pointer;
}

.labor-settings-subtab:hover { color: var(--color-primary); border-color: var(--color-primary); }

.labor-settings-subtab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
}

.labor-settings-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  /* 一部の項目だけ<small>のヘルプ文言が付いて縦に長くなるため、align-items: end だと
     同じ行の短い項目が下寄せで押し下げられ、入力欄の高さが行ごとにバラバラになる
     (「階段状にずれる」の原因)。start にして全項目の先頭(ラベル)を揃え、
     <small>は下に伸びるだけで他の項目に影響しないようにする。 */
  align-items: start;
}

.labor-settings-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--color-muted);
}

.labor-settings-form select,
.labor-settings-form input {
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.labor-settings-form button[type='submit'] {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  cursor: pointer;
}

.labor-settings-form button[type='submit']:hover { background: var(--color-primary-dark); }

.labor-settings-section-title {
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.labor-settings-form label.labor-settings-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text);
}

.labor-settings-form input[type='checkbox'] {
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  flex-shrink: 0;
}

.labor-corrections-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  margin-bottom: 8px;
}

.labor-corrections-filter label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--color-muted);
}

.labor-corrections-filter select,
.labor-corrections-filter input {
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.labor-corrections-filter button {
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  background: var(--color-primary);
  color: white;
  font-size: 13px;
  cursor: pointer;
}

.labor-corrections-filter button:hover { background: var(--color-primary-dark); }

#labor-corrections-tbody input[type="datetime-local"] {
  min-width: 180px;
}

.correction-badge {
  font-size: 10px;
  color: var(--color-danger);
  font-weight: 600;
}

/* 勤務記録の修正: 理由入力+ステータス修正の詳細行(既定は非表示) */
#labor-corrections-tbody tr.correction-details.hidden { display: none; }
#labor-corrections-tbody tr.correction-details td {
  background: var(--color-bg);
  padding: 10px 12px;
  border-top: 1px dashed var(--color-border);
}

.correction-reason-label {
  display: block;
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 6px;
}

.correction-reason-input {
  display: block;
  width: 100%;
  max-width: 520px;
  margin-top: 4px;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.correction-status-edits {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.correction-status-edit-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.row-actions .link-button {
  margin-right: 8px;
  font-size: 12px;
}

/* ADOMS #22/#23/#47・LABOR_CORRECTION_PLAN.md N-6: 事由登録パネル(打刻修正の理由とは別枠) */
.assignment-reasons-list-wrap { margin-bottom: 8px; }

.assignment-reasons-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.assignment-reasons-list li {
  font-size: 12px;
  padding: 4px 6px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
}

.assignment-reasons-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.assignment-reasons-form select,
.assignment-reasons-form input[type='datetime-local'],
.assignment-reasons-form input[type='number'] {
  padding: 5px 6px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.assignment-reasons-conditional {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-muted);
}

.assignment-reasons-conditional.hidden { display: none; }

.assignment-reasons-conditional input,
.assignment-reasons-conditional select {
  padding: 5px 6px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

/* P-H: 勤務記録の修正のビジュアルタイムライン(COMPLIANCE_AND_HARDENING_PLAN.md §23)。
   1日を選んで大きく表示し、「表示幅」で1画面に見せる時間数(ズーム)を変えられる。
   24時間より狭くすると内側のキャンバスが横に伸びるため、外側の枠を横スクロールさせる。 */
.corrections-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg);
}

.timeline-day-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.timeline-day-tab {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
  color: var(--color-text);
  cursor: pointer;
}

.timeline-day-tab:hover { background: #f3f4f6; }

.timeline-day-tab.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  font-weight: 600;
}

.timeline-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-muted);
}

.timeline-toolbar select {
  margin-left: 4px;
  padding: 3px 6px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 12px;
}

.timeline-toolbar-hint { color: var(--color-muted); }

.timeline-scroll-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 8px;
}

.timeline-canvas {
  position: relative;
  min-width: 100%;
}

.timeline-ruler {
  position: relative;
  height: 16px;
  margin-bottom: 4px;
}

.timeline-ruler-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--color-muted);
  white-space: nowrap;
}

.timeline-track {
  position: relative;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #e5e7eb;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.timeline-block {
  position: absolute;
  top: 0;
  height: 100%;
}

.timeline-block-rest { background: #d1d5db; }

.timeline-block-pending {
  opacity: 0.75;
  outline: 2px dashed rgba(0, 0, 0, 0.4);
  outline-offset: -2px;
  cursor: pointer;
}

.timeline-anchor {
  position: absolute;
  top: -5px;
  width: 10px;
  margin-left: -5px;
  height: calc(100% + 10px);
  background: rgba(17, 24, 39, 0.6);
  border-radius: 4px;
  cursor: ew-resize;
  touch-action: none;
  z-index: 2;
}

.timeline-anchor:hover { background: rgba(17, 24, 39, 0.85); }

.timeline-anchor-static {
  cursor: default;
  background: rgba(17, 24, 39, 0.3);
}

/* ドラッグ中、アンカーの真上に現在時刻を追従表示するツールチップ(position:fixed、body直下) */
.timeline-drag-tooltip {
  position: fixed;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.9);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  pointer-events: none;
  z-index: 3000;
  white-space: nowrap;
}

.labor-alert-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
}

.labor-alerts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}

.labor-alerts-list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--color-bg);
  font-size: 13px;
  border-left: 3px solid var(--color-muted);
}

.labor-alerts-list li.warning { border-left-color: var(--color-danger); }
.labor-alerts-list li.notice { border-left-color: #eab308; }

/* 本文+日時の行。アクションボタン(下記)は別行にして、幅の狭い右サイドバーでも
   本文とボタンが幅を奪い合ってCJK文字が1文字ずつ縦折り返しになる崩れを防ぐ。 */
.labor-alerts-list .alert-row-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.labor-alerts-list .alert-meta {
  color: var(--color-muted);
  font-size: 11px;
  white-space: nowrap;
}

.labor-alerts-list .alert-body {
  flex: 1;
  min-width: 0;
  /* プラン変更通知(planNotify.js)は改行入りの複数行本文を送るため、既存の単一行アラートの
     見た目を変えずに改行だけ効かせる(pre-lineは連続空白は詰めるが\nは改行として扱う) */
  white-space: pre-line;
}

/* LABOR_INTERPRETATION_PLAN.md §6.2(決定事項D-14): 取消済みアラート(「取消済みも表示」時のみ表示) */
.labor-alerts-list li.alert-retracted {
  opacity: 0.6;
}
.labor-alerts-list li.alert-retracted .alert-body {
  text-decoration: line-through;
}
.labor-alerts-list .alert-retracted-note {
  font-size: 11px;
  color: var(--color-muted);
  margin-top: 2px;
}

.alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.alert-action-button {
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  background: #fff;
  color: var(--color-primary);
  cursor: pointer;
}

.alert-action-button:hover { background: #eff6ff; }

.labor-card-highlight { animation: labor-card-flash 2.5s ease-out; }

@keyframes labor-card-flash {
  0% { box-shadow: 0 0 0 3px var(--color-primary); }
  100% { box-shadow: none; }
}

/* ステータス設定の労務フラグ(除外/停止検知) */
.status-config-flags {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--color-muted);
  margin: 0 0 4px 2px;
}

.status-config-flags label {
  display: flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
}

/* 日報(P5) */
.report-content h3 {
  font-size: 13px;
  color: var(--color-muted);
  margin: 16px 0 6px;
}

.report-content table {
  margin-bottom: 4px;
}

.report-actions {
  display: flex;
  gap: 14px;
  margin-bottom: 8px;
}

.link-button {
  color: var(--color-primary);
  font-size: 13px;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.link-button:hover { text-decoration: underline; }

.version-footer {
  text-align: center;
  color: #9CA3AF;
  font-size: 11px;
  padding: 12px 0 24px;
}

/* 営業所グルーピング(2026-07-14 アカウントレベル分け対応) */

.office-filter-details {
  margin-bottom: 8px;
  font-size: 12px;
}

.office-filter-details summary {
  cursor: pointer;
  color: var(--color-primary);
}

.office-filter-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 6px 0 2px;
}

.office-filter-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: normal;
  cursor: pointer;
}

.office-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 8px;
}

.office-table th,
.office-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 13px;
}

.office-table td.actions {
  white-space: nowrap;
}

.office-name-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 13px;
}

.multi-login-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: #fef3c7;
  color: #92400e;
  font-size: 13px;
  border-bottom: 1px solid #fde68a;
}

.multi-login-banner button {
  padding: 4px 10px;
  border: none;
  border-radius: 6px;
  background: #92400e;
  color: white;
  font-size: 12px;
  cursor: pointer;
}

/* A-5: 管理側労務ウォッチ */
.labor-watch-header-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--color-border, #d1d5db);
  background: none;
  font-size: 12px;
  cursor: pointer;
}
.labor-watch-count-notice { color: #92400e; font-weight: 700; }
.labor-watch-count-danger { color: #b91c1c; font-weight: 700; }

/* FEATURE_INVENTORY.md 5.2章: トライアル中のヘッダーバッジ */
.trial-header-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid #f59e0b;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* FEATURE_INVENTORY.md 5.2章: 制限機能はグレーアウト+クリックで案内表示に統一する */
.plan-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.vehicle-watch-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  white-space: nowrap;
}
.vehicle-watch-badge.labor-watch-row-notice,
li.labor-watch-row-notice { background: #fef3c7; }
.vehicle-watch-badge.labor-watch-row-notice { color: #92400e; }
.vehicle-watch-badge.labor-watch-row-danger,
li.labor-watch-row-danger { background: #fee2e2; }
.vehicle-watch-badge.labor-watch-row-danger { color: #b91c1c; }

@keyframes labor-watch-halo-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.labor-watch-halo-pulse { animation: labor-watch-halo-pulse 1.2s ease-in-out infinite; }

.labor-watch-toast-container {
  position: fixed;
  top: 56px;
  right: 12px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.labor-watch-toast {
  background: #b91c1c;
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  max-width: 320px;
}

/* ---- ヘッダー左側(ハンバーガー+タイトル)・アイコンボタン共通 ---- */
.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.icon-btn:hover { background: var(--color-bg); }

#mobile-sidebar-toggle { display: none; }

/* ---- 左サイドバー: 開閉(アイコンレールに収束) ---- */
.app-body {
  position: relative; /* モバイル時のオーバーレイ配置の基準 */
}

.sidebar {
  width: 320px;
  min-width: 320px;
  overflow: hidden;
  background: var(--color-panel);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.sidebar-header {
  display: flex;
  justify-content: flex-end;
  padding: 8px 8px 0;
  flex: none;
}

.sidebar-toggle-btn {
  width: 26px;
  height: 26px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  flex: none;
}

.sidebar-toggle-btn:hover { background: var(--color-bg); }

.sidebar-rail {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 0 12px;
  flex: none;
}

.sidebar-rail-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  cursor: pointer;
  font-size: 15px;
}

.sidebar-rail-btn:hover { background: var(--color-bg); }

.sidebar-panels {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 12px 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.sidebar.collapsed {
  width: 48px;
  min-width: 48px;
}

.sidebar.collapsed .sidebar-header { justify-content: center; }
.sidebar.collapsed .sidebar-panels { display: none; }
.sidebar.collapsed .sidebar-rail { display: flex; }

/* パネルのアコーディオン化(旧.panel相当の見た目をdetails/summaryへ) */
.panel-details {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
  flex: none;
}

.panel-details > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-panel);
}

.panel-details > summary::-webkit-details-marker { display: none; }

.panel-details > summary::after {
  content: '▸';
  color: var(--color-muted);
  transition: transform 0.15s;
}

.panel-details[open] > summary::after { transform: rotate(90deg); }

.panel-details .panel-body {
  padding: 0 12px 12px;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 890;
}

.sidebar-backdrop.active { display: block; }

/* ---- レスポンシブ: 900px未満はサイドバーをオーバーレイドロワー化 ---- */
@media (max-width: 900px) {
  #mobile-sidebar-toggle { display: inline-flex; }

  .sidebar-header { display: none; } /* デスクトップの収束トグルは使わない */

  .sidebar,
  .sidebar.collapsed {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 900;
    width: 85vw;
    max-width: 340px;
    min-width: 0;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.2);
  }

  .sidebar.mobile-open { transform: translateX(0); }

  .sidebar-rail { display: none !important; }
  .sidebar.collapsed .sidebar-panels,
  .sidebar-panels { display: flex; }
}

/* ---- このアプリについて ---- */
.about-modal-content { width: min(420px, 92vw); }

.about-app-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
}

.about-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 12px 0;
}

.about-contact {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 13px;
}

.about-contact dt { color: var(--color-muted); }
.about-contact dd { margin: 0; }
.about-contact a { color: var(--color-primary); text-decoration: none; }
.about-contact a:hover { text-decoration: underline; }

.about-attribution {
  font-size: 11px;
  color: var(--color-muted);
  line-height: 1.6;
  margin: 0;
}

.login-about-link {
  margin-top: 4px;
  align-self: center;
}

/* ---- 右サイドバー: メッセージ/アラート統合(UI_REDESIGN_PLAN.md 6章) ---- */

.right-sidebar {
  width: 360px;
  min-width: 360px;
  border-right: none;
  border-left: 1px solid var(--color-border);
}

.right-sidebar .sidebar-header { justify-content: flex-start; }
.right-sidebar.collapsed .sidebar-header { justify-content: center; }
.right-sidebar.collapsed { width: 56px; min-width: 56px; }
.right-sidebar.collapsed .right-sidebar-panels { display: none; }
.right-sidebar.collapsed .right-rail { display: flex; }

.right-rail { position: relative; }

.rail-badge {
  position: absolute;
  top: -4px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--color-danger);
  color: white;
  font-size: 9px;
  line-height: 16px;
  text-align: center;
}

.right-sidebar-panels {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
}

.right-tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  flex: none;
}

.right-tab {
  flex: 1;
  padding: 10px 8px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--color-muted);
  font-size: 13px;
  cursor: pointer;
}

.right-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

.right-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* 新規送信・チャットメニュー共通のドロップダウン */
.dropdown-wrap { position: relative; }

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  z-index: 20;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-item {
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  color: var(--color-text);
}

.dropdown-item:hover { background: var(--color-bg); }
.dropdown-menu .message-tts-toggle { padding: 6px 10px; margin: 0; }

/* 会話一覧(ビューA) */
.conversation-list-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 10px;
}

.conversation-list-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex: none;
}

#conversation-search {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
}

.conversation-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.conversation-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 8px;
  cursor: pointer;
}

.conversation-list li:hover { background: var(--color-bg); }
.conversation-list li.broadcast-row { border-bottom: 1px solid var(--color-border); margin-bottom: 4px; padding-bottom: 10px; }

.conversation-list .conv-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex: none;
}

.conversation-list .conv-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.conversation-list .conv-name {
  font-size: 13px;
  font-weight: 600;
}

.conversation-list .conv-preview {
  font-size: 12px;
  color: var(--color-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-list .conv-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}

.conversation-list .conv-time {
  font-size: 11px;
  color: var(--color-muted);
}

.conversation-list .conv-unread-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #22c55e;
  color: white;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

/* チャット(ビューB) */
.chat-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 10px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex: none;
}

.chat-peer-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-view .message-log {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.date-separator {
  align-self: center;
  font-size: 11px;
  color: var(--color-muted);
  margin: 4px 0;
}

.message-log li .broadcast-tag {
  display: inline-block;
  font-size: 10px;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.message-log li.mine .broadcast-tag { color: rgba(255, 255, 255, 0.85); }

.read-receipt {
  display: block;
  font-size: 10px;
  color: var(--color-muted);
  margin-top: 2px;
  text-align: right;
}

.read-receipt.clickable { cursor: pointer; text-decoration: underline; }

.chat-view .message-form textarea {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
}

/* アラートフィード(ビューC) */
#right-panel-alerts {
  padding: 10px;
  overflow-y: auto;
}

#right-panel-alerts .labor-alerts-list li { cursor: pointer; }
#right-panel-alerts .labor-alerts-list li.unread { box-shadow: 0 0 0 1px var(--color-primary) inset; }

/* 既読者/未読者一覧モーダル */
.read-status-modal-content { width: min(480px, 92vw); }

.read-status-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.read-status-columns h3 {
  font-size: 12px;
  color: var(--color-muted);
  margin: 0 0 6px;
}

.read-status-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  max-height: 40vh;
  overflow-y: auto;
}

.read-status-list .read-status-time {
  display: block;
  font-size: 11px;
  color: var(--color-muted);
}

/* ---- レスポンシブ: 右サイドバーもモバイルではオーバーレイドロワー ---- */
@media (max-width: 900px) {
  #right-sidebar-toggle { display: none; }

  .right-sidebar,
  .right-sidebar.collapsed {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    height: 100%;
    z-index: 900;
    width: 100vw;
    max-width: none;
    min-width: 0;
    transform: translateX(100%);
    transition: transform 0.2s ease;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.2);
  }

  .right-sidebar.mobile-open { transform: translateX(0); }
  .right-rail { display: none !important; }
  .right-sidebar.collapsed .right-sidebar-panels,
  .right-sidebar-panels { display: flex; }

  #mobile-right-sidebar-toggle { display: inline-flex; }
}

#mobile-right-sidebar-toggle { display: none; position: relative; }

/* LABOR_UX_IMPROVEMENT_PLAN.md B-4: 帳票の共通ブランディング(会社ロゴ・押印欄)のプレビュー */
.report-branding-logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}

.report-branding-logo-preview-wrap img {
  max-width: 160px;
  max-height: 60px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
  padding: 4px;
}
