/* Stable public-page layout: native flow, bounded width, and native scrolling. */
html {
  --frame-width: min(100vw, 100vh);
  --frame-width: min(100vw, 100svh);
  --frame-height: min(100vh, 233.333vw);
  --frame-height: min(100svh, 233.333vw);
  --canvas-width: var(--frame-width);
  --canvas-height: var(--frame-height);
  --frame-scale: 1;
  --canvas-offset-x: 0px;
  display: block;
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: #e5faff;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  box-sizing: border-box;
}

html.theme-deep-sea.light,
html.theme-deep-sea.light body {
  background: linear-gradient(135deg, #e5faff 0%, #c5f1f9 50%, #a5e7f3 100%);
}

html.theme-deep-sea.dark,
html.theme-deep-sea.dark body {
  background: linear-gradient(135deg, #122b35 0%, #173b49 50%, #0b1c25 100%);
}

html.theme-deep-sea.dark .principles-grid {
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

html.theme-deep-sea.dark .principles-grid article {
  color: var(--text-primary);
  border-color: var(--border-color);
}

html.theme-deep-sea.dark .official-links a {
  color: var(--accent-color);
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  height: auto;
  max-height: none;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text-primary, #123744);
  background: transparent;
}

#app-frame {
  position: relative;
  inset: auto;
  display: block;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: min(100%, var(--frame-width));
  max-width: 100%;
  min-height: var(--frame-height);
  height: auto;
  margin: auto;
  overflow: visible;
  isolation: isolate;
  background: transparent;
  transform: none !important;
  zoom: 1 !important;
}

#frame-scroll {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
}

#frame-content {
  position: relative;
  display: block !important;
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0;
  min-height: var(--frame-height);
  height: auto !important;
  max-width: 100%;
  margin: 0 !important;
  padding: 0;
  overflow: visible;
  zoom: 1 !important;
  transform: none !important;
  translate: none !important;
  background: transparent;
}

#main,
#main > [data-page] {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
}

#main {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  transform: none !important;
  translate: none !important;
}

#main > [data-page][hidden] {
  display: none !important;
}

#main > [data-page]:not([hidden]) {
  position: relative !important;
  inset: auto !important;
  display: block !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  overflow: visible !important;
  transform: none !important;
  translate: none !important;
}

#main > #page-home:not([hidden]) {
  min-height: var(--frame-height) !important;
}

.inner-page-chrome {
  position: sticky !important;
  z-index: 10;
  top: 0 !important;
  flex: 0 0 var(--inner-header-height, 68px) !important;
  width: 100%;
  min-height: var(--inner-header-height, 68px);
  height: var(--inner-header-height, 68px) !important;
  margin: 0 !important;
  transform: none !important;
  translate: none !important;
}

body.home-layout .inner-page-chrome {
  display: none !important;
}

body.inner-page #frame-content,
body.inner-page #main {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
}

body.inner-page #main {
  display: flex !important;
  flex-direction: column !important;
}

body.inner-page #main > #page-home[hidden] {
  display: none !important;
}

body.inner-page #main > [data-page]:not([hidden]) > .immersive-page {
  position: relative !important;
  inset: auto !important;
  box-sizing: border-box;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  transform: none !important;
  translate: none !important;
}

body.inner-page #main > .immersive-section:not([hidden]) {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}

body.inner-page #main > #page-howto,
body.inner-page #main > #page-website,
body.inner-page #main > #page-faq,
body.inner-page #main > #page-info,
body.inner-page #main > #page-policy {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  padding: clamp(20px, 3.5vw, 44px) clamp(16px, 4vw, 52px) 44px !important;
}

.policy-heading {
  max-width: 900px;
  margin: 0 auto 28px;
}

.policy-heading h1 {
  margin: 0 0 14px;
  color: var(--text-primary, #123744);
  font-size: clamp(28px, 5vw, 46px);
  line-height: 1.15;
}

.policy-heading > p {
  max-width: 820px;
  color: var(--text-secondary, #426b78);
  font-size: 15px;
  line-height: 1.75;
}

.policy-document {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--border-color, #a5e7f3);
  border-radius: 22px;
  color: var(--text-primary, #123744);
  background: color-mix(in srgb, var(--bg-secondary, #fff) 86%, transparent);
}

.policy-section + .policy-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--border-color, #a5e7f3);
}

.policy-section h2 {
  margin: 0 0 18px;
  color: var(--text-primary, #123744);
  font-size: clamp(20px, 3vw, 26px);
  line-height: 1.35;
}

.policy-section h3 {
  margin: 20px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border-color, #a5e7f3);
  border-radius: 14px;
  background: var(--bg-card, #d5f5fa);
  color: var(--text-primary, #123744);
  font-size: clamp(16px, 2.4vw, 19px);
  line-height: 1.45;
}

.policy-subcontent {
  margin-top: 8px;
  padding: clamp(14px, 3vw, 20px);
  border: 1px solid var(--border-color, #a5e7f3);
  border-radius: 16px;
  background: var(--bg-secondary, #fff);
}

.policy-detail + .policy-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color, #a5e7f3);
}

.policy-detail h4 {
  margin: 0 0 6px;
  color: var(--text-primary, #123744);
  font-size: clamp(14px, 2vw, 17px);
  line-height: 1.45;
}

.policy-detail p {
  margin: 0 !important;
}

.policy-section p,
.policy-heading > p,
.website-story p,
.guide-card p,
.guide-card li {
  color: var(--text-secondary, #426b78);
  line-height: 1.8;
}

.policy-section p,
.website-story p {
  margin: 0 0 12px;
}

.guide-section > .section-heading {
  align-items: flex-start;
}

.guide-section > .section-heading p {
  max-width: 720px;
  margin-top: 10px;
  color: var(--text-secondary, #426b78);
  line-height: 1.7;
}

.guide-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 980px;
}

.guide-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 20px;
  padding: clamp(20px, 4vw, 32px);
  border: 1px solid var(--border-color, #a5e7f3);
  border-radius: 22px;
  background: var(--bg-secondary, #fff);
  color: var(--text-primary, #123744);
}

.guide-card h3 {
  margin: 0 0 12px;
  color: var(--text-primary, #123744);
  font-size: clamp(20px, 3vw, 27px);
  line-height: 1.35;
}

.guide-card h4 {
  margin: 22px 0 8px;
  color: var(--text-primary, #123744);
  font-size: 17px;
}

.guide-card ul,
.guide-card ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 18px;
  padding-left: 24px;
}

.guide-card .step-number {
  color: var(--accent-color, #159bb8);
}

.guide-card .section-kicker {
  color: var(--accent-color, #159bb8);
}

.guide-card .shortcut-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border-color, #a5e7f3);
  border-radius: 16px;
  background: var(--bg-card, #d5f5fa);
}

.guide-platform,
.guide-method {
  margin-top: 16px;
  padding: clamp(14px, 3vw, 20px);
  border: 1px solid var(--border-color, #a5e7f3);
  border-radius: 16px;
  background: var(--bg-card, #d5f5fa);
}

.guide-platform h4,
.guide-method h4 {
  margin-top: 0;
}

.guide-platform > :last-child,
.guide-method > :last-child {
  margin-bottom: 0;
}

.guide-platform ol,
.guide-card > div > ol {
  padding: 14px 16px 14px 38px;
  border: 1px solid var(--border-color, #a5e7f3);
  border-radius: 14px;
  background: var(--bg-secondary, #fff);
}

.guide-platform li + li {
  margin-top: 10px;
}

.guide-instruction-image {
  display: block;
  width: min(100%, 380px);
  max-width: 100%;
  max-height: 240px;
  height: auto;
  margin: 12px auto;
  border-radius: 12px;
  object-fit: contain;
}

.guide-inline-icon {
  display: inline-block;
  width: 1.5em;
  height: 1.5em;
  vertical-align: middle;
  object-fit: contain;
}

.guide-inline-label {
  display: inline-block;
  max-width: min(100%, 180px);
  max-height: 30px;
  height: auto;
  vertical-align: middle;
  object-fit: contain;
}

.guide-add-home-label {
  max-width: min(100%, 190px);
}

.guide-install-fallback {
  margin-top: 12px !important;
  padding: 12px 14px;
  border: 1px dashed var(--border-color, #a5e7f3);
  border-radius: 12px;
  background: var(--bg-secondary, #fff);
}

.guide-install-button {
  margin-top: 4px;
}

.guide-install-manual {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border-color, #a5e7f3);
  border-radius: 14px;
  background: var(--bg-secondary, #fff);
}

.guide-install-manual h5 {
  margin: 0 0 8px;
  color: var(--text-primary, #123744);
  font-size: 15px;
}

.guide-install-manual ol {
  margin: 0;
  padding-left: 22px;
}

.guide-install-manual li + li {
  margin-top: 7px;
}

.guide-install-button,
.guide-official-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  border: 2px solid #123744 !important;
  border-radius: 24px;
  background: #123744 !important;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
}

.guide-install-button:hover,
.guide-official-link:hover {
  background: #0b2731 !important;
}

.guide-install-button:focus-visible,
.guide-official-link:focus-visible {
  outline: 3px solid #f4b942;
  outline-offset: 3px;
}

html.theme-deep-sea.dark .policy-document,
html.theme-deep-sea.dark .guide-card {
  border-color: var(--border-color, #285363);
  background: var(--bg-secondary, #173b49);
}

html.theme-deep-sea.dark .policy-section h3,
html.theme-deep-sea.dark .policy-subcontent,
html.theme-deep-sea.dark .guide-platform,
html.theme-deep-sea.dark .guide-method,
html.theme-deep-sea.dark .guide-platform ol,
html.theme-deep-sea.dark .guide-card > div > ol,
html.theme-deep-sea.dark .guide-install-fallback,
html.theme-deep-sea.dark .guide-install-manual {
  border-color: var(--border-color, #285363);
  background: var(--bg-card, #204b5a);
}

html.theme-deep-sea.dark .policy-section h2,
html.theme-deep-sea.dark .policy-section h3,
html.theme-deep-sea.dark .policy-detail h4,
html.theme-deep-sea.dark .policy-heading h1,
html.theme-deep-sea.dark .guide-card h3,
html.theme-deep-sea.dark .guide-card h4,
html.theme-deep-sea.dark .guide-install-manual h5 {
  color: var(--text-primary, #e5faff);
}

html.theme-deep-sea.dark .policy-section p,
html.theme-deep-sea.dark .policy-heading > p,
html.theme-deep-sea.dark .website-story p,
html.theme-deep-sea.dark .guide-card p,
html.theme-deep-sea.dark .guide-card li,
html.theme-deep-sea.dark .guide-section > .section-heading p {
  color: var(--text-secondary, #a5cbd5);
}

@media (max-width: 620px) {
  .guide-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .guide-card .step-number {
    font-size: 22px;
  }

  .guide-card .shortcut-panel {
    padding: 14px;
  }

  .policy-document {
    padding: 18px;
    border-radius: 16px;
  }

  .policy-section + .policy-section {
    margin-top: 26px;
    padding-top: 22px;
  }

  .policy-section h3 {
    padding: 10px 12px;
  }

  .policy-subcontent {
    padding: 12px;
  }

  .guide-instruction-image { max-height: 190px; }
}

.home-redesign {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--frame-height);
  overflow: visible;
}

body.navigation-open {
  overflow: hidden;
}

.nav-shade {
  position: fixed !important;
  z-index: 45 !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100svh !important;
}

.toast {
  position: fixed !important;
  z-index: 60 !important;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom)) !important;
  left: 16px;
  width: max-content;
  max-width: calc(100vw - 32px);
  margin: 0 auto;
  transform: none;
}

.skip-link {
  position: absolute !important;
  z-index: 100;
  top: 10px !important;
  left: 20px !important;
}

dialog {
  box-sizing: border-box;
  width: min(460px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  max-height: calc(100svh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
}

@media (min-width: 1px) {
  .nav-search,
  .mobile-menu:not([hidden]) {
    max-height: calc(100svh - 48px);
    overflow-x: hidden;
    overflow-y: auto;
  }
}

.page-back-home {
  margin: 0 0 clamp(14px, 2vh, 24px);
}

.official-section .official-heading {
  margin: 0 0 clamp(18px, 3vh, 30px);
  color: var(--text-primary, #123744);
}

.official-section .official-heading h1 {
  max-width: 28ch;
  margin: 0;
  font-size: clamp(23px, 3.3vw, 38px);
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.official-section .official-heading p {
  margin: 9px 0 0;
  color: var(--text-secondary, #426b78);
  font-size: clamp(13px, 1.45vw, 17px);
  line-height: 1.5;
}

.official-section .official-links {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(9px, 1.5vh, 15px);
  width: min(100%, 900px);
  margin: 0 auto;
}

.official-section .official-links a {
  display: grid;
  grid-template-columns: clamp(38px, 7vw, 62px) minmax(0, 1fr) clamp(18px, 4vw, 34px);
  align-items: center;
  gap: clamp(8px, 2vw, 18px);
  box-sizing: border-box;
  min-width: 0;
  min-height: clamp(54px, 7.5vh, 76px);
  padding: 6px clamp(10px, 2vw, 20px);
  border: 2px solid var(--text-primary, #123744);
  border-radius: 999px;
  background: #59cfe2;
  color: #06151a;
  font: 700 clamp(13px, 2.1vw, 23px)/1.18 Cookie, 'Noto Sans', sans-serif;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.official-section .official-links a:hover,
.official-section .official-links a:focus-visible {
  border-color: var(--accent-color, #159bb8);
}

.official-brand-icon {
  display: block;
  width: clamp(34px, 6vw, 54px);
  height: clamp(34px, 6vw, 54px);
  max-width: 100%;
  object-fit: contain;
}

.official-brand-haegin {
  border-radius: 50%;
}

.official-chevron {
  justify-self: end;
  font: 700 clamp(34px, 5vw, 54px)/.8 Arial, sans-serif;
}

.page-related-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 760px);
  margin: 12px 0 0;
}

.page-related-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 0;
  min-height: 52px;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 2px solid var(--text-primary, #123744);
  border-radius: 24px;
  background: #59cfe2;
  color: #06151a;
  text-decoration: none;
}

.page-related-links a img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.page-related-arrow {
  justify-self: end;
  font: 700 32px/.8 Arial, sans-serif;
}

.codes-related-links {
  margin-top: -8px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .official-section .official-heading h1 {
    font-size: clamp(21px, 6vw, 29px);
  }

  .official-section .official-links a {
    grid-template-columns: 38px minmax(0, 1fr) 20px;
    gap: 8px;
    min-height: 53px;
    padding-inline: 9px;
    font-size: clamp(12px, 3.6vw, 16px);
  }

  .official-brand-icon {
    width: 34px;
    height: 34px;
  }

  .official-chevron {
    font-size: 35px;
  }

  .page-related-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .page-related-links a {
    min-height: 46px;
    padding: 5px 8px;
  }

  .page-related-links a img {
    width: 32px;
    height: 32px;
  }

  .codes-related-links {
    margin-top: -7px;
    margin-bottom: 14px;
  }
}
