/* タクトタイム計算・生産計画ツール 専用スタイル */

/* ---------- タクトタイム ---------- */

.takt {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-left-width: 6px;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-top: 20px;
}

.takt-label { font-size: .85rem; font-weight: 600; color: var(--text-muted); }

.takt-value {
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin: 2px 0 4px;
}

.takt-sub { font-size: .82rem; color: var(--text-muted); line-height: 1.7; }

/* ---------- 判定 ---------- */

.verdict {
  border: 1px solid var(--border);
  border-left-width: 6px;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 28px 0 18px;
  background: var(--surface-2);
}

.verdict.ok { background: var(--accent-soft); border-left-color: var(--ok); }
.verdict.ng { border-left-color: var(--danger); }

.verdict-title { font-size: 1.4rem; font-weight: 700; line-height: 1.3; }
.verdict.ok .verdict-title { color: var(--ok); }
.verdict.ng .verdict-title { color: var(--danger); }

.verdict-sub { font-size: .88rem; color: var(--text-muted); margin-top: 5px; line-height: 1.6; }

/* ---------- 工程の入力 ---------- */

.step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.step-no {
  flex: 0 0 26px;
  height: 26px;
  line-height: 26px;
  text-align: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .78rem;
  font-weight: 700;
}

.step-name { flex: 1 1 auto; min-width: 0; }
.step-ct { flex: 0 0 92px; text-align: right; }
.step-unit { flex: 0 0 auto; color: var(--text-muted); font-size: .9rem; }

.step-del { flex: 0 0 auto; padding: 6px 12px; font-size: .82rem; font-weight: 500; }
.step-del:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); }

/* ---------- 工程のグラフ ---------- */

.proc-title { font-size: 1.1rem; margin-top: 32px; border: 0; padding: 0; }

.procs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 12px 0 20px;
}

.proc + .proc { margin-top: 14px; }

.proc-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: .86rem;
  margin-bottom: 5px;
}

.proc-name { font-weight: 600; }

.proc-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--danger);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
}

.proc-ct { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.proc-track {
  position: relative;
  height: 14px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
}

.proc-bar { height: 100%; background: var(--accent); border-radius: 4px; }
.proc.bn .proc-bar { background: var(--danger); }

/* タクトタイムの位置を示す縦線 */
.proc-line {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 0;
  border-left: 2px dashed var(--text);
  opacity: .55;
}

.proc-idle {
  font-size: .74rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ---------- 数値カード ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  min-width: 0;
}

.stat-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat-sub { font-size: .76rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- 対策の表 ---------- */

.act-title { font-size: 1.1rem; margin-top: 30px; border: 0; padding: 0; }

td.tl, th.tl { text-align: left; white-space: normal; }
td { font-variant-numeric: tabular-nums; }

/* ---------- 計算式 ---------- */

.formula {
  background: var(--surface-2);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: 1rem;
  font-weight: 600;
  overflow-x: auto;
}

ol { padding-left: 1.4em; }
ol li { margin-bottom: 10px; }

@media print {
  .takt, .verdict { border: 1px solid #999; background: #fff !important; }
  .step-del, #addStep, #reset { display: none; }
}

@media (max-width: 600px) {
  .takt-value { font-size: 1.7rem; }
  .verdict-title { font-size: 1.2rem; }
  .stat-value { font-size: 1.1rem; }
  .step-ct { flex: 0 0 76px; }
  .proc-tag { display: block; margin: 3px 0 0; }
}
