/* Compatibility entry point: every work page uses the same header rules. */
/* Appearance is shared by the work pages; their layout stays in each page's CSS. */
:root {
  --portal-theme-page: #f8faff;
  --portal-theme-surface: #fff;
  --portal-theme-soft: var(--portal-season-soft, #eff6ff);
  --portal-theme-ink: #1e293b;
  --portal-theme-muted: #606979;
  --portal-theme-line: #e2e8f0;
  --portal-theme-strong: #bfc8df;
  --portal-theme-accent: var(--portal-season-accent, #2563eb);
  --portal-theme-on-accent: #fff;
}

:root[data-portal-palette="mono"] {
  --portal-theme-page: #f7f7f7;
  --portal-theme-soft: #ececec;
  --portal-theme-ink: #222;
  --portal-theme-muted: #636363;
  --portal-theme-line: #dedede;
  --portal-theme-strong: #aaa;
  --portal-theme-accent: #333;
  /* Filtering the root also removes color from logos, images and emoji. */
  filter: grayscale(1);
}
:root[data-portal-palette="mono"] :is(dialog, [popover]) { filter: grayscale(1); }

:root[data-portal-mode="dark"] {
  color-scheme: dark;
  --portal-theme-page: #14181f;
  --portal-theme-surface: #1d232d;
  --portal-theme-soft: var(--portal-season-soft, #29364b);
  --portal-theme-ink: #edf1f7;
  --portal-theme-muted: #b0bbcd;
  --portal-theme-line: #364150;
  --portal-theme-strong: #687a93;
  --portal-theme-accent: var(--portal-season-accent, #9bbdff);
  --portal-theme-on-accent: #14233e;
}

:root[data-portal-palette="mono"][data-portal-mode="dark"] {
  --portal-theme-page: #171717;
  --portal-theme-surface: #232323;
  --portal-theme-soft: #343434;
  --portal-theme-ink: #eee;
  --portal-theme-muted: #b8b8b8;
  --portal-theme-line: #414141;
  --portal-theme-strong: #777;
  --portal-theme-accent: #ddd;
  --portal-theme-on-accent: #222;
}

:root[data-portal-season="spring"] { --portal-season-tint: #3e876b; }
:root[data-portal-season="summer"] { --portal-season-tint: #3492ae; }
:root[data-portal-season="autumn"] { --portal-season-tint: #a76b47; }
:root[data-portal-season="winter"] { --portal-season-tint: #6d63b5; }
:root[data-portal-season="holiday"] { --portal-season-tint: #a3546e; }
:root[data-portal-palette="default"][data-portal-season] {
  --portal-season-accent: color-mix(in srgb, #2563eb 81%, var(--portal-season-tint));
  --portal-season-soft: color-mix(in srgb, #eff6ff 95%, var(--portal-season-tint));
}
:root[data-portal-palette="default"][data-portal-mode="dark"][data-portal-season] {
  --portal-season-accent: color-mix(in srgb, #9bbdff 81%, var(--portal-season-tint));
  --portal-season-soft: color-mix(in srgb, #29364b 92%, var(--portal-season-tint));
}

:root[data-portal-daypart="morning"] { --portal-daypart-tint: #e6bc83; }
:root[data-portal-daypart="day"] { --portal-daypart-tint: #9abcdc; }
:root[data-portal-daypart="evening"] { --portal-daypart-tint: #da9ca2; }
:root[data-portal-palette="default"]:is([data-portal-daypart="morning"], [data-portal-daypart="day"], [data-portal-daypart="evening"]) .site-header.portal-header {
  background: color-mix(in srgb, var(--portal-theme-surface) 96%, var(--portal-daypart-tint));
}

.site-header.portal-header .header-actions { display: flex; align-items: center; gap: 8px; }
/* Page-specific dark palettes must not recolor the shared header. */
:root[data-portal-mode="dark"]:not([data-portal-palette="mono"]) .site-header.portal-header {
  --portal-theme-surface: #1d232d;
  --portal-theme-soft: var(--portal-season-soft, #29364b);
  --portal-theme-ink: #edf1f7;
  --portal-theme-muted: #b0bbcd;
  --portal-theme-line: #364150;
  --portal-theme-strong: #687a93;
  --portal-theme-accent: var(--portal-season-accent, #9bbdff);
  --portal-theme-on-accent: #14233e;
}
.site-header.portal-header .account-button-mypage svg { display: none; width: 18px; height: 18px; }
.site-header.portal-header .portal-theme { position: relative; flex: 0 0 auto; color: var(--portal-theme-ink); font: 14px/1.5 system-ui, -apple-system, 'Malgun Gothic', sans-serif; }
.site-header.portal-header .portal-theme > summary { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; padding: 8px 10px; border: 1px solid var(--portal-theme-line); border-radius: 10px; background: var(--portal-theme-surface); color: inherit; font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; }
.site-header.portal-header .portal-theme > summary::-webkit-details-marker { display: none; }
.site-header.portal-header .portal-theme > summary:hover, .site-header.portal-header .portal-theme[open] > summary { background: var(--portal-theme-soft); }
.portal-theme summary svg { width: 18px; height: 18px; }
.site-header.portal-header .portal-theme-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 2; width: 232px; max-width: calc(100vw - 32px); padding: 18px; border: 1px solid var(--portal-theme-line); border-radius: 16px; background: var(--portal-theme-surface); color: var(--portal-theme-ink); box-shadow: 0 12px 36px rgb(0 0 0 / 18%); }
.portal-theme-panel fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.portal-theme-panel legend { margin: 0 0 12px; padding: 0; font-size: 14px; font-weight: 600; }
.portal-theme-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.portal-theme-options label { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px; border: 1px solid var(--portal-theme-line); border-radius: 10px; cursor: pointer; }
.portal-theme-options label:has(:checked) { border-color: var(--portal-theme-accent); background: var(--portal-theme-soft); }
.site-header.portal-header .portal-theme-panel input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--portal-theme-accent); cursor: pointer; }
.site-header.portal-header .portal-theme-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--portal-theme-line); font-size: 14px; cursor: pointer; }
.site-header.portal-header .portal-theme-switch + .portal-theme-switch { margin-top: 4px; padding-top: 6px; }
.site-header.portal-header .portal-theme-switch input { appearance: none; width: 36px; height: 22px; border: 1px solid var(--portal-theme-strong); border-radius: 999px; background: var(--portal-theme-line); }
.portal-theme-switch input::before { content: ''; display: block; width: 16px; height: 16px; margin: 2px; border-radius: 50%; background: var(--portal-theme-muted); }
.site-header.portal-header .portal-theme-switch input:checked { border-color: var(--portal-theme-accent); background: var(--portal-theme-accent); }
.portal-theme-switch input:checked::before { background: var(--portal-theme-on-accent); transform: translateX(12px); }
.portal-theme-switch input[name="portal-dark"] { position: relative; overflow: hidden; }
.portal-theme-switch input[name="portal-dark"]::before {
  width: 10px; height: 10px; margin: 5px; background: var(--portal-theme-muted);
  box-shadow: 0 -7px 0 -4px currentColor, 0 7px 0 -4px currentColor, 7px 0 0 -4px currentColor, -7px 0 0 -4px currentColor,
    5px 5px 0 -4px currentColor, -5px -5px 0 -4px currentColor, 5px -5px 0 -4px currentColor, -5px 5px 0 -4px currentColor;
}
.portal-theme-switch input[name="portal-dark"]:checked::before { transform: translateX(13px) scale(1.45); background: var(--portal-theme-on-accent); box-shadow: none; }
.portal-theme-switch input[name="portal-dark"]::after {
  content: ""; position: absolute; top: 1px; right: 1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--portal-theme-accent); transform: translate(12px,-9px);
}
.portal-theme-switch input[name="portal-dark"]:checked::after { transform: translate(-2px,0); }
@media (prefers-reduced-motion: no-preference) {
  .portal-theme-switch input[name="portal-dark"]::before, .portal-theme-switch input[name="portal-dark"]::after { transition: transform .22s ease-out, box-shadow .18s, background-color .18s; }
}
.site-header.portal-header .portal-theme :focus-visible { outline: 2px solid var(--portal-theme-accent); outline-offset: 3px; }

/* Override page-local tokens too, including the directory's body-level palette. */
:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) body.portal-shell {
  --page: var(--portal-theme-page);
  --surface: var(--portal-theme-surface);
  --surface-soft: var(--portal-theme-soft);
  --ink: var(--portal-theme-ink);
  --muted: var(--portal-theme-muted);
  --line: var(--portal-theme-line);
  --line-strong: var(--portal-theme-strong);
  --blue: var(--portal-theme-accent);
  --drop-line: var(--portal-theme-accent);
  --claim-page: var(--page);
  --claim-ink: var(--ink);
  --claim-muted: var(--muted);
  --claim-line: var(--line);
  --claim-blue: var(--blue);
  --claim-soft: var(--surface-soft);
  background-color: var(--page);
  color: var(--ink);
}

:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) .site-header.portal-header,
:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) .portal-sidebar,
:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) .portal-account-link {
  background: var(--portal-theme-surface);
  color: var(--portal-theme-ink);
  border-color: var(--portal-theme-line);
}
:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) .site-header.portal-header .brand { color: var(--portal-theme-ink); }
:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) .site-header.portal-header .brand-domain { color: var(--portal-theme-accent); }
:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) .site-header.portal-header .portal-nav a { color: var(--portal-theme-muted); }
:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) .site-header.portal-header .portal-nav a:is(:hover, [aria-current="page"]) { background: var(--portal-nav-fill, var(--portal-theme-soft)); color: var(--portal-theme-accent); }
:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) .site-header.portal-header .portal-nav a::after { background: var(--portal-theme-accent); }
:root:is([data-portal-palette="mono"], [data-portal-mode="dark"]) .site-header.portal-header [data-account-status] { background: var(--portal-theme-surface); border-color: var(--portal-theme-line); }

/* Hardcoded light surfaces and secondary text in existing work screens. */
:root[data-portal-mode="dark"] .portal-shell :is(.search-wrap, .credential-panel, .group-management-row, .claim-card, .insurer-search-wrap, .insurer-pill, .secondary-button, .recent-sidebar, .recent-load, .preview-panel, .spotlight-card, .load-error, [id="login"], [id="profile"]) { background: var(--surface); border-color: var(--line); color: var(--ink); }
:root[data-portal-mode="dark"] .portal-shell :is(input:not([type="checkbox"], [type="radio"], [type="range"]), textarea, select) { background-color: var(--surface); color: var(--ink); border-color: var(--line-strong); }
:root[data-portal-mode="dark"] .portal-shell :is(input, textarea)::placeholder { color: var(--muted); }
:root[data-portal-mode="dark"] .portal-shell :is(.search-wrap kbd, .group-count, .privacy-note, .beneficiary-note, .insurer-fax, .insurer-mark, .preview-fax, .consent-summary, .selected-insurers button, .recent-sidebar-fax, .pdf-pages, .new-material-badge, .favorite-material-badge, .step-mark, .step-state, .status-card[data-state="on"]) { background: var(--surface-soft); color: var(--ink); border-color: var(--line-strong); }
:root[data-portal-mode="dark"] .portal-shell :is(.account-button, .account-avatar, .insurer-group-nav button, .sidebar-group-count, .list-columns, .filters button, .filters button span, .group-count, .group-title, .detail-links a, .detail-row .unverified, .credential-safe-note, .credential-field-hint, .source-list, .source-list a, .source-list time, .portal-tags li, .insurer-fax strong, .insurer-fax-date, .claim-result-fax, .signature-help) { color: var(--muted); }
:root[data-portal-mode="dark"] .portal-shell :is(.insurer-group-nav button:hover, .portal-list .launcher-card:hover, .favorites-group .group-dropzone, .filters button:hover, .insurer-pill:hover, .account-button:hover, .detail-links a:hover) { background: var(--surface-soft); border-color: var(--line-strong); color: var(--ink); }
:root[data-portal-mode="dark"] .portal-shell :is(.filters button[aria-pressed="true"], .insurer-pill[aria-checked="true"], .search-submit, .search-submit:hover, .search-button, .select-option[aria-selected="true"], .detail-links a:first-child, .detail-links a:first-child:hover, .security-main .primary-button, .security-main .primary-button:hover) { background: var(--blue); border-color: var(--blue); color: var(--portal-theme-on-accent); }
:root[data-portal-mode="dark"] .portal-shell .filters button[aria-pressed="true"] span { color: inherit; }
:root[data-portal-mode="dark"] .portal-shell :is(.portal-list .launcher-card-actions a.primary, .portal-list .launcher-card-actions a.primary:hover, .detail-row dd > a, .account-button-mypage, .account-button-naver) { color: var(--blue); }
:root[data-portal-mode="dark"] .portal-shell .portal-list .launcher-card-actions a.primary:hover { background: var(--surface-soft); }
:root[data-portal-mode="dark"] .portal-shell :is(.favorite-button.is-active, .favorite-button.is-active:hover) { color: #f2c875; background: var(--surface-soft); border-color: var(--line-strong); }
:root[data-portal-mode="dark"] .portal-shell :is(.field-error, .claim-result-message, .claim-result-state[data-state="error"], b) { color: #ffaaaa; }
:root[data-portal-mode="dark"] .portal-shell :is(.claim-result-state[data-state="success"], .claim-result-state[data-state="generated"]) { color: #9bd8b5; }
:root[data-portal-mode="dark"] .portal-shell :is(button, a, input, textarea, select, summary):focus-visible { outline-color: var(--blue); }
:root[data-portal-mode="dark"] .portal-shell :is(.search-wrap, .insurer-search-wrap):focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px var(--surface-soft); }
:root[data-portal-mode="dark"] .claims-page .primary-button { background: var(--blue); color: var(--portal-theme-on-accent); }
:root[data-portal-mode="dark"] .portal-shell :is(.company-mark, .term-company img, .spotlight-company img, .summary-company img, .card-company img, .reader-header img) { padding: 0; border-color: transparent; background: transparent; }
:root[data-portal-mode="dark"] .portal-shell :is(.view-buttons, .quick-topics button, .card-topics span, .update-status, .saved-note, .document-summary, .ocr-note, .reader-source-note, .image-tools, .image-frame) { background: var(--surface-soft); color: var(--ink); border-color: var(--line); }
:root[data-portal-mode="dark"] .portal-shell :is(.reader-toc, .reader-footer, .reader-action, .reader-close, .text-size button, .summary-jumps button, .image-tools button) { background: var(--surface); color: var(--ink); border-color: var(--line); }
:root[data-portal-mode="dark"] .portal-shell :is(.category-filters button[aria-pressed="true"], .quick-topics button[aria-pressed="true"], .term-actions .primary-button:hover) { background: var(--blue); color: var(--portal-theme-on-accent); border-color: var(--blue); }
:root[data-portal-mode="dark"] .portal-shell :is(.summary-points a:hover, .toc-button:hover, .toc-button[aria-current="page"]) { background: var(--surface-soft); color: var(--blue); }
:root[data-portal-mode="dark"] .portal-shell :is(.card-footer, .summary-points li, .summary-documents) { border-color: var(--line); }
:root[data-portal-mode="dark"] .portal-shell .document-summary p { color: var(--muted); }
:root[data-portal-mode="dark"] .portal-shell mark { background: #655a26; color: var(--ink); }
:root[data-portal-mode="dark"] .guide-page .segment[aria-pressed="true"] { color: var(--portal-theme-on-accent); }
:root[data-portal-mode="dark"] .guide-page:not(.guide-contacts) .copy-btn { color: var(--portal-theme-on-accent); }
:root[data-portal-mode="dark"] .guide-page:not(.guide-contacts) .copy-btn:hover { background: var(--blue); }
:root[data-portal-mode="dark"] .guide-page #resultCount { color: var(--blue); }
/* Keep signatures and original document previews on white paper. */
:root[data-portal-mode="dark"] .portal-shell :is(.signature-canvas, #signatureCanvas) { background: #fff; color-scheme: light; }

@media (forced-colors: none) {
  :root:is([data-portal-palette="mono"], [data-portal-mode="dark"]):has(body.portal-shell) {
    --portal-scrollbar-track: var(--portal-theme-page);
    --portal-scrollbar-thumb: var(--portal-theme-strong);
    --portal-scrollbar-hover: var(--portal-theme-muted);
  }
}

@media (max-width: 680px) {
  .site-header.portal-header .portal-theme > summary { padding-inline: 10px; }
  .portal-theme summary > span { display: none; }
  .site-header.portal-header .portal-theme-panel { position: fixed; top: calc(var(--portal-brand-row) + env(safe-area-inset-top, 0px)); right: 16px; }
}
@media (max-width: 480px) {
  .portal-shell .site-header.portal-header .header-inner { column-gap: 8px; }
  .site-header.portal-header .header-actions { gap: 2px; }
  .site-header.portal-header .portal-theme > summary { min-width: 36px; padding-inline: 8px; }
  .site-header.portal-header .account-button-mypage { width: 36px; padding-inline: 8px; }
  .site-header.portal-header .account-button-mypage svg { display: block; }
  .site-header.portal-header .account-button-mypage span { display: none; }
}
@media (max-width: 360px) {
  .portal-shell .site-header.portal-header .brand { gap: 8px; }
  .portal-shell .site-header.portal-header .brand img { width: 52px; height: 52px; }
  .portal-shell .site-header.portal-header .brand strong { font-size: 22px; }
}
@media print {
  :root[data-portal-palette="mono"], :root[data-portal-palette="mono"] :is(dialog, [popover]) { filter: none; }
  :root[data-portal-mode="dark"], :root[data-portal-palette="mono"][data-portal-mode="dark"] {
    color-scheme: light;
    --portal-theme-page: #fff;
    --portal-theme-surface: #fff;
    --portal-theme-soft: #eff6ff;
    --portal-theme-ink: #1e293b;
    --portal-theme-muted: #606979;
    --portal-theme-line: #e2e8f0;
    --portal-theme-strong: #bfc8df;
    --portal-theme-accent: #2563eb;
    --portal-theme-on-accent: #fff;
  }
}


/* Controls share full capsule corners, including page-local and dynamic controls.
   Radius alone takes precedence because pages load their own styles after this file. */
body.portal-shell { --portal-control-radius: 9999px; }
body.portal-shell :is(
  button, [role="button"], summary,
  input:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="hidden"]),
  select:not([multiple], [size]:not([size="1"])),
  nav a, a[class*="button"], a[class*="btn"],
  .card-actions a, .launcher-card-actions a, .detail-links a, .login-links a, .summary-points a,
  .credential-login-link, .resource-link, .open-chat, .text-action,
  .portal-theme-options label, .profile-option, .security-main .switch,
  .search-wrap, .insurer-search-wrap, .query-wrap, .view-buttons, .quick-nav,
  .portal-tags li, .card-topics span, .term-badge, .chip,
  .new-material-badge, .favorite-material-badge, .update-status,
  .ready-badge, .auto-badge, .vendor-badge, .step-state,
  .group-count, .sidebar-group-count, .insurer-mark, .insurer-fax, .preview-fax,
  kbd
) { border-radius: var(--portal-control-radius) !important; }
body.portal-shell input::file-selector-button { border-radius: var(--portal-control-radius) !important; }
body.portal-shell input[type="color"]::-webkit-color-swatch { border-radius: var(--portal-control-radius) !important; }
body.portal-shell input[type="color"]::-moz-color-swatch { border-radius: var(--portal-control-radius) !important; }

/* Shared Nangman identity and work menu across the portal and its tools. */
:root { --portal-brand-row: 100px; --portal-menu-row: 0px; --portal-header-height: calc(var(--portal-brand-row) + var(--portal-menu-row) + 1px + env(safe-area-inset-top, 0px)); scrollbar-gutter: stable; scroll-padding-top: calc(var(--portal-header-height) + 16px); }
.site-header.portal-header { position: sticky; top: 0; z-index: 20; box-sizing: border-box; margin: 0; padding: env(safe-area-inset-top, 0px) 0 0; background: #fff; color: #1e293b; border: 0; border-bottom: 1px solid #dce7f5; box-shadow: 0 3px 12px rgb(35 49 89 / 3%); font: 14px/1.5 system-ui, -apple-system, 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; -webkit-font-smoothing: antialiased; }
.site-header.portal-header * { box-sizing: border-box; }
.site-header.portal-header .header-inner { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; grid-template-rows: var(--portal-brand-row); align-items: center; gap: 0 28px; max-width: 1200px; min-height: var(--portal-brand-row); margin: auto; padding: 0 32px; }
.site-header.portal-header .brand { grid-area: 1 / 1; justify-self: start; display: inline-flex; align-items: center; gap: 12px; min-width: 0; min-height: 72px; color: #1e293b; text-decoration: none; white-space: nowrap; }
.site-header.portal-header .brand img { display: block; flex: 0 0 auto; width: 72px; height: 72px; object-fit: contain; border-radius: 0; }
.site-header.portal-header .brand strong { display: inline-flex; align-items: baseline; font-size: 26px; font-weight: 750; line-height: 1.2; letter-spacing: -.8px; }
.site-header.portal-header .brand-domain { color: #2563eb; font-size: .76em; font-weight: 650; letter-spacing: -.4px; }
@media (prefers-reduced-motion: no-preference) {
  .site-header.portal-header .brand img {
    transform-origin: 50% 85%;
    animation: var(--mascot-nod, none), var(--mascot-wiggle, none);
  }
  .site-header.portal-header .brand:is(:hover, :focus-visible, :active) img { --mascot-nod: portal-mascot-nod .38s ease-out; }
  .site-header.portal-header .brand img.is-wiggling { --mascot-wiggle: portal-mascot-wiggle .55s ease-out; }
}
@keyframes portal-mascot-nod {
  38% { transform: translateY(2px) rotate(9deg); }
  72% { transform: rotate(-3deg); }
}
@keyframes portal-mascot-wiggle {
  18% { transform: translate(-3px, -2px) rotate(-8deg); }
  38% { transform: translate(3px, -5px) rotate(8deg); }
  60% { transform: translate(-2px, -2px) rotate(-5deg); }
  82% { transform: translateX(1px) rotate(3deg); }
}
.portal-touch-ripple { position: fixed; overflow: hidden; pointer-events: none; z-index: 10000; }
.portal-touch-ripple > span { position: absolute; width: 42px; height: 42px; margin: -21px; border-radius: 50%; border: 2px solid currentColor; opacity: 0; }
.site-header.portal-header .portal-nav { grid-area: 1 / 2; justify-self: start; display: grid; grid-auto-flow: column; grid-auto-columns: max-content; align-items: center; align-content: center; gap: 4px; min-width: 0; max-width: 100%; height: 64px; margin: 0; padding: 0; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin; border: 0; border-radius: 0; background: transparent; box-shadow: none; font-size: 14px; color: #606979; }
.site-header.portal-header .portal-nav::before { content: none; }
.site-header.portal-header .portal-nav.has-moving-shade { isolation: isolate; --portal-nav-fill: transparent; }
.site-header.portal-header .portal-nav-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: 9999px; background: var(--portal-theme-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--portal-theme-accent) 9%, transparent), 0 2px 5px color-mix(in srgb, var(--portal-theme-accent) 8%, transparent); }
.site-header.portal-header .portal-nav a { position: relative; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 8px 14px; border: 0; border-radius: 12px; background: transparent; color: #606979; text-decoration: none; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1.5; letter-spacing: -.2px; white-space: nowrap; box-shadow: none; transition: color .16s, background-color .16s; }
.site-header.portal-header .portal-nav a::before { content: none; }
.site-header.portal-header .portal-nav a::after { content: ''; position: absolute; inset: auto 14px 0; height: 3px; border-radius: 3px; background: #2563eb; opacity: 0; transform: scaleX(.5); transition: opacity .16s, transform .16s; }
.site-header.portal-header .portal-nav a:hover { background: var(--portal-nav-fill, #f8faff); color: #1e293b; }
.site-header.portal-header .portal-nav a[aria-current="page"] { background: var(--portal-nav-fill, #eff6ff); color: #2563eb; }
.site-header.portal-header .portal-nav a[aria-current="page"]::after { opacity: 1; transform: scaleX(1); }
.site-header.portal-header a:focus-visible, .site-header.portal-header button:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.site-header.portal-header .portal-nav a:focus-visible { outline: 2px solid #2563eb; outline-offset: -3px; border-radius: 12px; }
.site-header.portal-header .header-actions { grid-area: 1 / 3; justify-self: end; min-width: 0; margin: 0; padding: 0; }
.site-header.portal-header [hidden] { display: none !important; }
.site-header.portal-header .account-area { display: flex; align-items: center; min-height: 44px; min-width: 0; }
.site-header.portal-header .account-login-buttons, .site-header.portal-header .account-user { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; flex-wrap: nowrap; }
.site-header.portal-header .account-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 11px; border: 1px solid transparent; border-radius: 9999px; background: transparent; color: var(--portal-theme-ink); font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; text-decoration: none; cursor: pointer; }
.site-header.portal-header .account-button:hover { border-color: var(--portal-theme-strong); background: var(--portal-theme-soft); }
.site-header.portal-header .account-button:disabled { cursor: wait; opacity: .6; }
.site-header.portal-header .account-button-naver { color: #278354; }
.site-header.portal-header .account-button-google { border-color: var(--portal-theme-line); background: var(--portal-theme-surface); }
.site-header.portal-header .account-button-mypage { color: var(--portal-theme-accent); }
.site-header.portal-header .account-button-logout { color: var(--portal-theme-muted); font-weight: 550; }
.site-header.portal-header .account-profile { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 280px; color: var(--portal-theme-ink); font-size: 12px; font-weight: 650; }
.site-header.portal-header .account-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; overflow: hidden; border: 0; border-radius: 50%; background: var(--portal-theme-soft); color: var(--portal-theme-muted); font-size: 10px; font-weight: 750; }
.site-header.portal-header .account-avatar img { display: none; width: 100%; height: 100%; object-fit: cover; }
.site-header.portal-header .account-avatar.has-image .account-avatar-fallback { display: none; }
.site-header.portal-header .account-avatar.has-image img { display: block; }
.site-header.portal-header .account-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-header.portal-header .account-email-consent { display: inline-flex; align-items: center; min-height: 44px; color: var(--portal-theme-accent); white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.site-header.portal-header .account-loading { color: var(--portal-theme-muted); font-size: 12px; }
.site-header.portal-header [data-account-status] { position: fixed; top: calc(var(--portal-header-height) + 8px); right: max(16px, calc((100vw - 1136px) / 2)); display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); padding: 8px 12px; border: 1px solid #dce7f5; border-radius: 12px; background: #fff; box-shadow: 0 4px 16px rgb(35 49 89 / 8%); }
.skip-link:focus { z-index: 30; }

@media (max-width: 1100px) {
  :root { --portal-brand-row: 84px; --portal-menu-row: 64px; }
  .site-header.portal-header .header-inner { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: var(--portal-brand-row) var(--portal-menu-row); gap: 0 24px; padding-inline: 32px; }
  .site-header.portal-header .portal-nav { grid-area: 2 / 1 / auto / -1; justify-self: stretch; grid-auto-columns: minmax(max-content, 1fr); }
  .site-header.portal-header .header-actions { grid-area: 1 / 2; }
  .site-header.portal-header .account-profile { max-width: clamp(100px, calc(100vw - 540px), 280px); }
}
@media (max-width: 820px) {
  .site-header.portal-header .header-inner { padding-inline: 24px; }
}
@media (max-width: 680px) {
  :root { --portal-brand-row: 76px; }
  .site-header.portal-header .header-inner { padding-inline: 16px; }
  .site-header.portal-header .brand { gap: 10px; min-height: 68px; }
  .site-header.portal-header .brand img { width: 60px; height: 60px; }
  .site-header.portal-header .brand strong { font-size: 24px; }
  .site-header.portal-header .portal-nav { gap: 2px; }
  .site-header.portal-header .portal-nav a { padding-inline: 4px; }
  .site-header.portal-header .portal-nav a::after { inset: auto 10px 0; }
  .site-header.portal-header .account-profile { max-width: min(200px, calc(100vw - 420px)); gap: 5px; font-size: 11px; }
  .site-header.portal-header .account-avatar { width: 28px; height: 28px; flex-basis: 28px; }
}
@media (max-width: 600px) {
  .site-header.portal-header .header-inner { column-gap: 12px; }
  .site-header.portal-header .account-login-buttons, .site-header.portal-header .account-user { gap: 4px; }
  .site-header.portal-header .account-button { padding-inline: 6px; font-size: 11px; }
  .site-header.portal-header .account-login-label { display: none; }
  .site-header.portal-header .account-user { display: grid; grid-template-columns: auto auto auto; justify-content: end; max-width: min(44vw, 220px); row-gap: 0; }
  .site-header.portal-header .account-profile { grid-column: 1 / -1; justify-self: end; max-width: 100%; line-height: 1.5; }
  .site-header.portal-header .account-email-consent { min-height: 28px; }
  .site-header.portal-header .account-avatar { display: none; }
}
@media (max-width: 360px) {
  .site-header.portal-header .portal-nav { grid-auto-columns: minmax(max-content, 1fr); }
  .site-header.portal-header .portal-nav a { padding-inline: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header.portal-header .portal-nav a, .site-header.portal-header .portal-nav a::after { transition: none; }
}

/* Keep page and nested scrollbars in the shared shell palette. */
@media (forced-colors: none) {
  :root:has(body.portal-shell) { --portal-scrollbar-track: #f2f5fa; --portal-scrollbar-thumb: #7c8faa; --portal-scrollbar-hover: #587db0; }
  :root:has(body.portal-shell), :root:has(body.portal-shell) * { scrollbar-color: var(--portal-scrollbar-thumb) var(--portal-scrollbar-track); }
  :where(:root:has(body.portal-shell), body.portal-shell *) { scrollbar-width: thin; }

  @supports not (scrollbar-color: auto) {
    :root:has(body.portal-shell)::-webkit-scrollbar, :root:has(body.portal-shell) *::-webkit-scrollbar { width: 10px; height: 10px; }
    :root:has(body.portal-shell)::-webkit-scrollbar-track, :root:has(body.portal-shell) *::-webkit-scrollbar-track { border-radius: 999px; background: var(--portal-scrollbar-track); }
    :root:has(body.portal-shell)::-webkit-scrollbar-thumb, :root:has(body.portal-shell) *::-webkit-scrollbar-thumb { min-width: 32px; min-height: 32px; border: 2px solid var(--portal-scrollbar-track); border-radius: 999px; background: var(--portal-scrollbar-thumb); }
    :root:has(body.portal-shell)::-webkit-scrollbar-thumb:hover, :root:has(body.portal-shell) *::-webkit-scrollbar-thumb:hover { background: var(--portal-scrollbar-hover); }
    :root:has(body.portal-shell)::-webkit-scrollbar-corner, :root:has(body.portal-shell) *::-webkit-scrollbar-corner { background: var(--portal-scrollbar-track); }
  }
}

/* The shared shell reserves no space for the unused sidebar. */
:root:has(body.portal-shell) { --portal-sidebar-width: 0px; }
body.portal-shell { box-sizing: border-box; min-width: 0; margin: 0; padding: var(--portal-header-height) 0 0 var(--portal-sidebar-width); }
.portal-shell .site-header.portal-header { position: fixed; inset: 0 0 auto; z-index: 100; }
.portal-shell .skip-link:focus { z-index: 110; }
.portal-sidebar { display: none; }
.portal-account-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 10px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #526079; font: 600 13px/1.5 system-ui, -apple-system, 'Malgun Gothic', sans-serif; text-decoration: none; }
.portal-account-link svg { display: block; width: 20px; height: 20px; }
.portal-account-link:hover { background: #eff6ff; color: #2563eb; }
.portal-account-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 3px; }
.portal-shell[data-portal-tool] .glass-nav, .portal-shell[data-portal-tool] .sticky.top-0 { top: var(--portal-header-height); }
.portal-shell[data-portal-tool] #action-btn-container, .portal-shell[data-portal-tool] #toast { left: calc(50% + var(--portal-sidebar-width) / 2); }
.portal-shell[data-portal-tool] #toast { top: calc(var(--portal-header-height) + 12px); }

/* Customer questionnaires show only their own steps and submission controls. */
:root:has(body[data-portal-service="guide"][data-portal-tool]) { --portal-header-height: 0px; }
.portal-shell[data-portal-service="guide"][data-portal-tool] > .site-header.portal-header { display: none; }

@media (min-width: 1100px) {
  .site-header.portal-header .header-inner { max-width: none; }
  .site-header.portal-header [data-account-status] { right: 32px; }
  body.portal-shell > main,
  body.portal-shell > .app > main,
  body.portal-shell > .claims-layout { box-sizing: border-box; width: 100%; max-width: none; padding-inline: 32px; }
  body.portal-shell > .claims-layout .claims-main { max-width: none; }
}

@media (max-width: 1099px) {
  body.portal-shell { padding-left: 0; }
  .portal-sidebar { display: none; }
  .portal-shell[data-portal-tool] #action-btn-container, .portal-shell[data-portal-tool] #toast { left: 50%; }
}
@media (max-width: 680px) {
  .portal-account-link span { display: none; }
}
@media print {
  body.portal-shell { padding: 0 !important; }
  .portal-shell .site-header.portal-header, .portal-sidebar { display: none !important; }
}

