/* ==========================================
   インフルエンザ皮下注射 予診票システム 専用スタイルシート
   ========================================== */

/* 1. デザインシステム */
:root {
  --primary-color: #1d4ed8;       /* 信頼感のある医療用ブルー */
  --primary-hover: #1e40af;
  --primary-light: #eff6ff;       /* 薄いブルー背景 */
  --accent-color: #0284c7;        /* スカイブルー */
  --accent-light: #f0f9ff;
  --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
  --text-dark: #0f172a;           /* スレートブラック */
  --text-muted: #64748b;          /* スレートグレー */
  --border-color: #cbd5e1;        /* ボーダー */
  --border-focus: #3b82f6;
  --success-color: #10b981;       /* 正常・完了 */
  --warning-color: #f59e0b;       /* 注意・警告 */
  --danger-color: #ef4444;        /* エラー・中止 */
  --white: #ffffff;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 25px -3px rgba(15, 23, 42, 0.08);
  --shadow-premium: 0 20px 35px rgba(15, 23, 42, 0.1);

  --font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-dark);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 2. Webアプリコンテナ＆ヘッダー */
#app-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px 80px 16px;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-icon {
  width: 44px;
  height: 44px;
  color: var(--primary-color);
  background: var(--primary-light);
  padding: 10px;
  border-radius: 14px;
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.2;
}

.app-header .subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.info-badge {
  background: var(--primary-color);
  color: var(--white);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.25);
  white-space: nowrap;
}

/* 3. プログレスバー */
.progress-container {
  margin-bottom: 28px;
  background: var(--white);
  padding: 18px 24px 14px 24px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e2e8f0;
}

.progress-bar-wrapper {
  background: #e2e8f0;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
  height: 100%;
  width: 0;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 4px;
}

.progress-steps {
  display: flex;
  justify-content: space-between;
}

.step-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.3s;
}

.step-label.active {
  color: var(--primary-color);
}

/* 4. フォームカード・ステップ管理 */
.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

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

.card {
  background: var(--white);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid #e2e8f0;
  margin-bottom: 24px;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title i {
  color: var(--primary-color);
}

.card-subtitle {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ウェルカム画面 */
.welcome-card {
  text-align: center;
  padding: 40px 28px;
}

.welcome-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.welcome-text {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.7;
  max-width: 640px;
  margin: 0 auto 28px auto;
}

.alert-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent-color);
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  text-align: left;
  margin-bottom: 28px;
}

.alert-box.warning-alert {
  background: #fffbeb;
  border-left-color: var(--warning-color);
}

.alert-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.92rem;
  color: #b45309;
  margin-bottom: 6px;
}

.alert-content {
  font-size: 0.85rem;
  color: #78350f;
  line-height: 1.6;
}

.welcome-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
  text-align: left;
}

.feature-item {
  background: #f8fafc;
  padding: 20px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
}

.feature-item i {
  color: var(--primary-color);
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
}

.feature-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.feature-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* 説明文書閲覧アコーディオン */
.document-container {
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 28px;
  text-align: left;
  background: #fdfdfd;
}

.document-header {
  background: #f1f5f9;
  padding: 14px 20px;
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dark);
}

.document-body {
  padding: 20px;
  max-height: 320px;
  overflow-y: auto;
  font-size: 0.84rem;
  color: #334155;
  line-height: 1.7;
}

.document-body h4 {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--primary-color);
  margin-top: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}

.document-body h4:first-child {
  margin-top: 0;
}

.document-body ul, .document-body ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

/* 5. フォーム入力コントロール */
.form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.col-span-1 { grid-column: span 1; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }
.col-span-4 { grid-column: span 4; }

.form-group label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-required {
  background: #fee2e2;
  color: #dc2626;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

.badge-optional {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  outline: none;
  transition: all 0.2s;
  background: var(--white);
  color: var(--text-dark);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.input-help {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.radio-group-modern {
  display: flex;
  gap: 12px;
}

.radio-card {
  flex: 1;
  position: relative;
}

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

.radio-card span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--white);
  transition: all 0.2s;
  user-select: none;
}

.radio-card input[type="radio"]:checked + span {
  background: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.15);
}

/* 6. 問診質問カードスタイル */
.question-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 28px;
}

.question-item {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px 20px;
  transition: all 0.25s;
}

.question-item:focus-within {
  background: var(--white);
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.08);
}

.question-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.q-num {
  background: var(--primary-color);
  color: var(--white);
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.q-text-wrapper {
  flex: 1;
}

.q-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  line-height: 1.5;
}

.q-subtext {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
  margin-top: 4px;
}

.q-choices {
  display: flex;
  gap: 8px;
  align-self: center;
}

.choice-btn {
  position: relative;
}

.choice-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.choice-btn span {
  display: inline-block;
  padding: 7px 18px;
  background: var(--white);
  border: 1.5px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.choice-btn input[type="radio"]:checked + span {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.25);
}

/* 質問の詳細入力欄 */
.q-details {
  display: none;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #cbd5e1;
  padding-left: 38px;
}

.q-details.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

.q-details label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
  display: block;
  margin-bottom: 6px;
}

.q-details input[type="text"],
.q-details input[type="number"],
.q-details select {
  width: 100%;
  font-size: 0.9rem;
  padding: 8px 12px;
}

.q-details-inline {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* 7. ボタンスタイル */
.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  user-select: none;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
}

.btn-secondary {
  background: var(--white);
  border-color: var(--border-color);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-accent {
  background: var(--accent-color);
  color: var(--white);
}

.btn-accent:hover {
  background: #0369a1;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

.btn-large {
  padding: 14px 34px;
  font-size: 1.05rem;
  border-radius: 14px;
}

/* 8. 完了画面・QRコードモーダル */
.completed-card {
  text-align: center;
  padding: 36px 24px;
}

.success-icon-wrapper {
  width: 64px;
  height: 64px;
  background: #d1fae5;
  color: #059669;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px auto;
}

.completed-instruction {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 24px;
}

.print-instruction-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 20px;
  text-align: left;
  max-width: 640px;
  margin: 0 auto 28px auto;
}

.print-instruction-box h3 {
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--text-dark);
}

.print-instruction-box ol {
  padding-left: 20px;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.6;
}

.completed-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* QRコードモーダル */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}

.modal-content {
  background: var(--white);
  border-radius: 20px;
  padding: 20px 18px 16px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-premium);
  position: relative;
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f1f5f9;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.modal-content h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.qr-brightness-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.btn-qr-zoom {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  width: 100%;
  transition: all 0.2s ease;
}
.btn-qr-zoom:hover {
  background: #e2e8f0;
}

/* 全画面拡大QRモード（スキャン特化モード） */
.modal-content.fullscreen-qr {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  border-radius: 0 !important;
  padding: 20px !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  background: #ffffff !important;
}

.modal-content.fullscreen-qr h3,
.modal-content.fullscreen-qr p,
.modal-content.fullscreen-qr .qr-brightness-hint {
  display: none !important;
}

.modal-content.fullscreen-qr #qrcode-container {
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 0 16px 0 !important;
  max-width: 90vw !important;
  max-height: 70vh !important;
}

.modal-content.fullscreen-qr #qrcode-container canvas,
.modal-content.fullscreen-qr #qrcode-container img {
  width: min(85vw, 65vh) !important;
  height: min(85vw, 65vh) !important;
}

#qrcode-container {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
  padding: 8px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  cursor: pointer;
}

#qrcode-container img,
#qrcode-container canvas {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 6px;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: pixelated;
}

/* ==========================================
   9. A4実寸帳票プレビュー ＆ 印刷スタイル
   ========================================== */

#print-preview-container {
  display: none;
}

#step-4.active ~ #print-preview-container {
  display: block;
  max-width: 820px;
  margin: 24px auto 60px auto;
  padding: 0 8px;
}

.preview-heading {
  margin-top: 36px;
  margin-bottom: 14px;
  border-top: 1px dashed #cbd5e1;
  padding-top: 24px;
  text-align: center;
}

.preview-heading span {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary-color);
  display: block;
}

.preview-heading p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.a4-sheet {
  position: relative;
  background: #ffffff;
  box-shadow: var(--shadow-premium);
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  width: 100%;
  padding: 28px 32px;
  box-sizing: border-box;
  color: #000000;
  line-height: 1.15;
}

.a4-sheet * {
  color: #000000;
  line-height: 1.15;
}

/* ヘッダー */
.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 4px;
  border-bottom: 2px solid #000;
  padding-bottom: 2px;
}

.preview-header-main h1 {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.preview-header-side .badge-box {
  border: 1.5px solid #000;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

/* テーブルスタイル（武田薬品様式に完全準拠） */
.bordered-table {
  width: 100%;
  border-collapse: collapse;
  border: 1.5px solid #000;
  margin-bottom: 3px;
}

.bordered-table th,
.bordered-table td {
  border: 1px solid #000;
  padding: 1.5px 3px;
  vertical-align: middle;
}

.table-layout-fixed {
  table-layout: fixed;
}

.bg-gray {
  background-color: #f1f5f9;
}

.label-col {
  text-align: center;
  font-weight: 700;
  font-size: 0.72rem;
}

.content-col {
  font-size: 0.82rem;
}

.font-large {
  font-size: 1.05rem;
  font-weight: 700;
}

.font-normal {
  font-size: 0.76rem;
}

.font-small {
  font-size: 0.63rem;
}

.font-xsmall {
  font-size: 0.57rem;
}

.font-xxsmall {
  font-size: 0.52rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.pad-left-sm { padding-left: 4px !important; }
.pad-right-sm { padding-right: 4px !important; }
.relative-col { position: relative; }

.instruction-row {
  font-size: 0.58rem;
  margin-bottom: 2px;
  color: #1e293b;
}

/* 選択肢と丸印 */
.print-choice {
  display: inline-block;
  padding: 0 3px;
  position: relative;
  font-weight: 500;
}

.print-choice.selected {
  font-weight: 800;
}

.print-choice.selected::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1.4em;
  height: 1.4em;
  border: 1.8px solid #000000;
  border-radius: 50%;
  pointer-events: none;
}

.print-separator {
  margin: 0 1px;
}

.print-underline-text {
  border-bottom: 1px solid #000;
  padding: 0 4px;
  min-width: 28px;
  display: inline-block;
  text-align: center;
}

.print-underline-blank {
  border-bottom: 1px solid #000;
  display: inline-block;
  min-width: 60px;
}

.signature-line {
  min-height: 48px;
  width: 100%;
}

.table-subtext {
  font-size: 0.58rem;
  color: #334155;
}

/* ==========================================
   10. 印刷用スタイル (@media print)
   ========================================== */

@media print {
  html, body {
    background: #ffffff !important;
    font-family: var(--font-family) !important;
    width: 210mm;
    height: 297mm;
  }

  .no-print,
  #app-container,
  .progress-container,
  #questionnaire-form,
  .completed-card,
  .app-header,
  .modal-overlay {
    display: none !important;
  }

  #print-preview-container {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
  }

  .a4-sheet {
    display: block !important;
    border: none !important;
    box-shadow: none !important;
    padding: 5mm 10mm 6mm 10mm !important;
    width: 210mm !important;
    height: 297mm !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
  }

  .bg-gray {
    background-color: #f1f5f9 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .bordered-table th,
  .bordered-table td,
  .bordered-table {
    border-color: #000000 !important;
  }

  @page {
    size: A4 portrait;
    margin: 0;
  }
}

/* ==========================================
   11. レスポンシブ対応 (スマートフォン・小型画面)
   ========================================== */

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
  
  .col-span-1, .col-span-2, .col-span-3, .col-span-4 {
    grid-column: span 1;
  }

  .welcome-features {
    grid-template-columns: 1fr;
  }

  .progress-steps {
    display: none;
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .info-badge {
    align-self: flex-start;
  }

  .card {
    padding: 20px 16px;
    border-radius: 16px;
  }

  .question-header {
    flex-direction: column;
    gap: 10px;
  }

  .q-choices {
    align-self: flex-start;
    width: 100%;
  }

  .choice-btn {
    flex: 1;
  }

  .choice-btn span {
    text-align: center;
    width: 100%;
    padding: 7px 0;
  }

  .q-details {
    padding-left: 0;
  }

  .completed-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

/* ==========================================
   医師記入欄チェックマーク ＆ 医師名選択スタイル
   ========================================== */
.doctor-col-header {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.doctor-col-header:hover {
  background: #e2e8f0;
}
.doctor-col-header .header-sub-btn {
  display: inline-block;
  font-size: 0.68rem;
  background: #dc2626;
  color: #fff;
  padding: 1px 4px;
  border-radius: 4px;
  margin-left: 4px;
  font-weight: 700;
  vertical-align: middle;
}

.doctor-check-cell {
  text-align: center !important;
  vertical-align: middle !important;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease;
  position: relative;
}
.doctor-check-cell:hover {
  background-color: rgba(220, 38, 38, 0.08);
}
.doctor-check-mark {
  display: inline-block;
  color: #dc2626; /* 鮮やかな赤色チェックマーク */
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-1px);
}

/* ==========================================
   デジタルサイン拡大モーダル
   ========================================== */
.signature-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  z-index: 99999; /* 全面最前面 */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.signature-modal-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 840px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.signature-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  color: #ffffff;
}

.signature-modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.btn-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.btn-modal-close:hover {
  background: rgba(255, 255, 255, 0.35);
}

.signature-modal-body {
  padding: 20px 24px;
  background: #f8fafc;
}

.signature-consent-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  color: #1e3a8a;
  font-size: 0.95rem;
  line-height: 1.5;
}

.signature-pad-container {
  position: relative;
  background: #ffffff;
  border: 2px dashed #94a3b8;
  border-radius: 12px;
  height: 280px;
  touch-action: none;
  cursor: crosshair;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
}

.signature-pad-watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #cbd5e1;
  font-size: 1.4rem;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.05em;
  transition: opacity 0.2s;
}

.signature-pad-watermark.hidden {
  opacity: 0;
}

#modal-signature-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  touch-action: none;
}

.signature-modal-tip {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #64748b;
  text-align: center;
}

.signature-modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.btn-modal-confirm {
  background: #16a34a !important;
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 1rem !important;
  padding: 10px 24px !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3) !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-modal-confirm:hover {
  background: #15803d !important;
}

