/* Palette tokens shared with admin.css live in css/tokens.css, imported by
 * styles.css ahead of this file. Only workspace-specific tokens belong here. */
:root {
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --danger: #c2410c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  /* docs/plans/ROADMAP.md §2.1 U-2: Inter has no Hangul glyphs and neither
   * face is shipped as a webfont, so a Hangul-incapable face listed first
   * meant every Korean glyph silently fell through to whatever CJK font the
   * OS happened to have -- and on machines with Inter installed, numbers and
   * Latin rendered in Inter while adjacent Korean rendered in the OS
   * fallback, visibly mismatched. Reordering (a Hangul-capable face first)
   * was only the minimum fix -- "Pretendard" still wasn't served by anything,
   * so it never matched either and the same per-glyph split kept happening one
   * face further down the stack. The fuller fix is now done: css/tokens.css
   * declares @font-face for 'Pretendard' against a self-hosted variable woff2
   * (frontend/assets/fonts/), so this first name actually resolves. */
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  font-size: var(--fs-4);
  line-height: var(--lh-base);
}

header {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
}

body[data-workspace-view="testing"] header {
  position: static;
}

/* U-10 (docs/plans/ROADMAP.md §2.1): snapped from 1024px to ≤1180px, the same
 * tier css/modals.css's nav-collapse breakpoint now uses -- the header stops
 * being sticky at the same width the nav chrome it's sticky above goes
 * compact. */
@media (max-width: 1180px) {
  header {
    position: static;
  }
}

[hidden] { display: none !important; }

.nav {
  max-width: 1280px;
  margin: auto;
  padding: 12px 20px;
  display: grid;
  grid-template-columns: minmax(128px, 180px) minmax(220px, 280px) max-content minmax(0, 1fr);
  align-items: center;
  gap: 12px 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  min-width: 0;
}

.workspace-mode-switcher {
  position: relative;
  min-width: 0;
  grid-column: 1;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}

.workspace-mode-toggle {
  width: auto;
  max-width: 100%;
  padding: 4px 8px 4px 3px;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--rail-radius);
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.workspace-mode-toggle:not(.single-mode):hover,
.workspace-mode-toggle[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--surface-muted);
}

.workspace-mode-toggle.single-mode { cursor: default; }

.brand-copy {
  min-width: 0;
  display: block;
}

.brand-copy b {
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-4);
}

.brand img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(10, 189, 163, .22);
}

.brand-copy small {
  color: var(--brand-dark);
  font-size: var(--fs-1);
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-chevron {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  transition: transform .18s ease;
}

.workspace-mode-toggle[aria-expanded="true"] .mode-chevron { transform: rotate(180deg); }
.workspace-mode-toggle.single-mode .mode-chevron { visibility: hidden; }

.workspace-mode-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  width: 250px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.workspace-mode-item {
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  border-radius: var(--control-radius);
  text-decoration: none;
}

.workspace-mode-item:hover,
.workspace-mode-item.active { background: var(--brand-soft); }
.workspace-mode-item span { min-width: 0; display: grid; gap: 3px; }
.workspace-mode-item b { font-size: var(--fs-3); }
.workspace-mode-item small { color: var(--muted); font-size: var(--fs-1); }
.workspace-mode-item i { color: var(--brand-dark); font-style: normal; }

.workspace-account-switcher {
  position: relative;
  min-width: 220px;
  grid-column: 2;
}

.steps {
  grid-column: 3;
  min-width: 0;
}

.header-actions {
  grid-column: 4;
}

.workspace-account-toggle {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--rail-radius);
  color: var(--text);
  background: var(--surface-strong);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.workspace-account-toggle:hover,
.workspace-account-toggle[aria-expanded="true"] {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.workspace-account-toggle .workspace-account-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.workspace-account-toggle b,
.workspace-account-toggle small {
  overflow-wrap: anywhere;
  white-space: normal;
}

.workspace-account-toggle b { font-size: var(--fs-3); }
.workspace-account-toggle small { color: var(--muted); font-size: var(--fs-1); }
.workspace-account-toggle[aria-expanded="true"] .mode-chevron { transform: rotate(180deg); }

.workspace-account-menu {
  position: absolute;
  z-index: 35;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  max-height: min(420px, calc(100vh - 96px));
  overflow: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--row-radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.workspace-account-item {
  width: 100%;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--control-radius);
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.workspace-account-item:hover,
.workspace-account-item.current { background: var(--brand-soft); }

.workspace-account-item:disabled {
  cursor: default;
}

.workspace-account-item span {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.workspace-account-item b,
.workspace-account-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-account-item b { font-size: var(--fs-3); }
.workspace-account-item small { color: var(--muted); font-size: var(--fs-1); }
.workspace-account-item i { color: var(--brand-dark); font-size: var(--fs-1); font-style: normal; }

.workspace-account-menu-actions {
  margin-top: 6px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.workspace-account-create {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--control-radius);
  color: var(--brand-dark);
  background: var(--brand-soft);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.workspace-account-create:hover {
  border-color: var(--brand);
  background: #fff;
}

.steps {
  display: flex;
  min-width: 0;
  justify-content: flex-start;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.header-actions {
  justify-self: end;
  min-width: 0;
  padding-left: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  border-left: 1px solid var(--line);
}

.notification-badge {
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(10, 189, 163, .32);
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.notification-badge span {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-dark);
  font-size: var(--fs-1);
  line-height: 1;
}

.notification-badge b {
  min-width: 1ch;
  font-size: var(--fs-2);
  line-height: 1;
}

.notification-badge:hover,
.notification-badge:focus-visible {
  border-color: var(--brand);
  background: #fff;
}

.steps button,
.tabs button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: none;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
}

.steps button {
  flex: 0 0 auto;
}

.steps button:hover {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-muted);
}

.steps button.active {
  color: var(--brand-dark);
  border-color: rgba(10, 189, 163, .35);
  background: var(--brand-soft);
}

/* 계정(프로필·관리자·로그아웃)과 워크스페이스 전환이 예전엔 각자 토글+메뉴를 가져
   레일에 아바타+이름 상자가 위아래로 두 번 섰다. 2026-08-09에 워크스페이스 전환
   토글(.workspace-account-toggle) 하나로 합쳤다 -- 이 파일 위쪽 .workspace-account-*
   규칙이 그 토글/메뉴/목록이고, 아래 .account-menu-head/-free-runs/-item/-actions는
   합쳐진 메뉴 안에서 재사용하는 조각들이다. */
.account-avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-dark);
  font-size: var(--fs-2);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-menu-head {
  padding: 8px 10px 10px;
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.account-menu-head b,
.account-menu-head small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-head b { font-size: var(--fs-3); }
.account-menu-head small { color: var(--muted); font-size: var(--fs-1); }
.account-menu-head .badge { justify-self: start; margin-top: 3px; }

.account-menu-free-runs {
  margin: 0 0 6px;
  padding: 8px 10px;
  border-radius: var(--row-radius, 6px);
  font-size: var(--fs-1);
  font-weight: 600;
  line-height: 1.4;
  background: var(--surface-soft, #f4f5f4);
  color: var(--text);
}
.account-menu-free-runs[data-tone="low"] {
  background: var(--warning-soft);
  color: var(--warning);
}
.account-menu-free-runs[data-tone="exhausted"] {
  background: var(--warning-soft);
  color: var(--danger);
}

.account-menu-item {
  width: 100%;
  min-height: 40px;
  padding: 10px;
  display: flex;
  align-items: center;
  border: 0;
  border-radius: var(--control-radius);
  color: var(--text);
  background: transparent;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-menu-item:hover,
.account-menu-item:focus-visible { background: var(--brand-soft); }
.account-menu-item.active { color: var(--brand-dark); background: var(--brand-soft); }

.account-menu-actions {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

#logout { color: var(--muted); }
