/* モード切替タブ */
.mode-tabs {
  display: flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid var(--border-color);
}
.mode-tab {
  flex: 1;
  min-height: 38px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
}
.mode-tab.active {
  background: var(--bg-card-sub);
  color: var(--text-main);
}

#view-calc {
  padding-bottom: 20px;
}

/* ステッパー */
.stepper-group {
  display: flex;
  gap: 4px;
  align-items: center;
  width: 100%;
}
.stepper-group .btn-step {
  flex: 0 0 auto;
  min-width: 36px;
  height: 38px;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 700;
}
.stepper-group .input-with-unit {
  flex: 1 1 0;
  min-width: 0; /* Flexboxの縮小を許可 */
}
.stepper-group .input-with-unit input {
  height: 38px;
  font-size: 14px;
  padding-left: 4px;
}
/* 中央寄せと右パディングの相殺用 */
.stepper-input {
  text-align: center;
  padding-right: 0 !important;
}

/* 下部常時固定シミュレーションカード */
.result-card.sticky-bottom-card {
  position: sticky;
  bottom: 0;
  z-index: 30;
  margin-top: 20px;
  margin-left: -12px;
  margin-right: -12px;
  margin-bottom: -60px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-bottom: none;
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  border-top: 2px solid var(--color-primary);
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
  padding: 12px 14px 16px;
}

.result-card-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

/* スプール占有率ゲージ */
.spool-gauge-container {
  margin: 6px 0 8px;
}
.spool-gauge-bar {
  display: flex;
  width: 100%;
  height: 20px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.gauge-segment {
  height: 100%;
  transition: width 0.2s ease;
}
.segment-backing { background: #f59e0b; }
.segment-main { background: #0284c7; }

.gauge-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.dot-backing { background: #f59e0b; }
.dot-main { background: #0284c7; }
.dot-empty { background: #334155; }

/* 状態バッジ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
}
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--color-success); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: var(--color-danger); border: 1px solid rgba(239, 68, 68, 0.3); }

/* 詳細結果行 */
.result-details-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-color);
}
.result-value {
  font-weight: 700;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* マイリール台帳 */
.reel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
}
.reel-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.reel-maker-badge {
  font-size: 10px;
  background: var(--bg-card-sub);
  color: var(--text-accent);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  margin-right: 6px;
}
.reel-name-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}
.spool-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.spool-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.spool-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.spool-name-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
/* インジケーター (Loaded Indicator) */
.loaded-indicator {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-accent);
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}