.p-tools-edit__form {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
  position: relative;
}

.p-tools-edit__loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
}

.p-tools-edit__form.is-submitting .p-tools-edit__loading {
  display: flex;
}

.p-tools-edit__form.is-submitting .p-tools-edit__main,
.p-tools-edit__form.is-submitting .p-tools-edit__sidebar {
  pointer-events: none;
  opacity: 0.65;
}

.p-tools-edit__loading-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.p-tools-edit__loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid #d1d5db;
  border-top-color: #111827;
  animation: p-tools-edit-spin 0.8s linear infinite;
}

.p-tools-edit__loading-text {
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

@keyframes p-tools-edit-spin {
  to {
    transform: rotate(360deg);
  }
}

.p-tools-edit__main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  flex: 1;
  min-width: 0;
  background: #f9fafb;
  border-radius: 20px;
  padding: 40px 20px;
}

.p-tools-edit__sidebar {
  width: 300px;
  flex-shrink: 0;
  border: 1px solid #0000001a;
  border-radius: 20px;
  padding: 14px 24px;
  position: sticky;
  top: 80px;
  z-index: 1;
}

.p-tools-edit__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.p-tools-edit__btn {
  width: 100%;
  justify-content: center;
  border: 1px solid #d1d5db;
  border-radius: 50px;
  padding: 16px 40px;
  background: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  text-align: center;
  text-decoration: none;

  &:hover {
    background: #f9fafb;
    border-color: #9ca3af;
  }
}

.p-tools-edit__btn--primary {
  border-color: #03a9f4;
  background: #03a9f4;
  color: #ffffff;

  &:hover {
    background: #039be5;
    border-color: #039be5;
  }
}

.p-tools-edit__draft-btn {
  width: 100%;
  justify-content: center;
  border: 1px solid #d1d5db;
  border-radius: 50px;
  padding: 16px 40px;
  background: #f3f4f6;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
  text-align: center;
  text-decoration: none;

  &:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
  }
}

.p-tools-edit__contact {
  text-align: center;
  font-size: 14px;
  color: #9c9ca2;
}

.p-tools-edit__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.p-tools-edit__field:last-child {
  margin-bottom: 0;
}

.p-tools-edit__field-body {
  flex: 1;
  min-width: 0;
}

/* ラベルの装飾 */
.p-tools-edit__label {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.p-tools-edit__sub-text {
  font-size: 14px;
  font-weight: bold;
  color: #babac0;
}

.p-tools-edit__input {
  width: 100%;
  border: 2px solid #e5e5e5 !important;
  border-radius: 12px !important;
  font-size: 16px;
}

#post_excerpt.p-tools-edit__input {
  resize: none;
}

.p-tools-edit__input:focus {
  border-color: #007cba;
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.p-tools-edit__input--error {
  border-color: #e53e3e !important;
}

.p-tools-edit__error {
  font-size: 13px;
  color: #e53e3e;
  margin: 0;
}

/* ボタン風ラジオボタン */
.p-tools-edit__radio-item {
  flex: 1;
}

.p-tools-edit__radio-group {
  display: flex;
  gap: 24px;
}

.p-tools-edit__affiliate .p-tools-edit__radio-group {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  flex: 1;
}

/* ラジオボタン本体は非表示 */
.p-tools-edit .p-tools-edit__radio-input {
  display: none !important;
}

/* ラベル全体：縦並び (画像下テキスト) */
.p-tools-edit .p-tools-edit__radio-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 2px solid #e5e5e5 !important;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%;
  margin: 0 !important;
}

/* ホバー時 */
.p-tools-edit .p-tools-edit__radio-label:hover {
  border-color: #ccc !important;
  background-color: #fcfcfc;
}

.p-tools-edit__radio-icon {
  margin-bottom: 12px;
}

.p-tools-edit__radio-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.p-tools-edit__radio-text {
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: #333;
}

/* ラジオボタン風擬似要素 */
.p-tools-edit__radio-text::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid #e5e5e5;
  border-radius: 50%;
  margin-right: 6px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

/* ———————————————— 
   選択時のスタイル調整
   ———————————————— */
/* ラベル本体のハイライト */
.p-tools-edit .p-tools-edit__radio-input:checked + .p-tools-edit__radio-label {
  border-color: #03a9f4 !important;
}

/* テキストの色調整 */
.p-tools-edit
  .p-tools-edit__radio-input:checked
  + .p-tools-edit__radio-label
  .p-tools-edit__radio-text {
  color: #03a9f4;
}

/* 左側の●のハイライト */
.p-tools-edit
  .p-tools-edit__radio-input:checked
  + .p-tools-edit__radio-label
  .p-tools-edit__radio-text::before {
  border-color: #03a9f4;
}

.p-tools-edit__affiliate {
  display: flex;
  gap: 32px;
}

.p-tools-edit__affiliate-ratio {
  flex: 1;
  background: #ffffff;
  border-radius: 14px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.p-tools-edit__ratio-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.p-tools-edit__ratio-label {
  display: flex;
  justify-content: space-between;
}

.p-tools-edit__ratio-target {
  font-size: 14px;
  font-weight: bold;
  color: #000000;
}

.p-tools-edit__ratio-text {
  font-weight: bold;
  color: #37a0ea;
}

/* バーの土台（薄い色） */
.p-tools-edit__ratio-bar-container {
  width: 100%;
  height: 12px;
  background-color: #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

/* バーの中身（濃い色） */
.p-tools-edit__ratio-bar-inner {
  height: 100%;
  border-radius: 6px;
  background-color: #37a0ea;
  transition: width 0.3s ease-in-out;
}

.p-tools-edit__info {
  display: flex;
  gap: 12px;
  align-items: center;
}

.p-tools-edit__info-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  background: #fff3e0;
  border-radius: 12px;
  padding: 6px 20px;
}

.p-tools-edit__info-link {
  color: #666666;
}

/* モバイル対応：サイドバーを下に落とす */
@media (max-width: 768px) {
  .p-tools-edit__form {
    flex-direction: column;
  }
  .p-tools-edit__sidebar {
    width: 100%;
  }
  .p-tools-edit__sidebar-inner {
    position: static;
  }
}
