/* Alone — Layout 5 v2 (SPARK edition).
   Structural CSS. Theme tokens injected per file via <style> :root override. */

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'ss10' on, 'cv11' on;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  letter-spacing: -0.01em;
}

/* ---- Icon system ---- */
.ico {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor; fill: none;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.ico-sm { width: 14px; height: 14px; stroke-width: 1.8; }
.ico-md { width: 20px; height: 20px; }
.ico-lg { width: 24px; height: 24px; }

/* ---- Layout shell ---- */
.app { width: 100%; height: 100%; display: flex; }

/* === Sidebar === */
.sidebar {
  width: 260px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 28px 20px;
}
.brand { display: flex; align-items: center; gap: 12px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.brand-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.brand-mark .ico { width: 22px; height: 22px; stroke-width: 2.4; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 2px; }

.nav { padding: 18px 0; flex: 1; }
.nav-title { color: var(--text-3); font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; padding: 14px 6px 8px; }
/* 섹션 헤더 + 우측 액션(+추가) — 프로젝트 섹션용 */
.nav-title.row { display: flex; align-items: center; }
.nav-title .nav-add {
  margin-left: auto; width: 20px; height: 20px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3); cursor: pointer; border: 0; background: transparent;
}
.nav-title .nav-add:hover { background: var(--panel); color: var(--accent); }
.nav-title .nav-add .ico-sm { width: 15px; height: 15px; }
/* 프로젝트 아이템 — 좌측 색 점(아바타) + 이름 */
.nav-proj { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; letter-spacing: -0.01em; text-decoration: none; }
.nav-proj:hover { background: var(--panel); color: var(--text); }
.nav-proj.active { background: var(--panel); color: var(--text); }
.nav-proj .pdot { width: 18px; height: 18px; border-radius: 6px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.nav-proj .pdot .ico-sm { width: 12px; height: 12px; }
.nav-proj .pdot.personal { background: var(--panel-2); color: var(--text-2); }
.nav-proj .pdot.biz { background: var(--accent); color: var(--accent-fg); }
.nav-proj.active .pname { color: var(--text); font-weight: 600; }
.nav-proj .pname { letter-spacing: -0.01em; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  cursor: pointer;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item.active { background: var(--panel); color: var(--accent); }
.nav-item.active .nav-bar { width: 3px; height: 16px; background: var(--accent); border-radius: 2px; position: absolute; left: -2px; }
.nav-item .badge {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  padding: 1px 8px; border-radius: 999px;
  background: var(--accent); color: var(--accent-fg);
}

.sidebar-foot {
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--panel-2); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; letter-spacing: -0.02em;
}
.user-meta { font-size: 13px; font-weight: 600; line-height: 1.3; }
.user-meta .sub { color: var(--text-3); font-size: 11px; font-weight: 400; margin-top: 2px; }

/* === Main column === */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }

.thinbar {
  height: 48px;
  display: flex; align-items: center;
  padding: 0 40px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-3);
  letter-spacing: 0.02em;
}
.thinbar .left { display: flex; align-items: center; gap: 14px; }
.thinbar .right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.thinbar .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); display: inline-block; vertical-align: middle; margin-right: 5px; }
.thinbar b { color: var(--text-2); font-weight: 500; }

/* === Hero === */
.hero { padding: 44px 56px 22px; }
.hero h1 {
  font-size: 42px; line-height: 1.18; font-weight: 700;
  letter-spacing: -0.035em;
  max-width: 1100px;
}
.hero h1 em { font-style: normal; color: var(--accent); font-weight: 700; }
.hero .sub {
  margin-top: 14px;
  font-size: 15px; color: var(--text-2);
  letter-spacing: -0.01em;
  max-width: 900px;
}

.now-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-top: 32px;
}
.now-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
}
.now-card .corner-tag {
  position: absolute; top: 14px; right: 16px;
  font-size: 10px; color: var(--text-3);
  letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.now-card .corner-tag .ico-sm { color: var(--text-3); }
.now-card .label { font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-3); }
.now-card .title { margin-top: 10px; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; }
.now-card .meta { margin-top: 10px; font-size: 12.5px; color: var(--text-2); line-height: 1.55; }
.now-card .meta code { font-family: 'JetBrains Mono', 'IBM Plex Mono', Consolas, monospace; font-size: 12px; color: var(--text); background: var(--panel-2); padding: 1px 6px; border-radius: 4px; }
.now-card .progress { margin-top: 18px; height: 4px; background: var(--panel-2); border-radius: 2px; position: relative; overflow: hidden; }
.now-card .progress .bar { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent); border-radius: 2px; }
.now-card .progress-meta { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--text-3); }
.now-card .progress-meta b { color: var(--text); font-weight: 600; }
.now-card.accent .label { color: var(--accent); }
.now-card.accent { border-color: var(--accent); }

.chips { margin-top: 32px; display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 999px;
  font-size: 12.5px; color: var(--text-2);
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font-weight: 500; letter-spacing: -0.01em;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip .ico-sm { color: var(--text-3); }
.chip:hover .ico-sm { color: var(--accent); }

/* === Chat zone === */
.chat-zone {
  margin-top: 44px;
  padding: 0 56px 24px;
  display: flex; flex-direction: column; gap: 16px;
  flex: 1; min-height: 0;
}
.chat-strip {
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--text-3);
  letter-spacing: 0.16em; text-transform: uppercase; font-weight: 600;
  padding-bottom: 4px;
}
.chat-strip .rule { flex: 1; height: 1px; background: var(--border); }

.msg-row { display: flex; gap: 12px; max-width: 880px; }
.msg-row.me { align-self: flex-end; flex-direction: row-reverse; }
.msg-av {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.msg-av .ico { width: 15px; height: 15px; color: var(--text-2); }
.msg-row.me .msg-av { background: var(--accent); color: var(--accent-fg); font-size: 12px; font-weight: 700; }
.msg-body { min-width: 0; }
.msg-bubble {
  font-size: 14.5px; line-height: 1.6;
  color: var(--text);
  letter-spacing: -0.01em;
}
.msg-row.me .msg-bubble { color: var(--text); }
.msg-meta { font-size: 11px; color: var(--text-3); margin-top: 6px; }
.msg-row.me .msg-meta { text-align: right; }

/* === Composer === */
.composer { padding: 16px 56px 32px; }
.composer-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex; align-items: center; gap: 12px;
}
.composer-box:focus-within { border-color: var(--accent); }
.composer-box .ico { color: var(--text-3); cursor: pointer; }
.composer-box .ico:hover { color: var(--text); }
.composer-box input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--text); font-size: 14.5px; font-family: inherit;
  letter-spacing: -0.01em;
}
.composer-box input::placeholder { color: var(--text-3); }
.composer-box .hint { font-size: 11px; color: var(--text-3); padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-family: 'JetBrains Mono', Consolas, monospace; }
.send-btn {
  background: var(--accent); color: var(--accent-fg);
  border: 0; width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.send-btn .ico { color: var(--accent-fg); stroke-width: 2.2; }

/* === Status pills === */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid;
}
.pill.ok { color: var(--ok); border-color: oklch(from var(--ok) l c h / 0.4); background: oklch(from var(--ok) l c h / 0.08); }
.pill.warn { color: var(--warn); border-color: oklch(from var(--warn) l c h / 0.4); background: oklch(from var(--warn) l c h / 0.08); }
.pill.danger { color: var(--danger); border-color: oklch(from var(--danger) l c h / 0.4); background: oklch(from var(--danger) l c h / 0.08); }
.pill.muted { color: var(--text-3); border-color: var(--border); }
.pill.accent { color: var(--accent); border-color: oklch(from var(--accent) l c h / 0.5); background: oklch(from var(--accent) l c h / 0.10); }

/* === alone-bind helpers (live-data binder) === */
/* demo-note: unobtrusive "데모 데이터" marker on gap tabs */
.demo-note {
  margin: 10px 56px 0;
  display: inline-block;
  align-self: flex-start;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-3);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 3px 11px;
}
/* blinking cursor for in-progress AGI answers */
.agi-cursor {
  display: inline-block; margin-left: 2px;
  color: var(--accent); font-weight: 400;
  animation: alone-blink 1s steps(2, start) infinite;
}
@keyframes alone-blink { to { visibility: hidden; } }
/* brief transient hint under the composer (e.g. turn_in_progress) */
.compose-flash {
  margin-top: 8px; font-size: 12px; color: var(--text-3);
  opacity: 0; transition: opacity 0.25s ease;
}
