/* GEO Design Studio — 디자인 시스템
   색은 스톤파티의 딥 틸 + 민트를 유지하되, 화면 대부분은 무채색 표면으로 두고
   민트는 "지금 살아 있는 것"(진행·선택·강조)에만 쓴다. */

/* Pretendard — 파일을 같이 넣어 쓴다(외부 요청 0, CSP default-src 'self' 유지).
   가변 폰트 하나로 100~900 전 굵기를 덮는다. SIL OFL 1.1 · fonts/LICENSE.txt 참고.
   swap: 폰트를 받는 동안 글자를 감추지 않고 기본 폰트로 먼저 보여 준다. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("/assets/fonts/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f6f8f8;
  --surface: #ffffff;
  --surface-2: #f0f4f3;
  --surface-3: #e7eeec;
  --ink: #0f2320;
  --ink-2: #5a6f6a;
  --ink-3: #8a9c98;
  --line: #dde7e4;
  --line-2: #eaf1ef;
  --brand: #0b5351;
  --brand-ink: #063633;
  --accent: #02b48f;
  --accent-soft: #dff5ee;
  --warn: #b3261e;
  --warn-soft: #fbecea;
  --ok: #0e7a5f;
  --shadow: 0 1px 2px rgba(15, 35, 32, 0.06), 0 8px 24px -12px rgba(15, 35, 32, 0.18);
  --shadow-lg: 0 24px 60px -20px rgba(6, 40, 36, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
}

:root[data-theme="dark"] {
  --bg: #0a1513;
  --surface: #0f1f1c;
  --surface-2: #142723;
  --surface-3: #1b332e;
  --ink: #e6f0ed;
  --ink-2: #9ab0ab;
  --ink-3: #6d8480;
  --line: #1e3833;
  --line-2: #172c28;
  --brand: #3fc9ab;
  --brand-ink: #7fe0c8;
  --accent: #02c39a;
  --accent-soft: #10332c;
  --warn: #ff8b7e;
  --warn-soft: #331d1a;
  --ok: #4fd1b5;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
}

/* display 를 지정한 요소는 hidden 속성만으로 숨겨지지 않는다(.tabs 등). 우선순위를 올려 둔다. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: var(--brand);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: var(--surface-3);
  border-radius: 6px;
  border: 3px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--ink-3);
  background-clip: content-box;
}

/* ── 공통 부품 ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
  white-space: nowrap;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
:root[data-theme="dark"] .btn-primary {
  color: #04201c;
}
.btn-primary:not(:disabled):hover {
  background: var(--brand-ink);
}
.btn-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}
.btn-ghost:not(:disabled):hover {
  background: var(--surface-2);
}
.btn-quiet {
  color: var(--ink-2);
  padding: 6px 10px;
}
.btn-quiet:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.btn-danger {
  color: var(--warn);
}
.btn-danger:hover {
  background: var(--warn-soft);
}
.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.field {
  display: block;
  margin-bottom: 14px;
}
.field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 5px;
}
.field .hint {
  display: block;
  font-weight: 400;
  color: var(--ink-3);
  font-size: 11.5px;
  margin-top: 2px;
}
.field.key > span {
  color: var(--brand);
}
input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.6;
}
::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.tag.solid {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
:root[data-theme="dark"] .tag.solid {
  color: #04201c;
}
.tag.mint {
  background: var(--accent-soft);
  color: var(--ok);
  border-color: transparent;
}

.notice {
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.6;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
}
.notice.warn {
  background: var(--warn-soft);
  border-color: transparent;
  color: var(--warn);
}

/* ── 로그인 ────────────────────────────────────────────── */
.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--surface-2), var(--bg));
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 32px;
}
.login-card .mark {
  margin-bottom: 22px;
}
.login-card h1 {
  font-size: 19px;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.login-card p.sub {
  color: var(--ink-2);
  font-size: 12.5px;
  margin-bottom: 22px;
}
.login-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 11px;
  margin-top: 6px;
}
.login-foot {
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ── 브랜드 마크 ───────────────────────────────────────── */
.mark {
  display: flex;
  align-items: center;
  gap: 9px;
}
.mark svg {
  flex: none;
}
.mark .name {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.mark .kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  text-transform: uppercase;
}

/* ── 셸 ───────────────────────────────────────────────── */
/* 앱 화면은 세로로 꽉 채운다. 상단 배너가 있어도 셸이 밀려 내려가지 않게
   body 자체를 세로 flex 로 두고 셸이 남은 높이를 차지하게 한다. */
body:has(.shell) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.shell {
  display: grid;
  grid-template-columns: 258px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-head {
  padding: 16px 16px 12px;
}
.sidebar-section {
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sidebar-section h2 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-transform: uppercase;
  padding-left: 4px;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 10px;
}
.project-list {
  padding: 0 8px 4px;
}
.project-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
  transition: background 0.1s;
}
.project-item:hover {
  background: var(--surface-2);
}
.project-item.active {
  background: var(--surface-3);
}
.project-item .t {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-item .m {
  font-size: 11px;
  color: var(--ink-3);
  margin-top: 1px;
}
.project-item.active .m {
  color: var(--ink-2);
}
/* 업체 안의 목차 — 여기서 고른 것만 오른쪽에 뜬다 */
.nav {
  padding: 0 8px;
}
.nav-group {
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid var(--line-2);
}
.nav-group:first-child {
  border-top: none;
  margin-top: 2px;
}
.nav-title {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 0 10px 5px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  color: var(--ink-2);
  transition: background 0.1s, color 0.1s;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.nav-item.active {
  background: var(--surface-3);
  color: var(--ink);
  font-weight: 600;
}
.nav-item .nico {
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--ink-3);
}
.nav-item.active .nico {
  color: var(--ok);
}
.nav-item .nlabel {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-item .nlabel em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 400;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
}
.ncount {
  flex: none;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 7px;
}
.ncount.full {
  background: var(--accent-soft);
  color: var(--ok);
  font-weight: 700;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding: 12px;
}
.meter {
  margin-bottom: 10px;
}
.meter-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.meter-bar {
  height: 4px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}
.meter-bar.hot i {
  background: var(--warn);
}
.who {
  display: flex;
  align-items: center;
  gap: 8px;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex: none;
}
:root[data-theme="dark"] .avatar {
  color: #04201c;
}
.who .n {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── 본문 ─────────────────────────────────────────────── */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.topbar {
  height: 56px;
  flex: none;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
}
.topbar .title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 3px 6px;
  margin-left: -6px;
  max-width: 42ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .title:hover {
  border-color: var(--line);
}
.topbar .title:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}
.spacer {
  flex: 1;
}
.tabs {
  display: flex;
  gap: 2px;
  background: var(--surface-2);
  padding: 3px;
  border-radius: var(--radius-sm);
}
.tabs button {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.progress {
  height: 2px;
  background: transparent;
  flex: none;
}
.progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.35s ease;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

.section {
  margin-bottom: 26px;
}
.section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 10px;
}
.section-head h2 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.section-head .desc {
  font-size: 12px;
  color: var(--ink-3);
  flex: 1;
  min-width: 0;
}

/* 화면 맨 위 안내 문단 */
.lead {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  margin: -2px 0 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad {
  padding: 18px;
}

/* 제품 정의 */
details.profile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
details.profile > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 13.5px;
}
details.profile > summary::-webkit-details-marker {
  display: none;
}
details.profile > summary .chev {
  color: var(--ink-3);
  transition: transform 0.15s;
}
details.profile[open] > summary .chev {
  transform: rotate(90deg);
}
details.profile > summary .sum {
  font-weight: 400;
  font-size: 12px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.profile-body {
  padding: 4px 18px 18px;
  border-top: 1px solid var(--line-2);
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 820px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ── 구조 도식 ─────────────────────────────────────────── */
.schema {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.schema-cap {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.schema-icons {
  display: flex;
  gap: 6px;
}
.si {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--brand);
  display: grid;
  place-items: center;
  flex: none;
}
.schema-arrow {
  color: var(--ink-3);
  flex: none;
}
.schema-part:last-of-type {
  flex: 1;
  min-width: 0;
  max-width: 320px;
}
.schema-funnel {
  display: grid;
  gap: 4px;
}
.sf {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sf i {
  display: block;
  height: 7px;
  border-radius: 4px;
  background: var(--surface-3);
  flex: none;
}
.sf.key i {
  background: var(--accent);
}
.sf span {
  font-size: 11px;
  color: var(--ink-3);
  white-space: nowrap;
}
.sf.key span {
  color: var(--ok);
  font-weight: 600;
}
@media (max-width: 900px) {
  .schema {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .schema-arrow {
    display: none;
  }
  .schema-part:last-of-type {
    max-width: none;
  }
}

/* ── Territory 카드 ────────────────────────────────────── */
.terr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.tcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.tcard header,
.fly-col header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
}
.tico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--ok);
  display: grid;
  place-items: center;
  flex: none;
}
.tmeta {
  flex: 1;
  min-width: 0;
}
.tname {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.tcode {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-top: 1px;
}
.tredo {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--ink-3);
  font-size: 13px;
}
.tredo:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.qs {
  display: grid;
  gap: 6px;
}

.q {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.5;
  transition: border-color 0.12s, background 0.12s, transform 0.08s;
  position: relative;
}
.q .qlv {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.q.key {
  font-size: 13px;
  background: var(--surface);
  border-color: var(--line);
}
.q.key .qlv {
  color: var(--ok);
}
.q.sel .qlv {
  color: inherit;
  opacity: 0.75;
}
.q:hover {
  border-color: var(--accent);
  background: var(--surface);
}
.q:active {
  transform: translateY(1px);
}
/* 설계가 붙은 질문은 민트 바탕 + 왼쪽 민트 바.
   배지를 얹으면 좁은 칸에서 질문 글자와 겹치므로 색으로만 표시한다. */
.q.done {
  border-color: transparent;
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.q.sel {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
:root[data-theme="dark"] .q.sel {
  color: #04201c;
}
.q-empty {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  color: var(--ink-3);
  font-size: 12px;
}

/* 플라이휠 */
.fly {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 900px) {
  .fly {
    grid-template-columns: 1fr;
  }
}
.fly-col {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.fly-col .tico {
  background: var(--surface-2);
  color: var(--brand);
}

/* ── 새 업체 만들기 ────────────────────────────────────── */
.start-wrap {
  max-width: 620px;
  margin: 0 auto;
}

.intake {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 980px) {
  .intake {
    grid-template-columns: 1fr;
  }
}
.intake-main {
  min-width: 0;
}
.msgs {
  display: grid;
  gap: 14px;
  padding-bottom: 8px;
}
.msg {
  max-width: 88%;
}
.msg.user {
  justify-self: end;
}
.msg-who {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--ink-3);
  margin-bottom: 4px;
  padding-left: 2px;
}
.msg-body {
  padding: 12px 15px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.7;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.msg.user .msg-body {
  background: var(--brand);
  color: #fff;
  border-color: transparent;
  border-bottom-right-radius: 5px;
}
:root[data-theme="dark"] .msg.user .msg-body {
  color: #04201c;
}
.msg.assistant .msg-body {
  border-bottom-left-radius: 5px;
}

.composer {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 12px 0 4px;
  background: linear-gradient(to bottom, transparent, var(--bg) 22%);
}
.composer textarea {
  flex: 1;
  min-height: 46px;
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.composer .btn {
  height: 46px;
}

.intake-side {
  position: sticky;
  top: 0;
}
.sum-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 12px;
}
.sum-row {
  padding: 8px 0;
  border-top: 1px solid var(--line-2);
}
.sum-k {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.sum-v {
  font-size: 12.5px;
  line-height: 1.55;
}
.sum-row.empty .sum-v {
  color: var(--ink-3);
  font-style: italic;
}

/* ── 오른쪽 상세 화면 ──────────────────────────────────── */
.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.detail-head h2 {
  font-size: 19px;
  letter-spacing: -0.03em;
  line-height: 1.3;
}
.tico.big {
  width: 44px;
  height: 44px;
  border-radius: 13px;
}
.tsub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}

.qbig-list {
  display: grid;
  gap: 10px;
  max-width: 780px;
}
.qbig {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px;
  box-shadow: var(--shadow);
  transition: border-color 0.12s, transform 0.08s;
}
.qbig:hover {
  border-color: var(--accent);
}
.qbig:active {
  transform: translateY(1px);
}
.qbig .qlv {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.qbig .qtext {
  display: block;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.015em;
}
.qbig .qgo {
  display: block;
  margin-top: 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--brand);
}
.qbig.key {
  border-color: var(--accent);
}
.qbig.key .qlv {
  color: var(--ok);
}
.qbig.done {
  background: var(--accent-soft);
  border-color: transparent;
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow);
}
.qbig.sel {
  border-color: var(--brand);
  box-shadow: inset 3px 0 0 var(--brand), var(--shadow);
}

/* 질문 카드 아래 도구 줄 — 문구 고치기 / 다시 만들기 / 지우기 */
.qtools {
  display: flex;
  gap: 2px;
  padding: 4px 4px 0;
}
.qtools .btn {
  font-size: 11.5px;
  padding: 4px 8px;
  color: var(--ink-3);
}
.qtools .btn:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface-2);
}
.qtools .rate {
  font-size: 13px;
  padding: 3px 7px;
  filter: grayscale(1);
  opacity: 0.55;
}
.qtools .rate:hover {
  filter: none;
  opacity: 1;
}
.qtools .rate.on {
  filter: none;
  opacity: 1;
  background: var(--accent-soft);
}
.qtools .rate.on.bad {
  background: var(--warn-soft);
}
.rate-note {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  color: var(--warn);
  align-self: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-left: 4px;
}
td.num.hot {
  color: var(--warn);
  font-weight: 700;
}

.qedit {
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

/* 각도 넓히기 */
.expand-box {
  margin-top: 18px;
  max-width: 780px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.expand-head b {
  font-size: 13px;
}
.expand-head span {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
}
.expand-row {
  display: flex;
  gap: 8px;
  margin-top: 11px;
}
.expand-row input {
  flex: 1;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 22px;
  max-width: 780px;
}

/* 스켈레톤 */
.skel {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s linear infinite;
  height: 40px;
}
@keyframes shimmer {
  to {
    background-position: -135% 0;
  }
}

/* 빈 상태 */
.empty-state {
  max-width: 460px;
  margin: 12vh auto;
  text-align: center;
}
.empty-state .icon {
  color: var(--ink-3);
  margin-bottom: 14px;
}
.empty-state h2 {
  font-size: 17px;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.empty-state p {
  color: var(--ink-2);
  font-size: 13px;
  margin-bottom: 18px;
}

/* ── 글 설계 패널 (질문 카드 아래로 펼쳐짐) ─────────────── */
.qwrap {
  display: block;
}
.qwrap .qbig.sel {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.dpanel {
  border: 1px solid var(--brand);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface);
  padding: 4px 18px 14px;
  box-shadow: var(--shadow);
  animation: unfold 0.18s ease;
}
@keyframes unfold {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}
.dpanel-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--line-2);
}

.d-question {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.45;
  margin: 10px 0 4px;
}
.d-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 20px 0 6px;
}
/* 연관질문 두 묶음을 나란히 */
.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 20px;
}
@media (max-width: 760px) {
  .two {
    grid-template-columns: 1fr;
  }
}
.d-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.chip {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}
.chip .n {
  color: var(--ink-3);
  font-weight: 700;
  margin-right: 5px;
  font-size: 11px;
}
.rel li {
  font-size: 12.5px;
  margin: 3px 0;
  color: var(--ink-2);
}
.rel {
  padding-left: 16px;
}
.var-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 5px 0;
  font-size: 12.5px;
}
/* 질문에 붙는 표식 — 무엇을 묻는 질문인가 / 우리 근거로 답할 수 있는가 */
.qmeta {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 7px;
}
.mchip {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-3);
  border: 1px solid var(--line-2);
}
.q.sel .mchip,
.qbig.sel .mchip {
  background: transparent;
  border-color: currentColor;
  color: inherit;
  opacity: 0.75;
}
.mchip.fit-high {
  background: var(--accent-soft);
  color: var(--ok);
  border-color: transparent;
}
.mchip.fit-low {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}

/* 3중 게이트 */
.gates {
  display: grid;
  gap: 2px;
}
.gate-row {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--line-2);
}
.gate-no {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.gate-title {
  font-size: 12px;
  font-weight: 700;
}
.gate-title em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 4px;
}
.gate-body {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin-top: 2px;
}

.gate {
  margin-top: 22px;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 12.5px;
  line-height: 1.6;
}

/* ── 사용량 ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
@media (max-width: 860px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px;
  box-shadow: var(--shadow);
}
.stat .k {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
}
.stat .v {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.stat .s {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 1px;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 132px;
  padding: 10px 4px 0;
}
.chart .col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.chart .bar {
  width: 100%;
  max-width: 34px;
  background: var(--accent);
  border-radius: 4px 4px 2px 2px;
  min-height: 2px;
  opacity: 0.85;
}
.chart .col:hover .bar {
  opacity: 1;
}
.chart .lab {
  font-size: 10px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table.data th {
  text-align: left;
  font-size: 11px;
  color: var(--ink-3);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}
table.data td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-2);
}
table.data tr:last-child td {
  border-bottom: none;
}
table.data td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--ink-3);
}

/* ── 토스트 ───────────────────────────────────────────── */
.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 60;
  align-items: center;
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: rise 0.2s ease;
}
.toast.bad {
  background: var(--warn);
  color: #fff;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

dialog::backdrop {
  background: rgba(6, 24, 21, 0.45);
}
dialog {
  color: var(--ink);
  margin: auto; /* 위 * 규칙의 margin:0 이 기본 가운데 정렬을 없애 버린다 */
}

.spin {
  display: inline-block;
  animation: sp 0.9s linear infinite;
}
@keyframes sp {
  to {
    transform: rotate(360deg);
  }
}

.mock-banner {
  background: #7a5b00;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  padding: 5px;
  flex: none;
}
.mock-banner.bad {
  background: var(--warn);
}

@media (max-width: 720px) {
  .shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: none;
  }
}

/* ── 홈(대시보드) ─────────────────────────────────────── */
.home-slot {
  padding: 10px 10px 2px;
}
.home-item {
  border: 1px solid var(--line);
  background: var(--surface);
}
.home-item .nlabel em {
  display: block;
  font-size: 10.5px;
  font-style: normal;
  color: var(--ink-3);
  font-weight: 400;
}
.ncount.warn {
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
}

/* 손볼 것 */
.todo-box {
  padding: 6px 8px;
}
.todo-group + .todo-group {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line-2);
}
.todo-head {
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 8px 6px;
}
.todo-head.warn {
  color: var(--warn);
}
.todo-head em {
  display: block;
  font-style: normal;
  font-weight: 400;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.todo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}
.todo-row:hover {
  background: var(--surface-2);
}
.todo-row .tico {
  flex: none;
  color: var(--ink-3);
  display: flex;
}
.todo-row .tmain {
  min-width: 0;
  flex: 1;
}
.todo-row .tq {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.todo-row .tsub {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.todo-row .tgo {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-3);
  opacity: 0;
  transition: opacity 0.1s;
}
.todo-row:hover .tgo {
  opacity: 1;
}
.todo-more {
  font-size: 11.5px;
  color: var(--ink-3);
  padding: 4px 8px 8px;
}

/* 업체별 진행 */
.pgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.pcard {
  display: block;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow);
  transition: border-color 0.1s, transform 0.1s;
}
.pcard:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.pc-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pc-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.flag {
  flex: none;
  font-size: 10.5px;
  border-radius: 999px;
  padding: 1px 7px;
  background: var(--surface-2);
  color: var(--ink-2);
}
.flag.warn {
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
}
.pc-sub {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pc-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 11px;
}
.pc-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s;
}
.pc-bar.hot i {
  background: var(--warn);
}
.pc-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 7px;
}
.pc-todo {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 11px;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

/* 홈에서 찾아 들어온 질문을 잠깐 짚어 준다 */
.qbig.focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 처리함 */
.todo-line {
  display: flex;
  align-items: center;
  gap: 6px;
}
.todo-line .todo-row {
  flex: 1;
  min-width: 0;
}
.todo-line .tside {
  flex: none;
  opacity: 0;
  transition: opacity 0.1s;
  white-space: nowrap;
}
.todo-line:hover .tside,
.todo-line .tside:focus-visible {
  opacity: 1;
}
.handled-box {
  margin-top: 10px;
}
.handled-toggle {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background 0.1s;
}
.handled-toggle:hover {
  background: var(--surface-2);
}
.handled-toggle em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-3);
  margin-left: 6px;
  font-size: 11.5px;
}
.qtools .on.handled {
  background: var(--accent-soft);
  color: var(--ok);
  font-weight: 700;
}

/* 앱 전체 화면(평가·사용량) — 업체와 무관하므로 항상 보인다 */
.global-nav {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line-2);
}
.global-nav .nav-item .nlabel em {
  display: block;
  font-size: 10.5px;
  font-style: normal;
  color: var(--ink-3);
  font-weight: 400;
}
