/* Canterano 日次入力（メンバー用） — style.css のトークンを再利用したモバイル最優先レイアウト */

.input-body {
  padding-bottom: 40px;
}

/* ---- DEV切替バー ---- */
.dev-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px clamp(16px, 4vw, 24px);
  font-size: 0.75rem;
}
.dev-bar__label {
  font-family: var(--en);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #b9c6e0;
}

/* ---- ヘッダー(日付ナビ) ---- */
.input-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px clamp(16px, 4vw, 24px);
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.date-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6em 0.8em;
  font-family: var(--en);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
  min-width: 0;
}

/* ---- メイン ---- */
.input-main {
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.input-card__title {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 0 0 4px;
}
.input-card__subtitle {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 0.95rem;
  margin: 20px 0 2px;
}
.input-card__note {
  color: var(--faint);
  font-size: 0.78rem;
  margin: 0 0 12px;
}

/* ---- フィールド(縦1列) ---- */
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-2);
}
.field label {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}
.num-input {
  width: 6.5em;
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55em 0.7em;
  font-family: var(--en);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--white);
}
.num-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.num-input.is-invalid {
  border-color: #b3423a;
  box-shadow: 0 0 0 3px rgba(179, 66, 58, 0.12);
}
.num-input--short {
  width: 4em;
}
.text-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55em 0.7em;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--white);
}
.field--time .time-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.time-sep {
  font-size: 0.82rem;
  color: var(--faint);
}

/* ---- リアルタイム率表示 ---- */
.rate-live {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 14px;
}
.rate-live__item {
  background: var(--sand-2);
  text-align: center;
  padding: 12px 6px;
}
.rate-live__label {
  display: block;
  font-size: 0.68rem;
  color: var(--muted);
}
.rate-live__val {
  display: block;
  font-family: var(--en);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent);
  margin-top: 2px;
}

.field-error {
  color: #b3423a;
  font-size: 0.8rem;
  font-weight: 600;
  min-height: 1.2em;
  margin: 8px 0 0;
}
.field-warning {
  color: #8a6d1a;
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 1.2em;
  margin: 8px 0 0;
}

/* ---- 商材チップ ---- */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.product-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 0.5em 0.9em;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
  transition: 0.2s var(--ease);
}
.product-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.product-chip__count {
  font-family: var(--en);
  font-weight: 700;
  min-width: 1.4em;
  text-align: center;
}
.product-chip__minus {
  border: none;
  background: transparent;
  color: var(--faint);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0 4px;
  cursor: pointer;
}

/* ---- ボタン ---- */
.btn-primary {
  width: 100%;
  margin-top: 18px;
  border: none;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.9em 1em;
  cursor: pointer;
  transition: 0.3s var(--ease);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary:not(:disabled):active {
  transform: scale(0.98);
}

/* ---- トースト ---- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  padding: 0.8em 1.4em;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s var(--ease);
  z-index: 20;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.toast--error {
  background: #b3423a;
}

/* ---- 競合ダイアログ ---- */
.conflict-overlay {
  position: fixed;
  inset: 0;
  background: rgba(23, 32, 60, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 30;
}
.conflict-overlay[hidden] {
  display: none;
}
.conflict-box {
  background: var(--white);
  border-radius: 14px 14px 0 0;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
}
.conflict-box h3 {
  font-size: 1rem;
  margin: 0 0 8px;
}
.conflict-diff {
  background: var(--sand-2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
  margin: 10px 0;
  font-variant-numeric: tabular-nums;
}
.conflict-diff div {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.conflict-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.conflict-actions .btn-sm {
  flex: 1;
}
