:root {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;
  --success: #22c55e;
  --success-light: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #f59e0b;
  --warning-light: #fefce8;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-light: #fef2f2;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.03);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(160deg, #f0f4ff 0%, #faf8f5 40%, #f5f0ff 100%);
  color: var(--gray-800);
  line-height: 1.8;
  min-height: 100vh;
}

/* ===== ローディング ===== */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-size: 16px;
  color: var(--gray-500);
}

/* ===== ヘッダー ===== */
.header {
  background: white;
  border-bottom: 1px solid var(--gray-200);
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user {
  font-size: 13px;
  color: var(--gray-500);
  padding: 6px 14px;
  background: var(--gray-50);
  border-radius: 20px;
}

.save-indicator {
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--gray-50);
  border-radius: 20px;
}

.save-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.font-size-toggle {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 14px;
  transition: all 0.15s;
  font-family: inherit;
}

.font-size-toggle:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.logout-link {
  font-size: 12px;
  color: var(--gray-400);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 6px 8px;
}

.logout-link:hover {
  color: var(--gray-600);
}

/* ===== タブナビ ===== */
.tab-nav {
  max-width: 960px;
  margin: 24px auto 0;
  padding: 0 20px;
  display: flex;
  gap: 2px;
  position: relative;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px 12px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--gray-200);
  border-bottom: none;
  font-family: inherit;
  white-space: nowrap;
  position: relative;
}

.tab-btn:hover {
  color: var(--gray-600);
  background: var(--gray-50);
}

.tab-btn.active {
  color: var(--primary);
  background: white;
  border-color: var(--gray-200);
  border-bottom: 1px solid white;
  z-index: 2;
  margin-bottom: -1px;
}

.tab-btn .tab-tooltip {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-700);
  color: white;
  font-size: 12px;
  font-weight: 400;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
}

.tab-btn .tab-tooltip::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-bottom-color: var(--gray-700);
}

.tab-btn:hover .tab-tooltip {
  display: block;
}

/* ===== メインコンテンツ ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 120px;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-card {
  background: white;
  border-radius: var(--radius);
  padding: 40px 44px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-200);
  min-height: 400px;
}

.tab-panel[data-first-tab] .panel-card {
  border-radius: 0 var(--radius) var(--radius) var(--radius);
}

.panel-header {
  margin-bottom: 8px;
}

.panel-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-800);
}

.panel-desc {
  font-size: 14px;
  color: var(--gray-500);
  margin-bottom: 28px;
  line-height: 1.7;
}

/* ===== ナビゲーションボタン ===== */
.panel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
}

.btn-prev, .btn-next {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  border: none;
}

.btn-prev {
  background: var(--gray-50);
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
}

.btn-prev:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-next {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(59,130,246,0.2);
}

.btn-next:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

.btn-prev:disabled, .btn-next:disabled {
  opacity: 0;
  pointer-events: none;
}

.nav-spacer { flex: 1; }

/* ===== STEP 1: 課題シチュエーション ===== */
.situation-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 28px 32px;
  position: relative;
}

.copy-situation-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  font-weight: 500;
}

.copy-situation-btn:hover {
  background: var(--gray-100);
  color: var(--gray-600);
}

.role-tag-group {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.role-tag {
  display: inline-block;
  background: white;
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
}

.situation-box p {
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.9;
}

.conditions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

.conditions h4, .deliverables h4 {
  font-size: 13px;
  color: var(--gray-500);
  font-weight: 600;
  margin-bottom: 8px;
}

.conditions ul {
  list-style: none;
  padding-left: 0;
  font-size: 14px;
  line-height: 1.9;
}

.conditions li {
  padding: 4px 0 4px 20px;
  position: relative;
}

.conditions li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.5;
}

.deliverables {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

.deliverables ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.deliverables li {
  background: white;
  border: 1px solid var(--primary-border);
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--primary-hover);
  font-weight: 500;
}

/* ===== STEP 2: 資料選択 ===== */
.materials-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.material-card {
  background: white;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 16px 16px 16px 52px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  position: relative;
}

.material-card:hover {
  border-color: var(--gray-300);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.material-card.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.material-card .mat-checkbox {
  position: absolute;
  left: 16px;
  top: 18px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all 0.2s;
  background: white;
}

.material-card.selected .mat-checkbox {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.mat-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-800);
}

.mat-icon { font-size: 16px; flex-shrink: 0; }

.mat-desc {
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.6;
}

.mat-meta {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 6px;
}

.material-preview-btn {
  font-size: 12px;
  color: var(--primary);
  background: white;
  border: 1px solid var(--primary-border);
  border-radius: 6px;
  cursor: pointer;
  padding: 4px 14px;
  margin-top: 10px;
  font-weight: 600;
  display: inline-block;
  transition: all 0.15s;
  font-family: inherit;
}

.material-preview-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.material-download-btn {
  font-size: 12px;
  color: var(--gray-600);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  padding: 4px 14px;
  margin-top: 10px;
  margin-left: 6px;
  font-weight: 500;
  display: inline-block;
  transition: all 0.15s;
}

.material-download-btn:hover { background: var(--gray-100); }

/* ===== STEP 3: プロンプト ===== */
.prompt-entries {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.prompt-entry {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 20px;
  background: white;
  position: relative;
  transition: all 0.2s;
}

.prompt-entry:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.prompt-entry-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.entry-select {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--gray-700);
  background: var(--gray-50);
  cursor: pointer;
  transition: all 0.15s;
}

.entry-select:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.ai-select { min-width: 130px; }

.ai-help-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: help;
}

.ai-help-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-400);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-help-icon:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.ai-help-tooltip .ai-help-text {
  display: none;
  position: absolute;
  bottom: 30px;
  left: -10px;
  background: var(--gray-800);
  color: white;
  font-size: 12px;
  line-height: 1.7;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  width: 320px;
  z-index: 10;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  font-weight: 400;
}

.ai-help-tooltip:hover .ai-help-text { display: block; }

.phase-select { flex: 1; max-width: 260px; }

.prompt-entry-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.prompt-entry-move {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  color: var(--gray-400);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: all 0.15s;
  border-radius: 5px;
  font-weight: 700;
}

.prompt-entry-move:hover {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.prompt-entry-move:disabled {
  color: var(--gray-200);
  border-color: var(--gray-100);
  background: var(--gray-50);
  cursor: default;
}

.prompt-entry.moving-up { animation: slideUp 0.25s ease-out; }
.prompt-entry.moving-down { animation: slideDown 0.25s ease-out; }

@keyframes slideUp {
  0% { transform: translateY(20px); opacity: 0.5; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes slideDown {
  0% { transform: translateY(-20px); opacity: 0.5; }
  100% { transform: translateY(0); opacity: 1; }
}

.prompt-entry-remove {
  background: none;
  border: none;
  color: var(--gray-300);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s;
  margin-left: auto;
}

.prompt-entry-remove:hover { color: var(--danger); }

.prompt-entry-body { position: relative; }

.prompt-entry textarea {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px 50px 14px 14px;
  font-size: 14px;
  font-family: 'SF Mono', 'Fira Code', 'Noto Sans JP', monospace;
  resize: vertical;
  min-height: 160px;
  line-height: 1.8;
  background: var(--gray-50);
  transition: all 0.15s;
}

.prompt-entry textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 26px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--gray-400);
  transition: all 0.15s;
  font-family: inherit;
}

.copy-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
  color: var(--primary);
}

.copy-btn.copied {
  background: var(--success-light);
  border-color: var(--success-border);
  color: var(--success);
}

.ai-open-link {
  font-size: 11px;
  color: var(--primary);
  text-decoration: none;
  margin-left: 4px;
  white-space: nowrap;
}

.ai-open-link:hover { text-decoration: underline; }

.other-ai-input { margin-top: 8px; margin-bottom: 6px; }

.other-ai-input input {
  width: 100%;
  max-width: 250px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
}

.other-ai-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.add-entry-btn {
  margin-top: 8px;
  background: white;
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--gray-400);
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: all 0.2s;
  font-family: inherit;
  font-weight: 500;
}

.add-entry-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.prompt-tips {
  margin-top: 14px;
  font-size: 12px;
  color: var(--gray-400);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-tips span {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 3px 10px;
  border-radius: 6px;
}

/* ===== チェック・校正 ===== */
.review-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.review-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.review-item:hover {
  background: white;
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.review-item.checked {
  background: var(--success-light);
  border-color: var(--success-border);
}

.review-item .review-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--gray-300);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.2s;
  background: white;
}

.review-item.checked .review-checkbox {
  border-color: var(--success);
  background: var(--success);
  color: white;
}

.review-item-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--gray-600);
}

.review-item-text strong { color: var(--gray-800); }

.review-note { margin-top: 20px; }

.review-note label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 8px;
}

.review-note textarea,
.question-to-instructor textarea {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  line-height: 1.8;
  background: var(--gray-50);
  transition: all 0.15s;
}

.review-note textarea:focus,
.question-to-instructor textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

/* ===== 提出 ===== */
.output-block {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 20px;
  background: white;
  margin-bottom: 20px;
}

.output-block-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
}

.block-icon { font-size: 16px; }

.required-badge {
  font-size: 11px;
  background: var(--danger-light);
  color: var(--danger);
  padding: 2px 8px;
  border-radius: 5px;
  font-weight: 600;
}

.output-block textarea {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 200px;
  line-height: 1.8;
  background: var(--gray-50);
  transition: all 0.15s;
}

.output-block textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.08);
}

.file-upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  color: var(--gray-400);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 10px;
  background: var(--gray-50);
}

.file-upload-zone:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

.file-upload-zone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.file-upload-zone p { font-size: 13px; font-weight: 500; }
.file-upload-zone .upload-hint { font-size: 12px; margin-top: 6px; }

.uploaded-file {
  padding: 10px 14px;
  margin-top: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.uploaded-file-remove {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
}

.uploaded-file-remove:hover { color: var(--danger); }

.question-to-instructor {
  margin-top: 28px;
}

.question-to-instructor h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  margin: 0 0 8px 0;
}

.instructor-note {
  font-size: 13px;
  color: var(--gray-400);
  margin: 0 0 10px 0;
  line-height: 1.7;
}

/* ===== 提出ボタン ===== */
.submit-section {
  margin-top: 32px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-submit {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: white;
  border: none;
  padding: 16px 48px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  font-family: inherit;
  box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59,130,246,0.35);
}

.btn-submit:disabled {
  background: var(--gray-300);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.submit-note {
  font-size: 12px;
  color: var(--gray-400);
}

/* ===== モーダル ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,0.15);
}

.modal h3 { font-size: 17px; font-weight: 700; margin-bottom: 16px; }

.modal .close-btn {
  float: right;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  color: var(--gray-400);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal .close-btn:hover { background: var(--gray-100); color: var(--gray-600); }

.modal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 12px;
}

.modal th, .modal td {
  border: 1px solid var(--gray-200);
  padding: 10px 12px;
  text-align: right;
}

.modal th { background: var(--gray-50); font-weight: 600; text-align: center; }
.modal td:first-child { text-align: left; }

.modal .preview-text {
  font-size: 13px;
  line-height: 1.9;
  color: var(--gray-700);
  white-space: pre-wrap;
}

/* ===== 提出完了画面 ===== */
.submitted-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.submitted-overlay.show { display: flex; }

.submitted-content .check-icon { font-size: 64px; margin-bottom: 20px; }
.submitted-content h2 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.submitted-content p { color: var(--gray-500); margin-bottom: 28px; font-size: 15px; }

.submitted-content .btn-back {
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: white;
  border: none;
  padding: 14px 36px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ===== レスポンシブ ===== */
@media (max-width: 700px) {
  .header { padding: 12px 16px; }
  .brand-title { font-size: 14px; }
  .tab-nav { overflow-x: auto; padding: 0 12px; gap: 0; }
  .tab-btn { font-size: 11px; padding: 10px 12px; gap: 5px; }
  .panel-card { padding: 24px 16px; }
  .container { padding: 0 12px 100px; }
  .situation-box { padding: 48px 16px 20px; }
  .prompt-entry textarea { padding-top: 44px; }
  .prompt-entry-header { gap: 6px; }
  .entry-select { font-size: 12px; }
  .ai-select { min-width: 100px; }
  .phase-select { max-width: none; flex-basis: 100%; }
  .prompt-entry { padding: 14px; }
  .material-card { padding: 12px 12px 12px 42px; }
  .material-card .mat-checkbox { left: 12px; top: 14px; width: 20px; height: 20px; }
  .material-card .mat-desc {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .header-user { display: none; }
}
