.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

.control-panel {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: inline-block;
  width: 150px;
  font-weight: bold;
}

.form-group input[type="text"] {
  width: 300px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.form-group input[type="range"] {
  width: 200px;
  vertical-align: middle;
}

.form-group span {
  margin-left: 10px;
  font-weight: bold;
  color: #333;
}

.form-group small {
  display: block;
  margin-top: 5px;
  margin-left: 160px;
  color: #666;
  font-size: 12px;
}

/* キーチェーンオプションのsmallタグ */
.form-group:has(label[for="keychainToggle"]) small {
  margin-left: 25px;
}

.btn-primary, .btn-secondary {
  padding: 10px 20px;
  margin: 10px 5px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: #007bff;
  color: white;
}

.btn-primary:hover {
  background: #0056b3;
}

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

.btn-secondary:hover:not(:disabled) {
  background: #218838;
}

.btn-secondary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

#canvas-container {
  width: 100%;
  height: 600px;
  border: 2px solid #ddd;
  border-radius: 8px;
  margin-bottom: 20px;
  position: relative;
  background: #f9f9f9;
}

#canvas-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ダウンロードボタンエリア */
.download-buttons {
  text-align: center;
  padding: 20px;
  background: #f5f5f5;
  border-radius: 8px;
  margin-bottom: 20px;
}

.instructions {
  background: #e9f5ff;
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.instructions h2 {
  color: #0066cc;
  margin-bottom: 10px;
}

.instructions ol {
  margin-left: 20px;
}

.instructions li {
  margin-bottom: 5px;
}

.advanced-options {
  margin-top: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 10px;
  background: #fff;
}

.advanced-options summary {
  cursor: pointer;
  font-weight: bold;
  padding: 5px;
  user-select: none;
  list-style: none;
}

.advanced-options summary::-webkit-details-marker {
  display: none;
}

.advanced-options summary:hover {
  background: #f0f0f0;
}

.advanced-options[open] summary {
  margin-bottom: 10px;
}

.summary-arrow {
  font-size: 12px;
  color: #666;
  display: inline-block;
  transition: transform 0.3s ease;
  margin-left: 5px;
}

.advanced-options[open] .summary-arrow {
  transform: rotate(180deg);
}

.form-group input[type="checkbox"] {
  margin-right: 5px;
}

/* チェックボックスラベルのスタイル */
.form-group label[for="keychainToggle"] {
  display: inline-flex;
  align-items: center;
  width: auto;
  white-space: nowrap;
}

/* ラジオボタングループのスタイル */
.radio-group {
  display: flex;
  gap: 15px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.radio-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  transition: all 0.3s;
  background: #fff;
  min-width: 90px;
  text-align: center;
  height: 80px;
  box-sizing: border-box;
}

.radio-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 100%;
}

.radio-label:hover {
  border-color: #007bff;
  background: #f8f9fa;
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  width: 0;
  height: 0;
}

.radio-label input[type="radio"]:checked ~ .font-name {
  font-weight: bold;
  color: #007bff;
}

.font-name {
  font-size: 12px;
  color: #666;
  margin-top: 0;
  display: block;
  line-height: 1.2;
}

.font-preview {
  font-size: 32px;
  font-weight: bold;
  color: #333;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  height: 40px;
}

.radio-label:has(input[type="radio"]:checked) {
  border-color: #007bff;
  background: #e7f3ff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.radio-label:has(input[type="radio"]:checked) .font-preview {
  color: #007bff;
}

/* シンプルなラジオボタンスタイル */
.printer-options {
  margin-top: 10px;
}

.simple-radio {
  display: block;
  margin-bottom: 8px;
  cursor: pointer;
}

.simple-radio input[type="radio"] {
  margin-right: 8px;
}

.simple-radio span {
  color: #333;
  font-size: 14px;
}

/* 2Dプレビュー用のスタイル */
.form-group.with-preview {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}

.text-input-section {
  flex: 1;
}

.text-input-section label {
  display: block;
  margin-bottom: 5px;
}

.text-input-section input[type="text"] {
  width: 100%;
  max-width: 400px;
}

.text2d-preview {
  flex: 0 0 auto;
  border: 1px solid #ddd;
  background: #f9f9f9;
  padding: 10px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#preview2d-svg {
  display: block;
  width: 500px;
  height: 100px;
  background: white;
  border: 1px solid #eee;
  overflow: visible; /* 大きい文字が切れないように */
}