/* ベース設定 */
body {
  font-family: "Noto Serif JP", serif;
  background-color: #fdfdfd;
  color: #333;
  padding: 20px;
}

button {
  background: #009688;
  color: white;
  border: none;
  padding: 8px 16px;
  margin: 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.3s ease;
}

button:hover {
  background: #00796b;
}

select {
  padding: 6px;
  font-size: 14px;
  margin: 6px;
}

/* 入力用コントロール */
#controls {
  margin-bottom: 32px;
  font-size: 18px;
}

#controls input,
#controls select,
#controls button {
  margin-right: 10px;
  font-size: 20px;
  padding: 4px 8px;
}

/* 表全体 */
#printArea {
  overflow-x: auto;
  background: white;
  padding: 10px;
  box-sizing: border-box;
}

/* スケール調整：画面では拡大、印刷時は実寸 */
#pdfScaleWrapper {
  transform: scale(1);
  transform-origin: top left;
  width: fit-content;
  min-height: 100%;
  overflow: auto;
}

/* 表のスタイル */
table#dataTable {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

#dataTable th,
#dataTable td {
  border: 1px solid #333;
  padding: 4px;
  text-align: center;
  font-size: 20px;
  min-width: 80px;
}

#dataTable input {
  width: 100%;
  border: none;
  font-size: 16px;
  text-align: center;
  box-sizing: border-box;
  padding: 2px;
  outline: none;
}

/* タイトル */
#dataTable th.title-cell {
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  padding: 5px 0;
  background: #f9f9f9;
}
#numpad {
  width: 200px;
  min-width: 200px;
  max-width: 200px;
}
/* 曜日カラー */
td:first-child {
  font-weight: bold;
}
td:first-child[style*="red"] {
  color: red !important;
}
td:first-child[style*="blue"] {
  color: blue !important;
}

/* 全体を画面いっぱいに使う */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* 表エリアを縦にも広げてスクロール可能に */
#printArea {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  overflow-x: auto;
}

/* 印刷時の調整 */
@media print {
  body {
    zoom: 1.0;
  }

  #controls {
    display: none;
  }

  #pdfScaleWrapper {
    transform: scale(1); /* 印刷用に通常倍率 */
    transform-origin: top left;
    width: 100%;         /* 横幅フィット */
    overflow: hidden;
  }

  #dataTable th,
  #dataTable td {
    font-size: 14px;     /* 小さめに調整 */
  }

  #dataTable input {
    font-size: 14px;
  }

  table {
    page-break-inside: avoid;
  }
}
