/* NEXIO 공개 데모 - 시범 서비스 고지 배너 (D2-04). 외부 URL·웹폰트 없음, 스크립트 없음.
   마크업은 templates/nexio-notice.inc.template(envsubst → conf.d/nexio-notice.inc, snippets/notice.conf 가 include)의 sub_filter 가 index.html 의 닫는 body 앞에 넣는다 (#root 바깥, body 직속).
   접힘/펼침은 details 요소가 맡는다 (JS 불필요). 문구를 바꾸면 demo-web 진입 화면 문구(App.tsx)와 함께 맞춘다. */
#nexio-demo-notice {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2147483000;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  background: #1f2937;
  color: #f9fafb;
  font: 12px/1.5 system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  border-top: 2px solid #f59e0b;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.25);
  text-align: left;
}
#nexio-demo-notice * {
  box-sizing: border-box;
}
#nexio-demo-notice summary {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#nexio-demo-notice summary::-webkit-details-marker {
  display: none;
}
#nexio-demo-notice .nd-badge {
  flex: none;
  padding: 0 6px;
  border-radius: 3px;
  background: #f59e0b;
  color: #111827;
  font-weight: 700;
}
#nexio-demo-notice .nd-short {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
#nexio-demo-notice .nd-more {
  flex: none;
  color: #fcd34d;
  text-decoration: underline;
}
#nexio-demo-notice details[open] .nd-more::after {
  content: " 접기";
}
#nexio-demo-notice details:not([open]) .nd-more::after {
  content: " 자세히";
}
#nexio-demo-notice .nd-full {
  max-height: 50vh;
  overflow: auto;
  margin: 0;
  padding: 4px 12px 10px 32px;
  border-top: 1px solid #374151;
}
#nexio-demo-notice .nd-full li {
  margin: 2px 0;
}
#nexio-demo-notice .nd-http {
  color: #fcd34d;
}
/* 요약 줄(펼치기 전)의 HTTP 경고 (demo-042). 좁은 화면에서도 잘리지 않게 줄어들지 않는다 */
#nexio-demo-notice .nd-warn {
  flex: none;
  padding: 0 6px;
  border-radius: 3px;
  border: 1px solid #fcd34d;
  color: #fcd34d;
  font-weight: 700;
}
/* HTTPS 로 운영하면(NEXIO_DEMO_SCHEME=https) HTTP 경고 두 곳을 숨긴다 - 템플릿·재빌드 수정 없이 환경변수만 바꾼다 */
#nexio-demo-notice .nd-scheme-https {
  display: none;
}
/* 하단 고정 띠가 솔루션 화면의 아래쪽(푸터·페이지 번호·버튼 줄)을 가리지 않게 접힌 높이(28px)만큼 화면 높이를 줄인다.
   솔루션 SPA 는 로그인 화면이 #root{min-height:100vh}, 업무 화면 셸과 전체 화면 팝업이 .h-screen(height:100vh) 이다 (dist CSS 에서 확인).
   이 파일은 솔루션 CSS 뒤에 로드되고 선택자 세기가 같아서 순서로 이긴다. 펼친 상태는 사용자가 연 것이므로 위에 겹쳐 보인다. */
body {
  padding-bottom: 28px;
}
#root {
  min-height: calc(100vh - 28px);
}
.h-screen {
  height: calc(100vh - 28px);
}
@media print {
  body {
    padding-bottom: 0;
  }
  #nexio-demo-notice {
    display: none;
  }
}

/* ---- 솔루션 로그인 화면 카드 옆 체험 안내 (#nexio-demo-sol) ----
   마크업: templates/demo-login-info.conf.template(생성 - front/apps/demo-web/scripts/gen-login-info.mjs, 원본 = 진입 화면과 같은 solutions.json·accounts.json)
   의 map 값을 notice 의 닫는 body 치환이 앞에 붙인다(#root 바깥, body 직속). 스크립트 없음.
   보이는 조건: 화면에 로그인 카드(.mdm-auth__card - nexio-core-front 로그인 화면)가 있을 때만(:has). 로그인 뒤 업무 화면에서는 숨는다.
   :has 를 모르는 브라우저는 안내가 안 보일 뿐 로그인은 그대로 된다(fail-safe).
   넓은 화면(1100px 이상): 로그인 영역 오른쪽 안쪽 여백을 (안내 폭 + 간격)만큼 늘려 카드를 왼쪽으로 옮기고, 안내를 카드 오른쪽에 고정한다.
     카드 460px + 간격 24px + 안내 360px 묶음이 화면 가운데에 온다(카드 왼쪽 = 50% - 422px, 안내 왼쪽 = 50% + 62px).
   좁은 화면: 로그인 화면 아래에 이어서 놓인다(아래로 스크롤). */
#nexio-demo-sol {
  display: none;
}
body:has(.mdm-auth__card) #nexio-demo-sol {
  display: block;
  box-sizing: border-box;
  width: min(460px, calc(100% - 28px));
  margin: 16px auto 24px;
  padding: 22px 24px 18px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.16);
  color: #1e293b;
  font: 13px/1.55 system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  text-align: left;
}
#nexio-demo-sol * {
  box-sizing: border-box;
}
#nexio-demo-sol .nds-kicker {
  display: inline-block;
  margin: 0 0 6px;
  padding: 0 8px;
  border-radius: 4px;
  background: #f59e0b;
  color: #111827;
  font-size: 11px;
  font-weight: 700;
}
#nexio-demo-sol h2 {
  margin: 0 0 4px;
  font-size: 20px;
  line-height: 1.3;
  color: #0f172a;
}
#nexio-demo-sol h3 {
  margin: 14px 0 6px;
  font-size: 13px;
  color: #0369a1;
}
#nexio-demo-sol .nds-sum {
  margin: 0;
  color: #334155;
}
#nexio-demo-sol table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
#nexio-demo-sol th,
#nexio-demo-sol td {
  padding: 4px 6px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}
#nexio-demo-sol th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 600;
}
#nexio-demo-sol code {
  font: 600 12px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #0f172a;
}
#nexio-demo-sol .nds-pw {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 12px;
}
#nexio-demo-sol ul {
  margin: 0;
  padding-left: 18px;
}
#nexio-demo-sol li {
  margin: 2px 0;
}
#nexio-demo-sol .nds-home {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}
#nexio-demo-sol .nds-home a {
  color: #0284c7;
  font-weight: 600;
}
@media (min-width: 1100px) {
  body:has(.mdm-auth__card) .mdm-auth {
    padding-right: 404px;
  }
  body:has(.mdm-auth__card) #nexio-demo-sol {
    position: fixed;
    z-index: 30;
    top: 50%;
    left: calc(50% + 62px);
    width: 360px;
    max-height: calc(100vh - 140px);
    margin: 0;
    overflow: auto;
    transform: translateY(-50%);
  }
}
/* ---- 다국어(ko·en·vi) - 체험 안내(#nexio-demo-sol)와 하단 고지 띠(#nexio-demo-notice) 공통. 스크립트 없음 ----
   마크업은 언어마다 한 벌씩(.nl-ko·.nl-en·.nl-vi) 들어 있고, 지금 언어 한 벌만 보인다. 기본(언어를 모를 때) = ko.
   지금 언어: (1) 솔루션 화면 - 언어 선택 콤보(nexio-app-shared LocaleSwitcher, name=locale)의 숨은 입력값. 로그인 화면·업무 화면 헤더 둘 다 있다.
             (2) 진입 화면(demo-web) - 고른 언어를 html lang 에 적는다. 솔루션 앱의 html lang 은 ko 고정이라 (2)는 솔루션 화면에 영향이 없다.
   :has 를 모르는 브라우저는 ko 로 보인다(fail-safe). */
#nexio-demo-sol .nl-en,
#nexio-demo-sol .nl-vi,
#nexio-demo-notice .nl-en,
#nexio-demo-notice .nl-vi {
  display: none;
}
:root:has(input[name="locale"][value="en"]) #nexio-demo-sol .nl-ko,
:root:has(input[name="locale"][value="en"]) #nexio-demo-notice .nl-ko,
html[lang="en"] #nexio-demo-sol .nl-ko,
html[lang="en"] #nexio-demo-notice .nl-ko,
:root:has(input[name="locale"][value="vi"]) #nexio-demo-sol .nl-ko,
:root:has(input[name="locale"][value="vi"]) #nexio-demo-notice .nl-ko,
html[lang="vi"] #nexio-demo-sol .nl-ko,
html[lang="vi"] #nexio-demo-notice .nl-ko {
  display: none;
}
:root:has(input[name="locale"][value="en"]) #nexio-demo-sol .nl-en,
:root:has(input[name="locale"][value="en"]) #nexio-demo-notice .nl-en,
html[lang="en"] #nexio-demo-sol .nl-en,
html[lang="en"] #nexio-demo-notice .nl-en,
:root:has(input[name="locale"][value="vi"]) #nexio-demo-sol .nl-vi,
:root:has(input[name="locale"][value="vi"]) #nexio-demo-notice .nl-vi,
html[lang="vi"] #nexio-demo-sol .nl-vi,
html[lang="vi"] #nexio-demo-notice .nl-vi {
  display: block;
}
/* 하단 띠 「자세히/접기」 글자 - 언어별 */
#nexio-demo-notice details.nl-en[open] .nd-more::after {
  content: " Less";
}
#nexio-demo-notice details.nl-en:not([open]) .nd-more::after {
  content: " More";
}
#nexio-demo-notice details.nl-vi[open] .nd-more::after {
  content: " Thu gọn";
}
#nexio-demo-notice details.nl-vi:not([open]) .nd-more::after {
  content: " Chi tiết";
}
@media print {
  #nexio-demo-sol {
    display: none !important;
  }
}
