/* HEALS デジタコ — 車内視認性優先のダークテーマ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", sans-serif;
  background: #0f172a; color: #e2e8f0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  user-select: none; -webkit-user-select: none;
  overscroll-behavior: none;
}
body.flash-red { animation: flashred 0.6s infinite; }
@keyframes flashred { 0%,100% { background: #0f172a; } 50% { background: #7f1d1d; } }

.screen { min-height: 100dvh; display: flex; flex-direction: column; gap: 14px; padding: 18px 16px; max-width: 480px; margin: 0 auto; }
.hidden { display: none !important; }
h1 { font-size: 1.3rem; text-align: center; padding: 8px 0; }
.card { background: #1e293b; border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.topbar { font-size: 1.05rem; text-align: center; color: #94a3b8; }
.big-name { font-size: 1.6rem; text-align: center; }
.hint { font-size: 0.85rem; color: #94a3b8; line-height: 1.7; background: #1e293b; border-radius: 10px; padding: 12px; }
.legal { font-size: 0.7rem; color: #64748b; text-align: center; margin-top: auto; line-height: 1.5; }
.warn-text { color: #fbbf24; font-size: 0.9rem; text-align: center; }

input[type=text] {
  font-size: 1rem; padding: 12px; border-radius: 10px; border: 1px solid #334155;
  background: #0f172a; color: #e2e8f0; width: 100%;
}

.btn {
  font-size: 1.1rem; font-weight: bold; padding: 14px; border: none; border-radius: 12px;
  background: #334155; color: #e2e8f0; cursor: pointer; touch-action: manipulation;
}
.btn:disabled { opacity: 0.35; }
.btn.primary { background: #2563eb; color: #fff; }
.start-btn { background: #16a34a; color: #fff; font-size: 1.5rem; padding: 22px; }
.end-btn { background: #7f1d1d; color: #fca5a5; font-size: 0.95rem; padding: 12px 14px; }

.vehicle-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vehicle-btn.selected { background: #2563eb; color: #fff; }

/* 運行中画面 */
.speed-area { text-align: center; padding: 6px 0 0; }
#speed-value { font-size: 5.2rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
#speed-value.over { color: #f87171; }
.speed-unit { color: #94a3b8; font-size: 1rem; }
.timer-area { text-align: center; background: #1e293b; border-radius: 14px; padding: 12px; }
.timer-label { color: #94a3b8; font-size: 0.85rem; }
.timer-value { font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer-value.warn { color: #fbbf24; }
.timer-value.over { color: #f87171; }
.break-progress { color: #94a3b8; font-size: 0.9rem; margin-top: 2px; }

.status-area { display: flex; flex-direction: column; gap: 10px; }
.current-status { text-align: center; font-size: 1.3rem; font-weight: bold; background: #1e293b; border-radius: 10px; padding: 8px; }
.status-address { text-align: center; font-size: 0.9rem; color: #94a3b8; min-height: 1.2em; }
.vehicle-btn.other { background: #1e3a5f; }

/* 給油 */
.fuel-btn { background: #713f12; color: #fde68a; font-size: 1rem; padding: 12px; }
.fuel-card { text-align: center; }
.fuel-label { display: flex; flex-direction: column; gap: 6px; text-align: left; font-size: 0.95rem; }
.fuel-label input { font-size: 1.4rem; padding: 12px; border-radius: 10px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0; }
.fuel-btn-row { display: flex; gap: 10px; }
.fuel-btn-row .btn { flex: 1; }
.fuel-kmpl { font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.fuel-msg { line-height: 1.7; font-size: 1.02rem; }
.status-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.status-btn { font-size: 0.95rem; padding: 16px 4px; }
.status-btn.active { background: #2563eb; color: #fff; }

.alert-banner {
  background: #b91c1c; color: #fff; font-size: 1.1rem; font-weight: bold;
  text-align: center; padding: 14px; border-radius: 12px;
}
.alert-banner.warn-level { background: #b45309; }

.bottombar { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 8px; }
.sync-badge { font-size: 0.75rem; color: #94a3b8; background: #1e293b; border-radius: 8px; padding: 6px 8px; }
.sync-badge.pending { color: #fbbf24; }
.sync-badge.ok { color: #4ade80; }
.bottombar .end-btn { margin-left: auto; }

/* サマリ */
#summary-table table { width: 100%; border-collapse: collapse; font-size: 1rem; }
#summary-table td { padding: 7px 4px; border-bottom: 1px solid #334155; }
#summary-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.overlay {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.92);
  display: flex; align-items: center; justify-content: center; padding: 24px; z-index: 50;
}
.overlay .card { width: 100%; max-width: 360px; text-align: center; font-size: 1.1rem; line-height: 1.8; }
