/* H-Voice 디자인 규칙 v0.3. 업무·vendor 동작을 바꾸지 않는 명시적 UI 계약입니다. */
:root {
  --hv-font: "Paperlogy-Regular", "Paperlogy", system-ui, sans-serif;
  --hv-brand: #0053c6;
  --hv-action: #2a5fbd;
  --hv-text: #172633;
  --hv-muted: #526477;
  --hv-control-border: #758598;
  --hv-divider: #dbe3ec;
  --hv-modal-divider: var(--hv-divider);
  --hv-radius-button: 999px;
  --hv-radius-control: 8px;
  --hv-radius-panel: 12px;
}
.hv-ui { color: var(--hv-text); font-family: var(--hv-font); }
/* 비활성 상태 배지도 읽어야 하는 정보이므로 비활성 버튼과 구별해 대비를 확보합니다. */
.hv-ui .badge.inactive { color: #b42318; }
body.hv-ui.hv-error-page { font-family: var(--hv-font); min-height: 100dvh; height: auto; }
/* 공개 상세의 항목·답변 부가 정보는 좁은 폭에서도 읽는 순서를 유지합니다. */
.hv-ui .hv-result-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; column-gap: 24px; }
.hv-ui .hv-result-meta > div { min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--hv-divider); }
.hv-ui .hv-result-meta__wide { grid-column: 1 / -1; }
.hv-ui .hv-result-meta dt { margin-bottom: 6px; color: var(--hv-muted); font-weight: 600; }
.hv-ui .hv-result-meta dd { margin: 0; overflow-wrap: anywhere; }
.hv-ui .hv-result-content { white-space: pre-line; }
.hv-ui .hv-answer-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; border-top: 1px solid #cfe1ff; padding-top: 12px; margin-top: 16px; color: var(--hv-muted); font-size: 14px; }
.hv-ui .notification-channel-card label[for] { display: block; margin: 10px 0 6px; font-weight: 600; }
@media (max-width: 599px) {
  .hv-ui .hv-result-meta { grid-template-columns: minmax(0, 1fr); }
}
/* 비교용 통계는 표를 유지하면서 첫 기준 열과 넘침 안내만 보완합니다. */
.hv-ui .statistics-tab-panel .wf-table .hv-table-key {
  position: sticky; inset-inline-start: 0; z-index: 1; background: #fff;
  box-sizing: border-box; width: 132px; min-width: 96px; max-width: 132px;
  white-space: normal; overflow-wrap: anywhere;
  box-shadow: 1px 0 0 var(--hv-divider);
}
.hv-ui .statistics-tab-panel thead .hv-table-key { z-index: 2; background: #f4faff; }
.hv-ui .hv-table-scroll-hint { margin: 8px 0; font-size: 13px; color: var(--hv-muted); }
/* 서식은 실행 없이 확인하고 같은 본문을 키보드로 읽을 수 있게 제공합니다. */
.hv-ui .hv-preview-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; }
.hv-ui .hv-preview-toolbar p { margin: 0; color: var(--hv-muted); font-size: 14px; }
.hv-ui .hv-preview-format, .hv-ui .hv-preview-text { max-height: 55dvh; overflow: auto; }
.hv-ui .hv-preview-text { padding: 16px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--hv-text); background: #fff; border: 1px solid var(--hv-divider); border-radius: 8px; line-height: 1.6; }
.hv-error-page :where(.wrap, .container) { box-sizing: border-box; max-width: 720px; width: 100%; padding: 32px 16px; }
.hv-error-page :where(.btn, button) {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  min-height: 44px; height: auto; padding: 10px 18px;
  border: 1px solid transparent; border-radius: var(--hv-radius-button);
  font: inherit; font-weight: 600; text-decoration: none;
}
.hv-error-page :where(p, .meta) { overflow-wrap: anywhere; }
/* 업무 코드의 hidden 상태가 display 규칙으로 되살아나지 않도록 보장합니다. */
.hv-ui [hidden]:not([hidden="until-found"]) { display: none !important; }
.hv-ui :where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--hv-brand); outline-offset: 3px;
}
.hv-ui .hv-button { font: inherit; border-radius: var(--hv-radius-button); }
/* 링크를 버튼으로 표시할 때만 브라우저 기본 링크 색상과 밑줄을 제거합니다. */
.hv-ui a.hv-button,
.hv-ui a.hv-button:visited { color: var(--hv-text); text-decoration: none; }
.hv-ui .hv-button--compact {
  display: inline-flex; align-items: stretch; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 6px 0;
  border: 0; background: transparent; box-sizing: border-box;
}
.hv-ui .hv-button__surface {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; padding: 4px 12px; box-sizing: border-box;
  border: 1px solid var(--hv-control-border); border-radius: var(--hv-radius-button);
  font-size: .875rem; line-height: 1.5; background: #fff;
}
.hv-ui .hv-button--danger,
.hv-ui .hv-button--danger:visited { color: #b42318; }
.hv-ui .hv-button--danger .hv-button__surface { border-color: #d92d20; color: #b42318; background: #fff; }
.hv-ui .hv-button--danger:hover .hv-button__surface { background: #fff1f0; }
.hv-ui .hv-icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 10px; border: 0; background: transparent;
  box-sizing: border-box; flex: 0 0 44px;
}
.hv-ui :where(.hv-form, .hv-table-region, .hv-card-list) { min-width: 0; }
.hv-ui .hv-form { container-type: inline-size; }
.hv-ui :where(.wf-box.hv-form, .form-box.hv-form) { width: 100%; max-width: 720px; margin-inline: auto; box-sizing: border-box; border: 1px solid var(--hv-divider); border-radius: 12px; padding: 24px; }
.hv-ui .hv-form :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { width: 100%; box-sizing: border-box; min-width: 0; }
.hv-ui .hv-form label { line-height: 1.5; }
.hv-ui :where(.admin-tab-bar, .statistics-tab-wrap) { flex-wrap: wrap; }
.hv-ui :where(.hv-settings-page, .hv-manuals-page, .hv-ip-page) :where(td, a, code, small) { overflow-wrap: anywhere; }
.hv-ui .manual-upload-file-name { overflow-wrap: anywhere; white-space: normal; }
.hv-ui .manual-upload-controls { min-width: 0; flex-wrap: wrap; }
.hv-ui .manual-upload-state { min-width: 0; width: 100%; box-sizing: border-box; }
.hv-ui .pagination-btn { min-width: 44px; min-height: 44px; border-radius: var(--hv-radius-button); }
.hv-ui .pagination { gap: 6px; padding: 16px 0; }
.hv-ui .statistics-tab-panel .table-responsive { overflow: auto; }
.hv-ui .statistics-tab-panel .wf-table { min-width: 420px; }
.hv-ui .statistics-tab-panel .wf-table th { white-space: nowrap; }
.hv-ui .hv-ip-page input { max-width: 100%; box-sizing: border-box; }
@media (width < 800px) {
  .hv-ui .hv-settings-page :where(table, tbody, tr, th, td) { display: block; width: auto; }
  .hv-ui .hv-settings-page th { max-width: 100%; }
  .hv-ui .hv-settings-page td { min-width: 0; }
  .hv-ui .manual-upload-card { grid-template-columns: minmax(0, 1fr); }
}
.hv-ui .user-form-row-2col { grid-template-columns: minmax(0, 1fr) auto; }
.hv-ui .user-form-row-2col:has(.user-form-side-spacer) { grid-template-columns: minmax(0, 1fr); }
.hv-ui .user-form-side-spacer { display: none; }
.hv-ui .auth-top-tab { font-size: .9375rem; line-height: 1.5; word-break: keep-all; }
.hv-ui .hv-groupware-search { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; margin-top: 16px; }
.hv-ui .template-form-page { container: template-form / inline-size; }
.hv-ui .email-template-editor-grid { grid-template-columns: minmax(0, 1fr); }
.hv-ui .email-template-editor-grid > * { min-width: 0; }
.hv-ui .template-form-page .wf-table th { width: 150px; }
@container template-form (width < 720px) {
  .hv-ui .template-form-page .wf-table :where(tbody, tr, th, td) { display: block; box-sizing: border-box; }
  .hv-ui .template-form-page .wf-table th { width: 100%; }
  .hv-ui .template-form-page .wf-table td { width: auto; min-width: 0; }
  .hv-ui .template-form-page .table-responsive { overflow: visible; }
}
@media (width < 800px) {
  .hv-ui .hv-manuals-page table :where(tbody, tr, td) { display: block; width: 100%; box-sizing: border-box; }
  .hv-ui .hv-manuals-page thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .hv-ui .hv-manuals-page tbody tr { padding: 8px; border-bottom: 1px solid var(--hv-divider); }
  .hv-ui .hv-manuals-page tbody td { text-align: left; padding: 8px; border: 0; }
  .hv-ui .hv-manuals-page td:not([colspan]):nth-child(2)::before { content: '크기: '; color: var(--hv-muted); }
  .hv-ui .hv-manuals-page td:not([colspan]):nth-child(3)::before { content: '수정일시: '; color: var(--hv-muted); }
  .hv-ui .hv-manuals-page td:not([colspan]):nth-child(n+4) { display: inline-block; width: auto; }
}
@container (min-width: 960px) {
  .hv-ui .email-template-editor-grid { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (width < 600px) {
  .hv-ui :where(.wf-box.hv-form, .form-box.hv-form) { padding: 16px; }
  .hv-ui .hv-groupware-search, .hv-ui .user-form-row-2col { grid-template-columns: minmax(0, 1fr); }
}
.hv-ui .hv-form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.hv-ui .hv-field--wide { grid-column: 1 / -1; }
.hv-ui .hv-choice-radio { width: 20px; height: 20px; margin: 0 8px 0 0; vertical-align: middle; }
.hv-ui .report-type-card:has(input:focus-visible) { outline: 2px solid var(--hv-brand); outline-offset: 3px; }
.hv-ui .report-form .form-row > * { min-width: 0; }
.hv-ui :where(.result-main, .hv-guest-detail) :where(td, a, p) { overflow-wrap: anywhere; }
.hv-ui .hv-public-result-cards { display: none; }
.hv-ui .hv-public-results h3 { word-break: keep-all; overflow-wrap: anywhere; }
.hv-ui .hv-receipt-number { display: inline-block; width: min(480px, 100%); min-width: 0; box-sizing: border-box; padding: 24px; border: 1px dashed var(--hv-control-border); border-radius: 12px; background: #f5f7fa; overflow-wrap: anywhere; }
.hv-ui .menu-details-item { flex-wrap: wrap; gap: 8px 20px; }
.hv-ui .menu-details-actions { flex-wrap: wrap; }
.hv-ui .tab-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.hv-ui .tab-buttons .tab-btn { flex: 1 1 160px; min-height: 44px; }
#hvoiceLayerRoot :where(.agreement-consent-modal-box, .cert-consent-modal-box) { width: 720px; max-width: 100%; display: flex; flex-direction: column; }
#hvoiceLayerRoot :where(.agreement-consent-scroll, .cert-consent-body) { min-height: 0; overflow: auto; overscroll-behavior: contain; }
@media (width < 800px) {
  .hv-ui .report-form .form-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hv-ui .report-form .form-row > label { width: auto; text-align: left; }
  .hv-ui .report-form .form-row > label:empty { display: none; }
  .hv-ui .report-form .email-fields { flex-wrap: wrap; }
  .hv-ui .report-form .email-fields input { min-width: 0; }
  .hv-ui .hv-public-result-cards { display: grid; gap: 12px; }
  .hv-ui .hv-public-results .table-responsive > table { display: none; }
  .hv-ui .hv-guest-detail :where(table, tbody, tr, th, td) { display: block; box-sizing: border-box; }
  .hv-ui .hv-guest-detail th { min-width: 100%; }
}
@media (width < 600px) {
  .hv-ui.layout-default .result-main .inner { padding-inline: 16px; }
  .hv-ui .hv-public-results { padding: 16px; }
  .hv-ui .report-form .pw-wrap { flex-wrap: wrap; }
  .hv-ui .report-form .pw-wrap input { width: 100%; }
}
@container (min-width: 720px) {
  .hv-ui .hv-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.hv-ui .hv-table-region { overflow: auto; overscroll-behavior: contain; }
.hv-ui :where(.hv-file-name, .hv-identifier) { overflow-wrap: anywhere; }
.hv-ui .hv-card-list { display: grid; gap: 12px; }
.hv-ui .hv-card-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; font-size: .875rem; }
.hv-ui .hv-card-tools:has(+ [hidden]) { display: none; }
.hv-ui .hv-card-tools > label { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 44px; }
.hv-ui .hv-card-tools select { min-height: 44px; max-width: 100%; border: 1px solid var(--hv-control-border); border-radius: 8px; background: #fff; padding: 8px; font: inherit; }
.hv-ui .hv-card-select-all input { width: 20px; height: 20px; margin: 12px 4px; }
.hv-ui .hv-card-selection { display: inline-flex; justify-content: center; align-items: center; min-width: 44px; min-height: 44px; margin: -10px 0 -10px -10px; }
.hv-ui .hv-record-card { border: 1px solid var(--hv-divider); border-radius: 12px; background: #fff; padding: 16px; min-width: 0; }
.hv-ui .hv-record-card__heading { display: flex; align-items: flex-start; gap: 12px; }
.hv-ui .hv-record-card__heading h3 { margin: 0; font-size: 1rem; line-height: 1.5; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hv-ui .hv-record-card__heading input { width: 20px; height: 20px; margin: 2px; flex-shrink: 0; }
.hv-ui .hv-record-card__fields { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; margin: 16px 0; font-size: .875rem; line-height: 1.6; text-align: left; }
.hv-ui .hv-record-card__fields dt { color: var(--hv-muted); }
.hv-ui .hv-record-card__fields dd { margin: 0; overflow-wrap: anywhere; }
.hv-ui .hv-record-card__actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 8px; }
.hv-ui .hv-card-more summary { list-style: none; padding: 12px; cursor: pointer; font-size: .875rem; color: var(--hv-brand); border-radius: 999px; }
.hv-ui .hv-card-more[open] { display: flex; flex-wrap: wrap; }
.hv-ui .hv-card-more .hv-button { margin-inline: 4px; }
@media (width < 600px) {
  .hv-ui .template-guide-table :where(tbody, tr, td) { display: block; width: 100%; box-sizing: border-box; }
  .hv-ui .template-guide-table tr { padding: 12px; border: 1px solid #ffe69c; border-radius: var(--hv-radius-panel); }
  .hv-ui .template-guide-table tr + tr { margin-top: 12px; }
  .hv-ui .template-guide-table td { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; border: 0 !important; padding: 8px !important; overflow-wrap: anywhere; }
  .hv-ui .template-guide-table td::before { content: attr(data-label); color: #6b5800; font-weight: 700; }
}
.hv-ui .hv-list-empty { padding: 24px; text-align: center; color: var(--hv-muted); }
.hv-ui .hv-permission-matrix table { min-width: 600px; width: 100%; border-collapse: collapse; }
.hv-ui .hv-permission-matrix :where(th, td) { padding: 14px; white-space: nowrap; }
.hv-ui .hv-permission-matrix input { width: 20px; height: 20px; margin: 10px; }
.hv-ui .hv-permission-matrix th:first-child { position: sticky; left: 0; background: #f3f7fc; z-index: 1; }

/* 상세 업무는 뷰포트가 아니라 사용 가능한 본문 폭으로 열 수를 결정합니다. */
.hv-ui main.container:has(> .admin-report-detail-grid) { container-type: inline-size; }
.hv-ui .admin-report-detail-grid { grid-template-columns: minmax(0, 1fr); }
.hv-ui .admin-followup-section { container-type: inline-size; }
.hv-ui .admin-followup-grid { grid-template-columns: minmax(0, 1fr); }
.hv-ui .admin-followup-panel__header { flex-direction: row; flex-wrap: wrap; }
.hv-ui .admin-followup-panel__header > div { flex: 1 1 160px; min-width: 0; }
.hv-ui :where(.admin-followup-panel__title, .admin-followup-panel__summary) { word-break: keep-all; overflow-wrap: anywhere; }
.hv-ui .admin-followup-toggle { width: auto; }
.hv-ui .detail-card :where(td, a) { overflow-wrap: anywhere; }
.hv-ui .detail-card .table-responsive { overflow: visible; }
.hv-ui .detail-card table { width: 100%; table-layout: fixed; }
.hv-ui .detail-card .report-detail-label { width: 112px; }
@container (min-width: 960px) {
  .hv-ui .admin-followup-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hv-ui .admin-report-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (width < 600px) {
  .hv-ui .detail-card { padding: 16px; }
  .hv-ui .detail-card :where(table, tbody, tr, th, td) { display: block; width: auto; }
  .hv-ui .detail-card .report-detail-label { width: auto; background: #f5f7fa; }
}

/* 인증: 짧은 실행 문구는 한 줄로, 인증코드는 명확한 여섯 칸으로 표시합니다. */
body.hv-ui.admin-login-page { padding: 24px 16px; box-sizing: border-box; min-height: 100dvh; height: auto; }
.hv-ui.admin-login-page .admin-login-card { width: min(440px, 100%); margin: auto; padding: 32px; box-sizing: border-box; }
.hv-ui.admin-login-page .admin-login-title { font-size: 1.75rem; line-height: 1.4; margin-bottom: 24px; word-break: keep-all; }
.hv-ui.admin-login-page :where(.btn, .admin-login-btn) { width: 100%; min-height: 48px; height: auto; white-space: nowrap; font-size: .875rem; padding: 12px 16px; border-radius: var(--hv-radius-button); }
.hv-ui .otp-segments { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; width: 100%; }
.hv-ui .otp-segments .otp-cell { min-width: 0; width: 100%; height: 48px; padding: 0; font: 1.25rem var(--hv-font); text-align: center; letter-spacing: normal; box-sizing: border-box; border: 1px solid var(--hv-control-border); border-radius: 8px; }
.hv-ui .mfa-choice-status { color: var(--hv-muted); }
.hv-ui .mfa-choice-status:empty { display: none; }
/* 인증코드 오류는 6칸 입력과 인접하게 표시하고 타이머와 역할을 구분합니다. */
.hv-ui .hv-field-error { margin: 8px 0 0; color: #b42318; font-size: 14px; line-height: 1.5; }
/* 주요 조건과 실행 버튼은 상세 검색을 접어도 표시합니다. */
.hv-ui .hv-search-primary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.hv-ui .hv-search-details { margin-top: 16px; }
.hv-ui .hv-search-details .report-filter-grid--top { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.hv-ui .hv-filter-summary { margin: 12px 0 0; color: var(--hv-muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.hv-ui .report-filter-actions { margin-top: 14px; }
.hv-ui .report-date-range-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 8px; }
.hv-ui .report-date-range-inputs > div { min-width: 0; }
.hv-ui .report-date-range-inputs input { width: 100%; min-width: 0; font-size: 16px; }
@media (width < 600px) {
  .hv-ui .hv-search-primary { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hv-ui .report-date-range-inputs { grid-template-columns: minmax(0, 1fr); }
  .hv-ui .report-date-range-separator { display: none; }
}
.hv-ui.admin-login-page .pw-toggle { min-width: 44px; min-height: 44px; }
@media (width < 600px) {
  .hv-ui.admin-login-page .admin-login-card { padding: 24px 16px; }
  .hv-ui.admin-login-page .admin-login-title { font-size: 1.5rem; }
  .hv-ui .otp-segments { gap: 6px; }
}

/* body 직속 레이어는 content의 position/z-index와 독립적으로 겹칩니다. */
#hvoiceLayerRoot { position: relative; z-index: 3000; }
#hvoiceLayerRoot > [aria-modal="true"] {
  position: fixed; z-index: 0; inset: 0; width: 100%; height: 100%; height: 100dvh;
  box-sizing: border-box; padding: 16px; align-items: center; justify-content: center;
  overflow: auto; background: rgb(15 23 42 / 48%);
}
#hvoiceLayerRoot > [aria-modal="true"] + [aria-modal="true"] { z-index: 1; }
#hvoiceLayerRoot > .hv-drawer { padding: 0; justify-content: flex-start; align-items: stretch; }
#hvoiceLayerRoot .hv-drawer-panel {
  display: flex; flex-direction: column; width: min(320px, calc(100vw - 48px)); height: 100dvh;
  position: relative; inset: auto; transform: none; opacity: 1; visibility: visible;
  background: #fff; box-sizing: border-box; padding: 16px; overflow: auto; color: var(--hv-text);
}
#hvoiceLayerRoot .hv-drawer-panel .mobile-menu-head { display: flex; justify-content: flex-end; }
#hvoiceLayerRoot .hv-drawer-panel nav { display: block; min-height: 0; }
#hvoiceLayerRoot .hv-drawer-panel :where(.sidebar-link, .sidebar-section-title) { display: block; padding: 12px; }
#hvoiceLayerRoot .hv-drawer-panel .sidebar-link { color: var(--hv-text); }
#hvoiceLayerRoot .hv-drawer-panel .sidebar-link.active { background: #edf5ff; color: var(--hv-brand); }
#hvoiceLayerRoot .hv-drawer-panel .sidebar-section-title { margin-top: 8px; border-top: 1px solid var(--hv-divider); }
#hvoiceLayerRoot :where(.modal-box, .wf-modal-box) { max-width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; box-sizing: border-box; }
#hvoiceLayerRoot .hv-layer--form { width: 720px; max-width: 100%; }
#hvoiceLayerRoot :where(.hv-layer--wide, .notification-batch-modal) { width: 960px; max-width: 100%; }
#hvoiceLayerRoot #templatePreviewModal .modal-box { width: 960px; max-width: 100%; }
#hvoiceLayerRoot .notification-batch-modal { display: flex; flex-direction: column; padding: 24px; }
#hvoiceLayerRoot .notification-channel-grid { min-height: 0; }
#hvoiceLayerRoot :where(.btn, .modal-btn, .template-preview-modal-close) { width: auto; min-height: 44px; height: auto; font-size: .875rem; line-height: 1.5; border-radius: var(--hv-radius-button); white-space: nowrap; }
#hvoiceLayerRoot .modal-btn-danger { border-color: #d92d20; background: #d92d20; color: #fff; }
/* 모달 상단 닫기는 같은 X와 터치 영역을 사용하고 하단 취소·확인과 구분합니다. */
#hvoiceLayerRoot button.hv-modal-close {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px;
  width: 44px; height: 44px; min-height: 44px; padding: 0;
  border: 0; border-radius: var(--hv-radius-button); background: transparent;
  color: var(--hv-text); font: 400 28px/1 Arial, sans-serif; cursor: pointer;
}
#hvoiceLayerRoot button.hv-modal-close:hover { background: #edf5ff; }
#hvoiceLayerRoot button.hv-modal-close:focus-visible { outline: 2px solid var(--hv-brand); outline-offset: 2px; }
/* 본인인증 설명을 줄이지 않고 모바일 여백만 줄입니다. */
#hvoiceLayerRoot .cert-consent-modal-box { padding: 24px; }
#hvoiceLayerRoot .cert-consent-body { margin-bottom: 16px; font-size: 1rem; }
#hvoiceLayerRoot .cert-consent-intro { margin-bottom: 20px; font-size: 1rem; }
@media (width < 600px) {
  #hvoiceLayerRoot .cert-consent-modal-box { padding: 20px 16px; }
}
#hvoiceLayerRoot :where(select, input[type="text"], textarea) { max-width: 100%; min-width: 0; box-sizing: border-box; font-size: 1rem; }
#hvoiceLayerRoot :where(.modal-box h3, .modal-box p) { word-break: keep-all; overflow-wrap: anywhere; }
@media (width < 800px) {
  #hvoiceLayerRoot :where(.notification-channel-grid, .grid-2) { grid-template-columns: minmax(0, 1fr); }
  #hvoiceLayerRoot .notification-batch-modal { padding: 16px; }
  #hvoiceLayerRoot .notification-batch-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
}
.hv-ui .hv-layer__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 0 0 auto; }
/* 제목형 모달은 헤더와 본문 사이에 동일한 구분선과 간격을 사용합니다. */
.hv-ui .hv-layer__header--divided {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--hv-modal-divider);
}
.hv-ui .hv-layer__header--divided > :where(h1, h2, h3, h4) { margin: 0; }
.hv-ui :where(
  .notification-batch-modal__header,
  .email-preview-modal__header,
  .text-preview-modal__header
).hv-layer__header--divided { margin-bottom: 0; }
.hv-ui .hv-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@media (max-width: 599px) {
  .hv-ui .seo-mobile-field-label {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 0 6px !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    display: block;
    color: var(--hv-muted);
    font-size: 13px;
    font-weight: 700;
  }
}
.hv-ui .hv-layer__body { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.hv-ui .hv-layer__footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: 0 0 auto; }
@media (max-height: 480px) {
  #hvoiceLayerRoot > [aria-modal="true"] { align-items: flex-start; }
}

/* 관리자 화면 틀: 좁은 화면에서 사이드바가 본문 폭을 소비하지 않습니다. */
body.hv-ui.admin-page .admin-container { width: 100%; min-width: 0; padding-top: 0; }
body.hv-ui.admin-page .admin-container > .sidebar {
  width: 240px; flex-basis: 240px; position: sticky; top: 0; height: 100dvh;
  transform: none; visibility: visible; padding: 20px 16px;
}
body.hv-ui.admin-page .admin-container > .content {
  flex: 1; min-width: 0; width: auto; padding: 32px; margin: 0;
  overflow: visible;
}
body.hv-ui.admin-page .admin-container .page-title h1 { font-size: 2rem; line-height: 1.35; }
body.hv-ui.admin-page .admin-container .page-title { margin-bottom: 24px; }
body.hv-ui.admin-page .admin-header { display: none; }
body.hv-ui.admin-page .sidebar-overlay { display: none; }
body.hv-ui.admin-page .admin-container .sidebar .mobile-menu-head { display: none; }
/* 기존 컨테이너의 max-width!important와 충돌하지 않도록 본문 래퍼에서 폭을 제한합니다. */
body.hv-ui.admin-page .admin-container > .content > div { max-width: 1280px; margin-inline: auto; }
body.hv-ui.admin-page .admin-container :where(.btn, .admin-followup-toggle) {
  min-height: 40px; height: auto; width: auto; border-radius: var(--hv-radius-button);
  font-size: .875rem; line-height: 1.5; white-space: nowrap; padding: 8px 18px; box-sizing: border-box;
}
body.hv-ui.admin-page .admin-container :where(.form-control, .form-select, textarea) {
  max-width: 100%; min-width: 0; font-size: 1rem; box-sizing: border-box;
}
@media (width < 1100px) {
  body.hv-ui.admin-page .admin-header { display: block; position: sticky; top: 0; padding: 12px 24px; }
  body.hv-ui.admin-page .admin-container > .sidebar { display: none; }
  body.hv-ui.admin-page .admin-container > .content { padding: 24px; }
  body.hv-ui.admin-page .admin-container .page-title h1 { font-size: 1.75rem; }
  .hv-ui :where(.admin-mobile-menu-btn, .mobile-menu-btn) { display: flex; flex-direction: column; justify-content: center; gap: 5px; }
  .hv-ui :where(.admin-mobile-menu-btn, .mobile-menu-btn) span { width: 24px; height: 2px; border-radius: 2px; flex: 0 0 2px; transform: none; opacity: 1; }
  .hv-ui .gnb { display: none; }
  body.hv-ui.admin-page .admin-container :where(.btn, .admin-followup-toggle) { min-height: 44px; }
}
@media (width < 600px) {
  body.hv-ui.admin-page .admin-header { padding-inline: 16px; }
  body.hv-ui.admin-page .admin-container > .content { padding: 16px; }
  body.hv-ui.admin-page .admin-container .page-title h1 { font-size: 1.5rem; }
  body.hv-ui.admin-page .admin-container .wf-box { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .hv-ui :where(.sidebar, .mobile-menu, .modal-overlay) { transition: none; }
}

/* 수신자가 받는 최종 이메일을 관리자 화면마다 같은 구조로 표시합니다. */
#hvoiceLayerRoot .email-preview-modal,
.email-preview-modal {
  width: min(980px, calc(100vw - 32px));
  max-width: 980px;
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
}
.email-preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 16px 20px;
}
.email-preview-modal__header h2 { margin: 0; font-size: 1.125rem; line-height: 1.4; }
.email-preview-modal__close {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--hv-radius-button, 999px);
}
.email-preview-modal__close:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--hv-primary, #0053c6) 35%, transparent);
  outline-offset: 2px;
}
.email-preview-modal__body {
  min-width: 0;
  min-height: 0;
  max-height: calc(100dvh - 106px);
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
}
.email-preview-modal__sample {
  display: inline-flex;
  margin: 0 0 12px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #075985;
  background: #e0f2fe;
  font-size: .8125rem;
  font-weight: 700;
}
.email-preview-modal__sample[hidden] { display: none; }
.email-preview-modal__meta { display: grid; gap: 8px; margin: 0 0 16px; }
.email-preview-modal__meta > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
}
.email-preview-modal__meta > div[hidden] { display: none; }
.email-preview-modal__meta dt { color: var(--hv-muted, #526477); font-weight: 700; }
.email-preview-modal__meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.email-preview-modal iframe {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 400px;
  border: 1px solid var(--hv-border, #d9e1ea);
  border-radius: 8px;
  background: #fff;
  box-sizing: border-box;
}
.email-preview-modal__note { margin: 10px 0 0; color: var(--hv-muted, #526477); font-size: .8125rem; }

/* 일반 텍스트 안내는 이메일 미리보기와 동일한 닫기·여백 규칙을 사용합니다. */
#hvoiceLayerRoot .text-preview-modal,
.text-preview-modal {
  width: min(680px, calc(100vw - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  overflow: hidden;
  text-align: left;
}
.text-preview-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
}
.text-preview-modal__header h2 { margin: 0; font-size: 1.125rem; line-height: 1.4; }
.text-preview-modal__close {
  display: inline-grid;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;
}
.text-preview-modal__body { max-height: calc(100dvh - 112px); padding: 20px; overflow: auto; }
.text-preview-modal__meta { margin: 0 0 16px; }
.text-preview-modal__meta > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; }
.text-preview-modal__meta dt { color: var(--hv-muted, #526477); font-weight: 700; }
.text-preview-modal__meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.text-preview-modal__content {
  min-height: 220px;
  padding: 16px;
  border: 1px solid var(--hv-border, #d8e0ea);
  border-radius: 12px;
  background: #fff;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
@media (width < 600px) {
  .hv-ui .hv-layer__header--divided {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }
  .hv-ui :where(
    .notification-batch-modal__header,
    .email-preview-modal__header,
    .text-preview-modal__header
  ).hv-layer__header--divided { margin-bottom: 0; }
  #hvoiceLayerRoot .email-preview-modal,
  .email-preview-modal { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .email-preview-modal__header { padding: 12px 16px; }
  .email-preview-modal__body { max-height: calc(100dvh - 88px); padding: 16px; }
  .email-preview-modal__meta > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  #hvoiceLayerRoot .text-preview-modal,
  .text-preview-modal { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); }
  .text-preview-modal__header { padding: 12px 16px; }
  .text-preview-modal__body { max-height: calc(100dvh - 88px); padding: 16px; }
  .text-preview-modal__meta > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
