:root {
  --atlas-space-sm: 8px;
  --atlas-space-md: 16px;
  --atlas-space-lg: 24px;
  --atlas-touch: 44px;
  /* 고정 머리줄(측정값) + 이동 막대 높이 */
  --atlas-anchor-offset: calc(var(--lc-header-height, 64px) + 72px);
}
/* 공통 크롬 v1.1 머리줄: 앱 아이콘·이름과 테마만 두고 고정한다. 색은 지도 공방 토큰을 쓴다. */
.top[data-leeeo-header] {
  --lc-surface: var(--paper);
  --lc-ink: var(--ink);
  --lc-muted: var(--muted);
  --lc-line: var(--rule);
  --lc-s1: 4px;
  --lc-s2: 8px;
  --lc-caption: 12px;
  --lc-body: 16px;
  --lc-border: 1px;
  --lc-radius: 8px;
  --lc-touch: var(--atlas-touch);
  --lc-header-layer: 100;
  flex-wrap: nowrap;
  gap: var(--atlas-space-md);
  margin-inline: -16px;
  padding-inline: 16px;
  margin-bottom: var(--atlas-space-md);
}
.top .brand { margin: 0; min-width: 0; font-size: 20px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.25; }
.top .leeeo-app-brand { color: var(--ink); }
.top .leeeo-theme select { border-color: var(--rule-strong); background: var(--panel); }
.top :is(a, select):focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.top-tools { display: flex; justify-content: flex-end; margin-bottom: var(--atlas-space-md); }
.atlas-footer .leeeo-footer {
  --lc-ink: var(--ink);
  --lc-muted: var(--muted);
  --lc-line: var(--rule);
  --lc-focus-color: var(--accent);
  margin-top: 0;
}
.atlas-intro {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: var(--atlas-space-md) var(--atlas-space-lg);
  margin-bottom: var(--atlas-space-md);
  font-size: 17px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.atlas-lead { font-size: 24px; font-weight: 700; margin: 0 0 var(--atlas-space-sm); }
.atlas-intro summary { cursor: pointer; padding-block: var(--atlas-space-sm); color: var(--muted); }
.atlas-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--atlas-space-lg);
  list-style: none;
  padding: 0;
  margin: var(--atlas-space-md) 0;
}
.atlas-steps p { margin: var(--atlas-space-sm) 0 0; }
.atlas-steps .btn { font-size: 17px; }
.atlas-detail { max-width: 75ch; color: var(--muted); }
.atlas-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--atlas-space-sm);
  position: sticky;
  top: var(--lc-header-height, 0px);
  z-index: 10;
  background: var(--paper);
  padding-block: var(--atlas-space-sm);
  margin-bottom: var(--atlas-space-md);
  border-bottom: 1px solid var(--rule);
}
.atlas-nav a { margin-left: auto; padding: var(--atlas-space-sm); color: var(--ink); }
.atlas-nav .btn, .atlas-nav a, .atlas-intro .btn { min-height: var(--atlas-touch); }
.atlas-nav .btn { font-size: 15px; }
.atlas-footer {
  max-width: 75ch;
  margin: var(--atlas-space-lg) auto;
  padding: var(--atlas-space-md);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.atlas-footer a { color: inherit; }
#atlas-settings, #atlas-preview, #slide, #q, #dataText, #pinText, #saveWork {
  scroll-margin-top: var(--atlas-anchor-offset);
}
.atlas-nav a:focus-visible, .atlas-intro summary:focus-visible,
.atlas-footer a:focus-visible, .atlas-skip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.atlas-skip {
  position: absolute;
  top: -100%;
  left: var(--atlas-space-md);
  z-index: 110; /* 고정 머리줄 위 */
  min-height: var(--atlas-touch);
  padding: var(--atlas-space-sm) var(--atlas-space-md);
  background: var(--on);
  color: var(--on-ink);
  border: 0;
  border-radius: 8px;
  font: inherit;
}
.atlas-skip:focus { top: var(--atlas-space-sm); }
.ptabs { top: var(--lc-header-height, 0px); }
.stage { top: calc(var(--lc-header-height, 0px) + 12px); }
@media (max-width: 900px) {
  .atlas-steps { grid-template-columns: minmax(0, 1fr); }
}
/* 손가락으로 쓰는 화면: 원본 고밀도 조작부의 높이만 44px로 키운다. 데스크톱 마우스 화면은 원본 밀도를 유지한다. */
@media (max-width: 900px), (pointer: coarse) {
  .btn, .seg button, .chip, .tabs button, .ptabs button, .crumbs button, .decklist .open, .decklist .x {
    min-height: var(--atlas-touch);
  }
  .btn { min-width: var(--atlas-touch); }
  .chk, .map-control-row .chk { min-height: var(--atlas-touch); display: inline-flex; align-items: center; }
  .chk input[type="checkbox"] { width: 20px; height: 20px; }
}
@media (max-width: 560px) {
  .atlas-intro { padding: var(--atlas-space-md); }
  .atlas-lead { font-size: 24px; }
  .atlas-nav { gap: 0; }
  /* 320px: 44px 단추 네 개가 한 줄을 넘으면 다음 줄로 */
  .seg { flex-wrap: wrap; }
  .atlas-nav .btn { padding-inline: var(--atlas-space-sm); }
  .atlas-nav a { font-size: 15px; }
}
