/* 모든 화면이 함께 쓰는 바탕 · 머리 · 버튼 · 배지. 색과 글꼴은 /static/design/tokens.css의 변수만 쓴다. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--size-body);
  line-height: var(--line-height-body);
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--purple-text);
}

code,
pre,
kbd,
samp,
.mono {
  font-family: var(--font-mono);
}

h1,
h2,
h3 {
  line-height: 1.25;
}

/* 한글은 낱말 단위로 줄을 바꾼다(제목 끝 글자 하나가 홀로 남지 않게) */
h1,
h2,
h3,
p,
dt,
li,
.lab-card-title,
.lab-card-text {
  word-break: keep-all;
  overflow-wrap: break-word;
}

[hidden] {
  display: none !important;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* 무대(잉크) */
.stage {
  background: var(--ink);
  color: var(--stage-text);
}

.stage a {
  color: var(--purple-light);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--size-tag);
  letter-spacing: var(--tracking-tag);
  color: var(--purple-light);
}

.eyebrow-work {
  color: var(--purple-text);
}

/* 공통 머리 */
.site-head {
  border-bottom: 1px solid var(--stage-line);
}

.site-head .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.stage .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.logo-top { fill: var(--purple-light); }
.logo-mid { fill: none; stroke: var(--stage-text); stroke-width: 1.6; }
.logo-low { fill: none; stroke: var(--map-route); stroke-width: 1.6; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  font-size: 15px;
}

.stage .site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  padding: 0 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--stage-text-sub);
}

.stage .site-nav a[aria-current="page"] {
  color: var(--white);
  background: var(--stage-line);
}

.stage .site-nav a[aria-disabled="true"] {
  color: var(--stage-text-dim);
  cursor: not-allowed;
}

.stage .site-nav a.nav-login {
  margin-left: 8px;
  padding: 0 18px;
  border: 1px solid var(--stage-line-strong);
}

/* 로그인한 머리: 이메일 앞부분과 로그아웃 단추 */
.stage .site-nav .nav-user {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  margin-left: 8px;
  padding: 0 6px 0 10px;
  color: var(--stage-text);
  font-family: var(--font-mono);
  font-size: var(--size-sub);
  max-width: 14em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage .site-nav button.nav-login {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  margin-left: 4px;
  padding: 0 18px;
  border: 1px solid var(--stage-line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--stage-text-sub);
  font: inherit;
  cursor: pointer;
}

.stage .site-nav button.nav-login:focus-visible {
  outline: 2px solid var(--purple-light);
  outline-offset: 2px;
}

/* 버튼: 알약. 주 = 보라, 보조 = 옅은 보라, 기본 = 흰 바탕 테두리, 무대 보조 = 투명 흰 테두리 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--touch);
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-input);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn-primary {
  min-height: var(--touch-main);
  padding: 0 22px;
  border: 0;
  background: var(--purple);
  color: var(--white);
  font-size: var(--size-body);
  font-weight: 700;
}

.stage a.btn-primary {
  color: var(--white);
}

.btn-soft {
  border: 0;
  background: var(--purple-soft);
  color: var(--purple-text);
  font-weight: 500;
}

.btn-ghost {
  min-height: var(--touch-main);
  padding: 0 22px;
  background: transparent;
  border-color: var(--stage-line-strong);
  color: var(--stage-text);
  font-weight: 500;
}

.stage a.btn-ghost {
  color: var(--stage-text);
}

.btn:focus-visible,
.stage .site-nav a:focus-visible,
a:focus-visible {
  outline: 2px solid var(--purple-light);
  outline-offset: 2px;
}

.arrow {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

/* 상태 배지: 점 6px + 글자. 칸 전체를 칠하지 않는다. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--size-tag);
  font-weight: 600;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--text-muted);
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neutral-dot);
}

.badge-ok { background: var(--ok-bg); color: var(--ok-text); }
.badge-ok::before { background: var(--ok-dot); }
.badge-fail { background: var(--fail-bg); color: var(--fail-text); }
.badge-fail::before { background: var(--fail-dot); }
.badge-warn { background: var(--warn-bg); color: var(--warn-text); }
.badge-warn::before { background: var(--warn-dot); }

.tag-soft {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--purple-soft);
  color: var(--purple-text);
  font-size: var(--size-tag);
  font-weight: 500;
}

.tag-neutral {
  background: var(--neutral-soft);
  color: var(--text-muted);
}

/* 작업대 칸 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 22px;
}

.card h2 {
  margin: 0;
  font-size: var(--size-card-title);
}

.site-foot {
  border-top: 1px solid var(--line);
  background: var(--surface);
  font-size: var(--size-sub);
  color: var(--text-muted);
}

.site-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.site-foot a {
  color: var(--text-muted);
}

.site-foot a:hover {
  color: var(--text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* 통과 증표 옮기기 알림 칸: 로그인한 머리 바로 아래, 작업대 칸 모양 */
.merge-slot[hidden] {
  display: none;
}

.merge-slot {
  padding-bottom: 16px;
}

.merge-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 18px;
  border-radius: var(--radius-inner);
  background: var(--surface);
  color: var(--text);
  font-size: var(--size-sub);
}

.merge-notice p {
  margin: 0;
  flex: 1 1 320px;
  line-height: var(--line-height-body);
}

.merge-notice .merge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.merge-notice a {
  color: var(--purple-text);
}

/* 위치 줄: 「로봄 › 구역 › 실습실」. 마지막 칸만 aria-current="page"이고 링크가 아니다. */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 16px;
  font-size: var(--size-sub);
}

.crumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  color: var(--stage-text-dim);
}

.crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.crumbs li + li::before {
  content: "›";
  color: var(--stage-text-dim);
}

.stage .crumbs a {
  color: var(--stage-text-sub);
  text-decoration: none;
}

.stage .crumbs a:hover {
  color: var(--white);
}

.crumbs [aria-current="page"] {
  color: var(--white);
  font-weight: 500;
}

.stage .crumbs .crumbs-aside {
  color: var(--purple-light);
  font-weight: 500;
}
