/* 絵日記プリントメーカー: 画面UI・A4シート・印刷スタイル
   common.css のレガシーグローバル（*{font-size:14px;color:#313838}, *{list-style:none}, h2{width:900px} 等）を
   打ち消しつつ、keisan-print / genkoyoshi と同じA4印刷パターンで描く。 */

.en-privacy-note {
  background-color: var(--accent-bg, #eef6ff);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 0 auto 20px;
  max-width: 1080px;
  font-size: 0.95rem;
  color: #333;
  text-align: center;
}

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

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

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

.en-form .fs-title:first-child {
  margin-top: 0;
}

.en-form .radio-line,
.en-form .check-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-top: 6px;
}

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

/* レイアウト選択（縦積みのラジオカード） */
.en-form .layout-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.en-form .layout-choices label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 13.5px;
  color: #333;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.en-form .layout-choices label:hover {
  border-color: var(--accent);
}

.en-form .layout-choices input:checked + .layout-choice-body {
  color: #1a1a1a;
}

.en-form .layout-choices label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-bg, #eef6ff);
}

.en-form .layout-choice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.en-form .layout-choice-title {
  font-weight: 600;
}

.en-form .layout-choice-desc {
  font-size: 11.5px;
  color: #888;
  line-height: 1.5;
}

.en-form select {
  width: 100%;
  padding: 9px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
  color: #333;
}

.en-form .field-hint {
  font-size: 11.5px;
  color: #888;
  margin: 6px 0 0;
  line-height: 1.6;
}

.en-pages-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.en-pages-line input {
  width: 70px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  color: #333;
  background: #fff;
}

.en-pages-line span {
  font-size: 13.5px;
  color: #333;
}

/* 文字部分が無効なとき（＝設定不可）に薄く見せる */
.en-form .char-settings.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

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

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

.en-print-btn:hover {
  opacity: 0.85;
}

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

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

/* ===== A4シート（プレビュー兼 印刷対象） ===== */
.en-sheet-box {
  overflow: hidden;
  border-radius: 4px;
}

.en-sheet-box + .en-sheet-box {
  margin-top: 16px;
}

.en-sheet {
  width: 210mm;
  height: 297mm;
  background: #fff;
  box-sizing: border-box;
  position: relative;
  padding: 12mm 12mm 11mm;
  display: flex;
  flex-direction: column;
  transform-origin: top left;
  overflow: hidden;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.18);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", sans-serif;
  text-align: left;
  --ink: #1a1a1a;
  --line: #333;
}

/* common.cssのレガシーグローバル（*{font-size:14px;color:#313838} 等）対策 */
.en-sheet * {
  font-size: inherit;
  color: inherit;
  font-family: inherit;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 2日分レイアウトの区切り */
.en-day-block + .en-day-block {
  border-top: 0.3mm dashed #bbb;
}

/* ヘッダー欄 */
.en-head {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 4mm 8mm;
  padding-bottom: 2.5mm;
  border-bottom: 0.4mm solid var(--ink);
}

.en-head.compact {
  gap: 3mm 6mm;
  padding-bottom: 1.5mm;
}

.en-hd-group {
  display: flex;
  align-items: flex-end;
  gap: 1.5mm;
  white-space: nowrap;
}

.en-hd-weather {
  flex: 1;
}

.en-hd-name {
  margin-left: auto;
}

.en-hd-label {
  font-size: 10pt;
  color: var(--ink);
  padding-bottom: 0.6mm;
}

.en-head.compact .en-hd-label,
.en-head.compact .en-hd-unit {
  font-size: 8.5pt;
}

.en-hd-unit {
  font-size: 10pt;
  color: var(--ink);
  padding-bottom: 0.6mm;
}

.en-hd-paren {
  font-size: 10pt;
  color: var(--ink);
  padding-bottom: 0.6mm;
}

.en-blank {
  display: inline-block;
  height: 7mm;
  border-bottom: 0.3mm solid var(--ink);
}

.en-blank-num {
  width: 9mm;
}

.en-blank-you {
  width: 11mm;
}

.en-blank-name {
  width: 34mm;
}

.en-head.compact .en-blank {
  height: 5.5mm;
}

.en-head.compact .en-blank-name {
  width: 24mm;
}

/* 天気（○で囲む） */
.en-weather-opts {
  display: flex;
  align-items: flex-end;
  gap: 4mm;
}

.en-weather-opt {
  font-size: 10pt;
  color: var(--ink);
  padding: 0.4mm 1mm;
}

.en-head.compact .en-weather-opt {
  font-size: 8.5pt;
  gap: 3mm;
}

/* 絵の枠 */
.en-picture {
  border: 0.4mm solid var(--ink);
  border-radius: 2mm;
  position: relative;
  flex-shrink: 0;
}

.en-picture-label {
  position: absolute;
  top: 2mm;
  left: 3mm;
  font-size: 8pt;
  color: #bbb;
  letter-spacing: 0.15em;
}

/* 文字部分: マス目グリッド */
.en-grid {
  display: grid;
  border-top: 0.3mm solid var(--line);
  border-left: 0.3mm solid var(--line);
}

.en-grid-cell {
  border-right: 0.3mm solid var(--line);
  border-bottom: 0.3mm solid var(--line);
}

/* 文字部分: 罫線 */
.en-lines {
  border-top: 0.3mm solid var(--line);
}

.en-line-row {
  border-bottom: 0.3mm solid var(--line);
}

.en-footer-note {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4mm;
  text-align: center;
  font-size: 7pt;
  color: #bbb;
}

/* ===== レスポンシブ ===== */
@media (max-width: 940px) {
  .en-layout {
    flex-direction: column;
  }

  .en-form {
    width: 100%;
  }

  .en-preview {
    position: static;
    width: 100%;
  }
}

/* ===== 印刷用：プレビューのシートだけをA4いっぱいに ===== */
@media print {
  @page {
    size: A4;
    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(.en-layout) {
    display: none !important;
  }

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

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

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

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

  .en-sheet-box {
    height: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
    break-after: page;
    page-break-after: always;
  }

  .en-sheet-box:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .en-sheet {
    transform: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: 210mm !important;
    height: 296mm !important;
    overflow: hidden !important;
  }
}
