

.cal-year { display: grid; gap: var(--gap-block); grid-template-columns: 1fr; }
@media (min-width: 560px) { .cal-year { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 860px) { .cal-year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cal-month { background: var(--surface); padding: var(--s2); min-width: 0; }
.cal-month h3 { font-size: var(--t3); line-height: var(--gap-line); font-weight: 700; margin-bottom: var(--gap-item); }
.cal-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.cal-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cal-table th { font-size: var(--t1); line-height: var(--gap-line); font-weight: 600; color: var(--ink-2); padding: var(--s1) 0; border: 0; text-align: center; }
.cal-table td { text-align: center; vertical-align: top; padding: 0; border: 0; font-size: var(--t2); line-height: var(--gap-line); }
.cal-day .cal-d { font-weight: 600; }
.cal-sun .cal-d, .cal-hol .cal-d { color: var(--bad); }
.cal-sat .cal-d { color: var(--accent); }
.cal-off { background: var(--bg); }
.cal-mk {
  display: inline-block; font-size: var(--t1); line-height: var(--gap-line);
  margin-left: var(--s1); padding-inline: var(--s1);
  border: calc(var(--s1) / 4) solid var(--line); color: var(--ink-2);
}
.cal-btn {
  display: block; width: 100%; min-height: var(--touch); padding: var(--s1) 0;
  font: inherit; color: inherit; background: transparent; border: 0; cursor: pointer;
  box-shadow: none;
}
.cal-btn:hover { background: var(--bg); }
.cal-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.cal-btn[aria-pressed="true"] .cal-d { color: var(--accent-ink); }
.cal-year .cal-table td { height: var(--touch); }
.cal-bd { font-size: var(--t2); font-weight: 400; color: var(--ink-2); margin-left: var(--s1); }
.cal-mh { margin-top: var(--gap-item); font-size: var(--t1); line-height: var(--gap-line); color: var(--ink-2); overflow-wrap: break-word; }
.cal-mh b { color: var(--ink); font-weight: 600; margin-right: var(--s1); }
.cal-mh span { display: inline-block; margin-right: var(--s2); }
.cal-legend h3 { font-size: var(--t1); line-height: var(--gap-line); font-weight: 700; color: var(--ink-2); }
.cal-legend p { font-size: var(--t1); line-height: var(--gap-line); color: var(--ink-2); }
.cal-source { font-size: var(--t2); line-height: var(--gap-line); color: var(--ink-2); overflow-wrap: break-word; }
.cal-source a { color: var(--ink-2); }
.cal-controls { display: grid; gap: var(--gap-block); }
.printrow > :not(summary) { margin-top: var(--gap-item); }
.printrow > summary > h2 { font-size: var(--t3); line-height: var(--gap-line); }
.cal-count { font-size: var(--t2); line-height: var(--gap-line); color: var(--ink-2); }
.cal-hlist td { white-space: normal; text-align: left; }
.cal-hlist td:first-child, .cal-hlist td:nth-child(2) { white-space: nowrap; }

.cal-panelhead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--gap-item); margin-bottom: var(--gap-item); }
.cal-big .cal-month { padding: var(--s4); }
.cal-big .cal-table td { height: calc(var(--touch) + var(--s4)); }
.cal-big .cal-btn { min-height: calc(var(--touch) + var(--s4)); }
.cal-big .cal-table td, .cal-big .cal-btn { font-size: var(--t3); line-height: var(--gap-line); }
.cal-big .cal-mh { font-size: var(--t2); line-height: var(--gap-line); }

#memo { display: grid; gap: var(--gap-item); }
#memo-date { font-size: var(--t4); line-height: var(--t5-lh); font-weight: 600; }
.cal-holname { font-size: var(--t2); line-height: var(--gap-line); font-weight: 600; color: var(--bad); }

.cal-dialog {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ink) 45%, transparent);
  padding: var(--s4);
}
.cal-dialogbox {
  background: var(--surface); color: var(--ink);
  border: calc(var(--s1) / 4) solid var(--line); border-radius: var(--r1);
  box-shadow: var(--shadow-2);
  padding: var(--s5); width: 100%; max-width: calc(var(--s6) * 14);
  display: grid; gap: var(--gap-block);
}
.cal-dialogbox h2 { font-size: var(--t4); line-height: var(--t5-lh); }
.cal-dialogbox p { font-size: var(--t2); line-height: var(--gap-line); color: var(--ink-2); }

.print-sheet { position: absolute; left: -400vw; top: 0; width: 281mm; height: 194mm; overflow: hidden;
  background: #fff; color: #000; font-family: var(--sk-font-ja); font-size: 8pt; line-height: 1.25; }
.print-sheet:empty { display: none; }
.ps-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2mm 6mm; margin: 0 0 2mm; }
.ps-head h2 { font-size: 14pt; font-weight: 700; margin: 0; }
.ps-ws { font-size: 9pt; }
.ps-exp { font-size: 9pt; font-weight: 700; }
.print-sheet .cal-month { background: none; border: 0; border-radius: 0; padding: 0; }
.print-sheet .cal-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.print-sheet .cal-table td { border: 0.2mm solid #888; }
.print-sheet .cal-day .cal-d { color: #000; }
.print-sheet .cal-sun .cal-d, .print-sheet .cal-hol .cal-d { font-weight: 700; text-decoration: underline; }
.print-sheet .cal-off { background: #e6e6e6; }
.print-sheet .cal-mk { border-color: #000; color: #000; }
.print-sheet .cal-mt { display: block; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.print-sheet .cal-bd { color: #000; }
.ps-annual { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2mm 3mm; }
.ps-annual .cal-month h3 { font-size: 9pt; margin: 0 0 0.8mm; }
.ps-annual .cal-table th { font-size: 6.5pt; padding: 0; }
.ps-annual .cal-table td { height: 6.4mm; font-size: 7pt; }
.ps-annual .cal-mk { font-size: 5.5pt; padding: 0.2mm 0.4mm; }
.ps-annual .cal-mt { font-size: 5.5pt; padding: 0 0.4mm; }
.ps-annual .cal-bd { font-size: 6.5pt; }
.ps-annual .cal-mh { font-size: 6.5pt; margin: 0.8mm 0 0; color: #000; }
.ps-annual .cal-mh b { color: #000; }
.ps-monthly .cal-month h3 { font-size: 12pt; margin: 0 0 1.5mm; }
.ps-monthly .cal-table th { font-size: 9pt; }
.ps-monthly .cal-table td { height: 25mm; font-size: 11pt; text-align: left; vertical-align: top; padding: 1mm; }
.ps-monthly .cal-mk { font-size: 8pt; }
.ps-monthly .cal-bd { font-size: 9pt; }
.ps-monthly .cal-mt { font-size: 9pt; margin-top: 1mm; }
.ps-monthly .cal-mh { font-size: 9pt; margin: 2mm 0 0; color: #000; }
.ps-monthly .cal-mh b { color: #000; }
.ps-legend, .ps-src { font-size: 7.5pt; margin: 2mm 0 0; color: #000; }
.print-sheet:has(.ps-note) .ps-monthly .cal-table td { height: 24mm; }

@page { size: A4 landscape; margin: 8mm; }
@media print {
  html, body { background: #fff; color: #000; }
  body.has-sheet .site-header, body.has-sheet .site-footer { display: none !important; }
  body.has-sheet main.wrap > :not(.print-sheet) { display: none !important; }
  body.has-sheet main.wrap { max-width: none; margin: 0; padding: 0; }
  body.has-sheet .print-sheet { position: static; left: auto; width: auto; height: auto; overflow: visible; }
  body.has-sheet .print-sheet:has(.ps-grid) { margin-top: 0; }
  .skip, .cal-controls, .printrow, #memo, #copyrow, .cal-panelhead button, .cal-dialog, .site-header nav { display: none !important; }
  details.cal-legend > summary { list-style: none; }
  details.cal-legend > :not(summary) { display: block !important; }
  .cal-year { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cal-month { break-inside: avoid; }
}


.nn-base { font-size: var(--t3); line-height: var(--gap-line); font-weight: 600; color: var(--ink); }
.nn-range { font-size: var(--t2); line-height: var(--gap-line); color: var(--ink-2); }
.nn-table th, .nn-table td { white-space: nowrap; }
.table-scroll { contain: inline-size; }
.nn-table th[scope="row"] { color: var(--ink); }
.nn-table td:nth-child(2), .nn-table thead th:nth-child(1), .nn-table thead th:nth-child(2) { text-align: left; }
.nn-era { display: block; white-space: nowrap; font-size: var(--t2); line-height: var(--gap-line); }
.nn-table tr.nn-hit th, .nn-table tr.nn-hit td { background: var(--bg); }
.nn-mark {
  display: inline-block; margin-left: var(--s2); padding-inline: var(--s1);
  font-size: var(--t1); line-height: var(--gap-line); font-weight: 600;
  color: var(--accent); border: calc(var(--s1) / 4) solid var(--accent);
}
.nn-notes { display: grid; gap: var(--gap-item); }
.nn-notes p { font-size: var(--t2); line-height: var(--gap-line); color: var(--ink-2); }
.nn-sources { display: grid; gap: var(--gap-item); font-size: var(--t2); line-height: var(--gap-line); }

.nn-controls { display: grid; gap: var(--gap-block); }
#nn-search-error { color: var(--bad); }
#nn-output { display: grid; gap: var(--gap-block); }
.nn-result { display: grid; gap: var(--gap-block); }
.nn-result .nn-table { width: 100%; }
.nn-result .nn-table:empty { display: none; }

.print-only { display: none; }

.print-sheet { width: 186mm; height: 0; overflow: hidden; font-size: 10pt; line-height: 1.4; }
.print-sheet .nn-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.print-sheet .nn-table th, .print-sheet .nn-table td { border: 0.2mm solid #888; padding: 1mm 2mm; text-align: right; white-space: nowrap; }
.print-sheet .nn-table th { font-weight: 600; }
.print-sheet .nn-table th[scope="row"], .print-sheet .nn-table td:nth-child(2), .print-sheet .nn-table thead th:nth-child(1), .print-sheet .nn-table thead th:nth-child(2) { text-align: left; }
.print-sheet .nn-table .ps-cap { text-align: left; font-weight: 700; border: 0; padding: 0 0 1.5mm; }
.print-sheet .nn-table thead { display: table-header-group; }
.print-sheet .nn-table tr { break-inside: avoid; page-break-inside: avoid; }
.print-sheet .nn-era { display: block; }
.ps-warn { font-size: 10pt; font-weight: 700; margin: 0 0 2mm; color: #000; }
.ps-rules, .ps-src { font-size: 8.5pt; margin: 3mm 0 0; color: #000; }
.ps-links { margin: 1.5mm 0 0; padding-left: 5mm; font-size: 8.5pt; color: #000; }
.ps-links li { margin: 0.5mm 0; }
.ps-links a { color: #000; text-decoration: none; }
.ps-url { overflow-wrap: anywhere; }

@page { size: A4 portrait; margin: 12mm; }
@media print {
  .nn-controls, #nn-output, #nn-rules, .faq, #privacy, #privacy-on-this-page, .site-header, .site-footer, #nn-data-notice { display: none !important; }
  .table-scroll { max-height: none; overflow: visible; }
  .print-only { display: block; }
  .nn-table thead { display: table-header-group; }
  .nn-table tr { break-inside: avoid; page-break-inside: avoid; }
  .nn-table tr.nn-hit th, .nn-table tr.nn-hit td { background: none; }
  .nn-mark { display: none; }
}

.nn-era-result { font-size: var(--t3); line-height: var(--gap-line); color: var(--ink); font-weight: 600; }
.nn-era-result:empty { display: none; }
.nn-era-note { white-space: pre-line; }


:where(.p-percentage-calculator-ko, .p-percentage-calculator-en) .card input[type="text"] { text-align: right; }

:where(.p-centimeters-to-megameters-en) .example p { white-space: pre-line; }

:where(.p-suneung-dday-ko) .srcbox { display: grid; gap: var(--gap-item); }
:where(.p-suneung-dday-ko) .srcbox .note { overflow-wrap: break-word; }

:where(.p-calendar-ja, .p-dallyeok-ko) .tool h3 { font-size: var(--t3); line-height: var(--gap-line); font-weight: 700; color: var(--ink); }



.p-build-loan-calculator-en .buildloan-table { width: 100%; table-layout: fixed; }
.p-build-loan-calculator-en .buildloan-table th:first-child { width: 12%; }
.p-build-loan-calculator-en .buildloan-table td { overflow-wrap: anywhere; }
.p-build-loan-calculator-en .buildloan-table input { width: 100%; min-width: 0; }
.p-build-loan-calculator-en #answer .num { display: block; }

@media (max-width: 480px) {
  .p-build-loan-calculator-en .buildloan-table thead { display: none; }
  .p-build-loan-calculator-en .buildloan-table tbody { display: grid; gap: var(--gap-item); }
  .p-build-loan-calculator-en .buildloan-table tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: calc(var(--s1) / 4) solid var(--line); padding-block: var(--s2); }
  .p-build-loan-calculator-en .buildloan-table th,
  .p-build-loan-calculator-en .buildloan-table td { width: auto; border: 0; white-space: normal; text-align: left; padding: var(--s1); }
  .p-build-loan-calculator-en .buildloan-table th,
  .p-build-loan-calculator-en .buildloan-table td:nth-child(2) { grid-column: 1 / -1; }
  .p-build-loan-calculator-en .buildloan-table th::before { content: attr(data-label) " "; }
  .p-build-loan-calculator-en .buildloan-table td::before { content: attr(data-label); display: block; font-size: var(--t2); color: var(--ink-2); }
}
