/* Fluid Agent — iOS-inspired Light Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f2f2f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface2: rgba(255, 255, 255, 0.6);
  --surface3: rgba(0, 0, 0, 0.04);
  --border: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.05);
  --text: #1c1c1e;
  --text-dim: #8e8e93;
  --text-muted: #aeaeb2;
  --accent: #007aff;
  --accent-dim: rgba(0, 122, 255, 0.08);
  --green: #34c759;
  --yellow: #ff9f0a;
  --red: #ff3b30;
  --chat-bg: #f2f2f7;
  --bubble-user: #007aff;
  --bubble-agent: #ffffff;
  --radius: 16px;
  --radius-sm: 12px;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(255, 255, 255, 0.5);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
}

html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', system-ui, sans-serif; background: var(--bg); color: var(--text); overflow: hidden; -webkit-font-smoothing: antialiased; }

#app { display: none; height: 100%; }

/* ── Desktop ── */
#desktop { flex: 1; display: flex; flex-direction: column; position: relative; }

#desktop-header {
  height: 25px; display: flex; align-items: center; padding: 0 10px;
  background: rgba(255,255,255,0.55); backdrop-filter: blur(30px) saturate(1.6);
  border-bottom: 0.5px solid rgba(0,0,0,0.08);
  gap: 16px; flex-shrink: 0;
  position: absolute; top: 0; left: 0; right: 0; z-index: 9999;
  pointer-events: none;
  box-shadow: 0 0.5px 0 rgba(0,0,0,0.05);
}
#desktop-header > * { pointer-events: auto; }
.desktop-title { font-size: 13px; font-weight: 700; color: rgba(0,0,0,0.85); letter-spacing: -0.01em; }

#activity-stream {
  flex: 1; display: flex; align-items: center; gap: 8px;
  overflow: hidden; font-size: 12px; color: var(--text-dim);
}
.activity-item {
  display: flex; align-items: center; gap: 5px;
  padding: 1px 0; white-space: nowrap;
  background: transparent; color: rgba(0,0,0,0.55);
  font-size: 13px; font-weight: 400;
}
.activity-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

#desktop-area { flex: 1; position: relative; overflow: hidden; padding-bottom: 72px; }
#desktop-wallpaper {
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(120, 180, 255, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(200, 150, 255, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(100, 220, 200, 0.15) 0%, transparent 50%),
    linear-gradient(135deg, #e8f0fe 0%, #f0e6ff 30%, #e6f7f0 60%, #fef3e0 100%);
}

/* ── Dock ── */
#dock {
  position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
  height: 62px; display: flex; align-items: flex-end; justify-content: center; gap: 0;
  background: rgba(255,255,255,0.25); backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255,255,255,0.45);
  border-radius: 18px; flex-shrink: 0;
  padding: 0 10px 6px; z-index: 9998;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.06), 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
}
.dock-pinned, .dock-running { display: flex; align-items: flex-end; gap: 2px; }
.dock-separator { width: 1px; height: 32px; background: rgba(0,0,0,0.1); margin: 0 6px; flex-shrink: 0; align-self: center; }
.dock-item {
  width: 46px; height: 46px; display: flex; align-items: center; justify-content: center;
  font-size: 34px; border-radius: 12px; cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.15s;
  position: relative; flex-direction: column;
  background: transparent;
  transform-origin: bottom center;
}
/* Fisheye dock effect — pure CSS with :has() + adjacent sibling selectors */
.dock-item:hover {
  transform: scale(1.5);
  filter: brightness(1.05);
}
/* Direct neighbors: ±1 */
.dock-item:has(+ .dock-item:hover),
.dock-item:hover + .dock-item {
  transform: scale(1.25);
}
/* Two away: ±2 */
.dock-item:has(+ .dock-item + .dock-item:hover),
.dock-item:hover + .dock-item + .dock-item {
  transform: scale(1.1);
}
.dock-item:active { transform: scale(1.2); }
.dock-item.minimized { opacity: 0.45; }
.dock-item.dock-active::after { content: ''; width: 4px; height: 4px; border-radius: 50%; background: rgba(0,0,0,0.5); position: absolute; bottom: -2px; }
.dock-item.dock-focused::after { background: rgba(0,0,0,0.8); }
.dock-running-dot { width: 4px; height: 4px; border-radius: 50%; background: rgba(0,0,0,0.4); position: absolute; bottom: -2px; }

/* ── Windows ── */
.window {
  position: absolute; min-width: 300px; min-height: 200px;
  background: var(--glass); backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  transition: box-shadow 0.2s, border-color 0.2s, opacity 0.2s, transform 0.2s;
  animation: windowOpen 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.window.minimized { opacity: 0; transform: scale(0.5) translateY(100px); pointer-events: none; }
.window.fullscreen { border-radius: 0; border: none; transition: all 0.25s ease; }
@keyframes windowOpen {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.window.closing { animation: windowClose 0.2s ease forwards; }
@keyframes windowClose { to { opacity: 0; transform: scale(0.95) translateY(8px); } }
.window.focused { box-shadow: 0 16px 56px rgba(0,0,0,0.15), 0 4px 16px rgba(0,0,0,0.08); border-color: rgba(0, 122, 255, 0.2); }

.window-titlebar {
  height: 40px; display: flex; align-items: center; padding: 0 14px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.15) 70%, transparent 100%);
  border-bottom: none;
  cursor: grab; user-select: none; flex-shrink: 0;
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  border-radius: var(--radius) var(--radius) 0 0;
}
.window-terminal .window-titlebar {
  background: linear-gradient(to bottom, rgba(50,50,50,0.9) 0%, rgba(30,30,30,0.5) 70%, transparent 100%);
}
.window-terminal .window-title { color: rgba(255,255,255,0.6); }
.window-terminal .window-dot { border: 0.5px solid rgba(0,0,0,0.2); }
.window-titlebar:active { cursor: grabbing; }
.window-dots { display: flex; gap: 7px; margin-right: 12px; transition: opacity 0.2s; }
.window:not(.focused) .window-dots { opacity: 0; }
.window:not(.focused):hover .window-dots { opacity: 1; }
.window-dot {
  width: 12px; height: 12px; border-radius: 50%; cursor: pointer;
  transition: filter 0.15s;
}
.window-dot:hover { filter: brightness(1.1); }
.window-dot.close { background: #ff5f57; }
.window-dot.minimize { background: #febc2e; }
.window-dot.maximize { background: #28c840; }
.window:not(.focused) .window-dot { opacity: 0.35; }
.window-title { font-size: 13px; font-weight: 600; color: var(--text-dim); flex: 1; text-align: center; margin-right: 68px; }
.window:not(.focused) .window-title { opacity: 0.5; }
.window-body { flex: 1; overflow: auto; min-height: 0; padding-top: 40px; }
.window-resize {
  position: absolute; bottom: 0; right: 0; width: 20px; height: 20px;
  cursor: nwse-resize; opacity: 0; z-index: 10;
}
.window:hover .window-resize { opacity: 1; }

/* ── Finder ── */
.finder-layout { display: flex; height: calc(100% + 40px); margin-top: -40px; }
.finder-sidebar { width: 140px; flex-shrink: 0; background: var(--surface2); border-right: 1px solid var(--border); padding: 40px 0 8px; overflow-y: auto; }
.finder-sb-title { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px 4px; }
.finder-sb-item { font-size: 12px; color: var(--text-dim); padding: 4px 12px; cursor: pointer; border-radius: 4px; margin: 0 4px; transition: background 0.12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finder-sb-item:hover { background: var(--accent-dim); }
.finder-sb-item.active { background: var(--accent-dim); color: var(--text); }
.finder-main { flex: 1; display: flex; flex-direction: column; min-width: 0; padding-top: 40px; overflow: hidden; min-height: 0; }
.finder-toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.03); }
.finder-nav-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; padding: 3px 8px; border-radius: 4px; cursor: pointer; transition: all 0.12s; }
.finder-nav-btn:hover:not(.disabled) { background: var(--surface3); color: var(--text); }
.finder-nav-btn.disabled { opacity: 0.3; cursor: default; }
.finder-breadcrumb { flex: 1; display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--text-muted); overflow: hidden; }
.finder-crumb { cursor: pointer; padding: 2px 4px; border-radius: 3px; white-space: nowrap; }
.finder-crumb:hover { background: var(--accent-dim); color: var(--text); }
.finder-crumb-sep { color: var(--text-muted); opacity: 0.5; }
.finder-view-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: 13px; padding: 3px 8px; border-radius: 4px; cursor: pointer; }
.finder-view-btn:hover { background: var(--surface3); color: var(--text); }
.finder-path { padding: 8px 14px; font-size: 12px; color: var(--text-dim); border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.03); font-weight: 500; }
.finder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 4px; padding: 12px; flex: 1; overflow-y: auto; align-content: start; }
.finder-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: var(--radius-sm); cursor: pointer; transition: background 0.12s; }
.finder-item:hover { background: var(--accent-dim); }
.finder-item.finder-selected { background: var(--accent-dim); outline: 1px solid var(--accent); }
.finder-item .icon { font-size: 28px; line-height: 1; }
.finder-item .name { font-size: 11px; color: var(--text-dim); text-align: center; word-break: break-all; max-width: 72px; line-height: 1.3; }
.finder-list { flex: 1; overflow-y: auto; font-size: 12px; }
.finder-list-header { display: flex; padding: 6px 12px; border-bottom: 1px solid var(--border); font-size: 11px; color: var(--text-muted); font-weight: 600; }
.finder-list-row { display: flex; padding: 5px 12px; cursor: pointer; transition: background 0.12s; border-bottom: 1px solid rgba(255,255,255,0.03); }
.finder-list-row:hover { background: var(--accent-dim); }
.finder-list-row.finder-selected { background: var(--accent-dim); outline: 1px solid var(--accent); }
.fl-name { flex: 3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.fl-size { flex: 1; color: var(--text-muted); text-align: right; }
.fl-date { flex: 1; color: var(--text-muted); text-align: right; }
.finder-sidebar-section { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 12px 4px; }
.finder-sidebar-item { font-size: 12px; color: var(--text-dim); padding: 4px 12px; cursor: pointer; border-radius: 4px; margin: 0 4px; transition: background 0.12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finder-sidebar-item:hover { background: var(--accent-dim); }
.finder-sidebar-item.active { background: var(--accent-dim); color: var(--text); }
.finder-list-col { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.finder-col-name { flex: 3; color: var(--text); }
.finder-col-size { flex: 1; color: var(--text-muted); text-align: right; }
.finder-col-date { flex: 1; color: var(--text-muted); text-align: right; }
.finder-nav-btn:disabled { opacity: 0.3; cursor: default; }

/* ── Voice Preview ── */
.voice-preview-btn { background: var(--accent-dim); border: 1px solid var(--border); color: var(--accent); font-size: 11px; padding: 3px 10px; border-radius: 4px; cursor: pointer; transition: all 0.15s; margin-left: 6px; }
.voice-preview-btn:hover { background: var(--accent); color: white; }
.voice-preview-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Terminal ── */
.terminal-body {
  display: flex; flex-direction: column; height: calc(100% + 40px); margin-top: -40px;
  background: rgba(30, 30, 30, 0.95); font-family: 'SF Mono', 'Menlo', 'Fira Code', monospace;
  border-radius: var(--radius);
}
.terminal-output { flex: 1; overflow-y: auto; padding: 40px 14px 12px; font-size: 13px; line-height: 1.7; }
.terminal-line { color: #e0e0e0; white-space: pre-wrap; word-break: break-all; }
.terminal-line.output { color: #a0a0a0; }
.terminal-line.error { color: #ff6b6b; }
.terminal-input-line {
  display: flex; align-items: center; padding: 8px 14px;
  border-top: 1px solid rgba(255,255,255,0.08); gap: 8px;
}
.terminal-prompt { color: #34c759; font-size: 13px; white-space: nowrap; }
.terminal-input {
  flex: 1; background: transparent; border: none; color: #e0e0e0;
  font-family: inherit; font-size: 13px; outline: none; caret-color: #007aff;
}

/* ── Editor ── */
.editor-body { height: calc(100% + 40px); margin-top: -40px; display: flex; flex-direction: column; overflow: hidden; padding-top: 40px; }
.editor-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; padding-top: 0; background: rgba(245,245,247,0.9); border-bottom: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}
.editor-filename {
  font-size: 12px; font-weight: 500; color: rgba(0,0,0,0.6);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.editor-toggle {
  font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.1); background: white; color: rgba(0,0,0,0.7);
  cursor: pointer; transition: all 0.15s;
}
.editor-toggle:hover { background: rgba(0,0,0,0.04); }
.editor-toggle[data-mode="edit"] { background: var(--accent); color: white; border-color: var(--accent); }
.editor-textarea {
  flex: 1; width: 100%; padding: 16px 20px; background: rgba(30, 30, 30, 0.95); border: none;
  color: #e0e0e0; font-family: 'SF Mono', 'Menlo', monospace; font-size: 13px;
  line-height: 1.7; resize: none; outline: none; tab-size: 2;
}
.editor-textarea.hidden { display: none; }

/* ── Markdown Preview ── */
.editor-preview {
  flex: 1; overflow-y: auto; padding: 20px 24px;
  background: #fff; color: rgba(0,0,0,0.85);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  font-size: 14px; line-height: 1.75; cursor: default;
  -webkit-font-smoothing: antialiased;
}
.editor-preview.hidden { display: none; }
.md-h { font-weight: 700; color: rgba(0,0,0,0.9); margin: 16px 0 8px; }
.md-h1 { font-size: 24px; letter-spacing: -0.02em; padding-bottom: 6px; border-bottom: 1px solid rgba(0,0,0,0.08); }
.md-h2 { font-size: 20px; letter-spacing: -0.01em; }
.md-h3 { font-size: 16px; }
.md-h4, .md-h5, .md-h6 { font-size: 14px; }
.md-blockquote {
  padding: 8px 16px; margin: 8px 0; border-left: 3px solid rgba(0,0,0,0.15);
  color: rgba(0,0,0,0.55); font-style: italic; background: rgba(0,0,0,0.02); border-radius: 0 6px 6px 0;
}
.md-code-block {
  background: rgba(0,0,0,0.04); border-radius: 8px; padding: 12px 16px; margin: 8px 0;
  font-family: 'SF Mono', 'Menlo', monospace; font-size: 12px; line-height: 1.6;
  overflow-x: auto; color: rgba(0,0,0,0.75);
}
.md-inline-code {
  background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px;
  font-family: 'SF Mono', 'Menlo', monospace; font-size: 12px; color: #d63384;
}
.md-link { color: var(--accent); text-decoration: none; }
.md-link:hover { text-decoration: underline; }
.md-image { color: rgba(0,0,0,0.4); font-size: 12px; }
.md-li { padding: 2px 0; }
.md-hr { border: none; border-top: 1px solid rgba(0,0,0,0.08); margin: 16px 0; }
.md-blank { height: 8px; }
.md-check { font-size: 14px; }
.md-check.done { color: #22c55e; }
strong { font-weight: 600; }
em { font-style: italic; }
del { text-decoration: line-through; color: rgba(0,0,0,0.4); }

/* ── Plan ── */
.plan-body { padding: 16px; padding-top: 48px; }
.plan-goal { font-size: 14px; font-weight: 600; margin-bottom: 14px; color: var(--text); line-height: 1.5; }
.plan-steps { display: flex; flex-direction: column; gap: 6px; }
.plan-step {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px;
  border-radius: var(--radius-sm); font-size: 13px; line-height: 1.4;
  transition: background 0.15s;
}
.plan-step.running { background: var(--accent-dim); color: var(--accent); }
.plan-step.done { color: var(--green); }
.plan-step.aborted { color: var(--text-muted); text-decoration: line-through; }
.plan-step-icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.plan-step-text { flex: 1; }
.image-viewer { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; overflow: auto; background: #000; }
.image-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.tm-layout { display: flex; flex-direction: column; height: calc(100% + 40px); margin-top: -40px; padding-top: 40px; }
.tm-content { display: flex; flex: 1; overflow: hidden; }
.tm-list { width: 180px; border-right: 1px solid var(--border); overflow-y: auto; flex-shrink: 0; }
.tm-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 12px; border-bottom: 1px solid var(--border); }
.tm-item:hover, .tm-item.active { background: var(--surface2); }
.tm-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; background: var(--text-muted); }
.tm-item.running .tm-status-dot { background: var(--accent); }
.tm-item.done .tm-status-dot { background: var(--green); }
.tm-item.aborted .tm-status-dot, .tm-item.error .tm-status-dot { background: #ff5f57; }
.tm-goal { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.tm-detail { flex: 1; padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.tm-detail-goal { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.5; }
.tm-steps { display: flex; flex-direction: column; gap: 5px; }
.tm-step { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--text-muted); }
.tm-step.done { color: var(--green); }
.tm-step.running { color: var(--accent); }
.tm-step.aborted { text-decoration: line-through; }
.tm-step-icon { flex-shrink: 0; width: 14px; }
.tm-log { margin-top: 6px; border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.tm-log-line { font-size: 11px; color: var(--text-muted); font-family: monospace; }
.tm-log-view { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.tm-log-header { font-size: 11px; color: var(--text-muted); padding: 8px 14px 4px; border-bottom: 1px solid var(--border); font-weight: 500; }
.tm-log-body { flex: 1; overflow-y: auto; padding: 6px 0; }
.tm-log-entry { display: flex; gap: 8px; padding: 3px 14px; font-size: 11px; font-family: monospace; }
.tm-log-entry:hover { background: var(--surface2); }
.tm-log-idx { color: var(--text-muted); min-width: 20px; text-align: right; opacity: 0.5; }
.tm-log-text { color: var(--text); word-break: break-all; }
.tm-empty, .plan-empty { padding: 16px; font-size: 12px; color: var(--text-muted); text-align: center; }
.tm-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.tm-tab { padding: 5px 12px; font-size: 11px; background: none; border: none; border-radius: 6px 6px 0 0; color: var(--text-muted); cursor: pointer; transition: color 0.15s; }
.tm-tab:hover { color: var(--text); }
.tm-tab.active { color: var(--text); background: var(--surface2); }
.tm-queue { flex: 1; overflow-y: auto; padding: 8px 0; }
.tm-queue-section { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; padding: 8px 14px 4px; }
.tm-queue-item { display: flex; align-items: center; gap: 8px; padding: 6px 14px; font-size: 12px; }
.tm-queue-item.running { color: var(--accent); }
.tm-queue-item.pending { color: var(--text-muted); }

/* ── Task Manager: Intents Tab ── */
.tm-intents { flex: 1; overflow-y: auto; padding: 8px 0; }
.tm-intent-item { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.tm-intent-item.done { opacity: 0.5; }
.tm-intent-item.cancelled { opacity: 0.35; }
.tm-intent-header { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.tm-intent-status { font-size: 10px; }
.tm-intent-item.active .tm-intent-status { color: var(--accent); }
.tm-intent-id { font-family: var(--mono); font-size: 10px; opacity: 0.6; }
.tm-intent-age { margin-left: auto; font-size: 10px; }
.tm-intent-goal { font-size: 13px; color: var(--text); line-height: 1.4; }
.tm-intent-messages { margin-top: 6px; padding-left: 8px; border-left: 2px solid var(--border); }
.tm-intent-msg { font-size: 11px; color: var(--text-muted); line-height: 1.5; font-style: italic; }
.tm-intent-history { margin-top: 4px; }
.tm-intent-prev-goal { font-size: 10px; color: var(--text-muted); opacity: 0.5; }

/* ── Conductor Tab ── */
.cd-panel { flex: 1; overflow-y: auto; padding: 0; }
.cd-empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 8px; padding: 24px; }
.cd-empty-icon { font-size: 28px; opacity: 0.4; }
.cd-empty-title { font-size: 13px; font-weight: 600; color: var(--text); }
.cd-empty-hint { font-size: 11px; color: var(--text-muted); text-align: center; max-width: 240px; line-height: 1.5; }
.cd-stats { display: flex; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cd-stat { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); }
.cd-stat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.cd-stat-dot.running { background: var(--accent); animation: cd-pulse 1.5s ease-in-out infinite; }
.cd-stat-dot.done { background: var(--green); }
.cd-stat-dot.worker { background: #a78bfa; }
.cd-stat-dot.suspended { background: #f59e0b; }
@keyframes cd-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.cd-cards { display: flex; flex-direction: column; gap: 1px; }
.cd-card { padding: 10px 14px; border-bottom: 1px solid var(--border); transition: background 0.15s; }
.cd-card:hover { background: var(--surface2); }
.cd-card.running { border-left: 3px solid var(--accent); }
.cd-card.done { opacity: 0.55; border-left: 3px solid var(--green); }
.cd-card.cancelled { opacity: 0.35; border-left: 3px solid var(--text-muted); }
.cd-card.failed { border-left: 3px solid #ff5f57; }
.cd-card.pending { border-left: 3px solid var(--border); }
.cd-card-header { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.cd-card-status { font-size: 10px; }
.cd-card.running .cd-card-status { color: var(--accent); }
.cd-card.done .cd-card-status { color: var(--green); }
.cd-card.failed .cd-card-status { color: #ff5f57; }
.cd-card-id { font-family: var(--mono); font-size: 10px; opacity: 0.6; }
.cd-card-age { margin-left: auto; font-size: 10px; }
.cd-card-goal { font-size: 13px; color: var(--text); line-height: 1.4; }
.cd-card-deps { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cd-dep { font-size: 10px; padding: 2px 6px; border-radius: 4px; background: var(--surface2); color: var(--text-muted); }
.cd-dep.resolved { color: var(--green); }
.cd-dep.waiting { color: #f59e0b; }
.cd-card-worker { margin-top: 8px; padding: 6px 8px; background: var(--surface2); border-radius: 6px; }
.cd-worker-header { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--text-muted); margin-bottom: 4px; }
.cd-worker-id { font-family: var(--mono); font-weight: 600; }
.cd-worker-meta { opacity: 0.7; }
.cd-worker-status { margin-left: auto; padding: 1px 5px; border-radius: 3px; font-size: 9px; text-transform: uppercase; letter-spacing: 0.03em; }
.cd-worker-status.running { background: var(--accent); color: #fff; }
.cd-worker-status.suspended { background: #f59e0b; color: #fff; }
.cd-worker-status.done { background: var(--green); color: #fff; }
.cd-worker-steps { display: flex; flex-direction: column; gap: 2px; }
.cd-worker-step { font-size: 11px; color: var(--text-muted); }
.cd-worker-step.done { color: var(--green); }
.cd-worker-step.running { color: var(--accent); }
.cd-card-messages { margin-top: 6px; padding-left: 8px; border-left: 2px solid var(--border); }
.cd-card-msg { font-size: 11px; color: var(--text-muted); line-height: 1.5; font-style: italic; }

/* ── Chat Panel ── */
#chat-panel {
  width: 360px; display: flex; flex-direction: column;
  background: var(--bg); border-left: 1px solid var(--border);
  flex-shrink: 0;
}
#chat-header {
  height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid var(--border);
  background: var(--glass); backdrop-filter: blur(40px) saturate(1.8);
}
.chat-title { font-size: 15px; font-weight: 600; color: var(--text); }
#clear-chat-btn { background: none; border: none; font-size: 14px; cursor: pointer; opacity: 0.5; transition: opacity 0.15s; padding: 4px 8px; }
#clear-chat-btn:hover { opacity: 1; }

#chat-messages {
  flex: 1; overflow-y: auto; padding: 16px; display: flex;
  flex-direction: column; gap: 8px;
}
.chat-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 18px;
  font-size: 14px; line-height: 1.5; word-wrap: break-word;
  animation: bubbleIn 0.25s ease;
}
@keyframes bubbleIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.chat-bubble.user {
  align-self: flex-end; background: var(--accent);
  border-bottom-right-radius: 6px; color: #fff;
}
.chat-bubble.agent {
  align-self: flex-start; background: var(--surface-solid);
  border-bottom-left-radius: 6px; color: var(--text);
  box-shadow: var(--shadow-sm);
}
.chat-bubble.agent:empty::after {
  content: '●●●'; letter-spacing: 4px; color: var(--text-muted);
  animation: typing 1.2s ease-in-out infinite;
}
@keyframes typing { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.8; } }
.chat-bubble.system {
  align-self: center; background: transparent; color: var(--text-muted);
  font-size: 12px; padding: 4px 8px;
}

/* Markdown table in chat bubbles */
.chat-bubble .md-table-wrap {
  overflow-x: auto; margin: 6px -4px; max-width: 100%;
}
.md-table {
  width: max-content; border-collapse: collapse; font-size: 12px; white-space: nowrap;
}
.md-table th, .md-table td {
  padding: 4px 8px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.md-table th {
  font-weight: 600; color: var(--text-primary); border-bottom: 2px solid rgba(255,255,255,0.2);
}
.md-table tr:hover td { background: rgba(255,255,255,0.03); }

/* Chat inline media */
.chat-media {
  margin: 6px 0; border-radius: 10px; overflow: hidden; cursor: grab;
  position: relative; max-width: 280px;
}
.chat-media:active { cursor: grabbing; }
.chat-media img {
  display: block; max-width: 100%; border-radius: 10px;
  transition: transform 0.15s;
}
.chat-media img:hover { transform: scale(1.02); }
.chat-media audio { width: 100%; min-width: 220px; }
.chat-media video { display: block; max-width: 100%; border-radius: 10px; }
.chat-media::after {
  content: ''; position: absolute; bottom: 6px; right: 6px;
  width: 20px; height: 20px; opacity: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='7 10 12 15 17 10'/%3E%3Cline x1='12' y1='15' x2='12' y2='3'/%3E%3C/svg%3E") center/contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
  transition: opacity 0.2s; pointer-events: none;
}
.chat-media:hover::after { opacity: 0.7; }

#chat-input-area {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 14px; border-top: 1px solid var(--border);
  background: var(--glass); backdrop-filter: blur(20px);
}
#chat-input {
  flex: 1; padding: 10px 14px; background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: 22px; color: var(--text); font-size: 14px; font-family: inherit;
  outline: none; resize: none; max-height: 120px; line-height: 1.4;
  transition: border-color 0.15s;
}
#chat-input:focus { border-color: var(--accent); }
#chat-input::placeholder { color: var(--text-muted); }
#chat-send {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.15s, transform 0.1s;
}
#chat-send:hover { background: #0066d6; }
#chat-send:active { transform: scale(0.95); }
#voice-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-solid); color: var(--text-dim); font-size: 16px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all 0.2s;
}
#voice-btn:hover { background: var(--surface3); }
#voice-btn.listening { background: var(--red); border-color: var(--red); animation: voice-pulse 1.5s infinite; }
@keyframes voice-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center; z-index: 9999;
  backdrop-filter: blur(8px);
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface-solid); border: 1px solid var(--border);
  border-radius: 20px; padding: 36px 32px; width: 380px;
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: var(--shadow-lg);
}
.modal h2 { font-size: 22px; text-align: center; font-weight: 700; letter-spacing: -0.02em; }
.modal p { font-size: 13px; color: var(--text-dim); text-align: center; line-height: 1.5; }
.modal select, .modal input {
  padding: 11px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px; outline: none;
  transition: border-color 0.15s;
}
.modal input:focus, .modal select:focus { border-color: var(--accent); }
.modal button {
  padding: 11px; background: var(--accent); border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.modal button:hover { background: #0066d6; }
.modal button:active { transform: scale(0.98); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.25); }

/* ── Settings ── */
.settings-body { padding: 16px; padding-top: 48px; display: flex; flex-direction: column; gap: 14px; }
.settings-layout { display: flex; height: 100%; margin-top: -40px; }
.settings-sidebar { width: 120px; border-right: 1px solid var(--border); padding: 48px 0 8px; flex-shrink: 0; }
.settings-nav { padding: 7px 14px; font-size: 12px; color: var(--text-muted); cursor: pointer; transition: all 0.15s; }
.settings-nav:hover { color: var(--text); background: var(--surface2); }
.settings-nav.active { color: var(--text); background: var(--surface2); font-weight: 600; }
.settings-content { flex: 1; overflow-y: auto; padding-top: 40px; }
.settings-panel { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.settings-skill-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: var(--surface2); }
.settings-skill-name { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.settings-skill-desc { font-size: 11px; color: var(--text-muted); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.settings-skill-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.settings-skill-del:hover { background: rgba(255,95,87,0.15); color: #ff5f57; }
.settings-empty { font-size: 12px; color: var(--text-muted); padding: 8px 0; }
.settings-about-text { font-size: 13px; color: var(--text); line-height: 1.6; }
.settings-about-text p { margin: 0; }
.lp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 20px; }
.lp-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 12px; cursor: pointer; transition: background 0.15s; }
.lp-item:hover { background: var(--surface2); }
.lp-icon { font-size: 32px; line-height: 1; }
.lp-name { font-size: 11px; color: var(--text); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80px; }
.settings-section { display: flex; flex-direction: column; gap: 4px; }
.settings-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.settings-input { background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: var(--text); font-size: 13px; outline: none; }
.settings-input:focus { border-color: var(--accent); }
.settings-toggle { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.settings-toggle input { accent-color: var(--accent); }
.settings-save { background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 10px; font-size: 13px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.settings-save:hover { background: #0066d6; }
select.settings-input { appearance: none; cursor: pointer; }
.settings-divider { height: 1px; background: var(--border); margin: 4px 0; }
.settings-group-title { font-size: 12px; font-weight: 700; color: var(--text); letter-spacing: 0.3px; }

/* ── Music Player ── */
.music-player { display: flex; flex-direction: column; height: calc(100% + 40px); margin-top: -40px; padding: 48px 16px 16px; gap: 12px; overflow-y: auto; }
.music-art { display: flex; align-items: center; justify-content: center; height: 120px; border-radius: 12px; flex-shrink: 0; overflow: hidden; position: relative; }
.music-art-icon { font-size: 48px; }
.music-info { text-align: center; }
.music-title { font-size: 15px; font-weight: 600; color: var(--text); }
.music-artist { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.music-progress { display: flex; flex-direction: column; gap: 4px; }
.music-bar { height: 4px; background: var(--surface3); border-radius: 2px; overflow: hidden; cursor: pointer; }
.music-bar-fill { height: 100%; border-radius: 2px; transition: width 0.3s linear; }
.music-times { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); }
.music-controls { display: flex; align-items: center; justify-content: center; gap: 16px; }
.music-btn { background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 6px; border-radius: 50%; transition: all 0.15s; }
.music-btn:hover { color: var(--text); background: var(--surface3); }
.music-play { font-size: 24px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; border-radius: 50%; }
.music-play:hover { opacity: 0.9; background: var(--accent); color: #fff; }
.music-list { display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; overflow-y: auto; }
.music-track { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; transition: background 0.15s; }
.music-track:hover { background: var(--surface3); }
.music-track.active { background: var(--surface3); }
.music-track-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.music-track-title { color: var(--text); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-track-artist { color: var(--text-muted); font-size: 11px; }
.music-track-dur { color: var(--text-muted); font-size: 11px; flex-shrink: 0; }
.music-art-img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }
.music-track-thumb { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }

/* ── Voice Preview ── */
.voice-preview-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); font-size: 11px; padding: 3px 10px; border-radius: 4px; cursor: pointer; margin-left: 8px; transition: all 0.15s; }
.voice-preview-btn:hover { background: var(--surface3); color: var(--text); }
.voice-preview-btn:disabled { opacity: 0.5; cursor: default; }

/* ── Video Player ── */
.video-player { width: 100%; height: 100%; background: #000; display: flex; align-items: center; justify-content: center; }
.video-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 12px; padding: 24px; }
.video-empty-icon { font-size: 48px; opacity: 0.5; }
.video-empty-text { color: var(--text-muted); font-size: 13px; }
.video-url-bar { display: flex; gap: 6px; width: 100%; max-width: 360px; }
.video-url-input { flex: 1; background: var(--surface3); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; color: var(--text); font-size: 12px; outline: none; }
.video-url-input:focus { border-color: var(--accent); }
.video-url-go { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 8px 14px; cursor: pointer; font-size: 14px; }
.video-url-go:hover { opacity: 0.9; }
.video-samples { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.video-sample { font-size: 11px; color: var(--accent); cursor: pointer; padding: 4px 8px; border-radius: 4px; background: var(--surface3); }
.video-sample:hover { background: var(--surface-3); }

/* ── Browser ── */
.browser-window { display: flex; flex-direction: column; height: calc(100% + 40px); margin-top: -40px; padding-top: 40px; }
.browser-toolbar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--surface3); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.browser-nav-btn { background: none; border: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.browser-nav-btn:hover { background: var(--surface-3); color: var(--text); }
.browser-url-bar { flex: 1; }
.browser-url-input { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; color: var(--text); font-size: 12px; outline: none; }
.browser-url-input:focus { border-color: var(--accent); }
.browser-content { flex: 1; overflow: hidden; position: relative; }
.browser-content iframe { display: block; }
.browser-home { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 16px; }
.browser-home-logo { font-size: 48px; }
.browser-home-title { font-size: 18px; font-weight: 600; color: var(--text); }
.browser-bookmarks { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.browser-bookmark { font-size: 12px; color: var(--text); padding: 8px 14px; background: var(--surface3); border-radius: 8px; cursor: pointer; transition: all 0.15s; }
.browser-bookmark:hover { background: var(--surface-3); transform: translateY(-1px); }

/* ── Dock App Items ── */
.dock-app { position: relative; }

/* ── Voice PTT ── */
#voice-btn.ptt-active {
  background: #ef4444 !important;
  animation: ptt-pulse 0.8s ease-in-out infinite;
  transform: scale(1.15);
}
#voice-btn.listening {
  background: var(--accent) !important;
  animation: ptt-pulse 1.2s ease-in-out infinite;
}
@keyframes ptt-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
#voice-interim {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 12px;
  right: 12px;
  padding: 8px 12px;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  border-bottom: none;
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
  max-height: 60px;
  overflow: hidden;
}
#chat-input-area { position: relative; }
.settings-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

/* ── Chat separator ── */
.chat-separator {
  text-align: center;
  color: var(--text-muted);
  font-size: 11px;
  padding: 8px 0;
  opacity: 0.6;
  position: relative;
}
.chat-separator::before, .chat-separator::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--border);
}
.chat-separator::before { left: 5%; }
.chat-separator::after { right: 5%; }

/* ── Notification Center ── */

/* ── Drag & Drop ── */
#chat-panel.drag-over {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
  background: rgba(99, 102, 241, 0.05);
}

/* ── Dynamic Island (Task Status) ── */
#task-status-wrap {
  position: relative;
  z-index: 10000; pointer-events: auto;
}
#task-status {
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.85); color: rgba(255,255,255,0.9);
  border-radius: 20px; cursor: default;
  font-size: 11px; font-weight: 500;
  overflow: hidden; white-space: nowrap;
  transition: all 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  height: 20px; min-width: 28px;
  padding: 0 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
#task-status:empty {
  min-width: 0; max-width: 0; padding: 0;
  opacity: 0; pointer-events: none;
}
#task-status.island-active {
  min-width: 180px; max-width: 340px;
  padding: 0 12px;
}
#task-status.island-expanded {
  transform: scale(1.05);
}
#task-status:hover { background: rgba(0,0,0,0.9); }
#task-status .spinner {
  width: 8px; height: 8px; border: 1.5px solid rgba(255,255,255,0.8);
  border-top-color: transparent; border-radius: 50%;
  animation: spin 0.8s linear infinite; flex-shrink: 0;
}
#task-status .island-goal {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; letter-spacing: -0.01em;
}
#task-status .island-meta {
  font-size: 10px; color: rgba(255,255,255,0.5); flex-shrink: 0;
}
#task-hover-panel {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  width: 340px; max-height: 440px; overflow-y: auto;
  background: rgba(28,28,30,0.94); backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.15);
  padding: 14px; z-index: 10001;
  color: rgba(255,255,255,0.85); font-size: 12px;
}
#task-hover-panel.hidden { display: none; }
#task-hover-panel .thp-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
#task-hover-panel .thp-title {
  font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.9);
}
#task-hover-panel .thp-section {
  margin-bottom: 8px;
}
#task-hover-panel .thp-section-label {
  font-size: 10px; font-weight: 600; color: rgba(255,255,255,0.3); text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 6px; padding-top: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
#task-hover-panel .thp-task {
  padding: 8px 10px; border-radius: 10px; margin-bottom: 4px;
  background: rgba(255,255,255,0.05);
  transition: background 0.15s;
}
#task-hover-panel .thp-task:hover { background: rgba(255,255,255,0.08); }
#task-hover-panel .thp-task.active { background: rgba(59,130,246,0.12); }
#task-hover-panel .thp-task-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
#task-hover-panel .thp-task-name {
  font-weight: 500; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: rgba(255,255,255,0.85); flex: 1;
}
#task-hover-panel .thp-task-badge {
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 6px; flex-shrink: 0;
}
#task-hover-panel .thp-task-badge.running { background: rgba(59,130,246,0.2); color: #60a5fa; }
#task-hover-panel .thp-task-badge.queued { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.4); }
#task-hover-panel .thp-task-badge.done { background: rgba(34,197,94,0.15); color: #4ade80; }
#task-hover-panel .thp-task-badge.error { background: rgba(239,68,68,0.15); color: #f87171; }
#task-hover-panel .thp-task-badge.aborted { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.3); }
#task-hover-panel .thp-progress-row {
  display: flex; align-items: center; gap: 8px; margin: 6px 0 4px;
}
#task-hover-panel .thp-progress-bar {
  flex: 1; height: 3px; border-radius: 2px; background: rgba(255,255,255,0.1); overflow: hidden;
}
#task-hover-panel .thp-progress-fill {
  height: 100%; border-radius: 2px; background: #60a5fa; transition: width 0.3s ease;
}
#task-hover-panel .thp-progress-text {
  font-size: 10px; color: rgba(255,255,255,0.4); flex-shrink: 0;
}
#task-hover-panel .thp-steps {
  display: flex; flex-direction: column; gap: 2px; margin-top: 4px;
}
#task-hover-panel .thp-step {
  font-size: 11px; color: rgba(255,255,255,0.45); display: flex; align-items: center; gap: 4px;
}
#task-hover-panel .thp-step.done { color: rgba(255,255,255,0.3); }
#task-hover-panel .thp-step.done::before { content: '✓'; color: #4ade80; font-size: 10px; }
#task-hover-panel .thp-step.running::before { content: '●'; color: #60a5fa; font-size: 8px; }
#task-hover-panel .thp-step.pending::before { content: '○'; color: rgba(255,255,255,0.2); font-size: 8px; }
#task-hover-panel .thp-empty {
  text-align: center; padding: 20px 0; color: rgba(255,255,255,0.2); font-size: 12px;
}
#clock {
  font-size: 13px; color: rgba(0,0,0,0.85); font-variant-numeric: tabular-nums;
  min-width: 120px; text-align: right; font-weight: 500;
}
#header-right {
  display: flex; align-items: center; gap: 12px; margin-left: auto;
}

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

/* ── Keyboard hint ── */
.kbd-hint {
  position: fixed; bottom: 12px; left: 12px;
  font-size: 10px; color: var(--text-muted); opacity: 0.5;
  pointer-events: none;
}

/* ── Window snap preview ── */
.snap-preview {
  position: absolute; background: rgba(0, 122, 255, 0.1);
  border: 2px solid var(--accent); border-radius: 12px;
  z-index: 9998; pointer-events: none;
  transition: all 0.15s ease;
}

/* ── Context menu ── */
.context-menu {
  position: fixed; background: var(--glass); backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid var(--glass-border);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  z-index: 99999; min-width: 160px; padding: 4px 0;
  font-size: 13px;
}
.context-menu-item {
  padding: 8px 14px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  border-radius: 8px; margin: 0 4px;
}
.context-menu-item:hover { background: var(--accent); color: white; }
.context-menu-sep { height: 1px; background: var(--border); margin: 4px 8px; }

/* ── Spotlight ── */
#spotlight {
  position: fixed; top: 20%; left: 50%; transform: translateX(-50%);
  width: 520px; max-width: 90vw;
  background: var(--glass); backdrop-filter: blur(40px) saturate(1.8);
  border: 1px solid var(--glass-border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  z-index: 100000; overflow: hidden;
}
#spotlight.hidden { display: none; }
#spotlight-input {
  width: 100%; padding: 14px 18px; font-size: 16px;
  background: transparent; border: none; color: var(--text);
  outline: none; font-family: inherit;
}
#spotlight-input::placeholder { color: var(--text-muted); }
#spotlight-results {
  max-height: 300px; overflow-y: auto;
  border-top: 1px solid var(--border);
}
#spotlight-results:empty { border-top: none; }
.spotlight-item {
  padding: 10px 18px; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.spotlight-item:hover, .spotlight-item.selected { background: var(--accent); color: white; }
.spotlight-item .spot-icon { font-size: 16px; width: 24px; text-align: center; }
.spotlight-item .spot-label { flex: 1; }
.spotlight-item .spot-hint { font-size: 11px; color: var(--text-muted); }
.spotlight-item:hover .spot-hint, .spotlight-item.selected .spot-hint { color: rgba(255,255,255,0.7); }

/* ── Responsive ── */
@media (max-width: 768px) {
  #app { flex-direction: column; }
  #chat-panel { width: 100%; height: 50%; border-left: none; border-top: 1px solid var(--border-subtle); }
}

/* ── DynamicApp ── */
.dapp-body { padding: 12px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.dapp-title { font-size: 16px; font-weight: 600; color: var(--text); }
.dapp-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.dapp-empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 32px 0; }
.dapp-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.dapp-field { background: var(--surface-raised); border-radius: 8px; padding: 10px 12px; }
.dapp-field-key { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.dapp-field-value { font-size: 15px; color: var(--text); word-break: break-word; font-weight: 500; }
.dapp-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; min-height: 80px; }
.dapp-hero-value { font-size: 56px; font-weight: 200; color: var(--text); font-variant-numeric: tabular-nums; font-family: ui-monospace, 'SF Mono', monospace; }
.dapp-hero-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 1px; }
.dapp-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 0; border-top: 1px solid var(--border-subtle); margin-top: auto; }
.dapp-action-btn { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer; transition: all 0.15s; font-weight: 500; }
.dapp-action-btn:hover { background: var(--surface-raised); }
.dapp-action-btn:active { transform: scale(0.97); }
.dapp-action-btn.dapp-primary { background: var(--accent); color: white; border-color: var(--accent); }
.dapp-action-btn.dapp-primary:hover { filter: brightness(1.1); }
.dapp-action-btn.dapp-danger { color: #ff6b6b; border-color: #ff6b6b44; }
.dapp-action-btn.dapp-danger:hover { background: #ff6b6b22; }
.dapp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.dapp-table th { text-align: left; padding: 6px 10px; border-bottom: 2px solid var(--border); color: var(--text-muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.dapp-table td { padding: 6px 10px; border-bottom: 1px solid var(--border-subtle); }
.dapp-table tr:hover td { background: var(--surface-raised); }
.dapp-list-item { padding: 8px 10px; border-bottom: 1px solid var(--border-subtle); font-size: 12px; }
.dapp-list-item:last-child { border-bottom: none; }
.dapp-markdown { font-size: 12px; line-height: 1.6; white-space: pre-wrap; }
.dapp-custom-frame { width: 100%; border: none; flex: 1; min-height: 200px; background: transparent; border-radius: 4px; }
