﻿.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--rail);
  background:
    radial-gradient(circle at 72% 0%, rgba(135,104,255,.07), transparent 28%),
    var(--bg);
  transition: grid-template-columns .32s var(--ease), background .32s var(--ease);
}
.app-shell.sidebar-collapsed { --sidebar: 84px; }

.app-sidebar {
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
}
.sidebar-brand-row { display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:44px; }
.sidebar-collapse {
  width:34px; height:34px; flex:0 0 auto; display:grid; place-items:center;
  border:1px solid var(--line); border-radius:12px; color:var(--text-soft); background:var(--surface);
}
.sidebar-collapse:hover { color:var(--blue); background:rgba(10,115,255,.07); }
.sidebar-new-chat { width:100%; white-space:nowrap; }
.sidebar-section-title {
  margin: 0 0 10px;
  color: var(--muted);
  letter-spacing: .18em;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}
.sidebar-project,
.sidebar-chat {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 0 12px;
  text-align: left;
  color: var(--text-soft);
  font-weight: 650;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.sidebar-chat:hover,
.sidebar-project:hover { background: rgba(10,115,255,.06); color:var(--text); }
.sidebar-chat.active { background: rgba(10,115,255,.11); color: var(--blue); }
.sidebar-chat .chat-title { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.sidebar-chat .chat-dot { margin-left:auto; width:6px; height:6px; box-shadow:none; }
.chat-pin { margin-left:auto; color:var(--purple); opacity:.75; }
.chat-pin + .chat-dot { margin-left:0; }
.chat-group + .chat-group { margin-top:18px; }
.sidebar-scroll { overflow:auto; min-height:0; padding-right:3px; scrollbar-width:thin; }
.sidebar-footer { margin-top:auto; }
.analytics-card { width:100%; padding:15px; border:0; display:flex; justify-content:space-between; align-items:center; color:var(--text); text-align:left; }
.analytics-copy .tiny { display:block; margin-top:5px; }
.project-count { margin-left:auto; }

.sidebar-collapsed .app-sidebar { padding:24px 14px; align-items:center; }
.sidebar-collapsed .brand-label,
.sidebar-collapsed .sidebar-new-chat span,
.sidebar-collapsed .sidebar-project-block,
.sidebar-collapsed .sidebar-scroll,
.sidebar-collapsed .analytics-copy { display:none; }
.sidebar-collapsed .sidebar-brand-row { flex-direction:column; }
.sidebar-collapsed .sidebar-new-chat { width:48px; height:48px; min-height:48px; padding:0; border-radius:16px; }
.sidebar-collapsed .sidebar-footer { width:100%; }
.sidebar-collapsed .analytics-card { width:48px; height:48px; padding:0; margin:auto; justify-content:center; }

.chat-context-menu {
  position: fixed;
  z-index: 200;
  width: 210px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  animation: rise .18s var(--ease) both;
}
.context-title { padding:9px 10px 8px; color:var(--muted); font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.chat-context-menu button { width:100%; min-height:40px; border:0; border-radius:11px; background:transparent; display:flex; align-items:center; gap:10px; padding:0 10px; text-align:left; }
.chat-context-menu button:hover { background:rgba(10,115,255,.07); }
.chat-context-menu button.danger { color:var(--red); }

.app-main { min-width:0; padding:26px 30px 32px; }
.app-topbar { display:flex; justify-content:space-between; align-items:flex-start; gap:24px; margin-bottom:18px; }
.app-title h1 { margin:5px 0 0; font-size:clamp(44px,4.8vw,72px); letter-spacing:-.065em; line-height:.94; }
.app-title p { margin:10px 0 0; }
.app-top-actions { display:flex; gap:10px; align-items:center; }
.app-content { min-height:calc(100vh - 130px); }

.app-rail {
  height:100vh;
  position:sticky;
  top:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:space-between;
  padding:22px 12px;
  background:var(--surface);
  border-left:1px solid var(--line);
  backdrop-filter:blur(26px) saturate(150%);
  -webkit-backdrop-filter:blur(26px) saturate(150%);
}
.rail-nav { display:flex; flex-direction:column; gap:10px; margin-top:84px; }
.rail-btn {
  width:48px; height:48px; border:0; border-radius:16px; display:grid; place-items:center;
  color:var(--text-soft); background:transparent; transition:.22s var(--ease); position:relative;
}
.rail-btn:hover { background:rgba(10,115,255,.08); color:var(--blue); transform:translateY(-2px); }
.rail-btn.active { background:rgba(10,115,255,.12); color:var(--blue); box-shadow:inset 0 0 0 1px rgba(10,115,255,.08); }
.rail-btn .notify { width:7px; height:7px; border-radius:50%; background:var(--green); position:absolute; right:8px; top:8px; box-shadow:0 0 0 3px var(--surface-solid); }
.archive-btn { background:rgba(115,124,143,.09); border:1px solid var(--line); }

.workspace { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; align-items:start; }
.workspace.has-panel { grid-template-columns:minmax(390px,1fr) minmax(360px,430px); }
.workspace.panel-coding { grid-template-columns:minmax(400px,1fr) minmax(560px,1fr); }
.chat-pane { display:flex; flex-direction:column; gap:14px; min-width:0; }
.workspace-panel {
  min-width:0;
  max-height:calc(100vh - 124px);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  border-radius:26px;
  background:var(--surface-strong);
  border:1px solid var(--line);
  box-shadow:var(--shadow-soft);
}
.workspace-panel-header { padding:22px 22px 16px; display:flex; justify-content:space-between; align-items:flex-start; gap:16px; border-bottom:1px solid var(--line); }
.workspace-panel-header h2 { font-size:34px; margin:5px 0 0; }
.workspace-panel-body { padding:18px 20px 22px; overflow:auto; min-height:0; scrollbar-width:thin; }
.panel-stack { display:flex; flex-direction:column; gap:18px; }
.panel-section { display:flex; flex-direction:column; gap:12px; }
.panel-section-heading { display:flex; justify-content:space-between; gap:14px; align-items:flex-end; }
.panel-section-heading h3 { margin:6px 0 0; font-size:20px; }
.panel-intro { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.panel-intro p { margin:0; line-height:1.5; }
.panel-footer-line { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:12px; color:var(--text-soft); }
.panel-footer-line > span { display:flex; align-items:center; gap:9px; }

.session-banner { padding:14px 18px; display:flex; align-items:center; gap:13px; }
.session-banner strong { display:block; margin-bottom:3px; }
.session-live { margin-left:auto; display:flex; align-items:center; gap:9px; font-size:12px; color:var(--text-soft); }

.runtime-strip {
  min-height:86px;
  position:relative;
  overflow:hidden;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto auto;
  gap:14px;
  align-items:center;
  padding:14px 16px;
  background:
    radial-gradient(circle at 15% 50%, rgba(64,215,255,.14), transparent 24%),
    radial-gradient(circle at 70% 40%, rgba(142,92,255,.13), transparent 34%),
    var(--surface-strong);
  transition:min-height .35s var(--ease), background .35s var(--ease), box-shadow .35s var(--ease);
}
.runtime-strip[data-orb-state="thinking"] { min-height:104px; background:radial-gradient(circle at 22% 50%, rgba(138,92,255,.20), transparent 32%), var(--surface-strong); box-shadow:0 14px 40px rgba(138,92,255,.11); }
.runtime-strip[data-orb-state="writing"] { min-height:94px; background:radial-gradient(circle at 22% 50%, rgba(10,115,255,.18), transparent 32%), var(--surface-strong); }
.runtime-strip[data-orb-state="working"] { min-height:112px; background:radial-gradient(circle at 22% 50%, rgba(67,217,255,.18), transparent 34%), var(--surface-strong); }
.runtime-orb-button { width:58px; height:58px; padding:0; border:0; border-radius:50%; background:transparent; display:grid; place-items:center; }
.runtime-orb-mini {
  width:52px; height:52px; border-radius:50%; display:block; position:relative; overflow:hidden;
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,.98), transparent 20%),
    radial-gradient(circle at 70% 65%, rgba(145,97,255,.80), transparent 46%),
    radial-gradient(circle at 20% 76%, rgba(51,219,255,.95), transparent 44%),
    linear-gradient(135deg, rgba(255,255,255,.92), rgba(167,180,255,.70));
  box-shadow:inset -9px -12px 24px rgba(80,71,168,.18), 0 12px 24px rgba(88,99,192,.20);
  animation:floatOrb 5s ease-in-out infinite;
}
.runtime-orb-mini::after { content:""; position:absolute; width:30%; height:120%; left:-40%; top:-10%; background:linear-gradient(90deg,transparent,rgba(255,255,255,.72),transparent); filter:blur(3px); animation:shimmer 4.5s ease-in-out infinite; }
.runtime-strip[data-orb-state="thinking"] .runtime-orb-mini { animation:orbThink 1.15s ease-in-out infinite; }
.runtime-strip[data-orb-state="writing"] .runtime-orb-mini { animation:orbWrite .8s ease-in-out infinite; }
.runtime-strip[data-orb-state="working"] .runtime-orb-mini { animation:orbWork 1.4s linear infinite; }
.runtime-copy { min-width:0; }
.runtime-copy .kicker { font-size:9px; }
.runtime-title-row { display:flex; align-items:center; gap:10px; margin:4px 0 2px; }
.runtime-title-row strong { font-size:19px; }
.runtime-copy > span:last-child { color:var(--text-soft); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; }
.runtime-elapsed { color:var(--muted); font-size:11px; }
.runtime-activity { display:none; gap:4px; align-items:center; }
.runtime-activity i { width:6px; height:6px; border-radius:50%; background:var(--blue); animation:typingDot 1s infinite; }
.runtime-activity i:nth-child(2) { animation-delay:.15s; }
.runtime-activity i:nth-child(3) { animation-delay:.3s; }
.runtime-strip[data-orb-state="writing"] .runtime-activity,
.runtime-strip[data-orb-state="thinking"] .runtime-activity { display:flex; }
.runtime-state-actions { display:flex; gap:4px; padding:4px; border-radius:14px; background:rgba(115,124,143,.08); }
.orb-state-chip { width:32px; height:32px; border:0; border-radius:10px; display:grid; place-items:center; background:transparent; color:var(--muted); }
.orb-state-chip:hover,.orb-state-chip.active { background:var(--surface-strong); color:var(--blue); box-shadow:var(--shadow-tight); }

.messages { display:flex; flex-direction:column; gap:13px; min-height:250px; padding:18px; box-shadow:none; }
.message { max-width:78%; padding:14px 17px; border-radius:19px; line-height:1.48; box-shadow:var(--shadow-tight); font-size:14px; }
.message.assistant { align-self:flex-start; background:var(--surface-solid); border:1px solid var(--line); }
.message.user { align-self:flex-end; color:#fff; background:linear-gradient(135deg,#2d83f7,#0a68e5); }
.message .sender { display:block; font-weight:800; margin-bottom:4px; font-size:12px; }

.quick-card { padding:19px; }
.quick-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.quick-heading h3 { margin:7px 0 14px; font-size:24px; }
.quick-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:9px; }
.quick-action { border:1px solid var(--line); background:var(--surface); border-radius:15px; padding:13px; min-height:96px; text-align:left; transition:.22s var(--ease); }
.quick-action:hover { transform:translateY(-3px); box-shadow:var(--shadow-tight); border-color:rgba(10,115,255,.18); }
.quick-action strong { display:block; margin:8px 0 4px; font-size:13px; }
.quick-action span { color:var(--text-soft); font-size:11px; }

.composer {
  display:flex; align-items:center; gap:9px; padding:9px 10px 9px 16px; border-radius:23px;
  background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow-soft); position:sticky; bottom:16px; z-index:5;
}
.composer input { flex:1; border:0; outline:0; background:transparent; min-width:0; padding:8px 0; }
.composer-icon { border:0; background:transparent; color:var(--text-soft); width:38px; height:38px; display:grid; place-items:center; border-radius:12px; }
.composer-icon:hover { background:rgba(10,115,255,.07); color:var(--blue); }
.send-btn { width:46px; height:46px; flex:0 0 auto; border-radius:50%; border:0; background:#111318; color:#fff; display:grid; place-items:center; box-shadow:0 8px 20px rgba(17,19,24,.2); }
html[data-theme="dark"] .send-btn { background:#f4f6fa; color:#111318; }

/* Settings panel */
.settings-group { display:flex; flex-direction:column; gap:8px; }
.settings-group-title { color:var(--muted); letter-spacing:.16em; text-transform:uppercase; font-size:10px; font-weight:800; }
.settings-block { overflow:hidden; }
.settings-row { width:100%; min-height:48px; display:flex; align-items:center; gap:10px; padding:0 12px; border:0; border-bottom:1px solid var(--line); background:transparent; text-align:left; }
.settings-row:last-child { border-bottom:0; }
.setting-action:hover { background:rgba(10,115,255,.05); }
.settings-row .value { margin-left:auto; color:var(--text-soft); font-size:12px; }
.appearance-row { min-height:58px; }
.theme-segment { margin-left:auto; display:flex; gap:3px; padding:3px; border-radius:12px; background:rgba(115,124,143,.10); }
.theme-segment button { width:32px; height:30px; border:0; border-radius:9px; display:grid; place-items:center; color:var(--muted); background:transparent; }
.theme-segment button.active { color:var(--blue); background:var(--surface-solid); box-shadow:var(--shadow-tight); }
.switch { width:42px; height:24px; padding:2px; border:0; border-radius:99px; background:#c7cbd4; margin-left:auto; transition:.2s; }
.switch::after { content:""; display:block; width:20px; height:20px; border-radius:50%; background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.2); transition:.2s; }
.switch.on { background:var(--blue); }
.switch.on::after { transform:translateX(18px); }

/* Task panel */
.task-summary { display:grid; grid-template-columns:repeat(3,1fr); padding:14px; text-align:center; }
.task-summary > div + div { border-left:1px solid var(--line); }
.task-summary strong { display:block; font-size:24px; }
.task-summary span { color:var(--muted); font-size:10px; }
.task-list { display:flex; flex-direction:column; gap:10px; }
.task-card { padding:14px; display:grid; grid-template-columns:auto 1fr; gap:12px; align-items:start; }
.task-title-row { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.task-card h4 { margin:0; font-size:14px; }
.task-card p { margin:5px 0 11px; color:var(--text-soft); font-size:12px; }
.task-progress-row { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; color:var(--muted); font-size:11px; }
.task-footer { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:11px; }

/* Coding panel */
.coding-overview { display:grid; grid-template-columns:1.2fr 1fr 1fr; padding:14px; gap:12px; }
.coding-overview > div { min-width:0; padding:2px 10px; display:flex; flex-direction:column; gap:7px; justify-content:center; }
.coding-overview > div + div { border-left:1px solid var(--line); }
.coding-overview strong { font-size:25px; }
.panel-tabs { display:flex; gap:4px; padding:4px; border-radius:14px; background:rgba(115,124,143,.09); }
.panel-tabs button { flex:1; min-height:36px; border:0; border-radius:11px; background:transparent; color:var(--text-soft); font-weight:700; font-size:12px; }
.panel-tabs button.active { background:var(--surface-solid); color:var(--blue); box-shadow:var(--shadow-tight); }
.coding-tab { display:none; }
.coding-tab.active { display:block; animation:fadeIn .2s ease both; }
.workflow-list { margin-top:10px; }
.workflow-step { display:grid; grid-template-columns:auto 1fr auto; gap:11px; padding:13px 0; position:relative; }
.workflow-step:not(:last-child)::after { content:""; position:absolute; left:21px; top:53px; bottom:-7px; width:1px; background:var(--line-strong); }
.workflow-step h4 { margin:1px 0 4px; font-size:14px; }
.workflow-step p { margin:0; color:var(--text-soft); font-size:11px; line-height:1.45; }
.workflow-state { text-align:right; }
.workflow-state > span:last-child { display:block; margin-top:6px; color:var(--muted); font-size:9px; }
.file-browser { overflow:hidden; }
.file-browser-head { padding:13px 14px; display:flex; justify-content:space-between; align-items:center; border-bottom:1px solid var(--line); }
.file-browser button { width:100%; min-height:42px; padding:0 14px; border:0; border-bottom:1px solid var(--line); display:grid; grid-template-columns:auto 1fr auto; gap:9px; align-items:center; background:transparent; text-align:left; }
.file-browser button:last-child { border-bottom:0; }
.file-browser button:hover { background:rgba(10,115,255,.05); }
.file-browser button .muted { font-size:10px; }
.code-preview { margin-top:12px; border-radius:17px; overflow:hidden; background:#141820; color:#e8ebf1; box-shadow:var(--shadow-tight); }
.code-preview-bar { min-height:40px; padding:0 14px; display:flex; align-items:center; justify-content:space-between; background:#1d222c; font-size:12px; }
.code-preview pre { margin:0; padding:16px; overflow:auto; font:12px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace; }
.code-purple { color:#b794ff; }
.code-blue { color:#62b4ff; }
.test-summary { padding:14px; display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:center; }
.test-summary p { margin:4px 0 0; color:var(--text-soft); font-size:11px; }
.test-row { min-height:43px; display:flex; align-items:center; justify-content:space-between; gap:10px; border-bottom:1px solid var(--line); font-size:12px; }
.test-row span { display:flex; align-items:center; gap:9px; }
.coding-agent-chat { padding:14px; }
.coding-chat-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.coding-chat-head strong { display:block; margin-top:4px; }
.coding-message { max-width:100%; box-shadow:none; margin-bottom:10px; font-size:12px; }
.compact-composer { position:static; box-shadow:none; padding:7px 8px 7px 12px; }
.compact-composer .send-btn { width:40px; height:40px; }

/* Answer panel */
.confidence-card { padding:18px; display:grid; grid-template-columns:auto 1fr; gap:20px; align-items:center; }
.confidence-score { display:block; font-size:58px; line-height:1; font-weight:900; letter-spacing:-.07em; margin-top:7px; }
.confidence-copy > div { display:flex; justify-content:space-between; gap:10px; margin-bottom:9px; }
.confidence-copy p { color:var(--text-soft); font-size:11px; line-height:1.5; margin:10px 0 0; }
.reasoning-path { padding:0 14px; }
.reasoning-step { display:grid; grid-template-columns:auto 1fr auto; gap:11px; align-items:center; padding:13px 0; border-bottom:1px solid var(--line); }
.reasoning-step:last-child { border-bottom:0; }
.reasoning-step strong { font-size:13px; }
.reasoning-step p { margin:3px 0 0; color:var(--text-soft); font-size:10px; }
.info-list { padding:0 14px; }
.info-row { display:flex; justify-content:space-between; gap:18px; padding:12px 0; border-bottom:1px solid var(--line); font-size:12px; }
.info-row:last-child { border-bottom:0; }
.info-row span { color:var(--text-soft); }

/* Learning panel */
.learning-summary { display:grid; grid-template-columns:repeat(3,1fr); text-align:center; padding:14px; }
.learning-summary > div + div { border-left:1px solid var(--line); }
.learning-summary strong { display:block; font-size:24px; }
.learning-summary span { color:var(--muted); font-size:10px; }
.feedback-list { display:flex; flex-direction:column; gap:10px; }
.feedback-card { padding:13px; display:grid; grid-template-columns:auto 1fr; gap:11px; }
.feedback-card strong { font-size:12px; }
.feedback-card p { margin:5px 0 9px; color:var(--text-soft); font-size:11px; line-height:1.45; }
.feedback-tags { display:flex; gap:6px; flex-wrap:wrap; }
.cycle-list { padding:0 13px; }
.learning-cycle { min-height:59px; display:flex; justify-content:space-between; align-items:center; gap:10px; border-bottom:1px solid var(--line); }
.learning-cycle:last-child { border-bottom:0; }
.learning-cycle strong { display:block; font-size:12px; }
.learning-cycle span { display:block; margin-top:3px; color:var(--muted); font-size:10px; }
.safety-note { padding:14px; display:flex; gap:11px; align-items:flex-start; }
.safety-note strong { font-size:12px; }
.safety-note p { margin:4px 0 0; color:var(--text-soft); font-size:10px; line-height:1.5; }

/* Dashboard */
.dashboard-grid { display:grid; grid-template-columns:1.05fr .95fr .95fr; gap:16px; }
.dashboard-card { padding:22px; min-width:0; }
.dashboard-card h3 { margin:0 0 5px; font-size:19px; }
.dashboard-card p { color:var(--text-soft); font-size:13px; }
.dashboard-header-card { grid-column:1/-1; padding:18px 22px; display:grid; grid-template-columns:1fr auto auto; gap:26px; align-items:center; }
.system-optimal { color:#28b65a; font-weight:800; }
.metric-block { padding-left:26px; border-left:1px solid var(--line); }
.metric-block strong { display:block; font-size:22px; margin-top:4px; }
.service-row { display:grid; grid-template-columns:1fr auto auto; gap:8px; align-items:center; padding:9px 0; border-bottom:1px solid var(--line); font-size:13px; }
.service-row:last-child { border-bottom:0; }
.health-ring { width:145px; height:145px; border-radius:50%; margin:18px auto; display:grid; place-items:center; background:conic-gradient(var(--blue) 0 72%, var(--purple) 72% 98%, rgba(115,124,143,.14) 98%); position:relative; }
.health-ring::after { content:""; position:absolute; inset:12px; border-radius:50%; background:var(--surface-solid); }
.health-ring-content { position:relative; z-index:1; text-align:center; }
.health-ring-content strong { display:block; font-size:30px; }
.self-dev-card { grid-column:1/-1; padding:22px; }
.data-table { width:100%; border-collapse:collapse; font-size:13px; }
.data-table th { text-align:left; color:var(--muted); font-size:11px; font-weight:700; padding:12px 10px; border-bottom:1px solid var(--line); }
.data-table td { padding:13px 10px; border-bottom:1px solid var(--line); vertical-align:middle; }
.data-table tr:last-child td { border-bottom:0; }
.table-scroll { overflow:auto; }

/* Lock screen */
.lock-screen { position:fixed; inset:0; z-index:300; display:grid; place-items:center; padding:24px; background:radial-gradient(circle at 50% 38%, rgba(138,92,255,.22), transparent 22%), radial-gradient(circle at 38% 54%, rgba(55,214,255,.20), transparent 22%), color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter:blur(28px) saturate(150%); }
.lock-card { width:min(430px,100%); padding:34px; text-align:center; border-radius:32px; }
.lock-orb { width:116px; height:116px; margin:0 auto 18px; }
.lock-card h2 { font-size:40px; margin:0 0 8px; }
.lock-card p { color:var(--text-soft); }
.lock-field { text-align:left; margin:18px 0; }
.lock-field label { display:block; font-size:12px; color:var(--text-soft); margin:0 0 8px 4px; }
.lock-field input { width:100%; min-height:50px; border-radius:16px; border:1px solid var(--line-strong); background:var(--surface); padding:0 16px; outline:0; }
.lock-field input:focus { border-color:rgba(10,115,255,.45); box-shadow:0 0 0 4px rgba(10,115,255,.08); }
.pin-input { letter-spacing:.5em; font-size:22px; text-align:center; }
.lock-error { min-height:20px; color:var(--red); font-size:13px; margin-bottom:8px; }
.hidden { display:none !important; }
.auth-mode-switch {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:16px 0;
  padding:4px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.52);
}
.auth-mode-button {
  min-height:38px;
  border:0;
  border-radius:10px;
  background:transparent;
  color:var(--text-soft);
  font-weight:800;
  cursor:pointer;
}
.auth-mode-button.active {
  background:var(--surface);
  color:var(--text);
  box-shadow:var(--shadow-tight);
}
.auth-mode-button:disabled,
.conversation-composer.is-busy button,
.conversation-composer.is-busy input {
  opacity:.64;
  cursor:wait;
}

.toast { position:fixed; z-index:400; left:50%; bottom:24px; transform:translateX(-50%); padding:13px 18px; border-radius:999px; background:#12151b; color:#fff; font-size:13px; box-shadow:0 16px 40px rgba(0,0,0,.22); animation:toastIn .3s var(--ease) both; }
html[data-theme="dark"] .toast { background:#f5f7fb; color:#111318; }

@keyframes orbThink { 0%,100%{transform:scale(1)} 50%{transform:scale(1.12); filter:saturate(1.25)} }
@keyframes orbWrite { 0%,100%{transform:translateX(-1px) scale(1)} 50%{transform:translateX(2px) scale(1.04)} }
@keyframes orbWork { to{transform:rotate(360deg)} }
@keyframes typingDot { 0%,70%,100%{transform:translateY(0);opacity:.4} 35%{transform:translateY(-4px);opacity:1} }

/* Unified chat workspace v2 */
.conversation-shell {
  height: calc(100vh - 138px);
  min-height: 560px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0;
  background:
    radial-gradient(circle at 28% 4%, rgba(64,215,255,.07), transparent 24%),
    radial-gradient(circle at 76% 4%, rgba(142,92,255,.07), transparent 28%),
    var(--surface-strong);
}
.conversation-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 0 18px 28px;
  scroll-padding-top: 118px;
}
.conversation-runtime {
  position: sticky;
  top: 0;
  z-index: 14;
  margin: 0 -18px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: blur(28px) saturate(155%);
  -webkit-backdrop-filter: blur(28px) saturate(155%);
}
.runtime-eyebrow { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:9px; font-weight:750; letter-spacing:.06em; text-transform:uppercase; }
.runtime-eyebrow .runtime-elapsed { margin-left:3px; letter-spacing:0; text-transform:none; }
.runtime-title-row { min-width:0; }
.runtime-title-row > span { color:var(--text-soft); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.runtime-context-pill { padding:8px 10px; border-radius:999px; background:rgba(10,115,255,.07); color:var(--blue); font-size:10px; font-weight:700; white-space:nowrap; }
.runtime-strip[data-orb-state="thinking"] .runtime-context-pill { color:var(--purple); background:rgba(138,92,255,.10); }
.runtime-strip[data-orb-state="working"] .runtime-context-pill { color:#0798b8; background:rgba(51,219,255,.10); }
.conversation-meta {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding: 12px 4px 14px;
  border-bottom:1px solid var(--line);
}
.conversation-meta strong { display:block; margin-top:4px; font-size:15px; }
.conversation-online { display:flex; align-items:center; gap:8px; color:var(--text-soft); font-size:11px; }
.conversation-messages {
  min-height: 210px;
  padding: 20px 4px 12px;
  background: transparent;
  border: 0;
}
.conversation-shell[data-empty="true"] .conversation-messages { min-height: 12px; padding-bottom:0; }
.new-chat-start {
  margin: 4px 0 10px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 82% 18%, rgba(138,92,255,.08), transparent 26%),
    radial-gradient(circle at 16% 88%, rgba(67,217,255,.08), transparent 28%),
    var(--surface);
  animation: rise .35s var(--ease) both;
}
.new-chat-start.leaving { animation: newChatLeave .26s var(--ease) both; pointer-events:none; }
.new-chat-heading h3 { margin:8px 0 7px; font-size:clamp(24px,2.5vw,34px); letter-spacing:-.035em; }
.new-chat-heading p { margin:0 0 18px; color:var(--text-soft); font-size:13px; line-height:1.5; }
.new-chat-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
.conversation-composer {
  position: relative;
  bottom: auto;
  z-index: 16;
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
  padding: 12px 14px 12px 18px;
  box-shadow: 0 -12px 34px rgba(28,35,55,.06);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
}

@keyframes newChatLeave {
  to { opacity:0; transform:translateY(12px) scale(.985); max-height:0; padding-top:0; padding-bottom:0; margin:0; border-width:0; }
}

/* Coding Studio task workspace v2 */
.coding-studio-home { display:flex; flex-direction:column; gap:18px; }
.coding-studio-summary {
  display:grid;
  grid-template-columns:1fr 1fr auto;
  gap:14px;
  align-items:center;
  padding:16px;
}
.coding-studio-summary > div { display:flex; flex-direction:column; gap:3px; min-width:0; }
.coding-studio-summary > div + div { border-left:1px solid var(--line); padding-left:16px; }
.coding-studio-summary strong { font-size:27px; letter-spacing:-.04em; }
.coding-studio-summary span:last-child { color:var(--text-soft); font-size:10px; }
.coding-studio-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:16px; }
.coding-studio-heading h3 { margin:6px 0 4px; font-size:22px; }
.coding-studio-heading p { margin:0; color:var(--text-soft); font-size:11px; line-height:1.45; }
.coding-task-list { display:flex; flex-direction:column; gap:10px; }
.coding-task-card {
  width:100%;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:14px;
  border:1px solid var(--line);
  border-radius:18px;
  background:var(--surface);
  color:var(--text);
  text-align:left;
  transition:transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.coding-task-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-tight); border-color:rgba(10,115,255,.22); }
.coding-task-main { min-width:0; display:flex; flex-direction:column; gap:7px; }
.coding-task-title { display:flex; align-items:center; gap:8px; min-width:0; }
.coding-task-title strong { font-size:14px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.coding-task-title small { color:var(--muted); font-size:9px; margin-left:auto; white-space:nowrap; }
.coding-task-description { color:var(--text-soft); font-size:10px; line-height:1.4; }
.coding-task-progress { display:grid; grid-template-columns:1fr auto; gap:9px; align-items:center; }
.coding-task-progress b { font-size:10px; color:var(--muted); }
.coding-task-meta { display:flex; flex-direction:column; align-items:flex-end; gap:7px; color:var(--muted); }
.coding-task-meta small { font-size:9px; }
.coding-studio-foot { display:grid; grid-template-columns:auto 1fr; gap:12px; align-items:start; padding:15px; }
.coding-studio-foot p { margin:4px 0 0; color:var(--text-soft); font-size:10px; line-height:1.45; }

.coding-task-workspace { display:flex; flex-direction:column; gap:14px; }
.coding-task-header { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:12px; align-items:center; }
.coding-task-header h3 { margin:4px 0 0; font-size:22px; letter-spacing:-.035em; }
.coding-task-strip { display:grid; grid-template-columns:1.2fr 1fr 1fr; gap:12px; padding:14px; }
.coding-task-strip > div { display:flex; flex-direction:column; gap:6px; min-width:0; }
.coding-task-strip > div + div { border-left:1px solid var(--line); padding-left:14px; }
.coding-task-strip strong { font-size:16px; }
.coding-task-context { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.coding-context-block { padding:13px; min-width:0; }
.coding-context-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.coding-context-head strong { display:flex; align-items:center; gap:7px; font-size:12px; }
.coding-context-head span { color:var(--muted); font-size:9px; }
.coding-file-chips { display:flex; flex-wrap:wrap; gap:6px; }
.coding-file-chips button { max-width:100%; display:flex; align-items:center; gap:5px; border:1px solid var(--line); background:var(--surface); color:var(--text-soft); border-radius:9px; padding:6px 8px; font-size:9px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.coding-plan-list { margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:7px; }
.coding-plan-list li { display:grid; grid-template-columns:20px 1fr; gap:7px; align-items:center; color:var(--text-soft); font-size:9px; }
.coding-plan-list li span { width:20px; height:20px; display:grid; place-items:center; border-radius:50%; background:rgba(115,124,143,.10); color:var(--muted); font-weight:800; }
.coding-plan-list li.done { color:var(--text); }
.coding-plan-list li.done span { color:#fff; background:var(--green); }
.coding-task-chat { display:grid; grid-template-rows:auto minmax(180px,1fr) auto; min-height:350px; padding:14px; }
.coding-task-messages { min-height:180px; max-height:290px; overflow:auto; display:flex; flex-direction:column; gap:10px; padding:6px 2px 12px; scrollbar-width:thin; }
.coding-task-messages .message { max-width:88%; }
.coding-task-composer { margin-top:2px; }
.conversation-runtime { grid-template-columns:auto minmax(0,1fr) auto auto auto; }

/* v3: usable live chat runtime */
.conversation-composer input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  caret-color: var(--blue);
  position: relative;
  z-index: 2;
}
.conversation-composer input::placeholder { color: var(--muted); }
.conversation-composer:focus-within {
  border-color: rgba(10,115,255,.24);
  box-shadow: 0 0 0 4px rgba(10,115,255,.07), var(--shadow-soft);
}
.typing-message { min-width: 88px; }
.typing-dots { display:inline-flex; gap:4px; align-items:center; min-height:18px; }
.typing-dots i {
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--muted);
  animation:typingDot 1s ease-in-out infinite;
}
.typing-dots i:nth-child(2) { animation-delay:.14s; }
.typing-dots i:nth-child(3) { animation-delay:.28s; }
@keyframes typingDot {
  0%, 60%, 100% { transform:translateY(0); opacity:.42; }
  30% { transform:translateY(-4px); opacity:1; }
}

