/* gakudo tool styles (loaded after base.css). No inline styles (CSP). */

.h1-sub { display: block; font-size: 1rem; font-weight: 600; color: var(--text-muted); margin-top: var(--space-1); }
.verified { font-size: 0.875rem; color: var(--text-muted); margin: 0 0 var(--space-2); }
.verified .badge { border-color: var(--ok); color: var(--ok); }

#tool-form > fieldset, #tool-form > details, #tool-form > .field { margin-bottom: var(--space-3); }
#tool-form fieldset > .field, #mode-breakdown > .field, #mode-direct > .field, #mode-headcount > .field { margin-bottom: var(--space-2); }
.choice { display: flex; align-items: center; gap: var(--space-2); font-weight: 400 !important; min-height: 2.75rem; }
.choice input { width: 1.2rem; height: 1.2rem; flex: none; }
.mode-switch { margin-bottom: var(--space-2); }
.mode-switch .choice { font-weight: 600 !important; }
.sublabel { font-weight: 600; margin: var(--space-2) 0 var(--space-1); }
.count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr)); gap: var(--space-2); margin-bottom: var(--space-2); }
.count-grid input, .month-grid input { max-width: 8rem; }
.month-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: var(--space-2); margin-bottom: var(--space-2); }
.ov-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: var(--space-3); margin-bottom: var(--space-3); }
.ov-grid input { max-width: 10rem; }
.print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--space-2); margin-bottom: var(--space-2); }
.band-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
.btn-mini { min-height: 2.5rem; padding: 0.25rem 0.6rem; font-size: 0.9rem; }
details.options { margin-top: var(--space-2); border-top: 1px solid var(--border); }
details.options summary, details.helper summary, .notes-more summary { cursor: pointer; font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
details.helper { border: 1px solid var(--border); border-radius: var(--radius); padding: 0 var(--space-3); background: var(--bg-alt); margin-bottom: var(--space-2); }
#share-url { max-width: 100%; font-size: 0.85rem; }
.top-result { font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: var(--space-2) var(--space-3); margin: 0 0 var(--space-3); }
.quick-result { font-weight: 700; color: var(--accent); margin: 0; min-height: 1.5em; }
.save-line { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.btn-link { font: inherit; background: none; border: 0; padding: 0.5rem 0; min-height: 2.75rem; color: var(--accent); text-decoration: underline; cursor: pointer; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table.unit-input { border-collapse: collapse; margin: 0 0 var(--space-2); }
table.unit-input th, table.unit-input td { padding: 2px 4px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; font-size: 0.85rem; }
table.unit-input th[scope="row"] { position: sticky; left: 0; background: var(--surface); }
table.unit-input input.cell { width: 4.5rem; min-width: 4.5rem; min-height: 2.5rem; padding: 0.25rem 0.4rem; text-align: right; }
.th-sub { display: block; font-weight: 400; font-size: 0.7rem; }
.cell-error { display: block; white-space: normal; max-width: 9rem; font-size: 0.75rem; text-align: left; }
.cell-error:empty { display: none; }
#days-status:empty { display: none; }

/* ---------- Results ---------- */
.example-label { display: inline-block; font-size: 0.875rem; font-weight: 600; background: var(--mark-bg); color: var(--mark-text); padding: 0 var(--space-2); border-radius: 4px; margin-bottom: var(--space-2); }
.result-plain { margin-bottom: var(--space-2); }
.r-sec { margin-top: var(--space-3); }
.r-sec h3 { margin-top: var(--space-3); border-bottom: 1px solid var(--border); padding-bottom: var(--space-1); }
.result-table caption { text-align: left; font-weight: 700; padding: var(--space-2) 0; }
.result-table th.num, .result-table td.num { text-align: right; }
.result-table .strong { font-weight: 700; }
.calc { font-family: var(--font-mono); font-size: 0.9rem; }
.result-table td.calc { white-space: nowrap; }
.breakdown tr.total th, .breakdown tr.total td { background: var(--accent-soft); border-top: 2px solid var(--text); }
.judge th { white-space: nowrap; }
.judge td:nth-child(2) { width: 2.5rem; text-align: center; }
.compact { max-width: 34rem; }
.units th, .units td { white-space: nowrap; }
.months { min-width: 36rem; }
.mark { display: inline-block; min-width: 1.6em; text-align: center; font-weight: 700; border-radius: 4px; }
.m-ok { color: var(--ok); }
.m-warn { color: var(--mark-text); background: var(--mark-bg); }
.m-ng { color: var(--accent-contrast); background: var(--danger); }
.m-none { color: var(--text-muted); }
.result-notes { margin-top: var(--space-3); }
.note-info, .note-warn {
  border-left: 4px solid var(--accent); background: var(--accent-soft);
  padding: var(--space-2) var(--space-3); border-radius: 4px; font-size: 0.9rem;
}
.note-warn { border-left-color: var(--danger); }
.area-short { color: var(--danger); font-weight: 700; }

.rule-table { margin-bottom: var(--space-3); }
.hayami { min-width: 30rem; }
.hayami.narrow { min-width: 0; max-width: 30rem; }
.sources li { margin-bottom: var(--space-1); overflow-wrap: anywhere; }

@media print {
  .no-print { display: none !important; }
  .print-header { margin-bottom: 6pt; }
  .print-title { font-size: 14pt; font-weight: 700; margin: 0 0 4pt; }
  .print-meta { display: grid; grid-template-columns: repeat(3, max-content 1fr); gap: 2pt 6pt; margin: 0; font-size: 10pt; }
  .print-meta dt { font-weight: 700; }
  .print-meta dd { margin: 0; border-bottom: 1px solid #000; min-width: 6em; }
  .print-meta dd.sign { min-height: 2.2em; }
  .results { break-inside: auto; }
  .r-sec, .result-table { break-inside: avoid; }
  thead { display: table-header-group; }
  .table-scroll { overflow: visible; }
  .months { min-width: 0; font-size: 9pt; }
  .notes-more summary { display: none; }
  .m-ng { color: #000; background: none; border: 1px solid #000; }
  .m-warn { color: #000; background: none; }
}
