/* 希望休からシフト表ページ専用のスタイル（共通の部品は shared/tool.css） */
.tool > .card + .card, .tool > .card + .message { margin-top: 14px; }
.field-row { display: grid; gap: 4px 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.weekday-set { border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; margin: 10px 0; }
.weekday-set legend { font-weight: 700; padding-inline: 4px; }
.weekday-checks { display: flex; flex-wrap: wrap; }

.form-table { max-block-size: none; }
.inputs td { vertical-align: middle; }
.inputs input[type="text"] { inline-size: 100%; min-inline-size: 8em; }
.inputs input[type="number"] { inline-size: 5.5em; }
.inputs .center { text-align: center; }
.inputs .remove { min-block-size: 36px; padding: 4px 10px; font-size: .875rem; }

.input-errors { padding-inline-start: 2em; font-weight: 400; }
.input-errors:empty { display: none; }

.result { margin-top: 16px; }
.shortage-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 6px; font-size: .875rem; }
.shortage-list:empty { display: none; }
.shortage-list li { background: var(--bad-bg); color: var(--bad); border-radius: 6px; padding: 0 8px; font-weight: 700; }

/* シフト表 */
.schedule-wrapper { max-block-size: none; }
.schedule { font-size: .8rem; inline-size: max-content; min-inline-size: 100%; }
.schedule th, .schedule td { padding: 4px 3px; text-align: center; border-inline-end: 1px solid var(--line); white-space: nowrap; min-inline-size: 2.4em; }
.schedule .name-col { position: sticky; inset-inline-start: 0; z-index: 2; background: var(--bg); text-align: start; padding-inline: 8px; min-inline-size: 6em; }
.schedule thead .name-col { z-index: 3; background: var(--bg-soft); }
.schedule .day .d { display: block; font-weight: 700; }
.schedule .day .w { display: block; font-weight: 400; font-size: .75rem; }
.schedule .sun, .schedule .holiday { color: var(--bad); }
.schedule .sat { color: var(--accent); }
.schedule .closed { background: #e6e8ec; color: var(--muted); }
.schedule td.work { font-weight: 700; }
.schedule td.off { color: var(--muted); }
.schedule td.count { font-size: .75rem; color: var(--muted); }
.schedule tfoot th, .schedule tfoot td { border-top: 2px solid var(--fg); }
.schedule tfoot tr + tr th, .schedule tfoot tr + tr td { border-top: 1px solid var(--line); }
.schedule td.short { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.schedule td.short .short-label { display: block; font-size: .7rem; }
.schedule td.enough { color: var(--ok); }
.print-only { display: none; }

/* 狭い画面では入力表をカード型に積む */
@container (width < 600px) {
  .inputs, .inputs thead, .inputs tbody, .inputs tr, .inputs th, .inputs td { display: block; }
  .inputs thead { display: none; }
  .inputs tr { border-bottom: 2px solid var(--line); padding-block: 6px; }
  .inputs td { border: none; padding: 4px 10px; text-align: start; }
  .inputs td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-size: .8rem; }
  .inputs td.center { text-align: start; }
}

/* 印刷：シフト表だけを A4 横に */
@page { size: A4 landscape; margin: 8mm; }
@media print {
  body { background: #fff; }
  .site-header, .site-footer, main > h1, main > .lead, main > section:not(.tool),
  .tool > h2, .tool > .card:not(.result), .message, .input-errors, .no-print, #summary, .shortage-list { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  main { padding: 0; }
  .result { border: none; padding: 0; margin: 0; }
  .result > h3 { display: none; }
  .print-only { display: table-caption; caption-side: top; text-align: start; font-weight: 700; font-size: 12pt; padding-bottom: 4px; }
  .schedule-wrapper { overflow: visible; border: none; max-block-size: none; }
  .schedule { font-size: 7.5pt; inline-size: 100%; min-inline-size: 0; }
  .schedule th, .schedule td { padding: 2px 1px; min-inline-size: 0; border: 1px solid #999; }
  .schedule .name-col { position: static; min-inline-size: 0; }
  thead th { position: static; }
  .schedule td.short, .schedule td.closed { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
