.ds-container {
  max-width: 860px;
  margin: auto;
  padding: 15px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-family: sans-serif;
  box-sizing: border-box;
  background: #fff;
}

.ds-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.ds-row label {
  width: 55%;
}

.ds-input-box {
  width: 45%;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ds-input-box input {
  width: 110px;
  text-align: center;
  padding: 6px;
  box-sizing: border-box;
}

.ds-pm-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #163a70, #244c84);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.ds-pm-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ds-toggle-switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-top: 12px;
}

.ds-switch {
  position: relative;
  width: 50px;
  height: 26px;
}

.ds-switch input {
  display: none;
}

.ds-slider {
  position: absolute;
  inset: 0;
  background: #ccc;
  border-radius: 26px;
  transition: 0.3s;
}

.ds-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 2px;
  bottom: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
}

.ds-switch input:checked + .ds-slider {
  background: #1e5aa8;
}

.ds-switch input:checked + .ds-slider:before {
  transform: translateX(24px);
}

.ds-mode-text {
  font-size: 12px;
  color: #777;
  margin-top: 5px;
}

.ds-toggle {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.ds-toggle button {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  border: none;
  background: #ddd;
  cursor: pointer;
}

.ds-toggle .active {
  background: #163a70;
  color: #fff;
}

.ds-result {
  margin-top: 14px;
  line-height: 1.8;
}

.ds-big {
  font-size: 20px;
  font-weight: bold;
  color: #0073aa;
}

.ds-sub {
  font-size: 12px;
  color: #777;
  margin-top: 2px;
}

.ds-note {
  font-size: 12px;
  color: #777;
  margin-top: 10px;
  line-height: 1.7;
}

.ds-profit {
  color: #d32f2f;
  font-weight: bold;
}

.ds-index-group.disabled {
  opacity: 0.4;
}

.ds-index-group.disabled input {
  background: #f1f1f1;
  color: #777;
}

.ds-index-group.disabled label {
  color: #888;
}

.ds-action-buttons {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.ds-small-btn {
  padding: 6px 12px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.2;
}

.ds-record-btn {
  background: #1e5aa8;
  color: #fff;
}

.ds-export-btn {
  background: #2e7d32;
  color: #fff;
}

.ds-export-detail-btn {
  background: #558b2f;
  color: #fff;
}

.ds-clear-btn {
  background: #888;
  color: #fff;
}

.ds-history-delete-btn {
  background: #b71c1c;
  color: #fff;
  padding: 5px 10px;
  font-size: 11px;
}

.ds-history-wrap {
  margin-top: 20px;
  border-top: 1px solid #ddd;
  padding-top: 15px;
}

.ds-history-head-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}

.ds-history-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ds-history-title {
  font-size: 18px;
  font-weight: bold;
}

.ds-history-empty {
  color: #777;
  font-size: 13px;
}

.ds-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ds-history-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px;
  background: #fafafa;
  transition: 0.2s;
}

.ds-history-item:hover {
  background: #f2f7fc;
  border-color: #9dbbd5;
}

.ds-history-item.active {
  border: 2px solid #1e5aa8;
  background: #eef5fc;
}

.ds-history-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.ds-history-click-area {
  flex: 1;
  cursor: pointer;
}

.ds-history-head {
  font-size: 12px;
  color: #666;
  margin-bottom: 6px;
}

.ds-history-main {
  font-size: 14px;
  line-height: 1.7;
}

.ds-history-settings {
  margin-top: 6px;
  font-size: 12px;
  color: #555;
  line-height: 1.6;
}

.ds-message {
  margin-top: 10px;
  font-size: 13px;
  color: #1e5aa8;
  font-weight: bold;
}

.ds-selected-note {
  font-size: 12px;
  color: #666;
  margin-top: 6px;
}

.ds-result-box {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #d9e2ef;
  background: #f8fbff;
  border-radius: 8px;
}

.ds-result-caution {
  margin-top: 8px;
  font-size: 12px;
  color: #b71c1c;
  font-weight: bold;
}

.ds-assumption-box {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  font-size: 12px;
  line-height: 1.7;
  color: #555;
}

.ds-assumption-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.ds-guide-box {
  margin-top: 12px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ead9a7;
  background: #fffbea;
  font-size: 12px;
  line-height: 1.7;
  color: #665c2c;
}

.ds-guide-title {
  font-weight: bold;
  margin-bottom: 4px;
}

.ds-canvas-wrap {
  margin-top: 18px;
}

@media (max-width: 640px) {
  .ds-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .ds-row label,
  .ds-input-box {
    width: 100%;
  }

  .ds-history-item-top,
  .ds-history-head-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ===== CTAブロック（収益導線） ===== */
.ds-cta-box {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #f8fbff, #eef5ff);
  border: 1px solid #cfe0ff;
  border-radius: 10px;
  text-align: center;
}

.ds-cta-title {
  font-weight: bold;
  font-size: 15px;
  margin-bottom: 12px;
  color: #163a70;
}

.ds-cta-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ds-cta-btn {
  display: block;
  width: 100%;              /* ←追加 */
  box-sizing: border-box;   /* ←追加（これが重要） */
  padding: 12px;
  background: linear-gradient(135deg, #1e5aa8, #2f6edb);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  transition: 0.2s;
}

/* 一番クリックさせたい（オレンジ） */
.ds-cta-btn.main {
  background: linear-gradient(135deg, #ff9800, #ffb74d);
  font-size: 15px;
}

/* 優先度低め */
.ds-cta-btn.sub {
  background: #78909c;
}

/* ホバー */
.ds-cta-btn:hover {
  transform: translateY(-1px);
  opacity: 0.9;
}

/* スマホ対応 */
@media (max-width: 640px) {
  .ds-cta-btn {
    font-size: 13px;
    padding: 10px;
  }
}

.ds-rate-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  border: none;
  background: #e3e8ef;
  cursor: pointer;
  transition: 0.2s;
}

/* 選択中 */
.ds-rate-btn.active {
  background: #1e5aa8;
  color: #fff;
  font-weight: bold;
}

/* ホバー */
.ds-rate-btn:hover {
  background: #d0d9e8;
}