html { overflow-y: scroll; }
:root {
  --bg-page: linear-gradient(135deg, #f0f0f5 0%, #e8e8ee 100%);
  --bg-card: #ffffff;
  --accent: #0071e3;
  --accent-hover: #005bb5;
  --radius: 12px;
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
  font-size: 16px;
}

/* ナビバーアイコンのスタイル */
nav ul li a i {
  margin-right: 8px;
  font-size: 1.1em;
}

/* アクティブなページのアイコン - 青色 */
nav ul li a.active i {
  color: #007AFF;
}

/* アクティブでないページのアイコン - グレーの線だけ */
nav ul li a:not(.active) i {
  color: #999;
  opacity: 0.7;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg-page);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1d1d20;
  padding-top: 64px;
  padding-left: 32px;
  padding-right: 32px;
}

main {
  max-width: 1400px;
  margin: 96px auto 32px;
  padding-left: 32px;
  padding-right: 32px;
  box-sizing: border-box;
}
h1 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, var(--accent), #5ac8fa);
  -webkit-background-clip: text;
  color: transparent;
}
.subtitle {
  text-align: center; font-size: 19px;
  margin-bottom: 32px; color: #6e6e73;
}
.card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  max-width: 800px;
  width: 100%;
  margin: 0 auto 10px auto;
  padding: 20px 40px 20px 40px;
  transition: box-shadow var(--transition), padding 0.3s ease;
  box-sizing: border-box;
  word-break: break-word;
  overflow: hidden;
}

.card.card-closed {
  padding: 16px 40px 16px 40px;
}
.card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.card-title {
  padding: 8px 32px 12px 32px;
  font-size: 18px;
  font-weight: bold;
  color: var(--accent);
  border-bottom: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  margin-top: 3px;
}

.card.card-closed .card-title {
  padding: 12px 32px 8px 32px;
}
.card-title .step-label {
  font-size: 17px;
  font-weight: bold;
  color: var(--accent);
  margin-right: 11px;
}
.card-title .back-btn {
  font-size: 16px;
  color: #0071e3;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  padding: 3px 13px;
  border-radius: 6px;
  transition: background 0.2s;
}
.card-title .back-btn:hover {
  background: #e6f2ff;
}
.card-content {
  padding: 32px 32px 32px 32px;
  transition: max-height 0.5s var(--transition), opacity 0.5s var(--transition);
  overflow: hidden;
  opacity: 1;
  max-height: 2000px;
  position: relative;
  border: none;
  box-shadow: none;
  background: var(--bg-card);
  border-radius: 0;
}
.card-content.closed {
  opacity: 0;
  max-height: 0;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  height: 0 !important;
  min-height: 0 !important;
  border: none !important;
  border-bottom: none !important;
  pointer-events: none;
  transition: max-height 0.5s var(--transition), opacity 0.4s var(--transition);
}
.form-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.form-table td {
  padding: 16px 8px;
  vertical-align: top;
  box-sizing: border-box;
  overflow-wrap: break-word;
}
.form-table td:first-child {
  width: 140px;
  min-width: 120px;
  max-width: 180px;
  font-weight: bold;
  color: #6e6e73;
  padding-right: 16px;
  white-space: nowrap;
  box-sizing: border-box;
}
.form-table td:last-child {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
select, textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 12px;
  font-size: 15px;
  border: 1px solid #d1d1d6;
  border-radius: 12px;
  transition: border-color var(--transition), transform var(--transition);
  appearance: none;
  background: #f9f9fb;
}
select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
  transform: translateY(-1px);
}
textarea {
  resize: vertical;
  height: 108px;
  color: #333;
}
textarea::placeholder {
  color: #999;
  white-space: pre-wrap;
}
.radios label {
  display: inline-flex;
  align-items: center;
  margin-right: 16px;
  cursor: pointer;
  font-size: 15px;
}
.radios input { margin-right: 6px; accent-color: var(--accent); }
.upload-btn {
  display: block; width: 100%;
  padding: 16px 12px; margin-top: 24px; margin-bottom: 16px;
  background: var(--accent); color: #fff;
  font-size: 16px; border: none;
  border-radius: 12px; cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  min-height: 48px;
  line-height: 1.2;
}
.upload-btn.loading {
  background: var(--accent-hover);
  animation: pulse 1s infinite;
}
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:0.6} }
.upload-btn:hover:not(.loading) {
  background: var(--accent-hover);
  transform: translateY(-2px);
}
.upload-btn:disabled {
  background: #a1a6a6; cursor: not-allowed;
}
.success-msg {
  margin-top: 12px;
  padding: 12px 8px;
  background: #e0ffe0;
  border: 1px solid #a0dca0;
  border-radius: 12px;
  color: #166616;
  font-size: 15px;
  white-space: nowrap;
  overflow-x: auto;
  text-align: center;
  margin-bottom: 12px;
}
.desc {
  font-size: 13px;
  color: #555;
  margin-top: 8px;
  margin-bottom: 12px;
  white-space: nowrap;
}
.continue-btn {
  display: block;
  margin: 19px auto 0 auto;
  padding: 11px 35px;
  background: #fff;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 8px;
  font-size: 17px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.continue-btn:hover {
  background: #e6f2ff;
  color: #005bb5;
}
.file-link {
  display: block;
  margin: 19px auto 0 auto;
  color: #0071e3;
  font-size: 16px;
  text-decoration: underline;
  text-align: center;
  word-break: break-all;
}
/* ファイルリスト用 */
#fileList {
  list-style:none; padding:0;
  max-width:600px; margin:0 auto 24px;
  margin-top:0;
}
.file-item {
  display:flex; align-items:center; gap:12px;
  padding:11px 11px;
  margin-bottom:10px;
  background:var(--bg-card); border-radius:18px;
  box-shadow:0 2px 5px rgba(0,0,0,.10);
  user-select:none;
  transition:box-shadow .2s;
}
.file-item:hover {
  box-shadow:0 4px 12px rgba(0,113,227,0.10);
}
.handle {
  font-size:19px; color:#888; cursor:grab;
  padding:8px; margin:-8px 0;
  touch-action:none;
  border-radius:50%; background:rgba(0,0,0,0.03);
  transition:background .2s;
}
.handle:hover {
  background:rgba(0,113,227,0.08);
}
.handle:active { cursor:grabbing; }
.file-number {
  min-width: 29px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: bold;
  font-size: 17px;
  text-align: center;
  flex-shrink: 0;
}
.file-icon { width:36px; height:36px; flex-shrink:0; }
.file-icon img { width:100%; height:100%; object-fit:contain; cursor:pointer; border-radius: 4px; transition: transform 0.2s; }
.file-icon img:hover { transform: scale(1.1); }
.file-icon svg { width:100%; height:100%; }
.file-name {
  flex-grow:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.remove-btn {
  background:transparent; border:none; color:#c00;
  font-size:19px; cursor:pointer;
  border-radius:50%; padding:3px 8px;
  transition:background .2s;
}
.remove-btn:hover {
  background:rgba(211,47,47,0.08);
}
/* プレビューモーダル */
.preview-modal {
  display: none; position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8); z-index: 2000;
  justify-content: center; align-items: center;
}
.preview-modal.show { display: flex; }
.preview-content {
  max-width: 1080px; max-height: 810px;
  position: relative;
}
.preview-content img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; border-radius: 8px;
}
.preview-close {
  position: absolute; top: -40px; right: 0;
  background: none; border: none; color: white;
  font-size: 32px; cursor: pointer;
}
.file-input-wrapper {
  position: relative;
  width: 100%;
  min-height: 51px;
  margin-bottom: 19px;
}
.custom-file-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 144px;
  padding: 35px 8px 32px 8px;
  border: 2px dashed #0071e3;
  border-radius: 12px;
  background: #f7faff;
  color: #0071e3;
  font-weight: bold;
  font-size: 17px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: center;
  user-select: none;
  margin-bottom: 5px;
  box-sizing: border-box;
}
.custom-file-btn.solid {
  border-style: solid;
  background: #e6f2ff;
}
.custom-file-btn:active, .custom-file-btn:focus {
  outline: none;
  border-color: #005bb5;
}
.file-input-wrapper.dragover .custom-file-btn {
  border-color: #005bb5;
  background: #e6f2ff;
}
.file-svg {
  display: block;
  margin: 0 auto 19px auto;
  width: 56px;
  height: 56px;
  max-width: 100%;
  max-height: 56px;
  pointer-events: none;
}
.file-btn-label {
  display: block;
  color: #0071e3;
  font-size: 16px;
  text-align: center;
  word-break: break-all;
  margin: 0 auto;
  max-width: 90%;
}
/* フリーモード表示デザインはcommon.cssで統一 */

/* Step2専用スタイル - 参考コードと同じ見た目にするため削除 */ 

/* metaFormの枠を削除 */
#metaForm {
  border: none;
  box-shadow: none;
  background: transparent;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

/* form-tableのcommon.cssスタイルを上書き */
.form-table {
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible !important;
} 

/* チェックボックスデザイン - search.htmlと同じスタイル */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

input[type="checkbox"]:checked {
  background: #007AFF;
  border-color: #007AFF;
}

input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="checkbox"]:hover {
  border-color: #007AFF;
  transform: scale(1.05);
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}

/* ラジオボタンデザイン - チェックボックスと同じ雰囲気 */
input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #ccc;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

input[type="radio"]:checked {
  background: #007AFF;
  border-color: #007AFF;
}

input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

input[type="radio"]:hover {
  border-color: #007AFF;
  transform: scale(1.05);
}

input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}

/* 写真撮影時の注意ポップアップ */
.photo-guide-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
  /* ポップアップ内のすべての要素で文字サイズを統一 */
  font-size: 16px !important;
}

.photo-guide-modal.show {
  display: flex;
  opacity: 1;
}

/* ポップアップ内のすべての要素で文字サイズを統一 */
.photo-guide-modal * {
  font-size: inherit !important;
}

.photo-guide-content {
  background: white;
  border-radius: 16px;
  padding: 2.5rem;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  margin: 2rem;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.photo-guide-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem !important;
  cursor: pointer;
  color: #666;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  width: 40px !important;
  height: 40px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.photo-guide-close:hover {
  background: #f0f0f0;
  color: #333;
}

.photo-guide-inner {
  max-width: 750px;
}

.photo-guide-title {
  color: #000;
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: 1.75rem !important;
  font-weight: bold;
  line-height: 1.3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  flex-shrink: 0;
}

.photo-guide-subtitle {
  color: #000;
  margin-bottom: 2rem;
  font-size: 1rem !important;
  text-align: center;
  font-family: 'Meiryo', 'Yu Gothic', sans-serif;
  font-weight: normal;
  line-height: 1.7;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  flex-shrink: 0;
}

.photo-guide-body {
  line-height: 1.8;
  font-size: 1rem !important;
}

.photo-guide-section {
  margin-bottom: 2rem;
}

.photo-guide-heading {
  color: #0071e3;
  margin-bottom: 1rem;
  font-size: 1.125rem !important;
  font-weight: bold;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  flex-shrink: 0;
}

.photo-guide-text {
  color: #555;
  font-size: 1rem !important;
  font-family: 'Meiryo', 'Yu Gothic', sans-serif;
  font-weight: normal;
  line-height: 1.7;
  margin: 0 0 1em 0;
  padding: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  flex-shrink: 0;
}

.photo-guide-flex {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.photo-guide-text-content {
  flex: 1;
  min-width: 250px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-shrink: 0;
  font-size: 1rem !important;
}

.photo-guide-note {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  border-left: 4px solid #0071e3;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
  flex-shrink: 0;
  font-size: 1rem !important;
}

.photo-guide-image {
  flex: 0 0 200px;
  text-align: center;
}

.photo-guide-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease;
}

.photo-guide-image img:hover {
  transform: scale(1.05);
}

.photo-guide-actions {
  text-align: center;
  margin-top: 2.5rem;
}

.photo-guide-button {
  padding: 0.8em 2em;
  border-radius: 8px;
  border: none;
  background: #0071e3;
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem !important;
  transition: all 0.2s ease;
  min-width: 120px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-shrink: 0;
}

.photo-guide-button:hover {
  background: #005bb5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.3);
}

.photo-guide-button:active {
  transform: translateY(0);
}

.photo-guide-checkbox-wrapper {
  margin-top: 1rem;
  text-align: center;
}

.photo-guide-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 1rem !important;
  color: #555;
  user-select: none;
}

.photo-guide-checkbox-label input[type="checkbox"] {
  /* スタイルは新しいinput[type="checkbox"]ルールで統一 */
}

.photo-guide-checkbox-text {
  font-size: 1rem !important;
  line-height: 1.4;
}

/* レスポンシブデザイン */
@media screen and (max-width: 768px) {
  .photo-guide-content {
    max-width: 95%;
    max-height: 95%;
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .photo-guide-flex {
    flex-direction: column;
  }
  
  .photo-guide-text-content {
    min-width: auto;
    flex: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
    flex-shrink: 0;
  }
  
  .photo-guide-image {
    flex: none;
    margin-top: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .photo-guide-content {
    max-width: 100%;
    max-height: 100%;
    padding: 1rem;
    margin: 0;
    border-radius: 0;
  }
  
  .photo-guide-close {
    top: 0.5rem;
    right: 0.5rem;
  }
  
  /* スマホでの文字サイズ固定 - どのタグでも統一 */
  .photo-guide-modal,
  .photo-guide-modal * {
    font-size: 16px !important;
  }
  
  .photo-guide-title {
    font-size: 1.75rem !important;
  }
  
  .photo-guide-subtitle {
    font-size: 1rem !important;
  }
  
  .photo-guide-heading {
    font-size: 1.125rem !important;
  }
  
  .photo-guide-text {
    font-size: 1rem !important;
  }
  
  .photo-guide-text-content {
    font-size: 1rem !important;
  }
  
  .photo-guide-button {
    font-size: 1rem !important;
    padding: 0.8em 2em;
    min-width: 120px;
  }
  
  .photo-guide-note {
    font-size: 1rem !important;
  }
  
  .photo-guide-body {
    font-size: 1rem !important;
  }
  
  .photo-guide-checkbox-label {
    font-size: 1rem !important;
  }
  
  .photo-guide-checkbox-text {
    font-size: 1rem !important;
  }
  
  .photo-guide-checkbox-label input[type="checkbox"] {
    /* スタイルは新しいinput[type="checkbox"]ルールで統一 */
  }
} 