*, *::before, *::after {
  box-sizing: border-box;
}

.box-content{
  padding: 16px 20px 18px;
}

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

.controls .row{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lbl{
  white-space: nowrap;
}

.num{
  width: 56px;
  padding: 6px 6px;
  border: 1px solid #888;
  border-radius: 10px;
  background: #fff;
  font-size: 0.95em;
  text-align: center;
}

.num-wide{
  width: 64px;
}

.unit{
  white-space: nowrap;
}

.previewWrap{
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid #bbb;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.pdfPreview{
  display: block;
  width: 100%;
  max-width: 100%;
  height: 0;           /* ★初期は高さゼロで潰す */
  border: 0;
}


.note{
  margin-top: 12px;
  font-size: 0.95em;
  color: #333;
  line-height: 1.6;
}

/* ===== AI Loading Overlay ===== */
.aiLoading{
  display: none;              /* JSで表示切替 */
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 200, 0.82); /* bodyの淡い黄色に寄せる */
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.aiLoading.is-on{
  display: flex;
}

.aiLoadingCard{
  width: min(520px, 92vw);
  border-radius: 18px;
  border: 1px solid rgba(120, 170, 255, 0.55);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  padding: 18px 18px 16px;
  text-align: center;
}

.aiSparkle{
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
  animation: sparkle 1.2s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(120, 170, 255, 0.65);
}

.aiLoadingTitle{
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: #1f3f8f;
}

.aiLoadingSub{
  font-size: 0.95rem;
  color: #333;
  line-height: 1.6;
  margin-bottom: 10px;
}

.aiDots{
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.aiDots span{
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(120, 170, 255, 0.95);
  animation: dots 1.0s infinite ease-in-out;
}

.aiDots span:nth-child(2){ animation-delay: 0.15s; }
.aiDots span:nth-child(3){ animation-delay: 0.30s; }

@keyframes dots{
  0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-5px); opacity: 1; }
}

@keyframes sparkle{
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.9; }
  50% { transform: translateY(-4px) rotate(12deg); opacity: 1; }
}

/* 初期表示の案内（プレビュー枠の中） */
.previewHint{
  display: grid;
  place-items: center;
  height: 180px;          /* ★ 初期はコンパクト */
  padding: 18px;
  text-align: center;
  color: #333;
  line-height: 1.7;
  background: #fff;
  border-radius: 10px;
}
.previewHint.is-off{
  display: none;
}
