:root {
  --p: #6c5ce7;
  --p-dk: #5b4bd6;
  --sec: #8b7cf6;
  --bg: #f6f6fb;
  --card: #ffffff;
  --sb: #15152e;
  --sb-hover: #23233f;
  --sb-act: #6c5ce7;
  --txt: #1a1e3c;
  --muted: #6b7280;
  --bdr: #e8e8f2;
  --ok: #10b981;
  --warn: #f59e0b;
  --err: #ef4444;
  --cyan: #00b8a9;
  --pink: #ec4899;
  --r: 16px;
  --r-sm: 10px;
  --sh: 0 2px 14px rgba(108, 92, 231, 0.08);
  --sh-md: 0 10px 32px rgba(108, 92, 231, 0.16);
  font-family: "Segoe UI", Pretendard, Inter, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--txt);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

/* =========================================================
   LOGIN
========================================================= */
#loginScreen {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #0f1229 0%, #1a1e50 45%, #3b2f7e 100%);
}

.login-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-deco::before {
  content: "";
  position: absolute;
  top: -250px;
  right: -150px;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 92, 231, 0.25) 0%, transparent 65%);
}

.login-deco::after {
  content: "";
  position: absolute;
  bottom: -150px;
  left: -80px;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 92, 252, 0.2) 0%, transparent 65%);
}

.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 44px 40px 40px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 36px;
}

.login-logo-mark {
  display: grid;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  font-weight: 800;
  font-size: 17px;
  background: linear-gradient(135deg, var(--p), var(--sec));
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.4);
}

.login-logo-text strong {
  display: block;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
}

.login-logo-text span {
  color: rgba(255, 255, 255, 0.45);
  font-size: 12px;
}

.login-h {
  margin-bottom: 6px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.login-sub {
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

.lf {
  margin-bottom: 14px;
}

.lf label {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 500;
}

.lf input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.lf input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.lf input:focus {
  border-color: rgba(108, 92, 231, 0.8);
  background: rgba(255, 255, 255, 0.13);
}

#loginError {
  display: none;
  margin: -4px 0 14px;
  padding: 8px 12px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 8px;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.12);
  font-size: 12px;
}

.login-btn {
  width: 100%;
  margin-top: 4px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--p), var(--sec));
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(108, 92, 231, 0.35);
  transition: opacity 0.2s, transform 0.1s;
}

.login-btn:hover {
  opacity: 0.9;
}

.login-btn:active {
  transform: scale(0.98);
}

.login-hint {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.login-hint code {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font-family: monospace;
}

/* =========================================================
   APP LAYOUT
========================================================= */
#appScreen {
  display: none;
  height: 100vh;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
}

/* =========================================================
   SIDEBAR
   - 플로우(flow.team) 스타일의 2단 구조: 왼쪽은 항상 보이는 좁은
     아이콘 레일(.sb-rail), 오른쪽은 그룹별 하위 메뉴가 담긴
     패널(.sb-panel). 패널은 접기 버튼으로 숨길 수 있지만 레일은
     항상 남아 있어, 접힌 상태에서도 다른 그룹으로 바로 이동 가능.
========================================================= */
.sb {
  display: flex;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--sb);
}

.sb-rail {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  width: 72px;
  padding: 14px 0;
}

.sb-rail-mark {
  display: grid;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  background: linear-gradient(135deg, var(--p), var(--sec));
}

.sb-rail-nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rail-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 58px;
  padding: 9px 4px;
  border: none;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, 0.5);
  background: none;
  text-align: center;
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
}

.rail-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: var(--sb-hover);
}

.rail-btn.on {
  color: #fff;
  background: linear-gradient(135deg, var(--p), var(--sec));
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
}

/* 홈/위키/설정처럼 nav-btn(가로형 기본 스타일)을 겸하는 레일 버튼은
   .nav-btn 규칙이 나중에 나와도 반드시 세로형 레일 레이아웃을 유지해야 한다. */
.rail-btn.nav-btn {
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 58px;
  padding: 9px 4px;
  text-align: center;
}

.ri {
  font-size: 18px;
  line-height: 1;
}

.rl {
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.sb-rail-foot {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.collapse-btn {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: none;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  font-size: 14px;
  transition: background 0.14s, color 0.14s;
}

.collapse-btn:hover {
  color: rgba(255, 255, 255, 0.75);
  background: var(--sb-hover);
}

.sb-panel {
  display: flex;
  flex-direction: column;
  width: 200px;
  min-width: 200px;
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  transition: width 0.2s ease, min-width 0.2s ease, opacity 0.15s ease;
}

.sb.closed .sb-panel,
.sb-panel.empty {
  width: 0;
  min-width: 0;
  border-left: none;
  opacity: 0;
}

.sb-panel-hd {
  padding: 18px 16px 12px;
}

.sb-panel-hd strong {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}

.sb-panel-hd span {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.38);
  font-size: 11px;
  white-space: nowrap;
}

.sb-panel-group {
  display: none;
  flex-direction: column;
  padding: 4px 8px 10px;
}

.sb-panel-group.on {
  display: flex;
}

.sb-section-lbl {
  padding: 10px 9px 4px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.28);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-btn {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 10px;
  padding: 10px 9px;
  border: none;
  border-radius: var(--r-sm);
  color: rgba(255, 255, 255, 0.55);
  background: none;
  font-size: 13px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.14s, color 0.14s, transform 0.14s;
}

.nav-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  background: var(--sb-hover);
}

.nav-btn.on {
  color: #fff;
  background: linear-gradient(135deg, var(--p), var(--sec));
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.4);
}

.ni {
  flex-shrink: 0;
  width: 18px;
  font-size: 14px;
  text-align: center;
}

/* =========================================================
   MAIN CONTENT
========================================================= */
.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--bdr);
  background: var(--card);
  box-shadow: 0 1px 0 rgba(15, 18, 41, 0.02);
}

.topbar-date {
  color: var(--muted);
  font-size: 13px;
}

.topbar-date strong {
  color: var(--p);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.conn-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
}

.conn-pill.ok {
  color: var(--ok);
  background: #ecfdf5;
}

.conn-pill.pnd {
  color: var(--warn);
  background: #fffbeb;
}

.conn-pill.err {
  color: var(--err);
  background: #fef2f2;
}

.tb-btn {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  color: var(--muted);
  background: var(--card);
  font-size: 16px;
  transition: background 0.14s, border-color 0.14s;
}

.tb-btn:hover {
  border-color: #d9d7fb;
  background: var(--bg);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--bdr);
  border-radius: 999px;
  background: var(--bg);
}

.u-av {
  display: grid;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  background: linear-gradient(135deg, var(--p), var(--sec));
}

.u-name {
  font-weight: 600;
  font-size: 13px;
}

.u-role {
  color: var(--muted);
  font-size: 11px;
}

.logout-btn {
  padding: 8px 14px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  color: var(--muted);
  background: var(--card);
  font-size: 13px;
  transition: background 0.14s, color 0.14s;
}

.logout-btn:hover {
  border-color: #fecaca;
  color: var(--err);
  background: #fef2f2;
}

.page-body {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}

.view {
  display: none;
}

.view.on {
  display: block;
}

/* =========================================================
   PAGE HEADING / NOTICE
========================================================= */
.ph {
  margin-bottom: 22px;
}

.ph h1 {
  margin: 0;
  font-weight: 700;
  font-size: 24px;
}

.ph p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.notice {
  display: flex;
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px 22px;
  border: 1px solid #dcd6fb;
  border-radius: var(--r);
  background: #f1efff;
}

.notice-ic {
  display: grid;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  background: var(--p);
}

.notice h2 {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 14px;
}

.notice p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.notice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag {
  padding: 3px 10px;
  border: 1px solid #dcd6fb;
  border-radius: 999px;
  color: var(--p);
  background: #fff;
  font-weight: 500;
  font-size: 11px;
}

/* =========================================================
   METRIC GRID
========================================================= */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.mc {
  padding: 20px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--sh);
  transition: box-shadow 0.16s, transform 0.16s;
}

.mc:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.mc-icon {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 10px;
  font-size: 17px;
}

.mc-icon.bl {
  background: #f1efff;
}

.mc-icon.gr {
  background: #ecfdf5;
}

.mc-icon.pu {
  background: #f5f0ff;
}

.mc-icon.or {
  background: #fffbeb;
}

.mc-label {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mc-val {
  margin-bottom: 4px;
  font-weight: 700;
  font-size: 28px;
  line-height: 1;
}

.mc-note {
  color: var(--muted);
  font-size: 11px;
}

/* =========================================================
   WORKSPACE / PANEL
========================================================= */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.panel {
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--sh);
}

.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--bdr);
}

.panel-hd.compact {
  padding-bottom: 12px;
}

.panel-title {
  font-weight: 600;
  font-size: 15px;
}

.panel-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 22px;
}

.search-inp {
  width: 220px;
  padding: 9px 14px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  color: var(--txt);
  background: var(--bg);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}

.search-inp:focus {
  border-color: var(--p);
}

/* =========================================================
   SOURCE LIST
========================================================= */
.source-list {
  padding: 6px 20px 20px;
}

.source-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  width: 100%;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--bdr);
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.source-item:last-child {
  border-bottom: none;
}

.source-item.selected {
  margin: 4px 0;
  padding: 14px;
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: 10px;
  background: #f1efff;
}

.source-item strong,
.source-item span,
.source-item small {
  display: block;
}

.source-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.source-item small {
  margin-top: 6px;
  color: #7b8798;
  font-size: 11px;
  line-height: 1.45;
}

.source-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.source-actions a {
  color: var(--p);
  font-size: 12px;
  text-decoration: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 12px;
}

.badge.done {
  color: #0d7f4a;
  background: rgba(16, 185, 129, 0.14);
}

.badge.risk {
  color: #c04114;
  background: rgba(239, 68, 68, 0.14);
}

/* =========================================================
   WORKBOOK LIST (SHEET PREVIEW)
========================================================= */
.workbook-list {
  display: grid;
  gap: 18px;
  padding: 0 22px 22px;
}

.workbook-card {
  overflow: hidden;
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  background: #fff;
}

.workbook-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
}

.workbook-head h3 {
  margin: 8px 0 0;
  font-size: 20px;
}

.workbook-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, white);
  font-weight: 700;
  font-size: 12px;
}

.open-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(108, 92, 231, 0.25);
  border-radius: 8px;
  color: var(--p);
  background: #f1efff;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}

.sheet-tabs {
  display: flex;
  gap: 8px;
  padding: 0 22px 16px;
  border-bottom: 1px solid var(--bdr);
  overflow-x: auto;
}

.sheet-tab {
  display: grid;
  gap: 4px;
  min-width: 118px;
  min-height: 56px;
  align-content: center;
  padding: 8px 12px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  color: #344054;
  background: var(--bg);
  text-align: left;
  cursor: pointer;
}

.sheet-tab.active {
  border-color: rgba(108, 92, 231, 0.5);
  color: var(--p-dk);
  background: #f1efff;
  box-shadow: inset 0 0 0 1px rgba(108, 92, 231, 0.16);
}

.sheet-tab span {
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-tab small {
  color: var(--muted);
}

.sheet-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  color: var(--muted);
  font-size: 13px;
}

.sheet-toolbar strong {
  display: block;
  color: var(--txt);
  font-size: 14px;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
}

.schedule-table th,
.schedule-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #eef0f5;
  font-size: 13px;
  text-align: left;
}

.schedule-table th {
  position: sticky;
  top: 0;
  background: #f7f8fc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.schedule-table tbody tr:last-child td {
  border-bottom: none;
}

.schedule-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
}

.schedule-badge.done {
  background: #dcfce7;
  color: #15803d;
}

.schedule-badge.pending {
  background: #fef3c7;
  color: #b45309;
}

.handover-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin: 0 22px 22px;
}

.handover-card {
  padding: 16px;
  border: 1px solid var(--bdr);
  border-radius: 12px;
  background: #fff;
}

.handover-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.handover-card-head strong {
  font-size: 14px;
  color: var(--txt);
}

.handover-pct {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--p);
}

.handover-company {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.handover-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--bdr);
  overflow: hidden;
  margin-bottom: 8px;
}

.handover-progress-bar {
  height: 100%;
  background: var(--p);
  border-radius: 999px;
}

.handover-steps {
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 8px;
}

.handover-note {
  font-size: 12px;
  color: var(--txt);
  background: var(--bg);
  border-radius: 8px;
  padding: 8px 10px;
  line-height: 1.5;
}

/* 플로우(flow.team) 위키 홈 화면 구조: 왼쪽에 최근 열람/즐겨찾기/카테고리를
   모아둔 좁은 사이드바, 오른쪽 넓은 영역에 인사말 + 카드형 문서 목록. */
.wiki-shell {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 0;
  min-height: 640px;
  border: 1px solid var(--bdr);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--sh);
  overflow: hidden;
  transition: grid-template-columns 0.18s ease;
}

.wiki-shell.side-collapsed {
  grid-template-columns: 0px minmax(0, 1fr);
}

.wiki-side {
  padding: 14px 14px 18px;
  border-right: 1px solid var(--bdr);
  background: #fbfbfe;
  overflow: hidden;
  overflow-y: auto;
  transition: opacity 0.15s ease, padding 0.18s ease;
}

.wiki-shell.side-collapsed .wiki-side {
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  pointer-events: none;
}

.wiki-side-expand-btn {
  position: absolute;
  top: 14px;
  left: 6px;
  z-index: 2;
  display: none;
  width: 26px;
  height: 26px;
  border: 1px solid var(--bdr);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.wiki-shell.side-collapsed .wiki-side-expand-btn {
  display: block;
}

.wiki-side-topbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
}

.wiki-side-brand {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 4px;
}

.wiki-side-brand-ic {
  font-size: 18px;
}

.wiki-side-brand strong {
  overflow: hidden;
  font-size: 14px;
  color: var(--txt);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-side-brand-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 10px;
}

.wiki-side-collapse-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}

.wiki-side-collapse-btn:hover {
  background: var(--bg);
  color: var(--p);
}

.wiki-side-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  padding: 0 4px;
}

.wiki-side-icon-btn {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--bdr);
  border-radius: 9px;
  background: var(--card);
  color: var(--txt);
  font-size: 13px;
  cursor: pointer;
}

.wiki-side-icon-btn:hover {
  border-color: var(--p);
  color: var(--p);
}

.wiki-side-new-btn {
  margin-left: auto;
  border-color: var(--p);
  background: var(--p);
  color: #fff;
  font-weight: 700;
}

.wiki-side-new-btn:hover {
  color: #fff;
  opacity: 0.9;
}

.wiki-side-search-box {
  margin: 0 4px 14px;
}

.wiki-side-search-box .fi {
  width: 100%;
  padding: 7px 10px;
  font-size: 12.5px;
}

.wiki-side-search-box .wiki-side-list {
  margin-top: 4px;
}

.wiki-side-fold {
  margin-bottom: 10px;
}

.wiki-side-fold-hd {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 4px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.wiki-side-fold-hd:hover {
  color: var(--txt);
}

.wiki-side-fold-chevron {
  display: inline-block;
  font-size: 9px;
  transition: transform 0.15s ease;
}

.wiki-side-fold.folded .wiki-side-fold-chevron {
  transform: rotate(-90deg);
}

.wiki-side-fold.folded .wiki-side-list,
.wiki-side-fold.folded .wiki-add-category {
  display: none;
}

.wiki-side-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wiki-side-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--txt);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}

.wiki-side-row-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-side-row:hover {
  background: var(--bg);
}

.wiki-side-empty {
  padding: 4px;
  color: var(--muted);
  font-size: 11.5px;
}

.wiki-cat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--txt);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.wiki-cat-btn span {
  color: var(--muted);
  font-size: 11.5px;
}

.wiki-cat-btn:hover {
  background: var(--bg);
}

.wiki-cat-btn.active {
  background: var(--p);
  color: #fff;
}

.wiki-cat-btn.active span {
  color: rgba(255, 255, 255, 0.8);
}

.wiki-add-category {
  display: flex;
  gap: 6px;
}

.wiki-add-category .fi {
  flex: 1;
  padding: 8px 10px;
  font-size: 12.5px;
}

.wiki-main {
  padding: 26px 30px;
  overflow-y: auto;
}

.wiki-greeting {
  margin-bottom: 30px;
}

.wiki-greeting-date {
  color: var(--muted);
  font-size: 13px;
}

.wiki-greeting h2 {
  margin: 6px 0 4px;
  font-size: 24px;
  color: var(--txt);
}

.wiki-greeting-name {
  color: var(--p);
}

.wiki-greeting p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.wiki-home-section {
  margin-bottom: 30px;
}

.wiki-home-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.wiki-home-hd-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.wiki-viewall {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
}

.wiki-viewall:hover {
  color: var(--p);
}

.wiki-home-hd h3 {
  margin: 0;
  font-size: 15px;
  color: var(--txt);
}

.wiki-home-hd span {
  color: var(--muted);
  font-size: 12px;
}

.wiki-new-btn {
  width: auto;
  margin: 0;
  padding: 8px 16px;
}

.wiki-empty-inline {
  padding: 18px;
  border: 1px dashed var(--bdr);
  border-radius: var(--r-sm);
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.wiki-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.wiki-card {
  padding: 0;
  border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  background: var(--card);
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.16s, transform 0.16s;
}

.wiki-card:hover {
  box-shadow: var(--sh-md);
  transform: translateY(-2px);
}

.wiki-card-cover {
  position: relative;
  display: grid;
  height: 64px;
  place-items: center;
  background: linear-gradient(135deg, var(--p), var(--sec));
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.wiki-card-cover-badge {
  position: absolute;
  bottom: -10px;
  left: 12px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 18, 41, 0.15);
  font-size: 13px;
}

.wiki-card-title {
  padding: 16px 12px 2px;
  overflow: hidden;
  color: var(--txt);
  font-weight: 600;
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-card-time {
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 11px;
}

.wiki-list-rows {
  border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  overflow: hidden;
}

.wiki-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  border-bottom: 1px solid var(--bdr);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.wiki-row:last-child {
  border-bottom: none;
}

.wiki-row:hover {
  background: var(--bg);
}

.wiki-row-title {
  overflow: hidden;
  color: var(--txt);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wiki-row-cat {
  flex-shrink: 0;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
}

.wiki-row-meta {
  flex-shrink: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 11.5px;
}

.wiki-back-btn {
  margin-bottom: 16px;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
}

.wiki-back-btn:hover {
  color: var(--p);
}

.wiki-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--bdr);
}

.wiki-detail-head h2 {
  margin: 8px 0 4px;
  font-size: 19px;
  color: var(--txt);
}

.wiki-detail-head p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.wiki-detail-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--txt);
  white-space: normal;
}

.wiki-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wiki-editor-textarea {
  resize: vertical;
  font-family: inherit;
  line-height: 1.7;
}

.sheet-grid-wrap {
  max-height: 600px;
  margin: 0 22px 22px;
  border: 1px solid var(--bdr);
  border-radius: 10px;
  background: #fff;
  overflow: auto;
}

.sheet-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sheet-grid td {
  width: 128px;
  max-width: 128px;
  height: 34px;
  padding: 6px 8px;
  overflow: hidden;
  border: 1px solid #eef0f5;
  color: #202938;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.sheet-grid td.blank {
  background: #fafbfe;
}

.sheet-grid td.header-cell {
  color: #fff;
  background: var(--sb);
  font-weight: 800;
  text-align: center;
}

.sheet-grid td.date-cell {
  color: var(--p-dk);
  background: #f1efff;
  font-weight: 800;
  text-align: center;
}

.sheet-grid td.warn-cell {
  color: #d92d20;
  background: #fff3e6;
  font-weight: 750;
}

.sheet-grid td.done-cell {
  color: #067647;
  background: #ecfdf3;
  font-weight: 750;
}

.sheet-grid td.number-cell {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* =========================================================
   EMPTY / LOADING STATES
========================================================= */
.empty,
.loading-state {
  display: grid;
  min-height: 200px;
  padding: 40px 20px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.empty-ic {
  margin-bottom: 12px;
  font-size: 38px;
}

.empty h3 {
  margin: 0 0 6px;
  color: var(--txt);
  font-weight: 600;
  font-size: 15px;
}

.empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.empty-inline {
  color: var(--muted);
  font-size: 13px;
}

.loading-state.error {
  color: #d92d20;
  background: #fff6f4;
}

/* =========================================================
   FORM ELEMENTS
========================================================= */
.fl {
  display: block;
  margin: 16px 0 6px;
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
}

.fl:first-child {
  margin-top: 0;
}

.fi {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  color: var(--txt);
  background: var(--bg);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fi:focus {
  border-color: var(--p);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}

.seo-textarea {
  min-height: 320px;
  line-height: 1.6;
  resize: vertical;
}

.pri-btn {
  width: 100%;
  margin-top: 14px;
  padding: 11px;
  border: none;
  border-radius: var(--r-sm);
  color: #fff;
  background: linear-gradient(135deg, var(--p), var(--sec));
  font-weight: 600;
  font-size: 13px;
  transition: opacity 0.14s;
}

.pri-btn:hover {
  opacity: 0.92;
}

.ghost-btn {
  padding: 9px 14px;
  border: 1px solid var(--bdr);
  border-radius: var(--r-sm);
  color: var(--p-dk);
  background: #f1efff;
  font-weight: 600;
  font-size: 12px;
  transition: background 0.14s;
}

.ghost-btn:hover {
  background: #e0e7ff;
}

.fine-print {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* =========================================================
   KEYWORD / SERP INPUT LAYOUT
========================================================= */
.kw-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* =========================================================
   BLOG SEO TOOL
========================================================= */
.seo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.seo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.chk-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.score-gauge-wrap {
  position: relative;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}

.score-ring {
  width: 140px;
  height: 140px;
  transform: rotate(-90deg);
}

.score-ring-bg,
.score-ring-fg {
  fill: none;
  stroke-width: 10;
}

.score-ring-bg {
  stroke: #eef0f5;
}

.score-ring-fg {
  stroke: var(--warn);
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  transition: stroke-dashoffset 0.35s ease, stroke 0.35s ease;
}

.score-ring-val {
  position: absolute;
  top: 48px;
  left: 0;
  width: 140px;
  font-weight: 800;
  font-size: 30px;
  text-align: center;
}

.score-ring-label {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.checklist {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.chk-item {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--bdr);
  border-radius: 9px;
  background: var(--bg);
}

.chk-item.pass {
  border-color: rgba(16, 185, 129, 0.3);
  background: #ecfdf5;
}

.chk-item.fail {
  border-color: rgba(239, 68, 68, 0.22);
  background: #fef7f7;
}

.chk-ic {
  flex-shrink: 0;
  font-size: 14px;
}

.chk-item.pass .chk-ic {
  color: var(--ok);
}

.chk-item.fail .chk-ic {
  color: var(--err);
}

.chk-body strong {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
}

.chk-body span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.hashtag-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--bdr);
}

.hashtag-box h3 {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 12.5px;
}

.hashtag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.hashtag-chip {
  padding: 5px 11px;
  border: 1px solid rgba(108, 92, 231, 0.22);
  border-radius: 999px;
  color: var(--p-dk);
  background: #f1efff;
  font-size: 12px;
  transition: background 0.14s;
}

.hashtag-chip:hover {
  background: #e0e7ff;
}

/* =========================================================
   SETTINGS PAGE
========================================================= */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 920px;
}

.settings-grid .panel:first-child {
  grid-column: 1 / -1;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bdr);
}

.user-row:last-child {
  border-bottom: none;
}

.uav {
  display: grid;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  background: linear-gradient(135deg, var(--p), var(--sec));
}

.u-info-name {
  font-weight: 600;
  font-size: 13px;
}

.u-info-id {
  color: var(--muted);
  font-size: 11px;
}

.badge-me {
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 20px;
  color: var(--p);
  background: #f1efff;
  font-size: 11px;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 1180px) {
  .workspace,
  .seo-layout,
  .kw-layout,
  .combiner-groups {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .settings-grid .panel:first-child {
    grid-column: auto;
  }
}

@media (max-width: 820px) {
  .sb {
    position: fixed;
    z-index: 50;
    height: 100vh;
  }

  .main {
    margin-left: 72px;
  }

  .page-body {
    padding: 20px 16px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .panel-hd {
    flex-direction: column;
    align-items: stretch;
  }

  .search-inp {
    width: 100%;
  }

  .topbar {
    gap: 8px;
    padding: 0 12px 0 66px;
  }

  .topbar-date,
  .conn-pill span:last-child {
    display: none;
  }

  .topbar-right {
    gap: 6px;
  }

  .user-chip {
    padding: 4px 10px 4px 4px;
  }

  .user-chip .u-role {
    display: none;
  }

  .logout-btn {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* =========================================================
   KEYWORD / SERP TOOLS — dark theme (독립 색상 체계)
========================================================= */
.kwd-shell {
  --kd-bg: #0b0f1a;
  --kd-panel: #131a2a;
  --kd-panel-2: #10161f;
  --kd-bdr: #232b3d;
  --kd-txt: #e8ebf3;
  --kd-muted: #8891a7;
  --kd-green: #22c55e;
  --kd-blue: #3b82f6;
  --kd-amber: #f5a524;
  --kd-purple: #a78bfa;
  --kd-pink: #ec4899;
  --kd-red: #ef4444;
  padding: 24px;
  border-radius: 18px;
  background: var(--kd-bg);
  color: var(--kd-txt);
}

.kwd-page-head {
  margin-bottom: 20px;
}

.kwd-page-head h1 {
  color: var(--kd-txt);
}

.kwd-page-head p {
  color: var(--kd-muted);
}

.kwd-searchbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.kwd-search-input-wrap {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  border: 1px solid var(--kd-bdr);
  border-radius: 12px;
  background: var(--kd-panel);
  transition: border-color 0.15s;
}

.kwd-search-input-wrap:focus-within {
  border-color: var(--kd-green);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.kwd-search-ic {
  flex-shrink: 0;
  color: var(--kd-muted);
  font-size: 16px;
}

.kwd-search-input-wrap input {
  flex: 1;
  height: 54px;
  border: none;
  color: var(--kd-txt);
  background: transparent;
  font-size: 15px;
  outline: none;
}

.kwd-search-input-wrap input::placeholder {
  color: #5a6376;
}

.kwd-analyze-btn {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  padding: 0 26px;
  border: none;
  border-radius: 12px;
  color: #06280f;
  background: linear-gradient(135deg, #34d766, var(--kd-green));
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(34, 197, 94, 0.28);
  transition: transform 0.12s, opacity 0.12s;
}

.kwd-analyze-btn:hover {
  opacity: 0.92;
}

.kwd-analyze-btn:active {
  transform: scale(0.98);
}

.kwd-recent {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
  min-height: 20px;
}

.kwd-recent-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
  color: var(--kd-muted);
  font-size: 12.5px;
}

.kwd-recent-tag {
  padding: 6px 13px;
  border: 1px solid var(--kd-bdr);
  border-radius: 999px;
  color: #c3c9d8;
  background: var(--kd-panel);
  font-size: 12.5px;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.kwd-recent-tag:hover {
  border-color: var(--kd-green);
  color: var(--kd-green);
  background: rgba(34, 197, 94, 0.08);
}

.kwd-empty {
  display: grid;
  padding: 70px 20px;
  place-items: center;
  color: var(--kd-muted);
  text-align: center;
}

.kwd-empty-ic {
  margin-bottom: 14px;
  font-size: 42px;
  opacity: 0.7;
}

.kwd-empty h3 {
  margin: 0 0 8px;
  color: var(--kd-txt);
  font-size: 16px;
}

.kwd-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.kwd-loading {
  display: grid;
  padding: 70px 20px;
  place-items: center;
  color: var(--kd-muted);
  text-align: center;
}

.kwd-spin {
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border: 3px solid var(--kd-bdr);
  border-top-color: var(--kd-green);
  border-radius: 50%;
  animation: kwd-spin 0.8s linear infinite;
}

@keyframes kwd-spin {
  to {
    transform: rotate(360deg);
  }
}

.kwd-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
}

.kwd-result-head h2 {
  margin: 0;
  color: var(--kd-txt);
  font-weight: 700;
  font-size: 21px;
}

.kwd-accent {
  color: var(--kd-green);
}

.kwd-result-actions {
  display: flex;
  gap: 10px;
}

.kwd-ghost-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 15px;
  border: 1px solid var(--kd-bdr);
  border-radius: 9px;
  color: #c3c9d8;
  background: var(--kd-panel);
  font-size: 12.5px;
  transition: background 0.14s, border-color 0.14s;
}

.kwd-ghost-btn:hover {
  border-color: #3a4358;
  background: #1a2233;
}

.kwd-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kwd-stat-grid.kwd-three {
  grid-template-columns: repeat(3, 1fr);
}

.kwd-stat-card {
  padding: 22px 20px;
  border: 1px solid var(--kd-bdr);
  border-radius: 14px;
  background: var(--kd-panel);
}

.kwd-stat-card.kwd-highlight {
  border-color: rgba(245, 165, 36, 0.35);
  background: linear-gradient(160deg, rgba(245, 165, 36, 0.1), var(--kd-panel) 60%);
}

.kwd-stat-ic {
  margin-bottom: 12px;
  color: var(--kd-amber);
  font-size: 20px;
}

.kwd-stat-card:not(.kwd-highlight):nth-child(2) .kwd-stat-ic {
  color: var(--kd-green);
}

.kwd-stat-card:not(.kwd-highlight):nth-child(3) .kwd-stat-ic {
  color: var(--kd-blue);
}

.kwd-stat-card:not(.kwd-highlight):nth-child(4) .kwd-stat-ic {
  color: var(--kd-purple);
}

.kwd-stat-val {
  margin-bottom: 4px;
  color: var(--kd-txt);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.15;
}

.kwd-stat-label {
  color: var(--kd-muted);
  font-size: 12.5px;
}

.kwd-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.kwd-chart-card {
  padding: 22px;
  border: 1px solid var(--kd-bdr);
  border-radius: 14px;
  background: var(--kd-panel);
}

.kwd-chart-card h3 {
  margin: 0 0 18px;
  color: var(--kd-txt);
  font-weight: 700;
  font-size: 14.5px;
}

.kwd-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  height: 180px;
  padding: 0 10px;
}

.kwd-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 90px;
}

.kwd-bar-track {
  display: flex;
  align-items: flex-end;
  height: 150px;
}

.kwd-bar {
  width: 64px;
  border-radius: 8px 8px 0 0;
  transition: height 0.4s ease;
}

.kwd-bar.pc {
  background: linear-gradient(180deg, #4f8cff, var(--kd-blue));
}

.kwd-bar.mobile {
  background: linear-gradient(180deg, #34d766, var(--kd-green));
}

.kwd-bar-val {
  color: var(--kd-txt);
  font-weight: 700;
  font-size: 13px;
}

.kwd-bar-label {
  color: var(--kd-muted);
  font-size: 12px;
}

.kwd-donut-wrap {
  display: grid;
  place-items: center;
  height: 180px;
}

.kwd-donut-val {
  color: var(--kd-txt);
  font-weight: 800;
  font-size: 24px;
}

.kwd-donut-label {
  color: var(--kd-muted);
  font-size: 11.5px;
}

.kwd-donut-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 8px;
}

.kwd-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--kd-muted);
  font-size: 12px;
}

.kwd-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.kwd-panel {
  padding: 22px;
  border: 1px solid var(--kd-bdr);
  border-radius: 14px;
  background: var(--kd-panel);
}

.kwd-panel h3 {
  margin: 0 0 16px;
  color: var(--kd-txt);
  font-weight: 700;
  font-size: 14.5px;
}

.kwd-table {
  width: 100%;
  border-collapse: collapse;
}

.kwd-table th,
.kwd-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--kd-bdr);
  color: var(--kd-txt);
  font-size: 12.5px;
  text-align: left;
}

.kwd-table th {
  color: var(--kd-muted);
  font-weight: 500;
  font-size: 11px;
}

.report-output {
  padding: 22px;
  border: 1px solid var(--kd-bdr);
  border-radius: 14px;
  background: var(--kd-panel);
  color: var(--kd-txt);
  font-size: 13.5px;
  line-height: 1.8;
  white-space: normal;
}

.kwd-table td.kwd-num {
  color: #c3c9d8;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.kwd-table a {
  color: #7fb2ff;
  text-decoration: none;
}

.kwd-table a:hover {
  text-decoration: underline;
}

.kwd-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 650;
  font-size: 11px;
}

.kwd-badge.low {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.14);
}

.kwd-badge.mid {
  color: #fbbf24;
  background: rgba(245, 165, 36, 0.14);
}

.kwd-badge.high {
  color: #f87171;
  background: rgba(239, 68, 68, 0.14);
}

.kwd-badge.video-yes {
  color: #f472b6;
  background: rgba(236, 72, 153, 0.14);
}

.kwd-badge.video-no {
  color: #6b7280;
  background: rgba(107, 114, 128, 0.14);
}

.kwd-note {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--kd-bdr);
  border-radius: 10px;
  color: var(--kd-muted);
  background: var(--kd-panel-2);
  font-size: 12px;
  line-height: 1.6;
}

.kwd-note strong {
  color: #c3c9d8;
}

.kwd-shell mark {
  background: transparent;
  color: var(--kd-red);
  font-weight: 700;
}

.kwd-error {
  padding: 40px 20px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 14px;
  background: rgba(239, 68, 68, 0.08);
  color: #fca5a5;
  text-align: center;
}

@media (max-width: 1180px) {
  .kwd-stat-grid,
  .kwd-stat-grid.kwd-three,
  .kwd-chart-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .kwd-shell {
    padding: 16px;
  }

  .kwd-searchbar {
    flex-direction: column;
  }

  .kwd-stat-grid,
  .kwd-stat-grid.kwd-three,
  .kwd-chart-grid {
    grid-template-columns: 1fr;
  }

  .kwd-result-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* =========================================================
   KEYWORD COMBINER
========================================================= */
.combiner-groups {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.combiner-textarea {
  height: auto;
  resize: vertical;
  font-family: inherit;
  line-height: 1.6;
}

.combiner-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.combiner-actions .pri-btn {
  flex: 1;
}
