:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #e1e1e1;
  background: #0c0c0c;
  font-synthesis: none;
  --muted: #999999;
  --line: #2e2e2e;
  --surface: #181818;
  --accent: #e6e6e6;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 80% 0, #2b2b2b55, transparent 55%); min-height: 100vh; }
button, input, textarea { font: inherit; }
button, summary { cursor: pointer; }
button { transition: color .15s, background .15s, border-color .15s; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
input, textarea { border: 1px solid #383838; border-radius: 6px; padding: 12px 14px; background: #111111; color: #e9e9e9; outline: none; }
input::placeholder, textarea::placeholder { color: #909090; }
input:focus, textarea:focus { border-color: #a3a3a3; box-shadow: 0 0 0 3px #e6e6e60a; }
textarea { resize: vertical; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 500 17px var(--mono); letter-spacing: -.5px; }
h2 { font-size: 17px; font-weight: 500; }
h3 { font-size: 13px; font-weight: 500; }
code, pre { font-family: var(--mono); }
.muted { color: var(--muted); font-size: 12px; line-height: 1.7; }
.primary, .secondary { border: 1px solid var(--accent); background: var(--accent); color: #161616; border-radius: 6px; padding: 11px 22px; font-size: 12px; font-weight: 600; white-space: nowrap; flex-shrink: 0; }
.primary:hover:not(:disabled) { background: #ffffff; border-color: #ffffff; box-shadow: 0 0 18px #e6e6e614; }
.secondary { background: var(--surface); color: #c9c9c9; border-color: #434343; font-weight: 400; }
.secondary:hover { border-color: #7d7d7d; }
.small { padding: 8px 18px; }
.text-button { border: 0; background: none; color: var(--muted); padding: 4px 0; font-size: 12px; }
.text-button:hover { color: var(--accent); }
.danger, .error { color: #dddddd; }
.workspace { max-width: 1320px; min-height: calc(100vh - 48px); margin: 24px auto; display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: 72px 1fr; background: #141414; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 24px 80px #00000033; }
.app-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 26px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.terminal-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; color: var(--accent); background: #e6e6e609; border: 1px solid #4f4f4f; border-radius: 6px; font: 18px var(--mono); flex-shrink: 0; }
.main-content { min-width: 0; padding: 32px 36px; }
.history-sidebar { padding: 24px 12px; border-right: 1px solid var(--line); background: #111111; border-radius: 0 0 0 10px; min-width: 0; }
#history-panel > summary { padding: 4px 12px 21px; font-size: 12px; font-weight: 500; color: #bfbfbf; list-style: none; display: flex; align-items: center; gap: 8px; }
#history-panel > summary::-webkit-details-marker { display: none; }
#history-panel > summary::before { content: '⌄'; color: #8d8d8d; font: 14px var(--mono); }
#history-panel:not([open]) > summary::before { content: '›'; }
#history-count { margin-left: auto; color: #9d9d9d; font: 10px var(--mono); border: 1px solid #323232; border-radius: 4px; padding: 2px 5px; }
#history-count:empty { display: none; }
#history-list { max-height: calc(100vh - 245px); overflow: auto; scrollbar-width: thin; scrollbar-color: #383838 transparent; }
.history-item { display: flex; flex-direction: column; align-items: stretch; width: 100%; gap: 6px; padding: 10px 11px; margin-bottom: 3px; background: none; border: 1px solid transparent; border-radius: 5px; text-align: left; }
.history-item:hover { background: #1f1f1f; }
.history-item.selected { background: #232323; border-color: #464646; box-shadow: inset 2px 0 var(--accent); }
.build-label { display: flex; align-items: center; gap: 8px; min-width: 0; }
.build-label b { color: #d3d3d3; font: 11px var(--mono); }
.build-label > span { margin-left: auto; color: #b1b1b1; font: 10px var(--mono); }
.history-item small { color: #9b9b9b; font-size: 10px; padding-left: 14px; }
.build-dot { width: 5px; height: 5px; border-radius: 50%; background: #999999; flex-shrink: 0; }
.build-dot.SUCCESS { background: #74d99f; box-shadow: 0 0 8px #74d99f33; }
.build-dot.FAILED { background: #dddddd; }
.build-dot.UNCERTAIN, .build-dot.NEEDS_ADMIN, .build-dot.WAITING { background: #c2c2c2; }
.build-dot.RUNNING, .build-dot.STARTING { background: #c7c7c7; box-shadow: 0 0 8px #c7c7c744; }
.history-empty { padding: 12px; font-size: 12px; color: var(--muted); }
.menu { position: relative; }
.menu > summary { list-style: none; font-size: 24px; color: var(--muted); padding: 0 5px; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-content { position: absolute; right: 0; top: 36px; width: 250px; padding: 18px; background: #1d1d1d; border: 1px solid #434343; border-radius: 7px; box-shadow: 0 8px 30px #00000066; z-index: 10; font-size: 12px; }
.menu-content p { margin-bottom: 9px; }
.menu-content button { display: block; margin: 6px 0; }
.thread-info { margin: 12px 0; color: var(--muted); font-size: 12px; }
.thread-info code { display: block; margin-top: 9px; overflow-wrap: anywhere; font-size: 10px; }
.online { color: var(--accent); }
.deploy-form { display: flex; gap: 10px; }
.deploy-form input { flex: 1; min-width: 0; font: 12px var(--mono); }
#submit-hint { margin: 9px 0 0; }
.status-line { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 21px 0 25px; font-size: 12px; }
.status-line strong { font-weight: 400; }
#run-number:not(:empty) { margin-right: 8px; font-family: var(--mono); }
#task-status::before { content: ''; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentColor; vertical-align: middle; margin: 0 7px 2px 0; }
#task-status.processing::before { animation: task-breathe 1.6s ease-in-out infinite; }
#task-status.processing::after { content: '...'; display: inline-block; width: 1.2em; margin-left: 2px; letter-spacing: .12em; animation: task-ellipsis 1.4s steps(4, jump-none) infinite; }
@keyframes task-breathe {
  0%, 100% { opacity: .35; transform: scale(.85); box-shadow: 0 0 0 0 #e6e6e600; }
  50% { opacity: 1; transform: scale(1.15); box-shadow: 0 0 0 4px #e6e6e61a; }
}
@keyframes task-ellipsis {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
.revisions { display: flex; gap: 16px; color: var(--muted); font-size: 11px; }
.revisions code { color: #c0c0c0; margin-left: 5px; font-size: 10px; }
.success, .badge.SUCCESS { color: #74d99f; }
.failed, .badge.FAILED { color: #dddddd; }
.uncertain, .badge.UNCERTAIN { color: #c2c2c2; }
.conversation { border: 1px solid var(--line); border-radius: 7px; background: #121212; overflow: hidden; }
.conversation-heading { padding: 13px 18px; color: #bfbfbf; font-size: 12px; background: #191919; }
.conversation-heading .muted { margin-left: 8px; font: 10px var(--mono); }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 0 18px; min-height: 38px; border-top: 1px solid #282828; border-bottom: 1px solid #282828; background: #191919; gap: 12px; }
.tabs { display: flex; gap: 24px; align-self: stretch; }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 2px; color: #9d9d9d; font-size: 12px; }
.tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.timeline { max-height: 42vh; padding: 6px 18px; overflow: auto; scrollbar-width: thin; scrollbar-color: #3b3b3b transparent; }
.empty-state { text-align: center; color: #8f8f8f; font-size: 12px; margin: 25px 0; }
.entry { margin: 0; border-bottom: 1px solid #242424; }
.entry:last-child { margin-bottom: 0; }
.entry:last-child { border-bottom: 0; }
.entry > .entry-summary { position: relative; padding: 10px 18px 10px 0; list-style: none; }
.entry > .entry-summary::-webkit-details-marker { display: none; }
.entry > .entry-summary::after { content: '›'; position: absolute; right: 0; top: 9px; color: #8d8d8d; font: 15px var(--mono); }
.entry[open] > .entry-summary::after { content: '⌄'; }
.entry-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 4px; color: #adadad; font: 11px var(--mono); }
.entry-head time { color: #8f8f8f; font-size: 10px; white-space: nowrap; }
.entry-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; color: #c4c4c4; font-size: 12px; line-height: 1.55; }
.command .entry-preview { font-family: var(--mono); font-size: 11px; }
.entry-detail { padding: 2px 0 12px; }
.entry-text { font-size: 12px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; color: #d0d0d0; }
.command-box { background: #0f0f0f; border: 1px solid #313131; border-left-color: #8b8b8b; color: #b1b1b1; padding: 12px 15px; margin: 0; border-radius: 4px; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.command-line { display: block; margin-bottom: 6px; color: var(--accent); }
.error-entry .entry-head { color: #dddddd; }
.entry details { margin-top: 9px; }
.entry summary { font-size: 10px; color: #9b9b9b; }
.entry details pre { color: #b4b4b4; background: #0f0f0f; border: 1px solid #313131; border-radius: 4px; padding: 12px; font-size: 11px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; }
.load-more { background: none; border: 0; color: #9a9a9a; font-size: 11px; width: 100%; padding: 12px 0; }
.load-more:hover { color: var(--accent); }
.admin-panel { padding: 14px 18px; border-top: 1px solid #282828; }
.admin-panel textarea { width: 100%; font-size: 13px; line-height: 1.7; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 8px; }
.composer-footer > div { display: flex; gap: 18px; }
.attention-banner, .approval { background: #222222; border: 1px solid #4e4e4e; border-left: 2px solid #c2c2c2; border-radius: 4px; padding: 12px 15px; color: #c6c6c6; font-size: 12px; line-height: 1.8; margin: 0 0 18px; }
.attention-banner strong { display: block; font-size: 11px; font-weight: 500; }
.attention-banner button { float: right; }
.approval h3 { font-size: 12px; }
.approval pre { font-size: 11px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 240px; overflow: auto; }
.approval summary { font-size: 11px; }
.approval label { display: block; font-size: 12px; margin: 10px 0; }
.approval input { display: block; width: 100%; margin-top: 8px; font-size: 12px; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.approval .secondary { padding: 8px 14px; font-size: 11px; }
.disclosure { border: 1px solid var(--line); border-radius: 6px; padding: 16px 20px; margin-bottom: 16px; background: #181818; }
.disclosure > summary { font-size: 12px; color: #b7b7b7; }
.report-content { padding-top: 22px; }
.report-title { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); margin-bottom: 13px; }
.badge { font-size: 11px; color: #b7b7b7; }
.report-summary, .report-next, .report-changes { font-size: 13px; color: #c9c9c9; line-height: 1.8; white-space: pre-wrap; }
.report-commits { font-size: 11px; color: var(--muted); }
.report-commits code { display: block; color: #cfcfcf; font-size: 11px; margin: 6px 0 14px; overflow-wrap: anywhere; }
.report-section { font-size: 12px; font-weight: 500; color: #c1c1c1; margin: 22px 0 12px; }
.evidence { padding-left: 12px; border-left: 1px solid #6c6c6c; font-size: 12px; line-height: 1.8; margin-bottom: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence strong { font-weight: 500; color: #d5d5d5; }
.evidence p { color: #bbbbbb; margin: 3px 0; }
.evidence code { font-size: 11px; color: #acacac; }
.report-changes { padding-left: 15px; }
.simulation-label { color: #c0c0c0; font-size: 11px; margin: 0 0 14px; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 28px; }
.login-view form { max-width: 380px; width: 100%; padding: 30px; background: #161616; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 24px 80px #00000033; }
.login-view .terminal-mark { margin-bottom: 20px; }
.login-view h1 { margin-bottom: 30px; font-size: 16px; }
.login-view label, dialog label { display: block; font-size: 12px; margin: 17px 0 9px; color: #aaaaaa; }
.login-view input { width: 100%; font-size: 14px; }
.login-view .primary { width: 100%; margin-top: 5px; }
.error { font-size: 12px; margin: 12px 0; }
#toast { display: none; position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: 90vw; padding: 11px 17px; border: 1px solid #5f5f5f; border-radius: 6px; background: #272727; color: #e5e5e5; font-size: 12px; z-index: 100; box-shadow: 0 8px 30px #00000044; }
#toast.show { display: block; }
dialog { width: 440px; max-width: 90vw; border: 1px solid #505050; border-radius: 8px; padding: 25px; color: #dfdfdf; background: #1b1b1b; }
dialog::backdrop { background: #070707bb; }
dialog p { font-size: 12px; color: #b4b4b4; line-height: 1.9; }
dialog textarea { width: 100%; font-size: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (max-width: 1400px) {
  .workspace { margin: 20px; min-height: calc(100vh - 40px); }
}
@media (max-width: 1000px) {
  .workspace { grid-template-columns: 218px minmax(0, 1fr); }
  .main-content { padding: 26px 24px; }
  .revisions { width: 100%; margin-top: 3px; }
  .history-sidebar { padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 720px) {
  .workspace { margin: 0; min-height: 100vh; border: 0; border-radius: 0; display: block; }
  .app-header { min-height: 74px; padding: 0 18px; }
  .brand { gap: 10px; }
  h1 { font-size: 14px; letter-spacing: -.6px; }
  .terminal-mark { width: 25px; height: 25px; font-size: 16px; }
  .menu > summary { padding: 0; }
  .history-sidebar { padding: 0 18px; border-right: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
  #history-panel > summary { padding: 15px 0; }
  #history-list { max-height: 220px; }
  .history-item { padding: 10px; }
  .build-label > span { margin-left: 8px; }
  .main-content { padding: 22px 18px; }
  .primary { padding: 11px 17px; }
  .small { padding: 8px 15px; }
  .status-line { gap: 8px; padding: 18px 0 20px; }
  .revisions { gap: 14px; font-size: 10px; }
  .revisions code { font-size: 9px; }
  .panel-header { padding: 0 15px; }
  .timeline { max-height: 40vh; padding: 5px 15px; }
  .conversation-heading { padding: 13px 15px; }
  .entry-text, .admin-panel textarea { font-size: 12px; }
  .entry-head { font-size: 10px; }
  .entry-head time { font-size: 9px; }
  .command-box { padding: 10px 12px; font-size: 11px; }
  .admin-panel { padding: 14px 15px; }
  .composer-footer > div { gap: 12px; }
  .composer-footer .text-button { font-size: 11px; }
  .report-commits code { font-size: 10px; }
  .disclosure { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  #task-status.processing::before, #task-status.processing::after { animation: none; }
}
