:root[data-theme="light"] {
  --app-canvas: #f2f4f0;
  --app-panel: #ffffff;
  --app-panel-soft: #f7f8f5;
  --app-panel-strong: #edf0ea;
  --app-nav: #151a16;
  --app-nav-soft: #222a23;
  --app-nav-text: #f2f5f0;
  --app-nav-muted: #9ba59d;
  --app-ink: #182019;
  --app-muted: #68716a;
  --app-faint: #8b958d;
  --app-line: #dce1da;
  --app-accent: #2c6d4b;
  --app-accent-soft: #e2f0e7;
  --app-shadow: rgba(29, 43, 32, .07);
  --app-shadow-strong: rgba(29, 43, 32, .12);
  /* 상태는 브랜드 색과 분리한다. 브랜드가 초록이라 초록으로 정상을 말할 수 없다. */
  --app-warn: #8a5d12;
  --app-warn-soft: #f6ecd8;
  --app-crit: #a6413a;
  --app-crit-soft: #f7e3e1;
}

:root[data-theme="dark"] {
  --app-canvas: #0d0f0d;
  --app-panel: #171a17;
  --app-panel-soft: #1e221e;
  --app-panel-strong: #272c27;
  --app-nav: #101310;
  --app-nav-soft: #1d231e;
  --app-nav-text: #f2f5f0;
  --app-nav-muted: #8d978f;
  --app-ink: #edf1eb;
  --app-muted: #a5aea6;
  --app-faint: #7f8980;
  --app-line: #303630;
  --app-accent: #75c995;
  --app-accent-soft: #193326;
  --app-shadow: rgba(0, 0, 0, .3);
  --app-shadow-strong: rgba(0, 0, 0, .48);
  --app-warn: #e0a94a;
  --app-warn-soft: #33280f;
  --app-crit: #e0837a;
  --app-crit-soft: #331d1b;
}

body.app-page {
  margin: 0;
  min-width: 320px;
  color: var(--app-ink);
  background: var(--app-canvas);
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 242px minmax(0, 1fr);
  background: var(--app-canvas);
}

/* 탐색이 뷰포트보다 길어도 화면 전체를 밀지 않는다. 사이드바만 스크롤하고
   계정은 아래에 붙어 있는다. */
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  min-height: 0;
  padding: 20px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--app-nav-text);
  background: var(--app-nav);
}

/* 탐색만 스크롤한다. 사이드바 자체는 자르지 않아야 계정 메뉴가 밖으로 열린다. */
.app-nav-scroll {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.app-brand {
  padding: 0 8px 8px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.app-brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--app-nav);
  background: var(--app-nav-text);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.04em;
}

.app-brand-copy { display: grid; gap: 2px; }
.app-brand-copy strong { font-size: 14px; line-height: 1.2; }
.app-brand-copy span { color: var(--app-nav-muted); font-size: 11px; }
.app-nav-group { display: grid; gap: 5px; }
.app-nav-label { padding: 0 10px 5px; color: var(--app-nav-muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }

.app-nav-link,
.app-nav-disabled {
  min-height: 39px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--app-nav-muted);
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.app-nav-link:hover { color: var(--app-nav-text); background: var(--app-nav-soft); }
.app-nav-link[aria-current="page"] { color: var(--app-nav-text); background: var(--app-nav-soft); box-shadow: inset 3px 0 0 var(--app-accent); }
.app-nav-icon {
  width: 17px;
  height: 17px;
  flex: none;
  display: inline-grid;
  place-items: center;
  font-size: 15px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}
.app-nav-icon[data-icon="overview"]::before { content: "▦"; }
.app-nav-icon[data-icon="trend"]::before { content: "↗"; }
.app-nav-icon[data-icon="bookmark"]::before { content: "◇"; }
.app-nav-icon[data-icon="report"]::before { content: "▤"; }
.app-nav-icon[data-icon="activity"]::before { content: "∿"; }
.app-nav-icon[data-icon="knowledge"]::before { content: "▥"; }
.app-nav-icon[data-icon="agent"]::before { content: "◎"; }
.app-nav-icon[data-icon="chat"]::before { content: "⌁"; }
.app-nav-icon[data-icon="skill"]::before { content: "✦"; }
.app-nav-icon[data-icon="sandbox"]::before { content: "□"; }
.app-nav-icon[data-icon="arrow"]::before { content: "→"; }
.app-nav-text { min-width: 0; flex: 1; }
.app-nav-count,
.app-nav-later { padding: 2px 6px; border-radius: 999px; font-size: 10px; font-variant-numeric: tabular-nums; }
.app-nav-count { color: var(--app-nav-text); background: var(--app-nav-soft); }
.app-nav-later { border: 1px solid color-mix(in srgb, var(--app-nav-muted) 35%, transparent); }
.app-nav-disabled { opacity: .56; cursor: default; }

/* 좌하단은 계정 자리다. 메뉴는 위로 열린다. */
.app-account { position: relative; flex: none; }
.app-account > summary {
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
}
.app-account > summary::-webkit-details-marker { display: none; }
.app-account > summary:hover,
.app-account[open] > summary { background: var(--app-nav-soft); }
.app-account > summary:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -2px; }
.app-account-copy { min-width: 0; display: grid; gap: 1px; }
.app-account-copy strong { overflow: hidden; color: var(--app-nav-text); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.app-account-copy span { color: var(--app-nav-muted); font-size: 10px; }
.app-account-caret { margin-left: auto; color: var(--app-nav-muted); font-size: 13px; line-height: 1; }
.app-account[open] .app-account-caret { transform: rotate(180deg); }

.app-account-menu {
  position: absolute;
  z-index: 120;
  bottom: calc(100% + 7px);
  left: 0;
  width: 232px;
  padding: 11px;
  display: grid;
  gap: 11px;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: 12px;
  box-shadow: 0 18px 44px var(--app-shadow-strong);
}
.app-account-label { display: block; margin-bottom: 6px; color: var(--app-faint); font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.app-account-menu a {
  padding: 8px 9px;
  display: block;
  color: var(--app-ink);
  border-radius: 8px;
  font-size: 12.5px;
  text-decoration: none;
}
.app-account-menu a:hover { background: var(--app-panel-soft); }
.app-account-menu hr { height: 1px; margin: 0; background: var(--app-line); border: 0; }

.app-segmented { display: grid; grid-auto-flow: column; gap: 3px; padding: 3px; background: var(--app-panel-soft); border-radius: 9px; }
.app-segmented button {
  min-height: 30px;
  padding: 0 4px;
  color: var(--app-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
}
.app-segmented button[aria-pressed="true"] { color: var(--app-ink); background: var(--app-panel); box-shadow: 0 1px 3px var(--app-shadow); }
.app-segmented button:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -2px; }

.app-stage { min-width: 0; min-height: 100dvh; }
.app-topbar {
  min-height: 64px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background: color-mix(in srgb, var(--app-panel) 95%, transparent);
  border-bottom: 1px solid var(--app-line);
}

/* topbar가 페이지 이름을 겸한다. 본문에서 제목을 반복하지 않는다. */
.app-top-context { min-width: 0; display: flex; align-items: baseline; gap: 8px; color: var(--app-faint); font-size: 12px; }
.app-top-context strong { color: var(--app-ink); font-size: 16px; font-weight: 750; letter-spacing: -.015em; }
.app-top-slot { margin-left: auto; display: flex; align-items: center; gap: 10px; color: var(--app-muted); font-size: 12px; }
.app-top-link { padding: 6px 11px; color: var(--app-ink); background: var(--app-panel-soft); border: 1px solid var(--app-line); border-radius: 8px; font-size: 12px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.app-top-link:hover { border-color: color-mix(in srgb, var(--app-accent) 40%, var(--app-line)); }
.app-top-actions { display: flex; align-items: center; gap: 8px; }
.app-status-dot { width: 7px; height: 7px; background: var(--app-accent); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb, var(--app-accent) 14%, transparent); }
.app-avatar { width: 30px; height: 30px; display: grid; place-items: center; color: var(--app-nav-text); background: color-mix(in srgb, var(--app-nav-text) 14%, transparent); border-radius: 50%; font-size: 11px; font-weight: 700; }

/* 우상단은 알림 자리다. 보고할 게 없으면 뱃지를 그리지 않는다. */
.app-alerts { position: relative; }
.app-alerts > summary {
  width: 34px;
  height: 34px;
  position: relative;
  display: grid;
  place-items: center;
  color: var(--app-muted);
  border-radius: 9px;
  cursor: pointer;
  list-style: none;
}
.app-alerts > summary::-webkit-details-marker { display: none; }
.app-alerts > summary:hover,
.app-alerts[open] > summary { color: var(--app-ink); background: var(--app-panel-soft); }
.app-alerts > summary:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -2px; }
.app-alerts svg { width: 17px; height: 17px; display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.app-alert-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: none;
  place-items: center;
  color: var(--app-panel);
  background: var(--app-warn);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.app-alerts[data-count] .app-alert-count { display: grid; }
.app-alert-menu {
  position: absolute;
  z-index: 120;
  top: calc(100% + 7px);
  right: 0;
  width: min(340px, calc(100vw - 28px));
  padding: 6px;
  display: grid;
  gap: 2px;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: 12px;
  box-shadow: 0 18px 44px var(--app-shadow-strong);
}
.app-alert-item {
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  color: inherit;
  border-radius: 8px;
  text-decoration: none;
}
.app-alert-item:hover { background: var(--app-panel-soft); }
.app-alert-item > i { align-self: stretch; border-radius: 2px; background: var(--app-warn); }
.app-alert-item[data-sev="crit"] > i { background: var(--app-crit); }
.app-alert-item div { min-width: 0; display: grid; gap: 2px; }
.app-alert-item strong { font-size: 12.5px; font-weight: 650; }
.app-alert-item span { color: var(--app-faint); font-size: 11px; }
.app-alert-empty { padding: 14px 11px; color: var(--app-faint); font-size: 12px; }
.app-mobile-brand,
.app-mobile-menu,
.app-mobile-nav { display: none; }

.app-shell .site-shell,
.app-shell .live-shell {
  width: auto;
  max-width: none;
  min-height: 0;
  margin: 0;
  padding: 24px 28px 18px;
}

.app-shell .section-nav { display: none; }
.app-shell .site-footer { margin-top: 16px; }
.app-scroll-page .app-stage { min-height: 100dvh; }
.app-fixed-page { height: 100%; overflow: hidden; }
.app-fixed-page .app-shell,
.app-fixed-page .app-stage { height: 100dvh; min-height: 0; }
.app-fixed-page .app-stage { display: grid; grid-template-rows: 64px minmax(0, 1fr); }
.app-fixed-page .site-shell { height: 100%; }
.app-fixed-page .section-header { margin: 0 0 12px; align-items: center; }
.app-fixed-page .section-header .section-eyebrow { margin-bottom: 4px; color: var(--app-accent); }
.app-fixed-page .section-header .section-title { font-size: 28px; line-height: 1.1; }
.app-fixed-page .section-header .section-intro { max-width: 520px; color: var(--app-muted); }


.app-scroll-page:not(.live-page) .app-shell .section-header { margin: 10px 0 18px; }
.app-scroll-page:not(.live-page) .app-shell .section-title { font-size: 34px; line-height: 1.1; }
.app-scroll-page:not(.live-page) .app-shell .content-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; border-top: 0; }
.app-scroll-page:not(.live-page) .app-shell .content-item { min-height: 210px; padding: 18px; display: flex; flex-direction: column; background: var(--app-panel); border: 1px solid var(--app-line); border-radius: 14px; box-shadow: 0 8px 22px var(--app-shadow); }
.app-scroll-page:not(.live-page) .app-shell .content-title { margin: 12px 0 10px; font-size: 20px; }
.app-scroll-page:not(.live-page) .app-shell .content-summary { display: -webkit-box; overflow: hidden; color: var(--app-muted); font-size: 13px; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
/* `app-dashboard-page`는 `app-fixed-page`와 규칙이 같아 통합했다. 모바일에서 문서
   스크롤로 돌아가는 화면만 `app-mobile-scroll`을 함께 선언한다. Trends·Bookmarks는
   모바일에서도 master-detail을 유지하므로 선언하지 않는다. */

.agents-shell { max-width: 1080px; min-height: 0; display: flex; flex-direction: column; }
.agents-gateway { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; color: var(--app-accent); background: var(--app-accent-soft); border-radius: 999px; font-size: 11px; font-weight: 700; }
.agents-gateway.is-offline { color: var(--app-crit); background: var(--app-crit-soft); }
.agents-gateway.is-offline .app-status-dot { background: var(--app-crit); box-shadow: none; }
.agents-error { margin: -4px 0 14px; padding: 11px 13px; color: var(--app-crit); background: var(--app-crit-soft); border: 1px solid color-mix(in srgb, var(--app-crit) 34%, var(--app-line)); border-radius: 10px; font-size: 12px; }
.agents-summary { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.agents-summary article { min-height: 78px; padding: 14px 16px; display: grid; align-content: space-between; background: var(--app-panel); border: 1px solid var(--app-line); border-radius: 12px; }
.agents-summary span { color: var(--app-muted); font-size: 11px; }
.agents-summary strong { font-size: 25px; line-height: 1; }
.agents-workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .85fr); grid-template-rows: minmax(0, 1fr) auto; gap: 14px; }
.agents-catalog { overflow: hidden; }
.agents-catalog { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); grid-row: span 2; }
.agents-catalog-head { min-height: 62px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--app-line); }
.agents-catalog-head h2 { margin: 0; font-size: 15px; }
.agents-catalog-head p { margin: 3px 0 0; color: var(--app-faint); font-size: 11px; }
.agents-catalog-head > span { color: var(--app-faint); font-size: 11px; }
.agents-list { min-height: 0; display: grid; align-content: start; overflow: auto; }
.agent-row { width: 100%; min-height: 118px; padding: 18px; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: start; gap: 14px; color: inherit; background: transparent; border: 0; border-bottom: 1px solid var(--app-line); font: inherit; text-align: left; cursor: pointer; transition: background .16s ease, box-shadow .16s ease; }
.agent-row:last-child { border-bottom: 0; }
.agent-row:hover { background: var(--app-panel-soft); }
.agent-row[aria-pressed="true"] { background: var(--app-accent-soft); box-shadow: inset 3px 0 var(--app-accent); }
.agent-row:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--app-accent); outline-offset: -3px; }
.agent-mark { width: 44px; height: 44px; display: grid; place-items: center; color: var(--app-nav-text); background: var(--app-nav); border-radius: 12px; font-size: 12px; font-weight: 750; }
.agent-copy { min-width: 0; }
.agent-copy h2 { margin: 0; font-size: 15px; }
.agent-copy p { margin: 5px 0 0; color: var(--app-muted); font-size: 12px; }
.agent-meta { margin: 13px 0 0; display: flex; gap: 18px; }
.agent-meta div { display: flex; align-items: center; gap: 7px; }
.agent-meta dt { color: var(--app-faint); font-size: 10px; }
.agent-meta dd { margin: 0; color: var(--app-ink); font-size: 11px; font-weight: 650; }
.agent-state { padding: 6px 9px; display: inline-flex; align-items: center; gap: 8px; color: var(--app-accent); background: var(--app-accent-soft); border-radius: 999px; font-size: 11px; font-weight: 700; }
.agent-state .app-status-dot { width: 6px; height: 6px; box-shadow: none; }
.agent-state-offline,
.agent-state-blocked { color: var(--app-crit); background: var(--app-crit-soft); }
.agent-state-offline .app-status-dot,
.agent-state-blocked .app-status-dot { background: var(--app-crit); }
.agents-task-counts { margin: 0; padding: 10px 18px 14px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.agents-task-counts div { min-width: 0; padding: 9px 6px; text-align: center; background: var(--app-panel-soft); border-radius: 8px; }
.agents-task-counts dt { color: var(--app-faint); font-size: 10px; }
.agents-task-counts dd { margin: 5px 0 0; font-size: 17px; font-weight: 750; }
.agents-skills { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden; }
.agents-skill-list { min-height: 0; margin: 0; padding: 8px 18px 12px; overflow: auto; list-style: none; }
.agents-skill-list li { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--app-line); }
.agents-skill-list li:last-child { border-bottom: 0; }
.agents-skill-list li > div { min-width: 0; display: grid; gap: 3px; }
.agents-skill-list strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.agents-skill-list span { color: var(--app-faint); font-size: 10px; }
.agents-skill-list b { flex: 0 0 auto; color: var(--app-accent); font-size: 11px; }
.agents-empty { margin: 0; padding: 18px; color: var(--app-faint); font-size: 12px; }
.agents-skill-list .agents-empty { min-height: 0; padding: 12px 0; border: 0; }
.agents-skill-list .agents-skill-limit { min-height: 0; padding: 12px 0 4px; color: var(--app-faint); border: 0; font-size: 10px; }
.agents-skill-toggle { display: none; }
.agents-skill-toggle[hidden] { display: none; }
.agents-updated { margin: 12px 2px 0; color: var(--app-faint); font-size: 10px; text-align: right; }

.dashboard-main { min-height: 0; padding: 22px 30px 22px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.dashboard-eyebrow { margin: 0 0 7px; color: var(--app-accent); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.dashboard-title { margin: 0; font-size: clamp(30px, 4vw, 42px); line-height: 1.15; letter-spacing: -.04em; }
.dashboard-intro { margin: 7px 0 0; color: var(--app-muted); font-size: 15px; }
.dashboard-report-link { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; color: var(--app-nav-text); background: var(--app-nav); border-radius: 9px; font-size: 13px; font-weight: 700; text-decoration: none; }
.dashboard-report-link .app-nav-icon { width: 15px; height: 15px; }

.dashboard-freshness {
  margin-bottom: 12px;
  min-height: 50px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--app-muted);
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: 12px;
}

.dashboard-freshness strong { color: var(--app-ink); font-size: 13px; }
.dashboard-freshness-separator { width: 1px; height: 22px; background: var(--app-line); }
.dashboard-source-freshness { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.dashboard-source-freshness time { color: var(--app-faint); }
.dashboard-freshness-spacer { flex: 1; }
#overview-load-status { color: var(--app-faint); font-size: 12px; }

.is-system-warning #overview-system-value { color: #a16207; }

/* 12열 3행 격자다. 위젯은 이 위의 사각형이고 위치·크기를 JS가 grid-area로 준다.
   행과 열 수가 고정이라 배치를 바꿔도 한 화면 계약이 깨지지 않는다. */
.dashboard-board {
  position: relative;
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
/* 위젯은 어느 슬롯에 놓여도 자기 영역 안에서 스크롤한다. 슬롯이 좁다고 내용이
   잘리면 배치를 바꿀 수 없다. */
/* 위젯은 카드가 아니다. 제목 막대와 구분선을 없애고 여백으로 나눈다. 이름은
   내용 안의 작은 라벨이고, 값이 화면을 지배한다. */
.dashboard-board > .dashboard-module {
  min-height: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  /* 위치와 크기는 저장된 배치를 JS가 이 속성으로 넣는다. 인라인 grid-area 대신
     속성을 쓰면 모바일 규칙이 !important 없이 덮을 수 있다. */
  grid-column: var(--widget-x, auto) / span var(--widget-w, 4);
  grid-row: var(--widget-y, auto) / span var(--widget-h, 1);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--app-line);
  border-radius: 18px;
  box-shadow: 0 1px 2px var(--app-shadow), 0 10px 26px var(--app-shadow);
}
/* 헤더는 채우지 않는다. 채운 띠는 낡아 보인다. 실선 하나와 제목 굵기로 나눈다. */
.dashboard-board .dashboard-module-head {
  min-height: 0;
  padding: 11px 15px 10px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--app-line);
}
.dashboard-board .dashboard-module-title { gap: 0; }
.dashboard-board .dashboard-module-title h2 {
  color: var(--app-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.01em;
}
/* 설명 문장은 위젯에서 소음이다. 이름만 남긴다. */
.dashboard-board .dashboard-module-title p { display: none; }
.dashboard-board .dashboard-module-link { font-size: 11px; font-weight: 650; }
.dashboard-board .dashboard-module-link .app-nav-icon { width: 12px; height: 12px; }
.dashboard-board .dashboard-module-count {
  min-width: 24px;
  height: 22px;
  padding: 0 7px;
  color: var(--app-ink);
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  font-size: 11px;
}
/* 내용은 위에서부터 쌓는다. 늘려서 채우면 항목 하나짜리 패널이 통째로 부풀고,
   남는 공간이 행 사이에 흩어져 읽기 어려워진다. */
.dashboard-board > .dashboard-module > :not(.dashboard-module-head) {
  min-height: 0;
  padding: 7px 8px 9px;
  align-content: start;
  overflow: hidden;
}
/* 배치 편집 --------------------------------------------------------------- */
/* 위젯 안에 링크가 있어 평소에는 잡아끌 수 없다. 편집 모드에서만 격자와 손잡이를
   보여주고 내용은 눌리지 않게 한다. */
.dashboard-grip,
.dashboard-resize { display: none; }

.is-editing-board .dashboard-board::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -6px;
  border: 1px dashed color-mix(in srgb, var(--app-accent) 45%, transparent);
  border-radius: 14px;
  pointer-events: none;
}
.is-editing-board .dashboard-board > .dashboard-module {
  position: relative;
  z-index: 1;
  user-select: none;
}
.is-editing-board .dashboard-board > .dashboard-module > :not(.dashboard-grip):not(.dashboard-resize) {
  pointer-events: none;
}
.is-editing-board .dashboard-board > .dashboard-module.is-dragging {
  z-index: 3;
  box-shadow: 0 12px 34px var(--app-shadow-strong);
  opacity: .92;
}
.is-editing-board .dashboard-board > .dashboard-module:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
}

.is-editing-board .dashboard-grip {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: block;
  background: color-mix(in srgb, var(--app-accent) 7%, transparent);
  border: 0;
  border-radius: 18px;
  cursor: grab;
}
.is-editing-board .dashboard-module.is-dragging .dashboard-grip { cursor: grabbing; }
.is-editing-board .dashboard-resize {
  position: absolute;
  z-index: 3;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  display: block;
  padding: 0;
  background:
    linear-gradient(135deg, transparent 46%, var(--app-accent) 46%, var(--app-accent) 54%, transparent 54%),
    linear-gradient(135deg, transparent 66%, var(--app-accent) 66%, var(--app-accent) 74%, transparent 74%);
  border: 0;
  border-radius: 7px;
  cursor: nwse-resize;
}
.is-editing-board .dashboard-grip:focus-visible,
.is-editing-board .dashboard-resize:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
}
.app-top-link[aria-pressed="true"] {
  color: var(--app-panel);
  background: var(--app-accent);
  border-color: var(--app-accent);
}

@media (max-width: 1000px) {
  /* 좁은 화면에서는 편집하지 않는다. 배치는 데스크톱에서 정한다. */
  #dashboard-edit { display: none; }
}

/* 위젯 안의 행은 구분선이 아니라 간격으로 나눈다. 좌우 여백은 위젯이 이미 갖고
   있으므로 행에서 다시 주지 않는다. */
.dashboard-board .dashboard-attention-list,
.dashboard-board .dashboard-list,
.dashboard-board .dashboard-pipeline-list { gap: 2px; }
.dashboard-board .dashboard-attention-row,
.dashboard-board .dashboard-trend-row,
.dashboard-board .dashboard-github-row,
.dashboard-board .dashboard-pipeline-list a {
  padding-inline: 8px;
  border-bottom: 0;
  border-radius: 10px;
}
.dashboard-board .dashboard-resource-list { padding: 0; gap: 2px; }
.dashboard-board .dashboard-resource-list div {
  padding: 7px 8px;
  border-bottom: 0;
  border-radius: 10px;
}
.dashboard-board .dashboard-resource-list div:hover,
.dashboard-board .dashboard-agent-stats { background: transparent; }
.dashboard-board .dashboard-empty { padding: 10px 8px; font-size: 13px; }
/* 값이 지배한다. 라벨은 작고 낮은 대비로 둔다. */
.dashboard-board .dashboard-resource-list dd { font-size: 20px; }
.dashboard-board .dashboard-agent-stats dd { font-size: 19px; }

/* 슬롯에 들어가지 않는 행은 자르지 않고 감춘다. 전체는 패널 머리의 링크로 본다. */
.dashboard-board [data-overflow] { display: none; }
.dashboard-slot-empty { border: 1px dashed var(--app-line); border-radius: 15px; }
.dashboard-resource-list { margin: 0; padding: 2px 17px 10px; display: grid; }
.dashboard-resource-list div { min-height: 51px; padding: 7px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--app-line); }
.dashboard-resource-list div:last-child { border-bottom: 0; }
.dashboard-resource-list dt { color: var(--app-muted); font-size: 12px; }
.dashboard-resource-list dd { margin: 0; font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; }
.dashboard-resource-list dd.is-warning { color: var(--app-warn); }

.dashboard-command-grid { margin-bottom: 14px; display: grid; grid-template-columns: minmax(260px, .92fr) minmax(330px, 1.16fr) minmax(250px, .82fr); gap: 14px; align-items: stretch; }
.dashboard-research-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(310px, .8fr); gap: 14px; align-items: start; }
.dashboard-module { overflow: hidden; background: var(--app-panel); border: 1px solid var(--app-line); border-radius: 15px; box-shadow: 0 8px 24px var(--app-shadow); }
.dashboard-module-head { min-height: 57px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--app-line); }
.dashboard-module-title { display: grid; gap: 3px; }
.dashboard-module-title h2 { margin: 0; font-size: 15px; }
.dashboard-module-title p { margin: 0; color: var(--app-faint); font-size: 11px; }
.dashboard-module-count { min-width: 28px; height: 28px; padding: 0 8px; display: inline-grid; place-items: center; color: var(--app-nav-text); background: var(--app-nav); border-radius: 999px; font-size: 11px; font-weight: 750; }
.dashboard-module-link { display: inline-flex; align-items: center; gap: 5px; color: var(--app-accent); font-size: 12px; font-weight: 700; text-decoration: none; }
.dashboard-module-link .app-nav-icon { width: 14px; height: 14px; }
.dashboard-list { display: grid; }
.dashboard-empty { margin: 0; padding: 24px 17px; color: var(--app-muted); }

.dashboard-attention-list { display: grid; }
.dashboard-attention-row { min-height: 51px; padding: 7px 15px; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 11px; color: var(--app-ink); border-bottom: 1px solid var(--app-line); text-decoration: none; }
.dashboard-attention-row:last-child { border-bottom: 0; }
.dashboard-attention-row:hover { background: var(--app-panel-soft); }
.dashboard-attention-mark { width: 8px; height: 8px; background: var(--app-accent); border-radius: 50%; box-shadow: 0 0 0 4px var(--app-accent-soft); }
.dashboard-attention-copy { min-width: 0; display: grid; gap: 3px; }
.dashboard-attention-copy strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-attention-copy small { overflow: hidden; color: var(--app-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-attention-row b { color: var(--app-accent); font-size: 12px; font-variant-numeric: tabular-nums; }
.dashboard-attention-row.attention-warning .dashboard-attention-mark { background: #d18a22; box-shadow: 0 0 0 4px color-mix(in srgb, #d18a22 13%, var(--app-panel)); }
.dashboard-attention-row.attention-danger .dashboard-attention-mark { background: var(--app-crit); box-shadow: 0 0 0 4px var(--app-crit-soft); }
.dashboard-attention-clear { min-height: 128px; padding: 20px; display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; }
.dashboard-attention-clear strong { font-size: 13px; }
.dashboard-attention-clear small { color: var(--app-faint); font-size: 10px; }
.dashboard-attention-check { width: 30px; height: 30px; display: grid; place-items: center; color: var(--app-accent); background: var(--app-accent-soft); border-radius: 50%; font-weight: 800; }

.dashboard-agent-body { padding: 14px 16px 15px; }
.dashboard-agent-primary { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 11px; }
.dashboard-agent-mark { width: 38px; height: 38px; display: grid; place-items: center; color: var(--app-nav-text); background: var(--app-nav); border-radius: 10px; font-size: 12px; font-weight: 750; }
.dashboard-agent-primary > div { min-width: 0; display: grid; gap: 3px; }
.dashboard-agent-primary strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-agent-primary > div span { overflow: hidden; color: var(--app-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-agent-state { padding: 6px 8px; display: inline-flex; align-items: center; gap: 6px; color: var(--app-accent); background: var(--app-accent-soft); border-radius: 999px; font-size: 10px; font-weight: 750; }
.dashboard-agent-state .app-status-dot { width: 6px; height: 6px; box-shadow: none; }
.dashboard-agent-state.is-warning { color: var(--app-crit); background: var(--app-crit-soft); }
.dashboard-agent-state.is-warning .app-status-dot { background: var(--app-crit); }
.dashboard-agent-stats { margin: 14px 0 11px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--app-line); border-radius: 10px; }
.dashboard-agent-stats div { padding: 9px 10px; display: grid; gap: 4px; }
.dashboard-agent-stats div:not(:last-child) { border-right: 1px solid var(--app-line); }
.dashboard-agent-stats dt { color: var(--app-faint); font-size: 9px; }
.dashboard-agent-stats dd { margin: 0; font-size: 16px; font-weight: 750; }
.dashboard-task-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.dashboard-task-flow > span { min-width: 0; min-height: 39px; padding: 6px; display: grid; place-items: center; gap: 2px; background: var(--app-panel-soft); border-radius: 8px; text-align: center; }
.dashboard-task-flow small { color: var(--app-faint); font-size: 8px; }
.dashboard-task-flow strong { font-size: 12px; }

.dashboard-pipeline-list { display: grid; }
.dashboard-pipeline-list a { min-height: 51px; padding: 7px 14px; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; color: var(--app-ink); border-bottom: 1px solid var(--app-line); text-decoration: none; }
.dashboard-pipeline-list a:last-child { border-bottom: 0; }
.dashboard-pipeline-list a:hover { background: var(--app-panel-soft); }
.dashboard-pipeline-mark { width: 30px; height: 30px; display: grid; place-items: center; color: var(--app-accent); background: var(--app-accent-soft); border-radius: 9px; font-size: 9px; font-weight: 800; }
.dashboard-pipeline-list a > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.dashboard-pipeline-list strong { font-size: 12px; }
.dashboard-pipeline-list small { overflow: hidden; color: var(--app-faint); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-pipeline-list b { color: var(--app-accent); font-size: 11px; }

.dashboard-trend-row,
.dashboard-github-row {
  min-height: 55px;
  padding: 8px 16px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--app-ink);
  border-bottom: 1px solid var(--app-line);
  text-decoration: none;
}

.dashboard-trend-row:last-child,
.dashboard-github-row:last-child { border-bottom: 0; }
.dashboard-trend-row:hover,
.dashboard-github-row:hover { background: var(--app-panel-soft); }
.dashboard-rank { color: var(--app-faint); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dashboard-trend-copy,
.dashboard-github-copy { min-width: 0; display: grid; gap: 4px; }
.dashboard-trend-copy strong,
.dashboard-github-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-trend-copy span,
.dashboard-github-copy span { overflow: hidden; color: var(--app-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-change,
.dashboard-period-stars { color: var(--app-accent); font-size: 11px; font-weight: 700; }


/* 설정 --------------------------------------------------------------------- */
.settings-shell { max-width: 780px; display: grid; gap: 16px; }
.settings-block { padding: 0; }
.settings-head { padding: 16px 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--app-line); }
.settings-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.settings-head p { margin: 3px 0 0; max-width: 52ch; color: var(--app-faint); font-size: 12px; }
.settings-head > span { flex: none; color: var(--app-faint); font-size: 11px; }
.settings-head > span[data-tone="warn"] { color: var(--app-warn); }
.settings-slots { padding: 6px 18px; display: grid; }
.settings-slot { padding: 11px 0; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 13px; border-bottom: 1px solid var(--app-line); }
.settings-slot:last-child { border-bottom: 0; }
.settings-slot-copy { min-width: 0; display: grid; gap: 2px; }
.settings-slot-copy strong { font-size: 13px; font-weight: 650; }
.settings-slot-copy span { color: var(--app-faint); font-size: 11.5px; }
.settings-slot[data-on="false"] .settings-slot-copy strong { color: var(--app-muted); }
/* 켜짐·꺼짐만 나타내므로 상태색이 아니라 채움 여부로 구분한다. */
.settings-toggle {
  width: 40px;
  height: 23px;
  position: relative;
  padding: 0;
  background: var(--app-panel-strong);
  border: 1px solid var(--app-line);
  border-radius: 999px;
  cursor: pointer;
  transition: background .14s ease;
}
.settings-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  background: var(--app-panel);
  border-radius: 50%;
  box-shadow: 0 1px 2px var(--app-shadow);
  transition: transform .14s ease;
}
.settings-toggle[aria-pressed="true"] { background: var(--app-accent); border-color: var(--app-accent); }
.settings-toggle[aria-pressed="true"]::after { transform: translateX(17px); }
.settings-toggle:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.settings-select,
.settings-field input {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  color: var(--app-ink);
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
}
.settings-select:focus-visible,
.settings-field input:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -1px; }
.settings-row { padding: 14px 18px; display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.settings-field { min-width: 160px; display: grid; gap: 5px; }
.settings-field.is-wide { flex: 1; }
.settings-field span { color: var(--app-faint); font-size: 11px; font-weight: 650; }
.settings-actions { padding: 0 18px 16px; display: flex; gap: 8px; }
.settings-button {
  min-height: 36px;
  padding: 0 13px;
  color: var(--app-ink);
  background: var(--app-panel-soft);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.settings-button:hover { border-color: color-mix(in srgb, var(--app-accent) 40%, var(--app-line)); }
.settings-button.is-primary { color: var(--app-panel); background: var(--app-accent); border-color: var(--app-accent); }
.settings-button:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 2px; }
.settings-preset-list { margin: 0; padding: 0 18px; display: grid; list-style: none; }
.settings-preset { padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--app-line); }
.settings-preset:last-child { border-bottom: 0; }
.settings-preset > div { min-width: 0; display: grid; gap: 3px; }
.settings-preset strong { font-size: 13px; }
.settings-preset span { overflow: hidden; color: var(--app-faint); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.settings-preset-actions { flex: none; display: flex; gap: 6px; }
.settings-empty { padding: 14px 0; color: var(--app-faint); font-size: 12px; }
.settings-note { margin: 0; padding: 0 18px 16px; color: var(--app-faint); font-size: 11.5px; overflow-wrap: anywhere; }
.settings-note[data-tone="warn"] { color: var(--app-warn); }

/* 공통 화면 규격 --------------------------------------------------------- */
/* 페이지 제목은 topbar가 소유한다. 본문은 곧바로 내용으로 시작한다. */

.app-panel {
  overflow: hidden;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: 15px;
  box-shadow: 0 8px 24px var(--app-shadow);
}

.app-page a:focus-visible,
.app-page button:focus-visible,
.app-page input:focus-visible,
.app-page textarea:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: 2px;
}

/* X·GitHub 작업 화면 */
.x-agent-page .site-shell { padding-top: 20px; }
.x-agent-page .section-header .section-eyebrow { margin-bottom: 7px; color: var(--app-accent); }
.x-agent-page .section-header .section-title { font-size: 34px; line-height: 1.08; }
.x-agent-page .section-header .section-intro { max-width: 560px; margin-top: 6px; text-align: left; }
.x-agent-page .x-workspace-overview,
.x-agent-page .x-board,
.x-agent-page .github-trending-panel {
  border-color: var(--app-line);
  border-radius: 14px;
  box-shadow: 0 8px 22px var(--app-shadow);
}

/* Report 목록: 반복 제목 없이 문서 인덱스부터 바로 보여준다. */
.reports-page .site-shell { padding-top: 18px; }
.reports-page .reports-catalog { overflow: hidden; }
.reports-page .reports-catalog-head {
  min-height: 58px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--app-line);
}
.reports-page .reports-catalog-head h1 { margin: 0; font-size: 15px; }
.reports-page .reports-catalog-head p { margin: 3px 0 0; color: var(--app-faint); font-size: 11px; }
.reports-page .reports-catalog-head span { color: var(--app-muted); font-size: 12px; }
.app-scroll-page.reports-page .app-shell .reports-list {
  display: block;
  border: 0;
}
.app-scroll-page.reports-page .app-shell .reports-list .content-item {
  min-height: 0;
  padding: 18px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 24px;
  grid-template-rows: auto auto;
  column-gap: 20px;
  row-gap: 6px;
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--app-line);
  border-radius: 0;
  box-shadow: none;
}
.app-scroll-page.reports-page .app-shell .reports-list .content-item:last-child { border-bottom: 0; }
.app-scroll-page.reports-page .app-shell .reports-list .content-item:hover { background: var(--app-panel-soft); }
.app-scroll-page.reports-page .app-shell .reports-list .content-meta {
  grid-column: 1;
  grid-row: 1 / span 2;
  color: var(--app-faint);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.app-scroll-page.reports-page .app-shell .reports-list .content-title {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}
.app-scroll-page.reports-page .app-shell .reports-list .content-summary {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  display: block;
  overflow: hidden;
  color: var(--app-muted);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-scroll-page.reports-page .app-shell .reports-list .content-item::after {
  content: "→";
  grid-column: 3;
  grid-row: 1 / span 2;
  color: var(--app-faint);
  font-size: 16px;
  text-align: right;
}
.app-scroll-page.reports-page .app-shell .reports-list .content-item:hover::after { color: var(--app-accent); }

/* Live Server도 같은 제목·panel·지표 규격을 쓴다. */
.live-page .live-shell { padding-top: 24px; }
.live-page .live-app.app-panel { border-top: 1px solid var(--app-line); }
.live-page .live-toolbar { padding: 0 16px; background: var(--app-panel-soft); }
.live-page .live-panel { padding: 24px 20px 20px; }
.live-page .live-status-hero { padding-bottom: 22px; }
.live-page .live-verdict { max-width: none; font-size: clamp(28px, 3.2vw, 38px); }
.live-page .live-summary { background: var(--app-panel-soft); }
.live-page .live-summary-item:first-child { padding-left: 20px; }
.live-page .live-summary-item:last-child { padding-right: 20px; }
.live-page .live-grid { margin-top: 28px; }

/* 개별 Report는 읽기 화면이지만 같은 제품의 compact app bar를 사용한다. */
.report-document {
  --bg: var(--app-canvas);
  --surface: var(--app-panel);
  --ink: var(--app-ink);
  --muted: var(--app-muted);
  --line: var(--app-line);
  --accent: var(--app-accent);
  --good: var(--app-accent);
  --good-soft: var(--app-accent-soft);
  background: var(--app-canvas);
}
.report-appbar {
  position: sticky;
  z-index: 70;
  top: 0;
  min-height: 58px;
  color: var(--app-ink);
  background: color-mix(in srgb, var(--app-panel) 95%, transparent);
  border-bottom: 1px solid var(--app-line);
  backdrop-filter: blur(14px);
}
.report-appbar-inner {
  width: min(100% - 32px, 1120px);
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font: 500 13px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.report-appbar-brand { display: inline-flex; align-items: center; gap: 9px; color: inherit; font-weight: 750; text-decoration: none; }
.report-appbar-brand .app-brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.report-appbar-context { display: flex; align-items: center; gap: 8px; color: var(--app-faint); }
.report-appbar-context strong { color: var(--app-ink); }
.report-appbar-links { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.report-appbar-links a { padding: 8px 10px; color: var(--app-muted); border-radius: 8px; font-weight: 650; text-decoration: none; }
.report-appbar-links a:hover { color: var(--app-ink); background: var(--app-panel-soft); }
.report-document .report-appbar .theme-toggle {
  position: static;
  min-height: 34px;
  padding: 0 10px;
  color: var(--app-muted);
  background: transparent;
  border-color: var(--app-line);
  border-radius: 8px;
  box-shadow: none;
  transform: none;
}
.report-document .wrap { max-width: 820px; padding-top: 42px; }
.report-document .report-back { display: none; }
.report-document .rn-fab { color: var(--app-nav-text); background: var(--app-nav); border-color: var(--app-nav); }

/* Legacy Reader는 데이터 밀도를 유지하되 상단 프레임을 Research OS와 맞춘다. */
.reader-page.with-site-nav .reader-nav-shell {
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  background: var(--app-panel);
  border-bottom: 1px solid var(--app-line);
}
.reader-page.with-site-nav .reader-nav-shell .section-nav {
  width: min(100% - 28px, 1120px);
  min-height: 58px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  border: 0;
}
.reader-app-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--app-ink); font-size: 13px; font-weight: 750; text-decoration: none; }
.reader-app-brand .app-brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.reader-app-context { display: flex; align-items: center; gap: 8px; color: var(--app-faint); font-size: 12px; }
.reader-app-context strong { color: var(--app-ink); }
.reader-app-links { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.reader-app-links a { padding: 8px 10px; color: var(--app-muted); border-radius: 8px; font-size: 12px; font-weight: 650; text-decoration: none; }
.reader-app-links a:hover,
.reader-app-links a[aria-current="page"] { color: var(--app-ink); background: var(--app-panel-soft); }
.reader-page.with-site-nav .theme-toggle { display: none; }
.reader-page.with-site-nav .bar { border-top: 0; background: var(--app-canvas); }
.reader-page.with-site-nav .bar-inner { max-width: 1120px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 82px minmax(0, 1fr); }
  .app-sidebar { padding-inline: 10px; align-items: center; }
  .app-brand { padding-inline: 0; }
  .app-brand-copy,
  .app-nav-label,
  .app-nav-text,
  .app-nav-count,
  .app-nav-later,
  .app-account-copy,
  .app-account-caret { display: none; }
  .app-account > summary { justify-content: center; padding: 8px 0; }
  .app-account-menu { width: 232px; }
  .app-nav-group { justify-items: center; }
  .app-nav-link,
  .app-nav-disabled { width: 42px; justify-content: center; padding: 9px; }
  .app-nav-link[aria-current="page"] { box-shadow: none; }
  .dashboard-command-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-system-module { grid-column: 1 / -1; }
  .dashboard-pipeline-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-pipeline-list a { border-bottom: 0; }
  .dashboard-pipeline-list a:not(:last-child) { border-right: 1px solid var(--app-line); }
  .app-scroll-page:not(.live-page) .app-shell .content-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar { display: none; }
  .app-stage { position: relative; min-height: 100dvh; }
  .app-topbar { min-height: 54px; padding: 0 14px; }
  .app-mobile-brand { display: flex; align-items: center; gap: 9px; color: var(--app-ink); font-size: 14px; font-weight: 700; text-decoration: none; }
  .app-mobile-brand .app-brand-mark { width: 29px; height: 29px; border-radius: 8px; }
  /* 모바일에서는 드롭다운 summary가 현재 페이지를 표시한다. */
  .app-top-context,
  .app-top-slot { display: none; }
  .app-account > summary { padding: 7px; }
  .app-account-menu { width: min(268px, calc(100vw - 28px)); }
  .app-avatar { width: 32px; height: 32px; }
  .app-mobile-menu {
    position: absolute;
    z-index: 100;
    top: 7px;
    right: 56px;
    display: block;
  }
  .app-mobile-menu summary {
    min-width: 108px;
    max-width: 150px;
    min-height: 40px;
    padding: 0 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    color: var(--app-ink);
    background: var(--app-panel-soft);
    border: 1px solid var(--app-line);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
    list-style: none;
  }
  .app-mobile-menu summary::-webkit-details-marker { display: none; }
  .app-mobile-menu summary::after { content: "⌄"; color: var(--app-faint); font-size: 15px; line-height: 1; transition: transform .16s ease; }
  .app-mobile-menu[open] summary { background: var(--app-panel); border-color: color-mix(in srgb, var(--app-accent) 38%, var(--app-line)); }
  .app-mobile-menu[open] summary::after { transform: rotate(180deg); }
  .app-mobile-current { min-width: 0; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
  .app-mobile-current > span:last-child,
  .app-mobile-current-copy > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-mobile-current .app-nav-icon { width: 17px; height: 17px; }
  .app-mobile-current-copy { display: none; align-items: center; gap: 7px; }
  html[data-x-page="trend"] .app-mobile-current-copy[data-x-copy="trend"],
  html[data-x-page="bookmark"] .app-mobile-current-copy[data-x-copy="bookmark"] { display: flex; }
  .app-mobile-nav {
    position: absolute;
    top: 46px;
    right: 0;
    width: min(268px, calc(100vw - 24px));
    padding: 7px;
    grid-template-columns: 1fr;
    gap: 3px;
    background: var(--app-panel);
    border: 1px solid var(--app-line);
    border-radius: 13px;
    box-shadow: 0 16px 40px color-mix(in srgb, var(--app-nav) 24%, transparent);
  }
  .app-mobile-menu[open] .app-mobile-nav { display: grid; }
  .app-mobile-nav a { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 11px; color: var(--app-muted); border-radius: 9px; text-decoration: none; }
  .app-mobile-nav a[aria-current="page"] { color: var(--app-ink); background: var(--app-panel-strong); }
  .app-mobile-nav .app-nav-icon { width: 18px; height: 18px; }
  .app-mobile-label { display: block; overflow: hidden; max-width: 100%; font-size: 13px; font-weight: 700; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
  .app-shell .site-shell,
  .app-shell .live-shell { width: auto; padding: 18px 13px 22px; }
  .app-fixed-page .app-stage { grid-template-rows: 54px minmax(0, 1fr); }
  .app-fixed-page.x-master-detail-open .app-shell .site-shell { height: 100%; }
  .app-fixed-page .section-header { display: block; margin-bottom: 10px; }
  .app-fixed-page .section-header .section-title { font-size: 24px; }
  .app-fixed-page .section-header .section-intro { margin-top: 5px; text-align: left; }
  .app-scroll-page:not(.live-page) .app-shell .section-header { margin-top: 4px; }
  .app-scroll-page:not(.live-page) .app-shell .content-list { grid-template-columns: 1fr; }
  .app-scroll-page:not(.live-page) .app-shell .content-item { min-height: 0; padding: 16px; }
  /* 모바일은 배치를 무시하고 저장된 순서대로 한 열로 쌓는다. */
  .dashboard-board { grid-template-columns: 1fr; grid-template-rows: auto; }
  .dashboard-board > .dashboard-module { grid-column: 1 / -1; grid-row: auto; }
  .agents-shell { display: block; }
  .agents-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agents-summary article { min-height: 68px; padding: 12px 13px; }
  .agents-workspace { grid-template-columns: 1fr; grid-template-rows: auto; }
  .agents-catalog { display: block; grid-row: auto; }
  .agents-list { overflow: visible; }
  .agents-skills { display: block; }
  .agent-row { min-height: 80px; padding: 14px; grid-template-columns: 40px minmax(0, 1fr); gap: 11px; }
  .agent-mark { width: 40px; height: 40px; border-radius: 10px; }
  .agent-state { grid-column: 2; width: max-content; margin-top: -3px; }
  .agent-meta { flex-wrap: wrap; gap: 6px 14px; }
  .agents-skills:not(.is-expanded) .agents-skill-list li:nth-child(n+7) { display: none; }
  .agents-skill-toggle { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: center; color: var(--app-accent); background: var(--app-panel-soft); border: 0; border-top: 1px solid var(--app-line); font: inherit; font-size: 11px; font-weight: 750; cursor: pointer; }
  .agents-skill-toggle:focus-visible { outline: 2px solid var(--app-accent); outline-offset: -3px; }
  .agents-task-counts { padding: 10px 12px 13px; gap: 4px; }
  .agents-task-counts div { padding: 8px 2px; }
  .app-mobile-scroll { height: auto; overflow: visible; }
  .app-mobile-scroll .app-shell,
  .app-mobile-scroll .app-stage { height: auto; min-height: 100dvh; }
  .app-mobile-scroll .app-stage { display: grid; grid-template-rows: 54px auto; }
  .app-mobile-scroll .site-shell { height: auto; }
  .dashboard-main { padding: 20px 14px 28px; }
  .dashboard-title { font-size: 28px; }
  .dashboard-report-link { display: none; }
  .dashboard-freshness { align-items: flex-start; flex-wrap: wrap; gap: 9px 12px; }
  .dashboard-freshness-separator,
  .dashboard-freshness-spacer { display: none; }
  #overview-load-status { flex: 1 0 100%; }
  .dashboard-command-grid,
  .dashboard-research-grid { grid-template-columns: 1fr; }
  .dashboard-system-module { grid-column: auto; }
  .dashboard-pipeline-list { grid-template-columns: 1fr; }
  .dashboard-pipeline-list a { border-right: 0 !important; border-bottom: 1px solid var(--app-line); }
  .dashboard-pipeline-list a:last-child { border-bottom: 0; }
  .dashboard-module-head { min-height: 60px; padding-inline: 14px; }
  .dashboard-agent-primary { grid-template-columns: 38px minmax(0, 1fr); }
  .dashboard-agent-state { grid-column: 2; width: max-content; margin-top: -4px; }
  .dashboard-trend-row,
  .dashboard-github-row { padding-inline: 11px; grid-template-columns: 30px minmax(0, 1fr) auto; }


  .reports-page .site-shell { padding-top: 12px; }
  .reports-page .reports-catalog-head { min-height: 54px; padding-inline: 14px; }
  .reports-page .reports-catalog-head span { max-width: 48%; text-align: right; }
  .app-scroll-page.reports-page .app-shell .reports-list .content-item {
    padding: 15px;
    grid-template-columns: minmax(0, 1fr) 20px;
    column-gap: 10px;
  }
  .app-scroll-page.reports-page .app-shell .reports-list .content-meta {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 2px;
  }
  .app-scroll-page.reports-page .app-shell .reports-list .content-title { grid-column: 1; grid-row: 2; font-size: 16px; }
  .app-scroll-page.reports-page .app-shell .reports-list .content-summary {
    grid-column: 1;
    grid-row: 3;
    white-space: normal;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .app-scroll-page.reports-page .app-shell .reports-list .content-item::after { grid-column: 2; grid-row: 1 / span 3; }

  .live-page .live-panel { padding: 20px 14px 16px; }
  .live-page .live-toolbar { padding-inline: 10px; }
  .live-page .live-summary-item:first-child { padding-left: 14px; }
  .live-page .live-summary-item:last-child { padding-right: 14px; }

  .report-appbar-context { display: none; }
  .report-appbar-links a:first-child { display: none; }
  .report-document .wrap { padding-top: 30px; }

  .reader-app-context { display: none; }
  .reader-app-links a:first-child { display: none; }
}

@media (max-width: 360px) {
  .app-mobile-brand > span:last-child { display: none; }
}

/* GitHub Trending 기간별 추이 ------------------------------------------- */
/* 선이 여러 개라 브랜드 색 하나로는 구분되지 않는다. 계열 색은 상태색과 별개이며
   상태를 뜻하지 않는다. */
:root[data-theme="light"] {
  --series-1: #2c6d4b;
  --series-2: #2f6f9e;
  --series-3: #8a5d12;
  --series-4: #7a4a8c;
  --series-5: #a6413a;
  --series-6: #4a6b57;
}
:root[data-theme="dark"] {
  --series-1: #75c995;
  --series-2: #79b6e3;
  --series-3: #e0a94a;
  --series-4: #c39ad6;
  --series-5: #e0837a;
  --series-6: #9dbfa9;
}

/* 표와 그래프가 같은 자리를 나눠 쓰므로 남은 높이를 그대로 받는다. */
.github-view-bar { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.github-history { min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; }
/* 클래스가 display를 정하면 [hidden]이 무력해진다. 표와 그래프가 동시에 자리를
   차지해 어느 쪽도 높이를 못 받는다. */
.github-history[hidden],
.github-leaderboard[hidden],
.app-segmented[hidden] { display: none; }
.github-history-chart { position: relative; min-height: 0; flex: 1; width: 100%; }
.github-history-svg { width: 100%; height: 100%; display: block; }
/* 한 저장소를 짚으면 나머지는 물러난다. 선이 여섯 개면 어느 선을 보고 있는지
   숫자만으로는 확인되지 않는다. */
.github-history-svg [data-series] { transition: opacity .12s ease; }
.github-history-svg.is-focused [data-series] { opacity: .18; }
.github-history-svg.is-focused [data-series].is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .github-history-svg [data-series] { transition: none; }
}
.github-history-grid { stroke: color-mix(in srgb, var(--app-line) 62%, transparent); stroke-width: 1; }
.github-history-axis { fill: var(--app-faint); font-size: 10.5px; }
/* 남의 관측으로 채운 구간. 우리 3시간 수집과 섞이지 않게 바닥을 밝혀 둔다. */
.github-history-archive { fill: color-mix(in srgb, var(--app-line) 13%, transparent); }
.github-history-archive-label { fill: var(--app-faint); font-size: 9.5px; font-weight: 700; }
.github-history-line[data-source="archive"],
.github-history-bridge[data-source="archive"] { stroke-width: 1.4; opacity: .72; }
.github-history-dot[data-source="archive"] { opacity: .72; }
/* 접어 둔 수집 공백. 양 끝의 파선이 시간축이 끊겼음을 알린다. */
.github-history-gap { fill: color-mix(in srgb, var(--app-line) 22%, transparent); }
.github-history-fold {
  stroke: color-mix(in srgb, var(--app-line) 85%, transparent);
  stroke-width: 1; stroke-dasharray: 2 3;
}
.github-history-label { font-size: 11px; font-weight: 650; dominant-baseline: middle; }
.github-history-leader { stroke-width: 1; opacity: .55; }
.github-history-guide { stroke: var(--app-line); stroke-width: 1; stroke-dasharray: 3 3; }
.github-history-guide[hidden] { display: none; }
/* 값 판독. 선 위에 겹치지 않도록 위쪽에 붙이고 포인터를 막지 않는다. */
.github-history-tip {
  position: absolute;
  z-index: 2;
  top: 4px;
  min-width: 244px;
  max-width: min(320px, 92%);
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  background: var(--app-panel);
  border: 1px solid var(--app-line);
  border-radius: 10px;
  box-shadow: 0 8px 22px var(--app-shadow-strong);
  font-size: 11.5px;
  pointer-events: none;
}
.github-history-tip[hidden] { display: none; }
.github-history-tip strong { color: var(--app-faint); font-size: 10.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.github-history-tip-name { display: flex; align-items: center; gap: 7px; min-width: 0; }
.github-history-tip-name i { width: 9px; height: 9px; flex: none; border-radius: 2px; }
.github-history-tip-name span {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--app-ink); font-size: 12.5px; font-weight: 700;
}
.github-history-fact { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.github-history-fact > span { color: var(--app-faint); }
.github-history-fact b { color: var(--app-ink); font-variant-numeric: tabular-nums; }
.github-history-tip-gain { color: var(--app-accent); font-weight: 650; }
.github-history-tip-absent { color: var(--app-faint); font-weight: 500; }
.github-history-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
/* 공백을 건너는 구간. 파선과 낮은 불투명도로 관측한 선과 구분한다. */
.github-history-bridge { stroke-width: 1.5; stroke-dasharray: 3 3; opacity: .5; vector-effect: non-scaling-stroke; }
.github-history-dot { stroke: var(--app-panel); stroke-width: 1.5; }
/* 범례와 회차 요약은 둘 다 그림에 대한 주석이다. 줄을 나누면 그릴 자리만 준다. */
.github-history-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between;
  gap: 4px 14px; flex-wrap: wrap;
}
.github-history-note { margin: 0; color: var(--app-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.github-history-legend { display: flex; align-items: center; gap: 6px 13px; flex-wrap: wrap; }
.github-history-legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--app-muted); font-size: 11.5px; }
.github-history-key { width: 9px; height: 9px; flex: none; border-radius: 2px; }
.github-history-legend-more { color: var(--app-faint); font-size: 11.5px; }

/* 진입·이탈은 회차마다 일어난 일을 그대로 읽는다. 값이 0~3이라 그래프로 그리면
   차이가 보이지 않는다. */
.github-flow { margin: 0; padding: 0; height: 100%; display: grid; align-content: start; gap: 2px; overflow-y: auto; list-style: none; }
.github-flow-round { padding: 9px 2px; display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: baseline; gap: 14px; border-bottom: 1px solid var(--app-line); }
.github-flow-round:last-child { border-bottom: 0; }
.github-flow-when { color: var(--app-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.github-flow-body { min-width: 0; display: grid; gap: 4px; font-size: 12.5px; }
.github-flow-same, .github-flow-base { color: var(--app-faint); }
.github-flow-in, .github-flow-out { display: flex; align-items: baseline; gap: 9px; }
.github-flow-in b, .github-flow-out b { flex: none; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.github-flow-in b { color: var(--app-accent); background: var(--app-accent-soft); }
.github-flow-out b { color: var(--app-warn); background: var(--app-warn-soft); }
.github-flow-in > span:last-child, .github-flow-out > span:last-child { min-width: 0; color: var(--app-muted); }
.github-history-note { margin: 10px 0 0; color: var(--app-faint); font-size: 11.5px; }

@media (max-width: 720px) {
  .github-history-chart { height: 220px; }
  .github-history-controls { width: 100%; }
}
