/* 余り数入力 — PlusG 上の案件固有（docs/09 §3 / docs/13） */
.hidden { display: none !important; }

.leftover-shell {
  max-width: 480px;
  margin: 0 auto;
}

.leftover-header {
  margin-bottom: 0.75rem;
}
.leftover-header .pg-page-title {
  margin-bottom: 0.35rem;
  font-size: 1.5rem;
}
.site-info {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--pg-color-muted, #6B7280);
  word-break: break-word;
}

.turnstile-widget {
  margin: 0.75rem 0 1rem;
  min-height: 65px;
}

.message { margin-bottom: 0.75rem; }

.guide {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  line-height: 1.55;
  word-break: normal;
  overflow-wrap: anywhere;
}

.toolbar.card {
  margin-bottom: 1rem;
  border: 1px solid #dde3ea;
  box-shadow: none;
}
.toolbar .form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.toolbar .form-control,
.toolbar textarea {
  width: 100%;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 5.5rem;
}

/* Tabler .card と衝突しないよう専用クラス */
.leftover-card {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}
.leftover-card .card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}
.planned-block {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  color: #6B7280;
}
.planned-label { font-weight: 600; }
.planned-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1d21;
}
.planned-unit { color: #6B7280; }

.leftover-card > label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.leftover-row {
  display: grid;
  grid-template-columns: 3rem 1fr 3rem;
  gap: 0.5rem;
  align-items: stretch;
  margin-bottom: 0.5rem;
}
.stepper-btn {
  min-height: 48px;
  border: 1px solid #c5ccd6;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: #1a1d21;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stepper-btn:active {
  background: #e8eef5;
}
.leftover-input {
  min-height: 48px;
  width: 100%;
  border: 2px solid #1a1d21;
  border-radius: 10px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  padding: 0.25rem;
  -moz-appearance: textfield;
}
.leftover-input::-webkit-outer-spin-button,
.leftover-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.leftover-input.is-over {
  border-color: #d32f2f;
  background: #ffebee;
  color: #d32f2f;
}

.usage-preview {
  font-size: 0.9rem;
  color: #6B7280;
}
.usage-preview.is-warn {
  color: #d32f2f;
  font-weight: 700;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  padding: 0.75rem 0 0.25rem;
  background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0));
  z-index: 10;
}

.complete-view,
.offline-panel {
  margin-top: 1rem;
}

.complete-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.complete-actions .btn {
  margin: 0;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 33, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
.busy-overlay.hidden { display: none !important; }
.busy-panel {
  background: #fff;
  padding: 1.5rem 1.75rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
  min-width: 12rem;
}
