/* 인쇄용 전화번호부 (/print): an A4 sheet on screen, a clean black-and-white table on paper.
   Shares the taste tokens (brand purple accent, Pretendard, pill controls). */
:root {
  color-scheme: only light;
  --accent: #6a5095;
  --accent-hover: #58427d;
  --accent-50: #f6f3fa;
  --accent-100: #ece6f4;
  --ink: #312f30;
  --muted: #67636a;
  --line: #e7e5e9;
  --line-strong: #cfcbd3;
  --desk: #eeecf1;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--desk); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.55; word-break: keep-all; -webkit-font-smoothing: antialiased; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
svg.icon { flex-shrink: 0; width: 1em; height: 1em; font-size: 1.15em; vertical-align: -.125em; fill: currentColor; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* Screen toolbar (never printed) */
.print-toolbar { position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line); background: rgb(252 251 253 / .92); backdrop-filter: blur(12px); }
.toolbar-inner { display: flex; align-items: center; gap: 20px; width: min(210mm, 100% - 32px); min-height: 64px; margin-inline: auto; }
.toolbar-note { flex: 1; font-size: 13px; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--accent); font-weight: 600; }
.text-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; white-space: nowrap; transition: background-color .2s, transform .2s; }
.button:hover { background: var(--accent-hover); }
.button:active { transform: scale(.98); }
.button:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }

/* The sheet */
.sheet { width: 210mm; min-height: 297mm; margin: 28px auto 56px; padding: 14mm 14mm 12mm; background: #fff; box-shadow: 0 24px 60px -30px rgb(49 47 48 / .45); display: flex; flex-direction: column; }
.sheet-head { display: flex; align-items: flex-end; gap: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.sheet-logo { width: 150px; height: auto; }
.sheet-title-block { flex: 1; }
.sheet-title-block h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.sheet-title-block p { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.sheet-status { padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sheet-body { flex: 1; padding-top: 6px; }
.sheet-message { padding: 40px 0; text-align: center; color: var(--muted); }

.sheet-table { width: 100%; border-collapse: collapse; font-size: 12.5px; line-height: 1.4; }
.sheet-table thead th { padding: 8px 8px 6px; border-bottom: 1px solid var(--line-strong); font-size: 11px; font-weight: 600; color: var(--muted); text-align: left; }
.sheet-table thead th:nth-child(3) { text-align: left; }
.group-row th { padding: 12px 8px 4px; font-size: 12px; font-weight: 700; color: var(--accent); text-align: left; }
.group-row th span { margin-left: 4px; font-weight: 500; color: var(--muted); }
.sheet-table tbody tr:not(.group-row) th, .sheet-table tbody td { padding: 5px 8px; vertical-align: top; }
.sheet-table tbody tr:not(.group-row) + tr:not(.group-row) > * { border-top: 1px solid var(--line); }
.sheet-table tbody tr:not(.group-row) th { width: 25%; font-weight: 700; text-align: left; }
.sheet-table td:nth-child(2) { width: 36%; color: #4a474a; }
.sheet-table td.tel { width: 17%; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-table td:nth-child(4) { width: 22%; color: #4a474a; }

.sheet-foot { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--ink); }
.sheet-qr { flex-shrink: 0; width: 24mm; height: 24mm; }
.sheet-qr svg { display: block; width: 100%; height: 100%; }
.sheet-foot-lead { font-size: 13px; font-weight: 700; }
.sheet-url { margin-top: 1px; font-size: 13px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.sheet-foot-note { margin-top: 4px; font-size: 11px; color: var(--muted); }

/* Narrow screens: the sheet becomes a readable list; printing still uses the A4 table below. */
@media screen and (max-width: 820px) {
  .toolbar-inner { flex-wrap: wrap; gap: 4px 12px; padding-block: 8px; }
  .toolbar-note { order: 3; flex-basis: 100%; }
  .button { margin-left: auto; }
  .sheet { width: auto; min-height: 0; margin: 16px; padding: 20px 18px; border-radius: 16px; }
  .sheet-head { flex-wrap: wrap; }
  .sheet-logo { width: 132px; }
  .sheet-title-block { flex-basis: 100%; }
  .sheet-table thead { display: none; }
  .sheet-table, .sheet-table tbody, .sheet-table tr, .sheet-table th, .sheet-table td { display: block; width: auto !important; }
  .sheet-table tbody tr:not(.group-row) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 10px 0; }
  .sheet-table tbody tr:not(.group-row) + tr:not(.group-row) { border-top: 1px solid var(--line); }
  .sheet-table tbody tr:not(.group-row) + tr:not(.group-row) > * { border-top: 0; }
  .sheet-table tbody tr:not(.group-row) > th, .sheet-table tbody tr:not(.group-row) > td { padding: 0; }
  .sheet-table tbody tr:not(.group-row) th { grid-column: 1; font-size: 15px; }
  .sheet-table td.tel { grid-column: 2; grid-row: 1; font-size: 14px; }
  .sheet-table td:nth-child(2), .sheet-table td:nth-child(4) { grid-column: 1 / -1; font-size: 13px; }
  .group-row th { padding: 16px 0 2px; font-size: 13px; }
  .sheet-foot { align-items: flex-start; }
  .sheet-qr { width: 72px; height: 72px; }
}

@media print {
  @page { size: A4 portrait; margin: 11mm 12mm 12mm; }
  body { background: #fff; font-size: 10pt; }
  .print-toolbar { display: none; }
  .sheet { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
  .sheet-table { font-size: 9.5pt; }
  .sheet-table thead { display: table-header-group; }
  .sheet-table tr { break-inside: avoid; }
  .group-row { break-after: avoid; }
  .group-row th { color: #000; }
  .sheet-table td.tel { font-size: 10pt; }
  .sheet-foot { break-inside: avoid; }
  .sheet-url { color: #000; }
}
