/* ===== 自己紹介カードメーカー ===== */

.jc-layout {
  display: flex;
  gap: 28px;
  max-width: 1080px;
  margin: 24px auto 40px;
  padding: 0 4px;
  align-items: flex-start;
}

/* --- フォーム --- */
.jc-form {
  width: 360px;
  flex-shrink: 0;
  text-align: left;
}

.jc-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.jc-tab {
  flex: 1;
  min-width: 140px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
  text-align: center;
}
.jc-tab:hover { background: #eef2f7; }
.jc-tab.is-active {
  background: var(--accent, #0f766e);
  border-color: var(--accent, #0f766e);
  color: #fff;
}

.jc-tab-hint {
  font-size: 11.5px;
  color: #888;
  margin: 8px 0 0;
  line-height: 1.6;
}

.jc-form .fs-title {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  margin: 22px 0 8px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--accent, #0f766e);
}

.jc-form .radio-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 6px;
}

.jc-form .radio-line label,
.jc-form .check-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 13.5px;
  color: #333;
  cursor: pointer;
}
.jc-form .check-line { margin-top: 6px; }

.jc-form .radio-line input,
.jc-form .check-line input {
  width: auto;
  margin: 0;
}

.fav-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 6px;
}

.fav-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #333;
  cursor: pointer;
}
.fav-toggle input { width: auto; margin: 0; }

.jc-custom-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.jc-custom-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  color: #0f766e;
}

.jc-custom-remove {
  border: none;
  background: none;
  color: #0f766e;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
}
.jc-custom-remove:hover { color: #ef4444; }

.jc-add-cat-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.jc-add-cat-form input[type='text'] {
  flex: 1;
  font-size: 13.5px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
}

.jc-add-cat-form button {
  flex-shrink: 0;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}
.jc-add-cat-form button:hover { background: #eef2f7; }

.jc-form input[type='text'],
.jc-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-size: 14.5px;
  color: #333;
  padding: 9px 11px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  margin-top: 8px;
}
.jc-form input[type='text']:first-child { margin-top: 0; }

.jc-form textarea {
  resize: vertical;
  line-height: 1.7;
}

.fav-answers {
  margin-top: 6px;
}

.jc-answer-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.jc-answer-row:first-child { margin-top: 0; }

.jc-answer-label {
  flex-shrink: 0;
  width: 108px;
  font-size: 12.5px;
  color: #475569;
}

.jc-answer-row input[type='text'] {
  flex: 1;
  margin-top: 0;
}

.jc-fav-answers-empty {
  font-size: 12.5px;
  color: #94a3b8;
  margin: 4px 0 0;
}

/* fill-only：手書きタブでは非表示 */
.jc-form[data-tab='handwrite'] .fill-only {
  display: none;
}

.jc-reset-btn {
  margin-top: 22px;
  padding: 8px 14px;
  font-size: 12.5px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #555;
  cursor: pointer;
}
.jc-reset-btn:hover { color: #c0392b; border-color: #c0392b; }

/* --- プレビュー側 --- */
.jc-preview {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: 16px;
  align-self: flex-start;
  text-align: center;
}

.jc-print-btn {
  width: 100%;
  background: var(--accent, #0f766e);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.jc-print-btn:hover { opacity: 0.85; }

.jc-print-note {
  font-size: 12px;
  color: #888;
  margin: 10px 0 12px;
  line-height: 1.5;
}

.jc-preview-caption {
  font-size: 12px;
  color: #888;
  margin-top: 8px;
}

/* ===== A4シート（プレビュー兼 印刷対象） ===== */
.jc-sheet-wrap { width: 100%; }

.jc-sheet-box {
  overflow: hidden;
  border-radius: 4px;
  position: relative;
}

.jc-sheet {
  position: relative;
  box-sizing: border-box;
  width: 210mm;
  height: 297mm;
  padding: 10mm;
  background: #fff;
  color: #1a1a1a;
  transform-origin: top left;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif;
}

.jc-page {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.jc-page-a4 .jc-card {
  flex: 1;
}

.jc-page-a5x2 {
  gap: 4mm;
}
.jc-page-a5x2 .jc-card {
  flex: 1;
  min-height: 0;
}

.jc-cutline {
  flex-shrink: 0;
  position: relative;
  height: 6mm;
  display: flex;
  align-items: center;
  justify-content: center;
}
.jc-cutline::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 0.3mm dashed #bbb;
}
.jc-cutline span {
  position: relative;
  background: #fff;
  padding: 0 6px;
  font-size: 8px;
  color: #999;
}

/* --- カード本体 --- */
.jc-card {
  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  border: 0.6mm solid #cbd5e1;
  border-radius: 4mm;
  background: #fff;
}
.jc-card.design-niji { border-color: #93c5fd; background: #f0f9ff; }
.jc-card.design-sports { border-color: #1e293b; }
.jc-card.design-simple { border-color: #99f6e4; }

.jc-deco-layer { position: absolute; inset: 0; pointer-events: none; }

.jc-deco { position: absolute; }

/* シンプル：四隅の角飾り＋区切り線 */
.jc-deco-corner { width: 9mm; height: 9mm; }
.jc-deco-corner-tl { top: 3mm; left: 3mm; }
.jc-deco-corner-tr { top: 3mm; right: 3mm; }
.jc-deco-corner-bl { bottom: 3mm; left: 3mm; }
.jc-deco-corner-br { bottom: 3mm; right: 3mm; }
.jc-deco-divider { left: 10%; right: 10%; top: 32%; height: 3mm; width: 80%; }

/* にじ：上部アーチ＋下段の雲 */
.jc-deco-niji-arc { top: 0; left: 8%; width: 84%; height: 16mm; }
.jc-deco-cloud { bottom: 3mm; width: 22mm; height: 11mm; }
.jc-deco-cloud-l { left: 2mm; }
.jc-deco-cloud-r { right: 2mm; }

/* スポーツ：上部ボール＋下部トラックライン */
.jc-deco-ball { top: 3mm; width: 12mm; height: 12mm; }
.jc-deco-ball-l { left: 3mm; }
.jc-deco-ball-r { right: 3mm; }
.jc-deco-track { left: 6%; right: 6%; bottom: 3mm; width: 88%; height: 3mm; }

.jc-card-inner {
  position: relative;
  height: 100%;
  box-sizing: border-box;
  padding: 16mm 10mm 8mm;
  display: flex;
  flex-direction: column;
  gap: 6mm;
}

.jc-page-a5x2 .jc-card-inner {
  padding: 11mm 8mm 8mm;
  gap: 3mm;
}

.jc-kicker {
  margin: 0;
  text-align: center;
  font-size: 4mm;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #64748b;
}

.jc-name-block {
  text-align: center;
  flex-shrink: 0;
}

.jc-kana-line {
  font-size: 3.4mm;
  color: #64748b;
  min-height: 4.4mm;
}

.jc-name-line {
  font-size: 8mm;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 0.4mm solid #94a3b8;
  padding-bottom: 1.5mm;
  margin: 1mm auto 0;
  display: inline-block;
  min-width: 60mm;
}

.jc-page-a5x2 .jc-name-line { font-size: 6mm; min-width: 44mm; }

.jc-favorites {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2.6mm;
  overflow: hidden;
}

.jc-page-a5x2 .jc-favorites { gap: 1.6mm; }

.jc-fav-row {
  display: flex;
  align-items: baseline;
  gap: 3mm;
}

.jc-fav-label {
  flex-shrink: 0;
  width: 28mm;
  margin: 0;
  font-size: 3.6mm;
  font-weight: 700;
  color: #334155;
}
.jc-page-a5x2 .jc-fav-label { width: 22mm; font-size: 3mm; }

.jc-fav-box {
  flex: 1;
  min-height: 6mm;
  border-bottom: 0.35mm solid #cbd5e1;
  font-size: 3.8mm;
  color: #1e293b;
  padding-bottom: 0.6mm;
}
.jc-page-a5x2 .jc-fav-box { font-size: 3.2mm; min-height: 5mm; }

.jc-fav-empty { font-size: 3mm; color: #94a3b8; }

.jc-hitokoto { flex-shrink: 0; }

.jc-hitokoto-label {
  margin: 0 0 1.4mm;
  font-size: 3.6mm;
  font-weight: 700;
  color: #334155;
}

.jc-hitokoto-box {
  min-height: 16mm;
  border: 0.35mm solid #cbd5e1;
  border-radius: 2mm;
  padding: 2.4mm 3mm;
  font-size: 3.6mm;
  line-height: 1.6;
  color: #1e293b;
  overflow: hidden;
  box-sizing: border-box;
}
.jc-page-a5x2 .jc-hitokoto-box { min-height: 10mm; }

.jc-blank,
.jc-fav-blank {
  display: inline-block;
  min-width: 30mm;
}

rt {
  font-size: 0.55em;
  color: #64748b;
}

/* ===== レスポンシブ ===== */
@media (max-width: 940px) {
  .jc-layout { flex-direction: column; }
  .jc-form { width: 100%; }
  .jc-preview { position: static; width: 100%; }
}

/* ===== 印刷用：プレビューのシートだけをA4いっぱいに ===== */
@media print {
  @page { size: A4 portrait; margin: 0; }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    height: auto !important;
  }

  body > *:not(.container) { display: none !important; }

  .container {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: auto !important;
  }

  .container > *:not(.jc-layout) { display: none !important; }

  .jc-layout {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  .jc-layout > *:not(.jc-preview) { display: none !important; }

  .jc-preview {
    position: static !important;
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
  }

  .jc-preview > *:not(.jc-sheet-wrap) { display: none !important; }

  .jc-sheet-wrap > *:not(.jc-sheet-box) { display: none !important; }

  .jc-sheet-box {
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
  }

  .jc-sheet {
    transform: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: 210mm !important;
    height: 297mm !important;
  }
}
