@property --accent { syntax: '<color>'; inherits: true; initial-value: #d6ae58; }

:root { background: #1d1b1b; }

#demo-root.dark {
  position: relative;
  overflow: hidden;
  user-select: none;
  --frame: color-mix(in srgb, var(--accent) 7%, #1f1d1c);
  --side: color-mix(in srgb, var(--accent) 4%, #262423) !important;
  transition: --accent .9s ease;
}

#demo-root ::selection { background: transparent; }
.dark .spinner { border-color: #ffffff1f; border-top-color: var(--accent); }
.dark .send-button { background: var(--accent); color: #1a1a1a; }
.dark .activity-count-badge { background: var(--accent); color: #1a1a1a; }
.dark .app-name, .dark .section-label, .dark .group-label, .dark .folder-label, .dark .nav-actions .icon, .dark .settings-button .icon { color: #9a9592; }
.dark .folders-label { color: #ccc; }
.dark .local-tabs button[aria-pressed=true] { border-bottom-color: var(--accent); }
.dark .positive { color: #5fcf98; }
.dark .negative { color: #f07a7a; }
.dark .task-list .icon { color: #5fcf98; }
.dark .composer:has(.is-typing) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

.window-bar { gap: 16px; }
.window-bar .demo-indicator { margin-left: 0; white-space: nowrap; }
.tour-tabs { display: flex; flex: 1; justify-content: center; gap: 4px; min-width: 0; }
.tour-tab { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; height: 24px; padding: 0 10px; border-radius: 6px; color: #8d8784; font-size: 11px; overflow: hidden; }
.tour-tab b { font-weight: 500; opacity: .6; }
.tour-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tour-tab i { position: absolute; left: 8px; right: 8px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; }
.tour-tab:hover { background: #ffffff0d; color: #ddd; }
.tour-tab[aria-current] { color: #eee; background: #ffffff0f; }
.tour-tab.is-done i { transform: scaleX(1); opacity: .35; }
.tour-tab.is-active i { animation: tour-progress 15s linear forwards; }
@keyframes tour-progress { to { transform: scaleX(1); } }

.app-shell { transition: opacity .45s ease, transform .45s ease, filter .45s ease; }
.app-shell.is-hidden { opacity: 0; transform: scale(.985); filter: blur(4px); }

.tour-card { position: absolute; inset: 32px 0 0; z-index: 8; display: grid; place-content: center; gap: 10px; padding: 24px; text-align: center; pointer-events: none; opacity: 0; transform: translateY(10px); transition: opacity .4s ease, transform .4s ease; }
.tour-card.is-visible { opacity: 1; transform: none; }
.tour-card small { color: var(--accent); font-size: 12px; letter-spacing: .12em; }
.tour-card strong { font-size: clamp(26px, 4vw, 40px); font-weight: 500; letter-spacing: -.03em; color: #f2f0ee; }
.tour-card p { max-width: 460px; margin: 0 auto; color: #a9a4a1; font-size: 14px; }

.tour-pointer { position: absolute; left: 0; top: 0; z-index: 9; width: 20px; height: 20px; margin: -2px 0 0 -3px; pointer-events: none; transition: transform .5s cubic-bezier(.45, .05, .25, 1), opacity .3s; }
.tour-pointer svg { width: 20px; height: 20px; fill: #fff; stroke: #111; stroke-width: 1.2; stroke-linejoin: round; filter: drop-shadow(0 2px 3px #0008); transition: scale .15s; transform-origin: 3px 2px; }
.tour-pointer.is-pressing svg { scale: .86; }
.tour-pointer.is-hidden { opacity: 0; }
.tour-ripple { position: absolute; z-index: 9; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%; border: 2px solid var(--accent); pointer-events: none; animation: tour-ripple .5s ease-out forwards; }
@keyframes tour-ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.is-pressed { filter: brightness(1.25); }

.is-new { animation: tour-in .35s ease both; }
@keyframes tour-in { from { opacity: 0; transform: translateY(6px); } }
.token { animation: tour-token .3s ease both; }
@keyframes tour-token { from { opacity: 0; filter: blur(2px); } }
.token code, .tour-tools span, .coord code { font: 11.5px Consolas, monospace; padding: 1px 4px; border-radius: 4px; background: #ffffff10; }

.tour-input { position: relative; min-height: 62px; padding: 5px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tour-input:has(.typed:empty)::before { content: attr(data-placeholder); position: absolute; color: #7a7a7a; }
.tour-caret { display: none; width: 1.5px; height: 1.1em; margin-left: 1px; vertical-align: text-bottom; background: var(--accent); animation: tour-blink 1s steps(1) infinite; }
.is-typing .tour-caret { display: inline-block; }
@keyframes tour-blink { 50% { opacity: 0; } }

.tour-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 5px; font-size: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tour-chip .icon { width: 12px; height: 12px; }
.user-message .tour-chip { display: flex; width: fit-content; margin-bottom: 8px; }

.tour-tools { display: grid; gap: 4px; margin: -8px 0 22px; color: var(--muted); font-size: 12px; }
.tour-tool { display: flex; align-items: center; gap: 7px; min-width: 0; }
.tour-tool .icon { width: 13px; height: 13px; color: var(--accent); }
.tour-tool strong { font-weight: 400; color: #ddd; }
.tour-tool span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tour-panel { transition: width .5s ease, min-width .5s ease, opacity .4s ease; }
.tour-panel.is-closed { width: 0; min-width: 0; opacity: 0; border: 0; overflow: hidden; }
.tour-panel .panel-tabs .icon { width: 14px; height: 14px; color: var(--accent); }

.agent-list { display: grid; gap: 10px; }
.agent-card { padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: border-color .4s; }
.agent-card[data-state=done] { border-color: color-mix(in srgb, #5fcf98 35%, var(--border)); }
.agent-card[data-state=warning] { border-color: color-mix(in srgb, #f0b35a 55%, var(--border)); }
.agent-card header { display: flex; align-items: center; gap: 8px; }
.agent-card strong { font-weight: 500; font-size: 12.5px; }
.agent-level { padding: 2px 6px; border-radius: 4px; font-size: 10px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.agent-model { display: flex; align-items: center; gap: 7px; margin-top: 9px; font-size: 12px; }
.agent-model small { margin-left: auto; color: var(--muted); font-size: 10px; }
.agent-model i { width: 8px; height: 8px; border-radius: 50%; background: #888; }
.provider-zai { background: #5a8cff !important; }
.provider-google { background: #34a853 !important; }
.provider-anthropic { background: #d97757 !important; }
.provider-openai { background: #e8e8e8 !important; }
.agent-progress { height: 3px; margin: 10px 0 8px; border-radius: 3px; background: #ffffff12; overflow: hidden; }
.agent-progress i { display: block; height: 100%; width: calc(var(--progress, 0) * 100%); background: var(--accent); transition: width var(--duration, .6s) ease-in-out; }
.agent-card[data-state=done] .agent-progress i { background: #5fcf98; }
.agent-status { display: flex; align-items: center; gap: 7px; margin: 0; color: var(--muted); font-size: 11px; }
.agent-status .icon { width: 13px; height: 13px; }
.agent-card[data-state=done] .agent-status .icon { color: #5fcf98; }
.agent-card[data-state=warning] .agent-status .icon { color: #f0b35a; }

.coord { margin: 0 0 12px; padding: 10px 12px; border-left: 2px solid var(--accent); border-radius: 0 8px 8px 0; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); font-size: 12px; }
.coord.is-warning { border-left-color: #f0b35a; }
.coord.is-approved { border-left-color: #5fcf98; }
.coord.is-reply { margin-left: 24px; border-left-color: #777; background: var(--surface); }
.coord header { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.coord header .icon { width: 12px; height: 12px; }
.coord b { font-weight: 500; color: #ddd; }
.coord p { margin: 4px 0 0; line-height: 1.55; }

.bot-msg { display: flex; gap: 9px; margin-bottom: 14px; }
.bot-msg > div { flex: 1; min-width: 0; padding: 9px 11px; border-radius: 4px 10px 10px 10px; background: var(--surface); }
.bot-msg header { color: var(--muted); font-size: 10.5px; }
.bot-msg header strong { color: #ddd; font-weight: 500; }
.bot-msg p { margin: 4px 0 0; line-height: 1.55; }
.org-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.org-list li { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; }
.org-list .icon { width: 14px; height: 14px; color: #5fcf98; }
.bot-state { display: grid; place-items: center; flex: 0 0 auto !important; }
.bot-state .icon { width: 13px; height: 13px; color: #7b7471; }
.bot-row .notification { padding: 0 5px; }

.git-files { display: grid; gap: 2px; margin-bottom: 12px; }
.git-file { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: 6px; font-size: 11.5px; }
.git-file span { flex: 1; }
.git-file b { font-weight: 400; font-size: 10.5px; }
.git-file .icon { width: 13px; height: 13px; color: var(--muted); }
.git-file.selected { background: #ffffff12; }
.git-diff { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font: 11px/1.75 Consolas, monospace; }
.git-line { display: grid; grid-template-columns: 26px 14px 1fr; transition: background .25s; }
.git-line > span { color: #777; text-align: right; padding-right: 4px; }
.git-line > span + span { text-align: center; padding: 0; }
.git-line code { white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.git-line.added { background: #2ea04318; }
.git-line.added > span + span { color: #5fcf98; }
.git-line.is-selected { background: color-mix(in srgb, var(--accent) 26%, transparent); }
.git-line.has-note { box-shadow: inset 2px 0 var(--accent); }
.git-line.is-updated { animation: tour-flash 1.2s ease; }
@keyframes tour-flash { 0%, 40% { background: color-mix(in srgb, var(--accent) 30%, transparent); } }
.annotation { margin: 6px; padding: 10px; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: 8px; background: var(--bg); font: 12px "Segoe UI", system-ui, sans-serif; }
.annotation header { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; }
.annotation header .icon { width: 12px; height: 12px; }
.annotation .tour-input { min-height: 40px; font-size: 12px; }
.annotation footer { display: flex; flex-wrap: wrap; gap: 5px; }
.tour-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--muted); font-size: 11px; }
.tour-btn .icon { width: 12px; height: 12px; }
.tour-btn.primary { margin-left: auto; border-color: transparent; background: var(--accent); color: #1a1a1a; }
.git-commit { margin-top: 12px; padding: 10px; border: 1px solid var(--border); border-radius: 8px; }
.git-commit .tour-input { min-height: 26px; font-size: 12px; }
.git-commit-actions { display: flex; gap: 6px; margin-top: 6px; }

.tour-toast { position: absolute; right: 18px; bottom: 18px; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: #2a2a2a; box-shadow: 0 10px 30px #0006; font-size: 12px; }
.tour-toast .icon { color: #5fcf98; }

.tour-menu { position: absolute; left: 22px; bottom: 120px; z-index: 4; width: 280px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: #262626; box-shadow: 0 14px 35px #0007; }
.tour-menu > div { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; }
.tour-menu > div:first-child { background: #ffffff0d; }
.tour-menu span { display: grid; gap: 2px; }
.tour-menu strong { font-weight: 500; font-size: 12.5px; }
.tour-menu small { color: var(--muted); font-size: 11px; }
.tour-menu .icon { color: var(--accent); }

.tour-mark { background: none; color: inherit; border-radius: 3px; transition: background .25s; }
.tour-mark.is-selected { background: color-mix(in srgb, var(--accent) 40%, transparent); }
.select-bar { position: absolute; z-index: 4; display: flex; gap: 2px; padding: 4px; border: 1px solid var(--border); border-radius: 9px; background: #262626; box-shadow: 0 10px 25px #0006; }
.select-bar button { display: flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 6px; font-size: 11px; white-space: nowrap; }
.select-bar .icon { width: 12px; height: 12px; color: var(--accent); }
.quick-pop { position: absolute; z-index: 4; width: min(330px, calc(100% - 24px)); padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #242424; box-shadow: 0 16px 40px #0008; font-size: 12px; transition: opacity .3s, transform .3s; }
.quick-pop.is-leaving { opacity: 0; transform: translateY(6px); }
.quick-pop header { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.quick-pop header .icon { width: 13px; height: 13px; color: var(--accent); }
.quick-pop header small { margin-left: auto; color: var(--muted); font-weight: 400; font-size: 10px; }
.quick-pop blockquote { margin: 9px 0 0; padding: 3px 8px; border-left: 2px solid var(--accent); color: var(--muted); }
.quick-pop .tour-input { min-height: 0; padding: 8px 0 0; font-size: 12px; }
.quick-answer { margin: 6px 0 0; line-height: 1.55; color: #cfcfcf; }
.quick-answer:empty { display: none; }
#side-feed .user-message { margin-bottom: 14px; padding: 9px 12px; font-size: 12px; }
#side-feed .assistant-message { font-size: 12px; margin-bottom: 12px; }
.side-composer { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; padding: 6px 6px 6px 8px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.side-composer .tour-input { flex: 1; min-height: 34px; font-size: 12px; }
.relay { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 8px 10px; border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--border)); border-radius: 8px; color: var(--accent); font-size: 11.5px; }
.relay .icon { width: 13px; height: 13px; flex-shrink: 0; }
.relay.is-incoming { color: inherit; }
.relay.is-incoming .icon { color: var(--accent); }
.relay strong { display: block; color: var(--accent); font-weight: 500; font-size: 10.5px; }

@media (max-width: 1000px) {
  .tour-tab span { display: none; }
  .tour-tab[aria-current] span { display: inline; }
}

@media (max-width: 700px) {
  .window-bar .demo-indicator { display: none; }
  .tour-tab { padding: 0 7px; }
  .tour-tab[aria-current] span { display: none; }
  .tour-panel { inset: 0; }
  .tour-menu { left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .token, .is-new, .git-line.is-updated { animation: none; }
  .app-shell, .tour-card, .tour-panel { transition: opacity .2s; }
}
