* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: auto;
  /* ← ここ重要 */
  overflow: visible;
}

body {
  font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  /* background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); */
  margin: 0;
  padding: 20px;
}

#llms-generator {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.content {
  padding: 30px 0;
}

.section {
  margin-bottom: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid #eee;
}

.section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.section-title {
  font-size: 1.3em;
  font-weight: 600;
  color: #333;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #667eea;
}

.section-note {
  font-size: 0.9rem;
  color: #666;
  margin: 8px 0 16px;
}

.input-error {
  border: 2px solid #f44336 !important;
  background-color: #fff8f8;
}


label {
  display: block;
  margin-bottom: 15px;
  font-weight: bold;
  color: #555;
}

input[type="text"],
input[type="url"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s ease;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="url"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #667eea;
}

textarea {
  height: 100px;
  resize: vertical;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.preset-btn {
  padding: 20px;
  border: 3px solid #e9ecef;
  border-radius: 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.preset-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: transparent;
  transition: background 0.3s ease;
}

.preset-btn:hover {
  border-color: #667eea;
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.preset-btn.active {
  border-color: #667eea;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.preset-btn.active::before {
  background: rgba(255, 255, 255, 0.3);
}

.preset-btn h4 {
  margin: 0 0 12px 0;
  font-size: 1.1em;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.preset-btn h4::before {
  content: "●";
  font-size: 1.2em;
  opacity: 0.7;
}

.preset-btn.active h4::before {
  content: "✓";
  font-size: 1.1em;
  opacity: 1;
}

.preset-btn p {
  margin: 0;
  font-size: 0.9em;
  opacity: 0.8;
  line-height: 1.4;
}

.preset-btn.active p {
  opacity: 0.95;
}

.preset-btn.disabled {
  border-color: #ddd;
  background: #f5f5f5;
  color: #999;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.preset-btn.disabled:hover {
  border-color: #ddd;
  background: #f5f5f5;
  transform: none;
  box-shadow: none;
}

.preset-btn.disabled h4::before {
  content: "🔒";
  opacity: 0.5;
}

.training-restriction {
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 25px;
  transition: all 0.3s ease;
}

.training-restriction.active {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
}

.training-restriction-header {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.training-restriction input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
}

.training-restriction label {
  margin: 0;
  font-weight: 600;
  color: #856404;
}

.training-restriction.active label {
  color: #721c24;
}

.training-restriction-desc {
  font-size: 0.9em;
  color: #856404;
  line-height: 1.5;
}

.training-restriction.active .training-restriction-desc {
  color: #721c24;
}

.training-restriction-warning {
  display: none;
  margin-top: 15px;
  padding: 12px;
  background: #d1ecf1;
  border: 1px solid #bee5eb;
  border-radius: 6px;
  font-size: 0.9em;
  color: #0c5460;
  font-weight: 500;
}

.training-restriction.active .training-restriction-warning {
  display: block;
}

.bot-category {
  margin-bottom: 30px;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
}

.bot-category-header {
  background: #f8f9fa;
  padding: 15px 20px;
  border-bottom: 1px solid #e9ecef;
}

.bot-category-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #495057;
  margin: 0;
}

.bot-list {
  padding: 0;
}

.bot-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid #f1f3f4;
  align-items: start;
}

.bot-item:last-child {
  border-bottom: none;
}

.bot-info {
  min-width: 0;
}

.bot-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  font-size: 1em;
}

.bot-description {
  font-size: 0.9em;
  color: #666;
  line-height: 1.4;
  margin: 0;
}

.bot-user-agent {
  font-family: "Courier New", monospace;
  font-size: 0.8em;
  color: #888;
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 5px;
  display: inline-block;
}

.toggle-group {
  display: flex;
  border: 2px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  background: white;
}

.toggle-group input[type="radio"] {
  display: none;
}

.toggle-group label {
  padding: 10px 20px;
  cursor: pointer;
  background: #f8f9fa;
  color: #666;
  border: none;
  margin: 0;
  transition: all 0.3s ease;
  font-size: 0.9em;
  font-weight: 500;
  text-align: center;
  min-width: 80px;
}

.toggle-group label:first-of-type {
  border-right: 1px solid #ddd;
}

.toggle-group input[type="radio"]:checked + label {
  background: #28a745;
  color: white;
}

.toggle-group input[type="radio"]:checked + label.disallow-label {
  background: #dc3545;
}

.toggle-group.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.toggle-group.disabled label {
  background: #f0f0f0 !important;
  color: #999 !important;
  cursor: not-allowed;
}

.bot-item.training-restricted {
  background: #f8f9fa;
  border-left: 4px solid #dc3545;
}

.bot-item.training-restricted .bot-name::after {
  content: " 🔒 学習制限により固定";
  font-size: 0.8em;
  color: #dc3545;
  font-weight: normal;
}

.bot-extra {
  display: none;
}

#toggle-more {
  display: block;
  margin: 30px auto;
  padding: 8px 20px;
  background: none;
  color: #667eea;
  border: 2px solid #667eea;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.3s ease;
}

#toggle-more:hover {
  background: #667eea;
  color: white;
}

.technical-controls {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
}

.technical-controls-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #495057;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #dee2e6;
}

.technical-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.site-type-presets {
  margin-bottom: 30px;
}

.site-type-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 25px;
}

.site-type-btn {
  padding: 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.site-type-btn:hover {
  border-color: #667eea;
  background: #f0f4ff;
}

.site-type-btn.active {
  border-color: #667eea;
  background: #667eea;
  color: white;
}

.site-type-btn h5 {
  margin: 0 0 8px 0;
  font-size: 1em;
  font-weight: 600;
}

.site-type-btn p {
  margin: 0;
  font-size: 0.85em;
  opacity: 0.8;
}

.additional-fields {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 25px;
}

.additional-fields-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #495057;
  margin: 0 0 20px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #dee2e6;
}

.field-categories {
  display: grid;
  gap: 25px;
}

.field-category {
  border: 1px solid #f1f3f4;
  border-radius: 6px;
  overflow: hidden;
}

.field-category-header {
  background: #f8f9fa;
  padding: 12px 16px;
  border-bottom: 1px solid #f1f3f4;
  font-weight: 600;
  color: #495057;
  font-size: 0.95em;
}

.field-category-content {
  padding: 16px;
}

.field-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
  margin-bottom: 15px;

  label {
    margin-bottom: 0;
  }
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
}

.field-checkbox input[type="checkbox"] {
  transform: scale(1.1);
}

.field-inputs {
  display: none;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f1f3f4;
}

.field-inputs.show {
  display: grid;
}

.field-input-group {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 15px;
  align-items: start;
}

.field-input-group label {
  margin: 0;
  font-size: 0.9em;
  font-weight: 500;
  color: #555;
  padding-top: 8px;
}

.field-input-group input {
  padding: 8px 12px;
  font-size: 0.9em;
}

.custom-field-add {
  margin-top: 20px;
  text-align: center;
}

.custom-field-btn {
  padding: 10px 20px;
  background: none;
  color: #667eea;
  border: 2px dashed #667eea;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
}

.custom-field-btn:hover {
  background: #f0f4ff;
  border-style: solid;
}

/* 第1ステップのボタン */
.step1-buttons {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.step1-buttons button {
  flex: 1;
  min-width: 150px;
  padding: 15px 25px;
  font-size: 1.1em;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* 第2ステップのボタン */
.step2-buttons {
  display: none;
  flex-direction: column;
  gap: 20px;
  margin-top: 30px;
  padding: 25px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 2px solid #e9ecef;
}

.step2-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #495057;
  margin: 0 0 15px 0;
  text-align: center;
}

.step2-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.step2-actions button {
  flex: 1;
  min-width: 120px;
  padding: 12px 20px;
  font-size: 1em;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
  transform: translateY(-1px);
}

.btn-success {
  background: #28a745;
  color: white;
}

.btn-success:hover {
  background: #218838;
  transform: translateY(-1px);
}

.btn-danger {
  background: #dc3545;
  color: white;
}

.btn-danger:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.btn-edit {
  background: #17a2b8;
  color: white;
}

.btn-edit:hover {
  background: #138496;
  transform: translateY(-1px);
}

button:disabled {
  background: #ddd !important;
  color: #999 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

#output {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 20px;
  white-space: pre-wrap;
  font-family: "Courier New", monospace;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 20px;
  max-height: 500px;
  overflow-y: auto;
}

.input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .input-group {
    grid-template-columns: 1fr;
  }

  .bot-item {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .toggle-group {
    justify-self: start;
  }

  .step1-buttons,
  .step2-actions {
    flex-direction: column;
  }

  .preset-buttons {
    grid-template-columns: 1fr;
  }

  .technical-controls-grid {
    grid-template-columns: 1fr;
  }

  .site-type-buttons {
    grid-template-columns: 1fr;
  }

  .field-checkboxes {
    grid-template-columns: 1fr;
  }

  .field-input-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .field-input-group label {
    padding-top: 0;
  }
}

.material-icons {
  color: dimgray;
}

h2 .material-icons {
  vertical-align: text-bottom;
}

h5 .material-icons {
  vertical-align: bottom;
}

/* モバイル対策 */
@media (max-width: 768px) {
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

.llms-generator-intro {
  background: #f4f4f4;
  padding: 20px;
  margin: 20px 0 55px;
  /* border-left: 5px solid #2196f3; */
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.llms-generator-intro code {
  background: #eee;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

.llms-generator-footer {
  background: #fafafa;
  padding: 30px 20px;
  margin-top: 40px;
  font-size: 0.95rem;
  line-height: 1.7;
}
.llms-generator-footer h2 {
  margin-top: 1.5em;
  font-size: 1.2em;
  color: #333;
}
.llms-generator-footer ul {
  padding-left: 1.5em;
  margin: 0.5em 0 1em;
  list-style-type: none;
}
.llms-generator-footer code {
  background: #eee;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: monospace;
}

.llms-generator-footer a {
  color: #667eea;
}

.step2-note {
  font-size: 0.95rem;
  color: #444;
  margin: 10px 0 20px;
  line-height: 1.6;
}
.step2-note code {
  background-color: #f0f0f0;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: monospace;
}

.diamond-bullet {
  display: inline-block;
  width: 10px;
  height: 10px;
  background-color: #667eea; /* 青系 */
  transform: rotate(45deg);
  margin-right: 8px;
  flex-shrink: 0;
}