body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0;
  padding: 0;
  background: #f4f7f9;
  color: #333;
  line-height: 1.6;
}
/* ヘッダー背景（深いネイビー） */
.site-header {
  background: #0047a5;
  color: white;
  padding: 15px 20px;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  gap: 15px;
}
.site-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: bold;
}
.header-sub {
  font-size: 0.85rem;
  opacity: 0.9;
}
.wrapper-main {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 15px;
  box-sizing: border-box;
}
section {
  background: white;
  padding: 20px;
  margin-bottom: 20px;
  border-radius: 2px;
  border: 1px solid #e1e8ed;
}
h2 {
  color: #2b2b2b;
  font-size: 1.15rem;
  border-left: 5px solid #0047a5;
  padding-left: 10px;
  margin-top: 0;
  margin-bottom: 15px;
}
h3 { font-size: 0.95rem; color: #444; margin: 5px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 5px;
  background: #fff;
}
td, th {
  border: 1px solid #dcdcdc;
  padding: 8px 10px;
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}
th {
  background: #ededed;
  color: #111111;
  font-weight: bold;
}
.time-cell-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
input[type="text"], input[type="number"], select {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid #ababab;
  border-radius: 2px;
  font-size: 13px;
}
.row-time { width: 100% !important; max-width: 120px; }
.time-jump-link {
  color: #0047a5;
  text-decoration: underline;
  cursor: pointer;
  font-size: 12px;
}
.btn-row-delete {
  background: #cc0000;
  color: white;
  border: none;
  padding: 4px 6px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
}
.btn-table-add {
  background: #0047a5;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
}
.control-panel { border-top: 4px solid #0047a5; }
.panel-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.status-container {
  margin-top: 12px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-left: 3px solid #6c757d;
  font-size: 12px;
  font-weight: bold;
}
.workspace-container { display: flex; gap: 20px; align-items: flex-start; }
.workspace-left { flex: 65; min-width: 0; }
.workspace-right { flex: 35; position: sticky; top: 15px; }
#thumbs { display: flex; flex-wrap: wrap; gap: 12px; }
.thumb {
  width: 185px;
  border: 1px solid #e1e8ed;
  border-radius: 2px;
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}
.thumb img { width: 100%; border-radius: 2px; cursor: pointer; }
.thumb-meta { font-size: 11px; margin: 6px 0; display: flex; align-items: center; gap: 4px; }
textarea {
  width: 100%;
  height: 100px;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid #ababab;
  border-radius: 2px;
  font-size: 13px;
  resize: vertical;
}
button { padding: 8px 14px; border-radius: 2px; cursor: pointer; font-weight: bold; font-size: 13px; border: none; }
.btn-primary { background: #0047a5; color: white; }
.btn-secondary { background: #e2e8f0; color: #4a5568; }
.btn-success { background: #228b22; color: white; }
.btn-pdf { background: #2d3748; color: white; }

/* ==========================================================================
   ★ 左右2列・20行分割型 公式様式1-5・1-6共通デザイン
   ========================================================================== */
.pdf-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #525659; z-index: 9999; overflow-y: auto; }
.pdf-toolbar { position: sticky; top: 0; left: 0; width: 100%; background: #323639; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; box-sizing: border-box; }
.pdf-pages-container { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 20px; }

/* A5横長用紙枠 */
.a5-landscape-page {
  background: white;
  width: 210mm;
  height: 148mm;
  box-sizing: border-box;
  padding: 10mm 12mm 12mm 20mm; /* 左綴じ代20mm確保 */
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* 左右に配置するためのコンテナ */
.nhk-split-container {
  display: table;
  width: 100%;
  table-layout: fixed;
  flex-grow: 1;
}
.nhk-split-column {
  display: table-cell;
  width: 50%;
  vertical-align: top;
}
/* 中央のセパレーター隙間 */
.nhk-split-column.left-col {
  padding-right: 5mm;
}
.nhk-split-column.right-col {
  padding-left: 5mm;
}

/* 各表のデザイン（公式準拠の太枠） */
.nhk-format-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  font-size: 8.5pt;
  table-layout: fixed;
  border: 2px solid #000000;
}
.nhk-format-table th {
  background: #ffffff;
  border: 1.5px solid #000000;
  color: #000000;
  text-align: center;
  padding: 4px 2px;
  font-weight: bold;
  font-size: 9pt;
}
/* 10行が綺麗に均等に並ぶよう高さを固定化 */
.nhk-format-table tbody tr {
  height: calc((100% - 24px) / 10);
}
.nhk-format-table td {
  border: 1.5px solid #000000;
  padding: 3px 4px;
  vertical-align: top;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 8.5pt;
  line-height: 1.2;
}
.nhk-format-table td[contenteditable="true"]:focus {
  background: #f0f7ff;
  outline: 2px solid #0047a5;
}

/* 最終ページ専用：グリッド形式での表示枠 */
.final-grid-title {
  font-size: 10pt;
  font-weight: bold;
  background: #ededed;
  border: 1.5px solid #000;
  border-bottom: none;
  padding: 4px 8px;
  text-align: center;
}
.final-grid-body {
  border: 1.5px solid #000;
  padding: 8px;
  font-size: 8.5pt;
  line-height: 1.4;
  white-space: pre-wrap;
  height: calc(100% - 26px);
  box-sizing: border-box;
  background: #fff;
  overflow: hidden;
}
.final-grid-body[contenteditable="true"]:focus {
  background: #f0f7ff;
  outline: 2px solid #0047a5;
}

/* 公式フッター */
.nhk-official-footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 4mm;
  font-size: 9pt;
  font-family: "Hiragino Mincho ProN", "MS Mincho", serif;
  font-weight: bold;
  color: #000000;
}
.nhk-footer-left { text-align: left; }
.nhk-footer-center-page { font-size: 8.5pt; font-family: sans-serif; font-weight: normal; }
.nhk-footer-right { text-align: right; }

@media print {
  @page { size: A5 landscape; margin: 0; }
  .no-print { display: none !important; }
  .pdf-overlay { position: absolute; top:0; left:0; width:100%; background: white; }
  .pdf-toolbar { display: none !important; }
  .pdf-pages-container { padding: 0; gap: 0; }
  .a5-landscape-page { box-shadow: none; margin: 0; page-break-after: always; width: 210mm; height: 148mm; page-break-inside: avoid; }
}