:root {
  --bg: #0b0e14;
  --card: #121826;
  --text: #e6eaf2;
  --muted: #9aa4b2;
  --accent: #7c5cff;
  --border: rgba(255, 255, 255, 0.08);
}

:root[data-theme="light"] {
  --bg: #f6f7fb;
  --card: rgba(255, 255, 255, 0.82);
  --text: #111827;
  --muted: #4b5563;
  --accent: #5b43ff;
  --border: rgba(17, 24, 39, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  background: radial-gradient(1200px 800px at 20% -10%, rgba(124, 92, 255, 0.35), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(76, 201, 240, 0.18), transparent 60%), var(--bg);
  color: var(--text);
}

:root[data-theme="light"] body {
  background: radial-gradient(1200px 800px at 20% -10%, rgba(124, 92, 255, 0.12), transparent 55%),
    radial-gradient(900px 600px at 90% 0%, rgba(76, 201, 240, 0.08), transparent 60%), var(--bg);
}

code {
  color: #dbe2ff;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
}

:root[data-theme="light"] code {
  color: #111827;
  background: rgba(17, 24, 39, 0.06);
}

.container {
  max-width: 1600px;
  padding: 28px 18px 60px;
  margin: 0 auto;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
  letter-spacing: 0.2px;
}

h2 {
  margin: 0 0 14px;
  font-size: 16px;
  color: #cfd7ff;
}

.muted {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.card {
  background: rgba(18, 24, 38, 0.85);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 14px 0;
  backdrop-filter: blur(8px);
}

:root[data-theme="light"] .card {
  background: var(--card);
  backdrop-filter: blur(10px);
}

.layout {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 14px;
  align-items: start;
}

.sticky {
  position: sticky;
  top: 16px;
  z-index: 2;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .sticky {
    position: static;
  }
}

.card.compact {
  padding: 12px;
}

.admin-settings {
  display: none !important;
}

.admin-link {
  display: none;
}

.admin-users {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.admin-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  flex-wrap: wrap;
}

.admin-user-info {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.sentinel-labels {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}

.sentinel-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 10px;
  align-items: start;
}

.sentinel-row textarea {
  min-height: 70px;
}

.admin-tools {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 10px 0;
}

.admin-tool {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.admin-tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.admin-tool textarea {
  min-height: 80px;
}

@media (max-width: 900px) {
  .sentinel-row {
    grid-template-columns: 1fr;
  }
  .admin-tool-grid {
    grid-template-columns: 1fr;
  }
}

.tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.tabs input[type="radio"] {
  display: none;
}

.tab-input {
  display: none;
}

.summary {
  cursor: pointer;
  user-select: none;
  color: var(--text);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-btn,
.icon-link {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  text-decoration: none;
  padding: 0;
  line-height: 1;
}

.icon-btn.tiny,
.icon-link.tiny {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

.icon-btn.tiny svg,
.icon-link.tiny svg {
  width: 14px;
  height: 14px;
}

.icon-btn.subtle,
.icon-link.subtle {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.icon-btn.subtle:hover,
.icon-link.subtle:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
}

.icon-btn.is-active,
.icon-link.is-active {
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.14);
}

:root[data-theme="light"] .icon-btn.subtle,
:root[data-theme="light"] .icon-link.subtle {
  border-color: rgba(17, 24, 39, 0.10);
  background: rgba(17, 24, 39, 0.02);
}

:root[data-theme="light"] .icon-btn.subtle:hover,
:root[data-theme="light"] .icon-link.subtle:hover {
  border-color: rgba(17, 24, 39, 0.18);
  background: rgba(17, 24, 39, 0.04);
}

:root[data-theme="light"] .icon-btn.is-active,
:root[data-theme="light"] .icon-link.is-active {
  border-color: rgba(91, 67, 255, 0.45);
  background: rgba(91, 67, 255, 0.12);
}

.icon-btn {
  cursor: pointer;
}

.icon-btn:hover,
.icon-link:hover {
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.12);
}

.icon-btn:active,
.icon-link:active {
  transform: translateY(1px);
}

.icon-btn svg,
.icon-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  opacity: 0.92;
}

.summary-icon {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.summary-icon svg {
  width: 16px;
  height: 16px;
}

.summary-icon:hover {
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.12);
}

.summary-icon::-webkit-details-marker {
  display: none;
}

.summary-icon::marker {
  content: "";
}

.layout-agent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--agent-sidebar-w, 420px);
  gap: 10px;
  margin-top: 12px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .layout-agent {
    grid-template-columns: 1fr;
  }
}

.chat {
  height: auto;
  min-height: 320px;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  padding: 10px;
  font-size: 11px;
  line-height: 1.35;
}

.layout-agent > section:first-child {
  display: flex;
  flex-direction: column;
  min-height: min(760px, calc(100vh - 260px));
}

.layout-agent > section:first-child .chat {
  flex: 1;
}

#agentStatusCard {
  position: sticky;
  top: 16px;
  height: fit-content;
}

@media (max-width: 900px) {
  #agentStatusCard {
    position: static;
  }
}

/* Collapsible sidebar (agent status column) */
body.agent-sidebar-collapsed .layout-agent {
  --agent-sidebar-w: 68px;
}

body.agent-sidebar-collapsed #agentStatusCard {
  padding: 10px 8px;
}

body.agent-sidebar-collapsed #agentStatusCard .muted,
body.agent-sidebar-collapsed #agentStatusCard h2,
body.agent-sidebar-collapsed #agentStatusCard .agent-status-toolbar,
body.agent-sidebar-collapsed #agentStatusCard #refreshStatusBtn {
  display: none !important;
}

body.agent-sidebar-collapsed #toggleSidebarBtn {
  margin-left: auto;
}

body.agent-sidebar-collapsed .agent-jobs {
  gap: 8px;
}

body.agent-sidebar-collapsed .agent-job {
  padding: 6px;
}

body.agent-sidebar-collapsed .agent-job-top {
  flex-direction: column;
  align-items: center;
}

body.agent-sidebar-collapsed .agent-job code,
body.agent-sidebar-collapsed .agent-job .agent-job-actions,
body.agent-sidebar-collapsed .agent-job .muted,
body.agent-sidebar-collapsed .agent-job .agent-job-title {
  display: none !important;
}

body.agent-sidebar-collapsed .agent-job .pill {
  font-size: 10px;
  padding: 4px 8px;
}

.agent-job-bar {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 6px;
}

.agent-job-bar > div {
  height: 100%;
  background: rgba(124, 92, 255, 0.75);
  width: 0%;
}

body.agent-sidebar-collapsed .agent-job-bar {
  width: 100%;
}

.chat-msg {
  margin-bottom: 10px;
}

.chat-meta {
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 4px;
}

.chat-text {
  line-height: 1.4;
  font-size: 11px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-text h2,
.chat-text h3,
.chat-text h4 {
  margin: 6px 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: #cfd7ff;
}

.chat-text ul {
  margin: 4px 0 6px 16px;
  padding: 0;
}

.chat-text li {
  margin: 2px 0;
}

.chat-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
  font-size: 11px;
  line-height: 1.35;
}

.chat-msg.user .chat-text,
.chat-msg.user .chat-pre {
  background: rgba(124, 92, 255, 0.10);
  border-color: rgba(124, 92, 255, 0.25);
  border-radius: 10px;
  padding: 8px;
}

.chat-msg.agent .chat-text,
.chat-msg.agent .chat-pre {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 8px;
}

.chat-text a {
  color: #cfd7ff;
  text-decoration: none;
  border-bottom: 1px dashed rgba(207, 215, 255, 0.55);
}

.chat-text a:hover {
  border-bottom-color: rgba(207, 215, 255, 0.95);
}

.chat-controls {
  margin-top: 10px;
}

.hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.composer {
  position: relative;
  margin-top: 10px;
}

.composer__input {
  padding-right: 86px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn.on {
  border-color: rgba(124, 92, 255, 0.7);
  background: rgba(124, 92, 255, 0.14);
}

.composer__attach,
.composer__send {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.composer__attach {
  right: 44px;
}

.composer__send {
  right: 8px;
}

.agent-busy {
  height: 16px;
  margin-top: 6px;
  font-size: 11px;
  visibility: hidden;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.agent-busy.on {
  visibility: visible;
}

.agent-busy.on::after {
  content: "";
  display: inline-block;
  width: 18px;
  margin-left: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
  animation: busyDots 1.2s infinite steps(4, end);
}

@keyframes busyDots {
  0% {
    width: 4px;
    opacity: 0.35;
  }
  33% {
    width: 10px;
    opacity: 0.55;
  }
  66% {
    width: 16px;
    opacity: 0.85;
  }
  100% {
    width: 4px;
    opacity: 0.35;
  }
}

.chat-msg.system .chat-meta {
  display: none;
}

.chat-msg.system .chat-text {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}

.chat-msg.agent-tech .chat-text {
  font-size: 11px;
  color: var(--muted);
}

.chat-msg.agent-tech .chat-meta {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
}

.queue {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.queue-pill {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 5px 8px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.queue-x {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  font-size: 12px;
}

.pending {
  opacity: 0.65;
}

.tech-details {
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
}

.tech-details summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--muted);
}

.tech-details summary::-webkit-details-marker {
  display: none;
}

.tech-pre {
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px;
}

.tech-rollup {
  margin-top: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
}

.tech-item {
  margin-top: 6px;
}

.tech-item summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.tech-time {
  display: inline-block;
  min-width: 62px;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}

.agent-jobs {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.agent-status-head {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.agent-status-toolbar {
  align-items: center;
  gap: 6px;
}

.agent-status-toolbar .input.mini {
  height: 26px;
  padding: 4px 8px;
}

.agent-job {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.2;
  overflow-wrap: anywhere;
  word-break: break-word;
}

:root[data-theme="light"] .agent-status-head {
  border-bottom-color: rgba(17, 24, 39, 0.18);
}

:root[data-theme="light"] .agent-job {
  border-color: rgba(17, 24, 39, 0.22);
  background: rgba(17, 24, 39, 0.03);
}

:root[data-theme="light"] .agent-job-bar {
  background: rgba(17, 24, 39, 0.10);
}

.agent-job.focus {
  border-color: rgba(124, 92, 255, 0.65);
}

.agent-job-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: flex-start;
}

.agent-job-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.agent-job .muted {
  font-size: 10px;
}

.agent-job code {
  font-size: 10px;
  padding: 1px 4px;
}

.agent-job .pill {
  font-size: 9px;
  padding: 2px 6px;
}

.agent-job .mini {
  padding: 4px 6px;
  border-radius: 8px;
  font-size: 10px;
}

button.danger,
.button.danger {
  border-color: rgba(255, 77, 79, 0.45);
  background: rgba(255, 77, 79, 0.12);
}

.tabs label {
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tabs label:hover {
  border-color: rgba(124, 92, 255, 0.6);
}

/* (legacy) side tabs were removed in favor of main tabs */

/* Main tabs (photo + video) */
.tab-panels-main > section {
  display: none;
  margin: 0;
}

#tabSettings:checked ~ .tabs label[for="tabSettings"],
#tabWork:checked ~ .tabs label[for="tabWork"],
#tabHistory:checked ~ .tabs label[for="tabHistory"],
#tabHelp:checked ~ .tabs label[for="tabHelp"],
#tabSettingsVideo:checked ~ .tabs label[for="tabSettingsVideo"],
#tabWorkVideo:checked ~ .tabs label[for="tabWorkVideo"],
#tabHistoryVideo:checked ~ .tabs label[for="tabHistoryVideo"],
#tabHelpVideo:checked ~ .tabs label[for="tabHelpVideo"] {
  border-color: rgba(124, 92, 255, 0.7);
  background: rgba(124, 92, 255, 0.14);
  color: #cfd7ff;
}

#tabWork:checked ~ .tab-panels-main #panelWork,
#tabSettings:checked ~ .tab-panels-main #panelSettings,
#tabHistory:checked ~ .tab-panels-main #panelHistory,
#tabHelp:checked ~ .tab-panels-main #panelHelp,
#tabWorkVideo:checked ~ .tab-panels-main #panelWorkVideo,
#tabSettingsVideo:checked ~ .tab-panels-main #panelSettingsVideo,
#tabHistoryVideo:checked ~ .tab-panels-main #panelHistoryVideo,
#tabHelpVideo:checked ~ .tab-panels-main #panelHelpVideo {
  display: block;
}

/* Admin tabs */
.tab-panels-admin > section {
  display: none;
  margin: 0;
}

#tabAdminLlm:checked ~ .tabs label[for="tabAdminLlm"],
#tabAdminPrompts:checked ~ .tabs label[for="tabAdminPrompts"],
#tabAdminSentinel:checked ~ .tabs label[for="tabAdminSentinel"],
#tabAdminTools:checked ~ .tabs label[for="tabAdminTools"],
#tabAdminUsers:checked ~ .tabs label[for="tabAdminUsers"],
#tabAdminSave:checked ~ .tabs label[for="tabAdminSave"] {
  border-color: rgba(124, 92, 255, 0.7);
  background: rgba(124, 92, 255, 0.14);
  color: #cfd7ff;
}

#tabAdminLlm:checked ~ .tab-panels-admin #panelAdminLlm,
#tabAdminPrompts:checked ~ .tab-panels-admin #panelAdminPrompts,
#tabAdminSentinel:checked ~ .tab-panels-admin #panelAdminSentinel,
#tabAdminTools:checked ~ .tab-panels-admin #panelAdminTools,
#tabAdminUsers:checked ~ .tab-panels-admin #panelAdminUsers,
#tabAdminSave:checked ~ .tab-panels-admin #panelAdminSave {
  display: block;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.row.tight {
  margin-top: 8px;
}

.checkbox {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  user-select: none;
}

.checkbox input {
  accent-color: var(--accent);
}

button,
.button {
  appearance: none;
  border: 1px solid rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.16);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

button:hover,
.button:hover {
  border-color: rgba(124, 92, 255, 0.7);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.secondary {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

.file input[type="file"] {
  display: block;
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.label {
  display: block;
  margin: 6px 0 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.textarea {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  resize: vertical;
  min-height: 46px;
}

.textarea:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.65);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 720px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
}

.input {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.input:focus {
  outline: none;
  border-color: rgba(124, 92, 255, 0.65);
}

.input:disabled,
.textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.dot.ok {
  background: rgba(50, 205, 50, 0.75);
  border-color: rgba(50, 205, 50, 0.75);
}

.dot.bad {
  background: rgba(255, 77, 79, 0.75);
  border-color: rgba(255, 77, 79, 0.75);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
}

.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 14px;
  align-items: center;
}

.kv .k {
  color: var(--muted);
}

.kv .v {
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  overflow: hidden;
  margin: 10px 0 14px;
}

.progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(124, 92, 255, 0.95), rgba(76, 201, 240, 0.85));
  transition: width 180ms ease;
}

.log {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.22);
  color: #cfd7ff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
}

.log-collapsed .log,
.log-collapsed .recent,
.log-collapsed .muted {
  display: none;
}

.recent {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.recent a {
  color: #cfd7ff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.recent a:hover {
  border-color: rgba(124, 92, 255, 0.7);
}

.history {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.history-item {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 10px;
}

.history-top {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--muted);
}

.pill.running {
  border-color: rgba(124, 92, 255, 0.6);
  color: #cfd7ff;
}

.pill.completed {
  border-color: rgba(50, 205, 50, 0.6);
  color: rgba(50, 205, 50, 0.9);
}

.pill.failed {
  border-color: rgba(255, 77, 79, 0.6);
  color: rgba(255, 77, 79, 0.9);
}

.pill.canceled {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--muted);
}

.history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.danger {
  border-color: rgba(255, 77, 79, 0.55) !important;
  background: rgba(255, 77, 79, 0.10) !important;
}

.danger:hover {
  border-color: rgba(255, 77, 79, 0.8) !important;
}

.mini {
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

/* Login/Setup */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-card {
  width: 360px;
  max-width: 90vw;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.login-card h1 {
  margin: 0 0 16px 0;
  font-size: 20px;
}
.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.login-field input {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
}
.login-error {
  margin-top: 10px;
  color: #f26c6c;
  font-size: 12px;
}
