:root {
  --editorial-canvas-max: 1360px;
  --editorial-canvas-gutter: 24px;
}

/* Premiere main (.masthead / .editorial-nav) 과 동일 시각 계약
   Cooling·Lab·Business 등 서브페이지 진입 시 네비 붕괴 방지 (2026-08-06)
   2026-08-07: tokens 연동 + 로컬 2중 헤더 정리 + 모바일 메뉴 가독성 */
.journal-global-masthead {
  position: sticky;
  z-index: 80;
  top: 0;
  width: 100%;
  margin-inline: auto;
  padding: 22px 0 0;
  border-bottom: 0;
  background: var(--paper, #f6f5f1);
  backdrop-filter: none;
  color: var(--ink, #111216);
}

.journal-global-masthead__top {
  display: flex;
  min-height: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.journal-global-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.025em;
  white-space: nowrap;
}

.journal-global-wordmark img { width: 26px; height: 26px; }

.journal-global-utility,
.journal-global-nav {
  display: flex;
  align-items: center;
  white-space: nowrap;
}

/* 유틸 = 메인 .account-nav 와 동일 계약 (SEARCH SHOP CART MY + theme) */
.journal-global-utility {
  flex: 0 0 auto;
  flex-shrink: 0;
  gap: 14px;
  overflow: visible;
  font: 11px/1.2 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .07em;
}
.journal-global-utility a,
.journal-global-utility button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.journal-global-utility .theme-toggle,
.journal-global-utility [data-theme-toggle] {
  padding: 2px 7px;
  border: 1px solid var(--ink, #111216);
  line-height: 1.2;
}
/* 로컬 2차 바 = 메인의 ticker 자리(높이·모노·우측정렬) */
.journal-global-masthead + :is(.lab-header, .business-header, .story-header, .archive-header, .library-head, .corrections-head) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 43px;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--ink, #111216);
  border-bottom: 1px solid var(--ink, #111216);
  background: var(--paper, #f6f5f1);
  box-sizing: border-box;
}
.journal-global-masthead + :is(.lab-header, .business-header, .story-header, .archive-header) nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px 22px;
  width: 100%;
  padding: 12px 0;
  font: 10px/1.2 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.journal-global-masthead + :is(.lab-header, .business-header, .story-header, .archive-header) nav a {
  color: var(--grey, #5d626d);
  text-decoration: none;
  border: 0;
  padding: 0;
  min-height: 0;
}
.journal-global-masthead + :is(.lab-header, .business-header, .story-header, .archive-header) nav a:hover {
  color: var(--ink, #111216);
}

/* 9개 1차 메뉴 — 메인 .editorial-nav 와 동일 타이포 계약 (20260808-nav1)
   실측 회귀: 메인은 15.8px/800/-0.01em, 서브는 18px/900/-0.045em 으로 어긋남 */
.journal-global-nav {
  display: flex;
  gap: clamp(8px, 1.05vw, 20px);
  min-height: 0;
  width: 100%;
  margin-top: 22px;
  border-top: 0;
  border-bottom: 1px solid var(--ink, #111216);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.journal-global-nav::-webkit-scrollbar { height: 4px; }
.journal-global-nav::-webkit-scrollbar-thumb { background: rgba(17, 18, 22, .25); }

.journal-global-nav a {
  position: relative;
  display: block;
  flex: 0 0 auto;
  min-height: 0;
  padding-bottom: 13px;
  place-items: unset;
  font-size: clamp(13px, 1.1vw, 17px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.01em;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.journal-global-nav a::after {
  content: "";
  position: absolute;
  right: 100%;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--lime, #a9ef2d);
  transition: right .2s ease;
}

.journal-global-nav a:hover::after,
.journal-global-nav a[aria-current="page"]::after,
.journal-global-nav a.is-active::after { right: 0; }

/* 글로벌 마스트헤드 아래 로컬 헤더 — 브랜드 숨김, 바 스타일은 위 계약 */
.journal-global-masthead + :is(.story-header, .archive-header, .lab-header, .business-header, .library-head, .corrections-head) {
  position: static;
}

.journal-global-masthead + .story-header .story-wordmark,
.journal-global-masthead + .archive-header .archive-wordmark,
.journal-global-masthead + .lab-header .lab-brand,
.journal-global-masthead + .business-header .business-brand,
.journal-global-masthead + .library-head .library-brand { display: none; }

/* story commerce — story.css only pages (no media.css) still styled */
.story-commerce {
  margin-top: 22px;
  padding: 16px 0 0;
  border-top: 1px solid var(--hairline, #c8c8c2);
}
.story-commerce > p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 10px;
  color: var(--grey, #5d626d);
  font-size: 13px;
  line-height: 1.45;
}
.story-commerce > p span {
  font: 800 10px/1.2 ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .12em;
  color: var(--ink, #111216);
}
.story-commerce__links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.story-commerce__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--ink, #111216);
  background: var(--surface, #fff);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  word-break: keep-all;
}
.story-commerce__links a:hover { background: var(--lime, #a9ef2d); }
.story-commerce__links a[data-commerce-relation="category"] {
  background: var(--ink, #111216);
  color: #fff;
}
.story-commerce__links a[data-commerce-relation="category"]:hover {
  background: #2a2d36;
  color: var(--lime, #a9ef2d);
}

@media (max-width: 1120px) {
  .journal-global-masthead__top,
  .journal-global-nav { padding-inline: clamp(16px, 3.8vw, 42px); }
}

@media (max-width: 620px) {
  .journal-global-utility a:nth-child(n+3) { display: none; }
  .journal-global-nav {
    gap: 12px;
    padding-right: 28px;
    scroll-padding-inline: 16px;
    mask-image: linear-gradient(90deg, #000 86%, transparent);
  }
  .journal-global-nav a {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    padding-bottom: 11px;
  }
  .journal-global-masthead + :is(.story-header, .archive-header, .lab-header, .business-header, .library-head, .corrections-head) {
    align-items: stretch;
    justify-content: flex-start;
  }
  .story-commerce__links a { font-size: 12.5px; }
}

@media (min-width: 1121px) {
  :root {
    --editorial-canvas: min(
      calc(100% - (2 * var(--editorial-canvas-gutter))),
      var(--editorial-canvas-max)
    );
    --page: var(--editorial-canvas);
    --max: var(--editorial-canvas-max);
  }

  :is(
    .masthead,
    .journal-global-masthead,
    .story-header,
    .archive-header,
    .lab-header,
    .business-header,
    .library-head,
    .corrections-head,
    .site-head
  ),
  body > main:not(#main),
  body > footer {
    width: var(--editorial-canvas);
    margin-inline: auto;
  }

  .benchmark-shell { width: 100%; }

  .journal-global-masthead__top,
  .journal-global-nav { padding-inline: 0; }

  .site-head { padding-inline: 0; }

  .prototype-note {
    padding-inline: max(
      var(--editorial-canvas-gutter),
      calc((100vw - var(--editorial-canvas-max)) / 2)
    );
  }

  .open-edition .corrections {
    margin-inline: 0;
    padding-inline: 0;
  }
}
