:root {
  color-scheme: dark;
  --bg: #641516;
  --panel: rgba(110, 22, 24, 0.8);
  --surface: rgba(66, 10, 14, 0.88);
  --line: rgba(255, 226, 192, 0.12);
  --line-strong: rgba(248, 208, 162, 0.36);
  --text: #fff4e3;
  --muted: #efc7a4;
  --accent: #c73433;
  --accent-strong: #de6242;
  --accent-soft: #f0d06d;
  --sea: #5f8c92;
  --shadow: 0 24px 64px rgba(48, 8, 10, 0.28);
  --radius: 18px;
  --mono: "SF Mono", "JetBrains Mono", Menlo, monospace;
  --sans: "Avenir Next", "SF Pro Text", "Helvetica Neue", sans-serif;
  --display: "Arial Black", "Avenir Next Condensed", Impact, "Helvetica Neue", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #7a1818;
  color: var(--text);
  font-family: var(--sans);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% -6%, rgba(255, 238, 211, 0.16), transparent 24%),
    radial-gradient(circle at 85% 10%, rgba(95, 140, 146, 0.44), transparent 22%),
    linear-gradient(180deg, #809ca0 0%, #91534b 18%, #8b2020 40%, #7a1818 100%);
}

body.modal-open {
  overflow: hidden;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.app-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  min-height: 100svh;
  padding:
    max(40px, calc(env(safe-area-inset-top) + 18px))
    14px
    max(18px, env(safe-area-inset-bottom))
    14px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.wordmark-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 6px 2px 2px;
}

.wordmark-lockup {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 30px;
  width: 100%;
}

.wordmark {
  display: grid;
  justify-items: start;
  align-content: end;
  gap: 0;
  flex: 0 1 auto;
  min-width: auto;
  margin: 0;
  transform: translateY(4px) rotate(-4deg) skewX(-12deg);
  isolation: isolate;
}

.wordmark-line {
  position: relative;
  display: block;
  font-family: var(--display);
  font-size: clamp(3.1rem, 11vw, 5rem);
  font-weight: 900;
  font-style: italic;
  line-height: 0.84;
  letter-spacing: -0.075em;
  color: #fffdf8;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.34),
    0 3px 0 rgba(111, 20, 18, 0.18),
    0 12px 24px rgba(45, 7, 9, 0.26);
}

.wordmark-line-top {
  margin-left: -0.08em;
}

.wordmark-line-bottom {
  margin-top: -0.14em;
  margin-left: 0.44em;
}

.wordmark-line::before,
.wordmark-line::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wordmark-line::before {
  content: attr(data-text);
  color: rgba(255, 255, 255, 0.24);
  transform: translate(0.05em, 0.08em) scale(1.02);
  filter: blur(7px);
  z-index: -2;
}

.wordmark-line::after {
  content: "";
  inset: -12px -16px -10px -10px;
  background:
    radial-gradient(circle at 8% 58%, rgba(255, 255, 255, 0.34) 0 1.4px, transparent 2px),
    radial-gradient(circle at 18% 24%, rgba(255, 255, 255, 0.26) 0 1.3px, transparent 2px),
    radial-gradient(circle at 31% 72%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1.8px),
    radial-gradient(circle at 54% 18%, rgba(255, 255, 255, 0.22) 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 77% 66%, rgba(255, 255, 255, 0.2) 0 1.2px, transparent 2px),
    radial-gradient(circle at 94% 28%, rgba(255, 255, 255, 0.28) 0 1.5px, transparent 2.2px);
  filter: blur(0.3px);
  opacity: 0.9;
  z-index: -1;
}

.mascot-carousel {
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
  flex: 0 0 auto;
  overflow: hidden;
}

.mascot-carousel:hover:not(:disabled),
.mascot-carousel:focus-visible:not(:disabled) {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.mascot-carousel:disabled {
  opacity: 1;
}

.mascot-photo {
  display: block;
  width: min(20vw, 74px);
  height: min(28vw, 108px);
  object-fit: cover;
  object-position: center 42%;
  border-radius: 18px;
  border: 1px solid rgba(255, 235, 214, 0.22);
  transform: translateY(2px) rotate(-1.25deg);
  box-shadow:
    0 16px 26px rgba(45, 7, 9, 0.26),
    inset 0 1px 0 rgba(255, 244, 227, 0.16);
  transition: opacity 220ms ease, transform 220ms ease;
}

.mascot-photo.is-switching {
  opacity: 0.74;
}

.mascot-carousel.is-static .mascot-photo {
  transition: opacity 180ms ease, transform 180ms ease, filter 180ms ease;
}

.mascot-carousel.is-static:active .mascot-photo,
.mascot-carousel.is-static.is-tapped .mascot-photo {
  opacity: 0.92;
  transform: translateY(2px) rotate(-1.25deg) scale(0.97);
  filter: brightness(1.03);
}

.header-catchphrase {
  width: min(100%, 560px);
  min-height: 2.6em;
  margin: 12px 0 0;
  padding: 0 6px;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(0.72rem, 2vw, 0.92rem);
  font-style: italic;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: 0.015em;
  text-align: center;
  text-wrap: balance;
  opacity: 0.86;
  transform: translateY(0);
  filter: blur(0);
  transition:
    opacity 280ms cubic-bezier(0.22, 1, 0.36, 1),
    transform 280ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 280ms cubic-bezier(0.22, 1, 0.36, 1);
}

.header-catchphrase.is-switching {
  opacity: 0;
  transform: translateY(4px);
  filter: blur(2px);
}

.composer,
.queue {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(120, 28, 28, 0.82), rgba(74, 13, 16, 0.94)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.workspace-tabs {
  display: grid;
  grid-template-columns: minmax(82px, 1fr) minmax(128px, 1.35fr) minmax(82px, 1fr);
  gap: 2px;
  padding: 4px;
  border: 1px solid rgba(255, 218, 185, 0.12);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(61, 8, 11, 0.66), rgba(45, 5, 8, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 237, 212, 0.05),
    0 10px 24px rgba(55, 4, 7, 0.16);
}

.workspace-tab {
  position: relative;
  min-height: 34px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  letter-spacing: 0;
  box-shadow: none;
  white-space: nowrap;
  transition:
    background 160ms ease,
    color 160ms ease,
    opacity 160ms ease;
}

.workspace-tab::after {
  content: "";
  position: absolute;
  left: 26%;
  right: 26%;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: rgba(255, 237, 190, 0.96);
  opacity: 0;
  transform: scaleX(0.45);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.workspace-tab.is-active {
  background: linear-gradient(180deg, rgba(103, 26, 22, 0.66), rgba(76, 12, 15, 0.72));
  color: rgba(255, 248, 238, 0.98);
}

.workspace-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.workspace-tab.has-live-delegates:not(.is-active) {
  color: rgba(255, 246, 224, 0.96);
}

.workspace-tab:hover:not(:disabled),
.workspace-tab:focus-visible:not(:disabled) {
  background: rgba(112, 29, 24, 0.42);
  color: rgba(255, 248, 238, 0.96);
}

.workspace-tab:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.workspace-tab .control-orb {
  top: 8px;
  right: 13px;
}

.workspace-pane {
  display: grid;
  gap: 12px;
}

.workspace-pane[hidden] {
  display: none;
}

.project-subtabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 218, 185, 0.1);
  border-radius: 12px;
  background: rgba(45, 5, 8, 0.42);
}

.project-subtab {
  min-height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0;
}

.project-subtab.is-active {
  background: rgba(103, 26, 22, 0.62);
  color: rgba(255, 248, 238, 0.98);
}

.project-subtab:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.auto-workspace {
  gap: 10px;
}

.delegation-dashboard-head {
  display: grid;
  gap: 3px;
  padding: 1px 2px 0;
}

.delegation-dashboard-title {
  color: rgba(255, 248, 238, 0.98);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0;
}

.files-workspace {
  gap: 10px;
}

.files-workspace-actions {
  display: flex;
  justify-content: flex-end;
}

.files-workspace-list {
  max-height: min(54vh, 540px);
  overflow: auto;
}

.active-runs-inline-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.active-runs-inline-head {
  min-height: 1em;
}

.session-control {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  position: relative;
  --session-spinner-right: 202px;
}

.project-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px minmax(48px, max-content);
  align-items: stretch;
  gap: 8px;
  min-width: 0;
  position: relative;
}

.project-control.is-featured select,
select.is-featured {
  border-color: rgba(240, 208, 109, 0.66);
  background:
    linear-gradient(180deg, rgba(98, 68, 16, 0.92), rgba(62, 41, 9, 0.98));
  color: #fff6d2;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 214, 0.18),
    0 0 0 1px rgba(240, 208, 109, 0.12);
}

.project-control.is-featured .thread-button {
  border-color: rgba(240, 208, 109, 0.58);
  background:
    linear-gradient(180deg, rgba(96, 66, 15, 0.92), rgba(60, 39, 9, 0.98));
  color: rgba(255, 236, 170, 0.95);
}

.project-control.is-featured .thread-button:hover:not(:disabled),
.project-control.is-featured .thread-button:focus-visible:not(:disabled) {
  border-color: rgba(255, 232, 159, 0.9);
  background:
    linear-gradient(180deg, rgba(112, 77, 18, 0.96), rgba(72, 47, 10, 1));
  color: #fff9e4;
}

.project-control.has-live-delegates .delegate-open-button {
  border-color: rgba(255, 212, 118, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.18),
    0 0 14px rgba(255, 76, 96, 0.2);
}

.project-control.has-live-delegates .delegate-auto-glyph {
  color: #fff0c7;
  text-shadow:
    0 0 6px rgba(255, 226, 132, 0.9),
    0 0 16px rgba(255, 74, 95, 0.66);
}

.project-control.is-live-delegate:not(.is-featured) select,
select.is-live-delegate:not(.is-featured) {
  border-color: rgba(255, 176, 105, 0.72);
  background:
    linear-gradient(180deg, rgba(105, 30, 24, 0.92), rgba(65, 10, 16, 0.98));
  color: #fff1d0;
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.15),
    0 0 0 1px rgba(255, 209, 125, 0.12),
    0 0 14px rgba(255, 73, 93, 0.16);
}

.project-control select {
  flex: 1 1 auto;
  min-width: 0;
}

.session-control select {
  flex: 1 1 auto;
  min-width: 0;
}

.session-control.is-loading select {
  padding-right: 88px;
}

.session-control.is-loading::after {
  content: "";
  position: absolute;
  right: var(--session-spinner-right);
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 244, 227, 0.18);
  border-top-color: rgba(255, 244, 227, 0.88);
  border-right-color: rgba(255, 244, 227, 0.62);
  animation: session-spinner 900ms linear infinite;
  pointer-events: none;
}

select,
input,
textarea,
button {
  width: 100%;
  font: inherit;
}

select,
input,
textarea {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(73, 10, 14, 0.9), rgba(57, 8, 11, 0.96));
  color: var(--text);
  outline: none;
  transition: border-color 120ms ease, background 120ms ease;
  box-shadow: inset 0 1px 0 rgba(255, 237, 212, 0.05);
}

select {
  min-height: 48px;
  padding: 0 42px 0 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25 7 9l4-3.75' stroke='%23cdb6a6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: calc(100% - 14px) center;
  background-size: 12px 12px;
}

input {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 150px;
  padding: 14px;
  resize: vertical;
  line-height: 1.45;
}

.message-input-wrap {
  position: relative;
  min-width: 0;
}

.message-input-wrap textarea {
  width: 100%;
  padding-right: 54px;
}

.composer-copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  color: rgba(255, 244, 227, 0.82);
}

.composer-copy-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.composer-actions {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 8px;
  align-items: stretch;
}

.composer-attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.composer-attachment-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 32px;
  gap: 9px;
  align-items: center;
  min-height: 48px;
  padding: 7px;
  border: 1px solid rgba(255, 218, 185, 0.14);
  border-radius: 10px;
  background: rgba(64, 8, 12, 0.72);
}

.composer-attachment-thumb,
.composer-attachment-file-icon {
  width: 38px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 218, 185, 0.14);
  background: rgba(40, 6, 9, 0.72);
}

.composer-attachment-thumb {
  object-fit: cover;
}

.composer-attachment-file-icon {
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.05em;
  color: rgba(255, 244, 227, 0.72);
}

.composer-attachment-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.composer-attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
}

.composer-attachment-detail {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.composer-attachment-remove {
  min-width: 32px;
  min-height: 32px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  color: rgba(255, 244, 227, 0.8);
}

.composer-attachment-button {
  color: rgba(255, 244, 227, 0.84);
}

.composer-voice-button {
  color: rgba(255, 244, 227, 0.86);
}

.composer-voice-button.is-recording {
  border-color: rgba(255, 177, 159, 0.58);
  color: #fff4e3;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 177, 159, 0.2), transparent 58%),
    linear-gradient(180deg, rgba(121, 18, 22, 0.98), rgba(77, 10, 13, 0.98));
}

.composer-voice-button.is-recording::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #fff4e3;
  box-shadow: 0 0 14px rgba(255, 244, 227, 0.74);
}

.composer-voice-button.is-loading {
  color: #f0d06d;
  border-color: rgba(240, 208, 109, 0.38);
}

.composer-voice-button.is-loading svg {
  animation: audio-spin 820ms linear infinite;
}

.quick-prompt-open-button {
  color: rgba(255, 244, 227, 0.88);
}

.quick-prompt-open-button.is-active {
  border-color: rgba(240, 208, 109, 0.44);
  color: #fff4e3;
  background:
    linear-gradient(180deg, rgba(104, 35, 20, 0.94), rgba(65, 11, 12, 0.98));
}

.composer-terminal-button {
  color: rgba(255, 218, 185, 0.9);
}

.composer-tools-button {
  min-width: 48px;
  width: 48px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 244, 227, 0.88);
}

.composer-tools-button.is-active,
.composer-tools-button.is-queue,
.composer-tools-button.is-interject {
  border-color: rgba(240, 208, 109, 0.5);
  color: #fff4e3;
}

.composer-tools-claw {
  width: 34px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(14, 2, 4, 0.42));
}

.composer-tools-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 45;
  width: min(360px, calc(100vw - 40px));
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(105, 22, 20, 0.98), rgba(70, 9, 12, 0.98));
  box-shadow: 0 20px 46px rgba(18, 2, 4, 0.38);
}

.composer-tools-menu[hidden] {
  display: none;
}

.composer-tools-list {
  display: grid;
  gap: 6px;
}

.composer-tools-item {
  position: relative;
  min-height: 42px;
  width: 100%;
  padding: 0 10px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  justify-content: start;
  border: 1px solid rgba(255, 218, 185, 0.14);
  border-radius: 10px;
  background: rgba(54, 7, 10, 0.52);
  color: rgba(255, 244, 227, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 237, 212, 0.04);
}

.composer-tools-item:hover:not(:disabled),
.composer-tools-item:focus-visible:not(:disabled) {
  background: rgba(88, 14, 15, 0.74);
  border-color: rgba(255, 218, 185, 0.3);
  color: #fff4e3;
}

.composer-tools-item svg {
  width: 17px;
  height: 17px;
}

.composer-tools-item .button-text {
  min-width: 0;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
}

.composer-tools-label {
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  color: rgba(255, 218, 185, 0.68);
  text-transform: uppercase;
}

.composer-mode-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.composer-mode-option {
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid rgba(255, 218, 185, 0.14);
  border-radius: 10px;
  background: rgba(54, 7, 10, 0.5);
  color: rgba(255, 244, 227, 0.78);
  box-shadow: none;
}

.composer-mode-option .button-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}

.composer-mode-option.is-active {
  border-color: rgba(240, 208, 109, 0.52);
  color: #fff4e3;
  background: linear-gradient(180deg, rgba(110, 36, 18, 0.9), rgba(67, 10, 12, 0.96));
}

#dispatchButton {
  min-width: 0;
}

#dispatchButton .button-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent-soft);
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff7f1;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(112, 15, 18, 0.24);
  transition: background 120ms ease, opacity 120ms ease, transform 120ms ease;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  background: linear-gradient(90deg, #d43b39 0%, #e36b49 100%);
  transform: translateY(-1px);
}

button:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: default;
}

.thread-button,
.queue-toggle {
  display: grid;
  place-items: center;
  width: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(73, 10, 14, 0.9), rgba(57, 8, 11, 0.96));
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 237, 212, 0.05);
}

.thread-button {
  min-height: 48px;
  min-width: 48px;
  position: relative;
}

.queue-toggle {
  min-height: 36px;
  min-width: 36px;
  border-radius: 999px;
}

.thread-button:hover:not(:disabled),
.thread-button:focus-visible:not(:disabled),
.queue-toggle:hover:not(:disabled),
.queue-toggle:focus-visible:not(:disabled) {
  background: linear-gradient(180deg, rgba(88, 12, 16, 0.94), rgba(65, 9, 12, 0.98));
  border-color: var(--accent-soft);
  color: var(--text);
}

.thread-button svg,
.queue-toggle svg {
  width: 16px;
  height: 16px;
  display: block;
}

.dispatch-mode-button {
  min-width: 96px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: rgba(255, 244, 227, 0.82);
}

.dispatch-mode-button .button-text {
  min-width: 48px;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  text-align: left;
}

.dispatch-mode-button.is-queue {
  border-color: rgba(255, 207, 117, 0.5);
  color: rgba(255, 234, 180, 0.95);
}

.dispatch-mode-button.is-interject {
  border-color: rgba(119, 214, 255, 0.48);
  color: rgba(197, 238, 255, 0.95);
}

.delegate-open-button {
  min-width: 48px;
  width: auto;
  padding: 0 13px;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: rgba(255, 244, 227, 0.86);
}

.delegate-open-button.is-live {
  border-color: rgba(255, 212, 118, 0.72);
  color: rgba(255, 248, 238, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.18),
    0 0 14px rgba(255, 76, 96, 0.2);
}

.delegate-open-button.is-blocked {
  border-color: rgba(255, 177, 159, 0.7);
}

.delegate-open-button span {
  white-space: nowrap;
}

.delegate-open-button .button-text {
  display: inline;
}

.delegate-auto-glyph,
.delegate-auto-button .auto-icon {
  display: inline-grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 900;
  line-height: 1;
}

.delegate-auto-glyph {
  font-size: 1.08rem;
}

.delegate-auto-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.delegate-auto-button .auto-icon {
  min-width: 1em;
  font-size: 1rem;
}

.active-runs-button.has-live-delegates {
  border-color: rgba(255, 212, 118, 0.72);
  color: rgba(255, 246, 224, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 218, 0.18),
    0 0 14px rgba(255, 76, 96, 0.2);
}

.control-orb {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 244, 227, 0.1),
    0 0 8px rgba(255, 255, 255, 0.22);
}

@keyframes session-spinner {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.mailbox-state {
  min-height: 14px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.queue-headbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.queue-status {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.queue-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.message-audio-button.is-ready {
  color: #fff4e3;
  border-color: rgba(240, 208, 109, 0.46);
}

.queue-unread-orb {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(255, 244, 227, 0.1), 0 0 10px rgba(255, 255, 255, 0.24);
}

.queue-toggle svg {
  transition: transform 160ms ease;
}

.queue.is-collapsed #queueToggle svg {
  transform: rotate(-90deg);
}

.queue.is-collapsed .queue-body {
  display: none;
}

.queue-list {
  display: grid;
  gap: 10px;
  min-height: 260px;
}

.queue-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(73, 10, 14, 0.9), rgba(57, 8, 11, 0.96));
  color: var(--muted);
  text-align: center;
}

.queue-card {
  position: relative;
  width: 100%;
  display: grid;
  gap: 8px;
  padding: 12px 118px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(80, 11, 15, 0.92), rgba(59, 8, 11, 0.96));
  color: var(--text);
  text-align: left;
  touch-action: pan-y;
  transform: translateX(var(--queue-card-swipe-x, 0));
  transition:
    background 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 160ms ease;
}

.queue-card::after {
  content: "Archive";
  position: absolute;
  top: 0;
  right: -104px;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 92px;
  border-radius: 0 12px 12px 0;
  background: rgba(20, 17, 16, 0.88);
  color: rgba(255, 244, 227, 0.86);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease, color 120ms ease, background 120ms ease;
}

.queue-card.is-swiping::after {
  opacity: 1;
}

.queue-card.is-swipe-armed {
  border-color: rgba(240, 208, 109, 0.62);
}

.queue-card.is-swipe-armed::after {
  background: rgba(94, 28, 18, 0.96);
  color: #fff4e3;
}

.queue-card.clickable {
  cursor: pointer;
}

.queue-card.clickable:hover,
.queue-card.clickable:focus-visible {
  border-color: rgba(240, 208, 109, 0.56);
  background: linear-gradient(180deg, rgba(89, 14, 17, 0.96), rgba(68, 10, 13, 0.98));
}

.queue-card.processing {
  border-color: rgba(240, 208, 109, 0.28);
}

.queue-card.failed {
  border-color: rgba(225, 113, 113, 0.34);
}

.queue-card.done {
  border-color: rgba(95, 140, 146, 0.32);
}

.queue-card.is-unread {
  border-color: rgba(255, 244, 227, 0.48);
  box-shadow:
    0 0 0 1px rgba(255, 244, 227, 0.08),
    0 0 22px rgba(255, 244, 227, 0.08);
}

.queue-card-archive-button.copy-button-floating {
  right: 78px;
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.queue-head-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.queue-project {
  min-width: 0;
  font-weight: 600;
}

.queue-card-unread-orb {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.96);
  box-shadow:
    0 0 0 1px rgba(255, 244, 227, 0.18),
    0 0 10px rgba(255, 250, 236, 0.28);
}

.queue-chip {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.queue-chip.processing {
  border-color: rgba(240, 208, 109, 0.34);
  color: #f0d06d;
}

.queue-chip.done {
  border-color: rgba(95, 140, 146, 0.36);
  color: #b6dcdf;
}

.queue-chip.failed {
  border-color: rgba(225, 113, 113, 0.34);
  color: #e69a8c;
}

.queue-session {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.queue-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.queue-time {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.queue-message {
  color: var(--text);
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.message-attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.message-attachment-chip {
  min-width: 0;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 218, 185, 0.14);
  border-radius: 999px;
  background: rgba(42, 6, 9, 0.55);
  color: rgba(255, 244, 227, 0.84);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
}

.message-attachment-kind {
  color: #f0d06d;
  font-weight: 800;
}

.message-attachment-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-card {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 12px 122px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(80, 11, 15, 0.92), rgba(59, 8, 11, 0.96));
}

.thread-card.outbound {
  border-color: rgba(240, 208, 109, 0.24);
}

.thread-card.outbound.queued-pending {
  border-color: rgba(240, 208, 109, 0.46);
  background:
    linear-gradient(180deg, rgba(98, 73, 24, 0.36), rgba(59, 8, 11, 0.94)),
    rgba(59, 8, 11, 0.96);
  box-shadow: inset 3px 0 0 rgba(240, 208, 109, 0.72);
}

.thread-card.inbound.failed {
  border-color: rgba(225, 113, 113, 0.34);
}

.thread-text {
  display: grid;
  gap: 10px;
  color: var(--text);
  line-height: 1.58;
  white-space: normal;
  word-break: break-word;
}

.thread-text > * {
  margin: 0;
}

.rich-heading {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}

.rich-paragraph {
  color: var(--text);
}

.rich-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.3rem;
}

.rich-list-item {
  padding-left: 0.1rem;
}

.rich-code {
  margin: 0;
  padding: 12px;
  overflow-x: auto;
  border: 1px solid rgba(255, 226, 192, 0.1);
  border-radius: 12px;
  background: rgba(22, 16, 15, 0.68);
  color: #fff7ea;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.inline-code {
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--mono);
  font-size: 0.92em;
}

.thread-text strong {
  font-weight: 700;
}

.thread-text em {
  font-style: italic;
}

.thread-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.thread-status {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.thread-status.queued {
  color: #d8b27f;
}

.thread-status.failed {
  color: #e69a8c;
}

.copy-button {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(81, 65, 57, 0.9);
  border-radius: 999px;
  background: rgba(20, 17, 16, 0.9);
  color: var(--muted);
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.copy-button:hover:not(:disabled),
.copy-button:focus-visible:not(:disabled) {
  background: rgba(76, 10, 12, 0.98);
  border-color: var(--accent-soft);
  color: var(--text);
}

.copy-button-floating {
  position: absolute;
  top: 10px;
  right: 10px;
}

.message-audio-button.copy-button-floating {
  right: 44px;
}

.message-audio-stop-button.copy-button-floating {
  right: 44px;
}

.thread-card:has(.message-audio-stop-button:not([hidden])) .message-audio-button.copy-button-floating {
  right: 78px;
}

.open-terminal-button.copy-button-floating {
  right: 44px;
}

.copy-button svg {
  width: 14px;
  height: 14px;
  display: block;
}

.copy-button.is-copied {
  color: #9fd19a;
  border-color: rgba(132, 188, 126, 0.42);
  background: rgba(17, 40, 22, 0.92);
  transform: scale(0.96);
}

.message-audio-button.is-playing {
  color: #fff4e3;
  border-color: rgba(240, 208, 109, 0.46);
  background: rgba(94, 28, 18, 0.94);
}

.message-audio-button.is-paused,
.message-audio-stop-button:not([hidden]) {
  color: #fff4e3;
  border-color: rgba(240, 208, 109, 0.34);
  background: rgba(76, 10, 12, 0.96);
}

.open-terminal-button {
  color: rgba(255, 218, 185, 0.82);
}

.open-terminal-button.is-loading {
  color: #f0d06d;
  border-color: rgba(240, 208, 109, 0.38);
}

.message-audio-button.is-unavailable {
  color: rgba(255, 177, 159, 0.92);
  border-color: rgba(255, 177, 159, 0.42);
  background: rgba(71, 13, 15, 0.96);
}

.message-audio-button.is-loading {
  color: #f0d06d;
  border-color: rgba(240, 208, 109, 0.38);
}

.message-audio-button.is-loading svg {
  animation: audio-spin 820ms linear infinite;
}

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

.detail-modal[hidden] {
  display: none;
}

.detail-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  min-height: 100%;
  border: 0;
  border-radius: 0;
  background: rgba(10, 8, 7, 0.78);
}

.detail-panel {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 20px), 760px);
  max-height: min(82vh, 760px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(124, 30, 31, 0.88), rgba(74, 12, 15, 0.96)),
    var(--panel);
  overflow: hidden;
  box-shadow: 0 26px 72px rgba(34, 6, 8, 0.42);
}

.detail-head {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.detail-meta {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.detail-project {
  font-size: 1.05rem;
  font-weight: 700;
}

.detail-session {
  min-width: 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.queue-archive-panel {
  width: min(calc(100% - 28px), 440px);
  grid-template-rows: auto auto auto;
}

.queue-archive-message {
  min-width: 0;
  max-height: 160px;
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(255, 218, 185, 0.12);
  border-radius: 10px;
  background: rgba(54, 7, 10, 0.48);
  color: rgba(255, 244, 227, 0.9);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.queue-archive-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.detail-close {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}

.detail-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-action-button {
  width: auto;
  min-width: 0;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(73, 10, 14, 0.9), rgba(57, 8, 11, 0.96));
  border: 1px solid var(--line-strong);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 237, 212, 0.05);
}

.detail-action-button:hover:not(:disabled),
.detail-action-button:focus-visible:not(:disabled) {
  background: linear-gradient(180deg, rgba(88, 12, 16, 0.94), rgba(65, 9, 12, 0.98));
  border-color: var(--accent-soft);
}

.detail-action-icon {
  width: 42px;
  padding: 0;
  display: inline-grid;
  place-items: center;
}

.detail-action-icon svg {
  width: 18px;
  height: 18px;
}

.detail-action-icon.is-loading {
  color: var(--accent);
}

.detail-thread {
  display: grid;
  gap: 10px;
}

.detail-history-state {
  min-height: 14px;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.detail-history-list {
  min-height: 200px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 2px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.detail-scroll-bottom-button {
  position: absolute;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 5;
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 236, 219, 0.2);
  border-radius: 999px;
  background: rgba(20, 5, 7, 0.58);
  color: rgba(255, 248, 238, 0.94);
  box-shadow:
    0 10px 26px rgba(12, 2, 3, 0.34),
    inset 0 1px 0 rgba(255, 237, 212, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.detail-scroll-bottom-button:hover,
.detail-scroll-bottom-button:focus-visible {
  border-color: rgba(240, 208, 109, 0.48);
  background: rgba(45, 7, 9, 0.74);
  color: rgba(255, 248, 238, 0.98);
}

.detail-scroll-bottom-button svg {
  width: 20px;
  height: 20px;
}

.terminal-panel[hidden] {
  display: none;
}

.terminal-panel {
  position: fixed;
  inset: 0;
  z-index: 70;
  background:
    linear-gradient(180deg, rgba(25, 18, 17, 0.98), rgba(54, 8, 11, 0.98)),
    #1b1211;
  color: var(--text);
}

.terminal-panel-shell {
  min-height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding:
    max(12px, env(safe-area-inset-top))
    12px
    max(12px, env(safe-area-inset-bottom))
    12px;
}

.terminal-panel-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.terminal-back-button {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 236, 219, 0.16);
  background: rgba(20, 5, 7, 0.58);
  color: rgba(255, 248, 238, 0.94);
}

.terminal-back-button svg,
.terminal-open-external-button svg {
  width: 18px;
  height: 18px;
}

.terminal-panel-title-wrap {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.terminal-panel-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
  font-weight: 800;
}

.terminal-panel-meta,
.terminal-panel-status,
.terminal-stream-state,
.terminal-stream-row-time {
  font-family: var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.terminal-panel-meta {
  min-width: 0;
  color: var(--muted);
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.terminal-panel-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid rgba(240, 208, 109, 0.26);
  border-radius: 8px;
  background: rgba(76, 10, 12, 0.76);
  color: rgba(255, 226, 179, 0.92);
  font-size: 0.64rem;
  font-weight: 850;
  white-space: nowrap;
}

.terminal-panel-status.is-terminal {
  border-color: rgba(95, 140, 146, 0.42);
  color: rgba(197, 229, 232, 0.95);
}

.terminal-panel-status.is-failed {
  border-color: rgba(255, 177, 159, 0.42);
  color: rgba(255, 200, 190, 0.95);
}

.terminal-stream-state {
  min-height: 16px;
  color: var(--muted);
  font-size: 0.66rem;
}

.terminal-stream-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 2px 0 12px;
  font-family: var(--mono);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.terminal-stream-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.terminal-stream-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid rgba(255, 236, 219, 0.1);
  border-radius: 8px;
  background: rgba(9, 8, 8, 0.42);
}

.terminal-stream-marker {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(240, 208, 109, 0.7);
}

.terminal-stream-row.is-success .terminal-stream-marker {
  background: rgba(126, 194, 142, 0.9);
}

.terminal-stream-row.is-warn .terminal-stream-marker {
  background: rgba(240, 208, 109, 0.96);
}

.terminal-stream-row.is-error .terminal-stream-marker {
  background: rgba(255, 146, 126, 0.96);
}

.terminal-stream-row-body {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.terminal-stream-row-head {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.terminal-stream-row-label {
  min-width: 0;
  overflow-wrap: anywhere;
  color: rgba(255, 248, 238, 0.96);
  font-size: 0.78rem;
  font-weight: 850;
}

.terminal-stream-row-time {
  flex: 0 0 auto;
  color: rgba(239, 199, 164, 0.72);
  font-size: 0.62rem;
}

.terminal-stream-row-text {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  color: rgba(255, 244, 227, 0.9);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-panel-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(54, 8, 11, 0), rgba(54, 8, 11, 0.98) 34%);
}

.terminal-open-external-button {
  width: 100%;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
}

.terminal-open-external-button.is-loading svg {
  animation: audio-spin 820ms linear infinite;
}

.import-session-list {
  min-height: 200px;
  align-content: start;
}

.import-session-empty {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(73, 10, 14, 0.9), rgba(57, 8, 11, 0.96));
  color: var(--muted);
  text-align: center;
}

.import-session-card {
  position: relative;
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(80, 11, 15, 0.92), rgba(59, 8, 11, 0.96));
  color: var(--text);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 237, 212, 0.05);
}

.import-session-card:hover:not(:disabled),
.import-session-card:focus-visible:not(:disabled) {
  border-color: rgba(240, 208, 109, 0.48);
  background: linear-gradient(180deg, rgba(89, 14, 17, 0.96), rgba(68, 10, 13, 0.98));
}

.import-session-card:disabled {
  opacity: 0.72;
}

.import-session-title {
  font-weight: 600;
}

.import-session-meta,
.import-session-time {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.import-session-preview {
  color: rgba(255, 244, 227, 0.82);
  line-height: 1.42;
}

.artifact-shelf {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 236, 219, 0.12);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.42);
}

.artifact-shelf[hidden] {
  display: none;
}

.artifact-shelf.is-collapsed .artifact-shelf-body {
  display: none;
}

.artifact-shelf.is-collapsed .artifact-shelf-toggle svg {
  transform: rotate(-90deg);
}

.artifact-shelf.has-error {
  border-color: rgba(255, 177, 159, 0.34);
}

.artifact-shelf-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.artifact-shelf-title {
  color: rgba(255, 248, 238, 0.96);
  font-weight: 900;
}

.artifact-shelf-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.artifact-shelf-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.artifact-shelf-open {
  width: auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 236, 219, 0.14);
  border-radius: 8px;
  background: rgba(65, 9, 12, 0.88);
  color: rgba(255, 244, 227, 0.94);
  font-size: 0.78rem;
  font-weight: 800;
}

.artifact-shelf-toggle {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
}

.artifact-shelf-list {
  display: grid;
  gap: 8px;
}

.dumpy-handoff-card .artifact-path {
  white-space: normal;
}

.artifact-shelf-empty {
  min-height: 68px;
}

.artifacts-list {
  min-height: 240px;
}

.artifact-card {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 236, 219, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(73, 10, 14, 0.92), rgba(44, 7, 9, 0.96)),
    var(--surface);
  box-shadow: inset 0 1px 0 rgba(255, 237, 212, 0.05);
}

.artifact-card.is-compact {
  gap: 8px;
  padding: 10px;
}

.artifact-card.is-compact .artifact-path {
  display: none;
}

.artifact-head {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.artifact-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: rgba(255, 248, 238, 0.96);
}

.artifact-meta,
.artifact-path {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.artifact-path {
  overflow-wrap: anywhere;
}

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

.artifact-action,
.artifact-action-button {
  width: auto;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 236, 219, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(98, 18, 21, 0.92), rgba(59, 8, 11, 0.96));
  color: rgba(255, 244, 227, 0.94);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 237, 212, 0.05);
}

.artifact-action:hover,
.artifact-action:focus-visible,
.artifact-action-button:hover:not(:disabled),
.artifact-action-button:focus-visible:not(:disabled) {
  border-color: rgba(240, 208, 109, 0.36);
  background: linear-gradient(180deg, rgba(119, 25, 27, 0.96), rgba(78, 12, 14, 0.98));
  color: #fff8ee;
  transform: translateY(-1px);
}

.artifact-action-button.is-quiet {
  background: linear-gradient(180deg, rgba(41, 9, 10, 0.84), rgba(31, 7, 8, 0.9));
  color: rgba(255, 236, 219, 0.82);
}

.artifact-action-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.detail-history-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.project-modal-panel {
  max-width: min(calc(100% - 20px), 520px);
}

.project-modal-form {
  display: grid;
  gap: 10px;
}

.session-title-form {
  display: grid;
  gap: 10px;
}

.session-title-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 10px;
}

.quick-prompt-dropdown {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  width: min(420px, calc(100vw - 40px));
  max-width: calc(100vw - 40px);
  max-height: min(58vh, 440px);
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 218, 185, 0.14);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(87, 14, 17, 0.86), rgba(47, 7, 10, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 237, 212, 0.06),
    0 14px 34px rgba(42, 7, 9, 0.22);
}

.quick-prompt-dropdown[hidden] {
  display: none;
}

.quick-prompt-dropdown-head {
  align-items: center;
}

.quick-prompt-panel {
  max-width: 100%;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.quick-prompt-body {
  min-height: 0;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

.quick-prompt-list {
  min-height: 0;
  max-height: min(42vh, 300px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  overflow: auto;
  scrollbar-width: none;
}

.quick-prompt-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.quick-prompt-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(52, 8, 11, 0.52);
}

.quick-prompt-use {
  min-width: 0;
  min-height: 58px;
  padding: 0;
  display: grid;
  gap: 5px;
  align-content: center;
  text-align: left;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.quick-prompt-use:hover:not(:disabled),
.quick-prompt-use:focus-visible:not(:disabled) {
  background: rgba(116, 31, 28, 0.34);
  transform: none;
}

.quick-prompt-title {
  min-width: 0;
  font-size: 0.94rem;
  font-weight: 850;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.quick-prompt-preview {
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.quick-prompt-edit {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  align-self: start;
  border-radius: 10px;
}

.quick-prompt-form {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.quick-prompt-form[hidden] {
  display: none;
}

.quick-prompt-form textarea {
  min-height: 132px;
}

.quick-prompt-form-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 0.85fr) minmax(0, 1fr);
  gap: 8px;
}

.detail-action-button.is-quiet {
  background: linear-gradient(180deg, rgba(41, 9, 10, 0.84), rgba(31, 7, 8, 0.9));
  color: rgba(255, 236, 219, 0.86);
}

.detail-action-button.is-quiet:hover:not(:disabled),
.detail-action-button.is-quiet:focus-visible:not(:disabled) {
  background: linear-gradient(180deg, rgba(54, 11, 13, 0.9), rgba(40, 8, 10, 0.95));
}

.delegate-brief-input {
  width: 100%;
  min-height: min(52vh, 430px);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(73, 10, 14, 0.9), rgba(57, 8, 11, 0.96));
  color: var(--text);
  line-height: 1.52;
  resize: vertical;
  box-shadow: inset 0 1px 0 rgba(255, 237, 212, 0.05);
}

.delegate-brief-input:focus-visible {
  outline: none;
  border-color: rgba(240, 208, 109, 0.44);
  box-shadow:
    inset 0 1px 0 rgba(255, 237, 212, 0.06),
    0 0 0 1px rgba(240, 208, 109, 0.16);
}

.delegate-overview {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid rgba(255, 236, 219, 0.12);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.34);
}

.delegate-overview-item {
  min-width: 0;
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.delegate-overview-item.is-live .delegate-overview-value {
  color: rgba(255, 224, 126, 0.96);
}

.delegate-overview-item.is-danger .delegate-overview-value {
  color: rgba(255, 158, 158, 0.96);
}

.delegate-overview-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.delegate-overview-value {
  min-width: 0;
  overflow-wrap: anywhere;
  color: rgba(255, 248, 238, 0.94);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.22;
}

.delegate-carousel {
  min-height: 0;
  display: grid;
  gap: 12px;
}

.delegate-carousel-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
}

.delegate-carousel-tab {
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 236, 219, 0.12);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.28);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.delegate-carousel-tab.has-unsaved {
  position: relative;
  border-color: rgba(240, 208, 109, 0.5);
  color: rgba(255, 248, 238, 0.96);
}

.delegate-carousel-tab.has-unsaved::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(240, 208, 109, 0.96);
  box-shadow: 0 0 0 2px rgba(45, 7, 9, 0.9);
}

.delegate-carousel-tab.is-active {
  border-color: rgba(240, 208, 109, 0.4);
  background: rgba(65, 9, 12, 0.78);
  color: rgba(255, 248, 238, 0.96);
}

.delegate-slide {
  min-height: min(52vh, 420px);
  max-height: min(52vh, 520px);
  overflow: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.delegate-slide::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.delegate-slide[hidden] {
  display: none;
}

.delegate-progress-list {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.delegate-progress-section {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.delegate-progress-section-title {
  color: rgba(255, 226, 179, 0.76);
  font-family: var(--mono);
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.delegate-progress-section-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.delegate-progress-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 236, 219, 0.12);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.34);
}

.delegate-progress-card.is-working {
  border-color: rgba(240, 208, 109, 0.34);
  background: rgba(72, 43, 9, 0.22);
}

.delegate-progress-marker {
  width: 17px;
  height: 17px;
  align-self: start;
  justify-self: center;
  margin-top: 2px;
  border-radius: 999px;
  background-color: rgba(118, 76, 14, 0.82);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.1 7.15 5.65 9.7l5.2-5.55' stroke='%23fff2c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
  box-shadow: inset 0 1px 0 rgba(255, 244, 227, 0.1);
}

.delegate-progress-spinner {
  width: 17px;
  height: 17px;
  align-self: start;
  justify-self: center;
  margin-top: 2px;
  border: 2px solid rgba(240, 208, 109, 0.24);
  border-top-color: rgba(255, 232, 159, 0.95);
  border-radius: 999px;
  animation: delegate-progress-spin 0.9s linear infinite;
}

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

.delegate-progress-card-body,
.delegate-next-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.delegate-progress-card-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
}

.delegate-progress-title {
  min-width: 0;
  color: rgba(255, 248, 238, 0.96);
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.delegate-progress-time,
.delegate-progress-meta {
  color: rgba(255, 226, 179, 0.66);
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.delegate-progress-body {
  min-width: 0;
  color: rgba(255, 244, 227, 0.9);
  font-size: 0.78rem;
  line-height: 1.36;
  overflow-wrap: anywhere;
}

.delegate-progress-note {
  min-width: 0;
  color: rgba(255, 226, 179, 0.72);
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.delegate-next-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 236, 219, 0.11);
  border-radius: 8px;
  background: rgba(25, 5, 7, 0.32);
}

.delegate-next-card.is-primary {
  border-color: rgba(240, 208, 109, 0.3);
}

.delegate-next-card.is-fallback {
  border-style: dashed;
}

.delegate-next-rank {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 208, 109, 0.34);
  border-radius: 999px;
  color: rgba(255, 232, 159, 0.96);
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 900;
}

.delegate-details-list {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.delegate-detail-section {
  min-width: 0;
  border: 1px solid rgba(255, 236, 219, 0.12);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.28);
}

.delegate-detail-section summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 11px;
  color: rgba(255, 248, 238, 0.92);
  font-size: 0.78rem;
  font-weight: 900;
  cursor: pointer;
}

.delegate-detail-section-body {
  min-width: 0;
  padding: 0 10px 10px;
}

.delegate-debug-list {
  display: grid;
  gap: 7px;
}

.delegate-debug-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.delegate-detail-section .delegate-supervisor-card {
  border-color: rgba(255, 236, 219, 0.12);
  background: rgba(35, 7, 8, 0.34);
}

.delegate-detail-section .delegate-supervisor-timeline,
.delegate-detail-section .delegate-review-list,
.delegate-detail-section .delegate-run-list {
  min-height: 0;
}

.delegate-overview {
  display: grid;
  gap: 8px;
}

.delegate-overview:empty {
  display: none;
}

.delegate-overview-card {
  display: grid;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 236, 219, 0.12);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.34);
}

.delegate-supervisor-card {
  display: grid;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(240, 208, 109, 0.2);
  border-radius: 8px;
  background: rgba(35, 7, 8, 0.48);
}

.delegate-overview-head {
  display: grid;
  gap: 3px;
}

.delegate-supervisor-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.delegate-supervisor-title-wrap {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.delegate-supervisor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.delegate-overview-title {
  color: rgba(255, 248, 238, 0.96);
  font-weight: 900;
}

.delegate-overview-meta,
.delegate-overview-label {
  color: rgba(255, 226, 179, 0.72);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.delegate-overview-fields {
  display: grid;
  gap: 7px;
}

.delegate-supervisor-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.delegate-supervisor-section {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.delegate-check-section-title {
  color: rgba(255, 226, 179, 0.74);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.delegate-checklist {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.delegate-check-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  min-height: 62px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 236, 219, 0.1);
  border-radius: 7px;
  background: rgba(25, 5, 7, 0.32);
}

.delegate-check-row.is-current {
  border-color: rgba(240, 208, 109, 0.34);
  background: rgba(72, 43, 9, 0.24);
}

.delegate-check-row.is-blocked {
  border-color: rgba(255, 130, 130, 0.34);
  background: rgba(75, 15, 17, 0.34);
}

.delegate-check-box {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 0;
  padding: 0;
  align-self: center;
  justify-self: center;
  border: 1px solid rgba(240, 208, 109, 0.48);
  border-radius: 5px;
  background: rgba(45, 7, 9, 0.72);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
  box-shadow: inset 0 1px 0 rgba(255, 244, 227, 0.08);
}

.delegate-check-box:checked {
  border-color: rgba(255, 232, 159, 0.92);
  background-color: rgba(118, 76, 14, 0.82);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3.1 7.15 5.65 9.7l5.2-5.55' stroke='%23fff2c8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.delegate-check-body {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-content: stretch;
  gap: 2px;
}

.delegate-check-label {
  min-width: 0;
  color: rgba(255, 248, 238, 0.94);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.18;
}

.delegate-check-detail {
  min-width: 0;
  color: rgba(255, 226, 179, 0.76);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.delegate-check-row.is-blocked .delegate-check-detail {
  color: rgba(255, 178, 166, 0.9);
}

.delegate-supervisor-timeline {
  display: grid;
  gap: 8px;
  min-height: min(44vh, 320px);
}

.delegate-supervisor-event {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(255, 236, 219, 0.11);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.34);
}

.delegate-supervisor-event.is-latest {
  border-color: rgba(240, 208, 109, 0.28);
  background: rgba(55, 9, 10, 0.54);
}

.delegate-supervisor-event.is-blocked {
  border-color: rgba(255, 130, 130, 0.34);
}

.delegate-supervisor-event-marker {
  width: 11px;
  height: 11px;
  align-self: start;
  justify-self: center;
  margin-top: 5px;
  border: 1px solid rgba(240, 208, 109, 0.56);
  border-radius: 999px;
  background: rgba(45, 7, 9, 0.72);
}

.delegate-supervisor-event.is-done .delegate-supervisor-event-marker {
  background: rgba(118, 76, 14, 0.82);
}

.delegate-supervisor-event.is-current .delegate-supervisor-event-marker {
  background: rgba(240, 208, 109, 0.84);
  box-shadow: 0 0 10px rgba(240, 208, 109, 0.24);
}

.delegate-supervisor-event.is-blocked .delegate-supervisor-event-marker {
  border-color: rgba(255, 130, 130, 0.58);
  background: rgba(137, 28, 29, 0.74);
}

.delegate-supervisor-event-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.delegate-supervisor-event-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
}

.delegate-supervisor-event-title {
  min-width: 0;
  color: rgba(255, 248, 238, 0.94);
  font-weight: 900;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.delegate-supervisor-event-time,
.delegate-supervisor-event-key {
  color: rgba(255, 226, 179, 0.72);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.delegate-supervisor-event-detail,
.delegate-supervisor-event-value {
  color: rgba(255, 226, 179, 0.84);
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.delegate-supervisor-event-fields {
  display: grid;
  gap: 3px;
}

.delegate-supervisor-event-row {
  display: grid;
  grid-template-columns: minmax(64px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.delegate-overview-field {
  display: grid;
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.delegate-overview-value {
  min-width: 0;
  color: rgba(255, 236, 219, 0.9);
  line-height: 1.36;
  overflow-wrap: anywhere;
}

.delegate-slide .history-state-card {
  min-height: min(42vh, 280px);
}

#delegateModal .detail-action-button,
#delegateModal .detail-close {
  border-radius: 8px;
}

.delegate-run-card-list {
  display: grid;
  gap: 8px;
}

.active-runs-list {
  display: grid;
  gap: 8px;
  min-height: min(44vh, 320px);
}

.selected-delegate-list {
  min-height: 0;
}

.active-run-card {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 236, 219, 0.12);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.36);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.active-run-card:hover,
.active-run-card:focus-visible {
  border-color: rgba(240, 208, 109, 0.38);
  background: rgba(65, 9, 12, 0.72);
}

.active-run-card.is-compact {
  gap: 4px;
  padding: 9px 10px;
  background: rgba(45, 7, 9, 0.24);
}

.active-run-card.is-compact .active-run-title {
  font-size: 0.92rem;
}

.active-run-card.is-compact .active-run-footer {
  padding-top: 2px;
}

.active-run-title {
  font-weight: 800;
  color: rgba(255, 248, 238, 0.96);
}

.active-run-meta,
.active-run-summary,
.active-run-footer {
  min-width: 0;
  overflow-wrap: anywhere;
}

.delegate-lane-body {
  display: grid;
  gap: 5px;
}

.delegate-lane-line {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.delegate-lane-line-label {
  color: rgba(255, 226, 179, 0.72);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.delegate-lane-line-value {
  min-width: 0;
  color: rgba(255, 236, 219, 0.88);
  line-height: 1.38;
}

.active-run-meta {
  color: rgba(255, 226, 179, 0.7);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.active-run-summary {
  color: rgba(255, 236, 219, 0.88);
  line-height: 1.42;
}

.active-run-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.active-run-chip {
  font-size: 0.74rem;
  font-weight: 700;
}

.active-run-chip {
  color: rgba(255, 226, 179, 0.8);
}

.hygiene-chip.is-ok {
  color: rgba(185, 235, 190, 0.9);
}

.hygiene-chip.is-work {
  color: rgba(240, 208, 109, 0.95);
}

.hygiene-chip.is-review,
.hygiene-chip.is-blocked {
  color: rgba(255, 177, 159, 0.95);
}

.active-run-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}

.active-run-action-button {
  width: auto;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 236, 219, 0.14);
  border-radius: 7px;
  background: rgba(45, 7, 9, 0.46);
  color: rgba(255, 248, 238, 0.96);
  font-size: 0.74rem;
  font-weight: 800;
}

.active-run-action-button:hover:not(:disabled),
.active-run-action-button:focus-visible:not(:disabled) {
  border-color: rgba(240, 208, 109, 0.5);
  background: rgba(84, 18, 18, 0.74);
}

.active-run-action-button.is-pause {
  color: rgba(255, 226, 179, 0.96);
}

.active-run-action-button.is-pause:hover:not(:disabled),
.active-run-action-button.is-pause:focus-visible:not(:disabled) {
  border-color: rgba(255, 177, 159, 0.62);
  color: rgba(255, 248, 238, 0.98);
}

.delegate-run-card {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid rgba(255, 236, 219, 0.12);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.36);
  color: var(--text);
  text-align: left;
}

.delegate-run-card:hover,
.delegate-run-card:focus-visible,
.delegate-run-card.is-selected {
  border-color: rgba(240, 208, 109, 0.38);
  background: rgba(65, 9, 12, 0.72);
}

.delegate-run-card-head {
  min-width: 0;
  display: block;
}

.delegate-run-card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
  color: rgba(255, 248, 238, 0.94);
}

.delegate-run-list {
  max-height: none;
  min-height: min(44vh, 320px);
  overflow: visible;
  padding: 2px;
  border-radius: 8px;
}

.delegate-review-list {
  display: grid;
  gap: 8px;
  min-height: min(44vh, 320px);
}

.delegate-log-mode-switch {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 0 8px;
  background: linear-gradient(180deg, rgba(125, 19, 24, 0.98), rgba(125, 19, 24, 0.72));
}

.delegate-log-mode-button {
  min-width: 0;
  min-height: 36px;
  border: 1px solid rgba(255, 236, 219, 0.14);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.38);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.delegate-log-mode-button.is-active {
  border-color: rgba(240, 208, 109, 0.42);
  background: rgba(65, 9, 12, 0.88);
  color: rgba(255, 248, 238, 0.96);
}

.delegate-live-current,
.delegate-event-card,
.delegate-review-card {
  position: relative;
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid rgba(95, 140, 146, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(71, 10, 14, 0.9), rgba(48, 7, 10, 0.96));
}

.delegate-live-current {
  border-color: rgba(240, 208, 109, 0.34);
  background: linear-gradient(180deg, rgba(88, 16, 19, 0.95), rgba(48, 7, 10, 0.98));
}

.delegate-event-card.failed {
  border-color: rgba(225, 113, 113, 0.38);
}

.delegate-review-card.is-hard-stop,
.delegate-review-card.is-pause-recommended {
  border-color: rgba(225, 113, 113, 0.42);
}

.delegate-review-card.is-needs-review {
  border-color: rgba(240, 208, 109, 0.38);
}

.delegate-review-risks {
  min-width: 0;
  overflow-wrap: anywhere;
  color: rgba(255, 226, 179, 0.66);
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.delegate-event-card.is-live {
  border-color: rgba(240, 208, 109, 0.28);
}

.delegate-event-head {
  display: grid;
  gap: 4px;
}

.delegate-event-title {
  font-weight: 700;
  color: rgba(255, 248, 238, 0.94);
}

.delegate-event-meta,
.delegate-current-kicker,
.delegate-step-label {
  color: rgba(255, 226, 179, 0.64);
  font-family: var(--mono);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: uppercase;
}

.delegate-event-body {
  color: rgba(255, 244, 227, 0.88);
}

.delegate-current-title {
  font-size: 0.98rem;
  font-weight: 900;
  color: rgba(255, 248, 238, 0.98);
}

.delegate-current-body {
  color: rgba(255, 244, 227, 0.92);
}

.delegate-step-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 236, 219, 0.12);
  border-radius: 8px;
  background: rgba(45, 7, 9, 0.42);
}

.delegate-step-card.failed {
  border-color: rgba(225, 113, 113, 0.38);
}

.delegate-step-fields {
  display: grid;
  gap: 10px;
}

.delegate-step-field {
  display: grid;
  gap: 4px;
}

.delegate-step-value {
  color: rgba(255, 244, 227, 0.9);
}

.delegate-summary-list {
  min-height: 0;
  max-height: none;
  overflow: visible;
}

.delegate-summary-list:empty {
  display: none;
}

.delegate-plan-list {
  min-height: min(44vh, 320px);
  max-height: none;
  overflow: visible;
}

#delegateModal .project-modal-panel {
  max-width: min(calc(100% - 20px), 680px);
  max-height: min(calc(100dvh - 24px), 820px);
  bottom: max(10px, env(safe-area-inset-bottom));
  grid-template-rows: none;
  align-content: start;
  overflow: auto;
}

@media (max-width: 640px) {
  #delegateModal .detail-head {
    display: grid;
    gap: 10px;
  }

  #delegateModal .detail-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(72px, 1fr) minmax(118px, 1.25fr) 40px;
    gap: 8px;
  }

  #delegateModal .detail-action-button {
    min-height: 38px;
    padding: 0 8px;
    font-size: 0.82rem;
  }

  #delegateModal .detail-close {
    width: 40px;
    min-width: 40px;
    min-height: 38px;
  }

  .delegate-overview-value {
    font-size: 0.82rem;
  }

  .delegate-supervisor-head,
  .delegate-supervisor-sections {
    grid-template-columns: 1fr;
  }

  .delegate-supervisor-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .delegate-slide {
    min-height: min(50vh, 380px);
    max-height: min(50vh, 440px);
  }
}

.session-title-form .detail-action-button {
  width: 100%;
}

.codex-integration-list {
  gap: 8px;
}

.codex-check-card {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 218, 185, 0.12);
  border-radius: 12px;
  background: rgba(48, 7, 10, 0.42);
}

.codex-check-card.is-pass {
  border-color: rgba(129, 199, 132, 0.34);
}

.codex-check-card.is-warn {
  border-color: rgba(255, 209, 128, 0.42);
}

.codex-check-card.is-fail {
  border-color: rgba(255, 124, 124, 0.46);
}

.codex-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.codex-check-title {
  min-width: 0;
  color: rgba(255, 248, 238, 0.98);
  font-size: 0.9rem;
  font-weight: 850;
}

.codex-check-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.codex-check-detail {
  color: rgba(255, 232, 205, 0.8);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.project-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mode-chip {
  min-height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(73, 10, 14, 0.9), rgba(57, 8, 11, 0.96));
  color: var(--muted);
  box-shadow: inset 0 1px 0 rgba(255, 237, 212, 0.05);
}

.mode-chip.is-active {
  background: linear-gradient(90deg, rgba(208, 59, 57, 0.94), rgba(227, 107, 73, 0.98));
  color: #fff7f1;
  border-color: rgba(240, 208, 109, 0.44);
}

.history-group {
  display: grid;
  gap: 10px;
}

.history-state-card {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(73, 10, 14, 0.9), rgba(57, 8, 11, 0.96));
  color: var(--muted);
  text-align: center;
}

.summary-list {
  gap: 12px;
}

.summary-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 12px 48px 14px 14px;
  border: 1px solid rgba(95, 140, 146, 0.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(80, 11, 15, 0.92), rgba(59, 8, 11, 0.96));
}

.summary-head {
  display: grid;
  gap: 4px;
}

.summary-timestamp {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.summary-source-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: rgba(255, 244, 227, 0.72);
}

.detail-card.failed {
  border-color: rgba(225, 113, 113, 0.34);
}

.is-empty {
  color: var(--muted);
}

.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;
}

@media (max-width: 640px) {
  .wordmark-wrap {
    gap: 7px;
  }

  .wordmark-lockup {
    align-items: center;
    gap: 22px;
  }

  .wordmark-line {
    font-size: clamp(2.9rem, 14vw, 4.1rem);
    letter-spacing: -0.06em;
  }

  .wordmark {
    transform: translateY(2px) rotate(-3.5deg) skewX(-11deg);
  }

  .wordmark-line-bottom {
    margin-top: -0.1em;
    margin-left: 0.38em;
  }

  .mascot-photo {
    width: min(22vw, 66px);
    height: min(31vw, 94px);
    transform: translateY(0) rotate(-1deg);
  }

  .mascot-carousel.is-static:active .mascot-photo,
  .mascot-carousel.is-static.is-tapped .mascot-photo {
    transform: translateY(0) rotate(-1deg) scale(0.97);
  }

  .header-catchphrase {
    width: min(100%, 320px);
    min-height: 2.8em;
    margin-top: 10px;
    padding: 0 10px;
    font-size: 0.76rem;
    line-height: 1.28;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .workspace-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding: 3px;
    border-radius: 14px;
  }

  .workspace-tab {
    min-height: 32px;
    font-size: 0.78rem;
  }

  .workspace-tab .control-orb {
    top: 7px;
    right: 9px;
  }

  .project-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 48px 48px;
  }

  .session-control {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .project-control select,
  .session-control select {
    grid-column: 1 / -1;
  }

  .project-control select {
    grid-column: 1 / 2;
  }

  .project-control .thread-button {
    grid-column: 2 / 3;
  }

  .project-control .delegate-open-button {
    grid-column: 3 / 4;
  }

  .project-control .thread-button,
  .session-control .thread-button {
    min-width: 0;
    width: 100%;
  }

  .session-control {
    --session-spinner-right: 14px;
  }

  .session-control.is-loading::after {
    top: 24px;
  }

  .delegate-open-button {
    min-width: 48px;
    width: 48px;
    padding: 0;
  }

  .delegate-open-button span:not(.delegate-auto-glyph) {
    display: none;
  }

  .queue-list {
    min-height: 220px;
  }

  .detail-panel {
    width: calc(100% - 16px);
    bottom: max(8px, env(safe-area-inset-bottom));
    max-height: min(88dvh, 760px);
    padding: 12px;
  }

  .terminal-panel-shell {
    gap: 8px;
    padding:
      max(10px, env(safe-area-inset-top))
      10px
      max(10px, env(safe-area-inset-bottom))
      10px;
  }

  .terminal-panel-head {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .terminal-panel-status {
    grid-column: 2 / 3;
    justify-self: start;
  }

  .terminal-stream-row {
    padding: 8px;
  }

  .project-modal-panel {
    max-width: none;
  }

  .artifacts-list {
    min-height: min(48dvh, 360px);
  }

  .artifact-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .artifact-action,
  .artifact-action-button {
    width: 100%;
  }
}

.boot-failure {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.boot-failure-panel {
  width: min(100%, 360px);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(52, 6, 8, 0.82);
  color: #fff7ec;
}

.boot-failure-panel h1 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.boot-failure-panel p {
  margin: 0 0 14px;
  color: rgba(255, 247, 236, 0.72);
  font-size: 0.9rem;
  line-height: 1.45;
}

.boot-failure-panel button {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #f9f2df;
  color: #3d0809;
  font: inherit;
  font-weight: 800;
}
