/* NameCard canonical header v1 — the only shared header layout contract.
   Keep both rows mounted, regardless of Firebase login state or locale. */
:root {
  --nc-header-top: 24px;
  --nc-header-height: 76px;
  --nc-header-row-1: 40px;
  --nc-header-row-2: 36px;
  --nc-header-bottom-gap: 16px;
}
body.nc-home,
body.nc-public,
body.nc-admin {
  margin-top: 0 !important;
  padding-top: var(--nc-header-top) !important;
}
body.nc-home { display: block !important; }

body.nc-home nav.nc-site-header,
body.nc-public nav.nc-site-header,
body.nc-admin nav.nc-site-header {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  grid-template-rows: var(--nc-header-row-1) var(--nc-header-row-2) !important;
  gap: 0 !important;
  box-sizing: border-box !important;
  width: min(var(--nc-page-width), calc(100% - var(--nc-page-inset))) !important;
  max-width: var(--nc-page-width) !important;
  height: var(--nc-header-height) !important;
  min-height: var(--nc-header-height) !important;
  max-height: var(--nc-header-height) !important;
  margin: 0 auto var(--nc-header-bottom-gap) !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  font-family: Arial, "Noto Sans KR", sans-serif;
  font-size: 13px;
}

.nc-site-header > .nc-header-account {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  flex-wrap: nowrap !important;
  box-sizing: border-box;
  height: var(--nc-header-row-1) !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 8px !important;
}
.nc-site-header .nc-header-identity {
  display: flex !important;
  flex: 1 1 0;
  min-width: 0;
  align-items: center;
  gap: 7px;
  color: #243b83;
  font-size: 13px;
  overflow: hidden;
  white-space: nowrap;
}
.nc-site-header .nc-header-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nc-site-header .nc-header-identity svg { flex: 0 0 16px; }
.nc-site-header .nc-header-controls {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  height: 40px;
  margin: 0 !important;
  padding: 0 !important;
}
.nc-site-header .nc-header-action {
  display: flex !important;
  align-items: center;
  justify-content: flex-end;
  min-width: 92px;
  height: 36px;
}
.nc-site-header .nc-header-language {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 116px;
  height: 36px;
}
.nc-site-header .nc-language-picker {
  display: block;
  width: 116px !important;
  height: 30px;
  padding: 4px 7px;
  margin: 0 !important;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #243b53;
  font-size: 12px;
  cursor: pointer;
}
.nc-site-header > .nc-header-links {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 3px !important;
  box-sizing: border-box;
  height: var(--nc-header-row-2) !important;
  min-height: 0 !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.nc-site-header .nc-header-links::-webkit-scrollbar { display: none; }
.nc-site-header .nc-header-link {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
  box-sizing: border-box;
  height: 30px;
  padding: 6px 9px;
  margin: 0 !important;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #2366a3;
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
}
.nc-site-header .nc-header-link.is-active {
  color: #163d78;
  background: #e8f1fb;
  font-weight: 700;
}
.nc-site-header .nc-header-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto !important;
  height: 30px;
  padding: 6px 8px !important;
  margin: 0 !important;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #52657b;
  font: inherit;
  font-size: 12px !important;
  white-space: nowrap;
  cursor: pointer;
}
.nc-site-header .nc-header-link:hover,
.nc-site-header .nc-header-logout:hover { background: #e8f1fb; }
.nc-site-header .nc-header-link:focus-visible,
.nc-site-header .nc-header-logout:focus-visible,
.nc-site-header .nc-language-picker:focus-visible { outline: 2px solid #1d70b7; outline-offset: 2px; }

@media (max-width: 599px) {
  :root { --nc-header-top: 12px; }
  .nc-site-header .nc-header-action { min-width: 0; }
  .nc-site-header .nc-header-language,
  .nc-site-header .nc-language-picker { width: 104px !important; }
  .nc-site-header .nc-header-controls { gap: 4px; }
  .nc-site-header .nc-header-link { font-size: 12px; }
}
