@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("assets/plus-jakarta-sans.woff2") format("woff2");
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #f7f7f5;
  --surface: #ffffff;
  --surface-soft: #f1f1ee;
  --text: #222225;
  --muted: #8b8b91;
  --line: #e6e6e2;
  --line-strong: #d9d9d4;
  --purple: #6f3df4;
  --purple-soft: #f1edff;
  --green: #2b7b59;
  --green-soft: #eaf6ef;
  --amber: #9a671c;
  --amber-soft: #fff4df;
  --red: #a64c43;
  --red-soft: #fff0ed;
  --shadow: 0 16px 42px rgba(29, 29, 35, .07), 0 2px 8px rgba(29, 29, 35, .035);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--page); }

body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 50% -20%, rgba(111, 61, 244, .055), transparent 32rem),
    var(--page);
  color: var(--text);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

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

.mobile-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: calc(64px + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 12px max(22px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(221, 221, 216, .78);
  background: rgba(247, 247, 245, .88);
  backdrop-filter: blur(18px) saturate(150%);
}

.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.035em;
  text-decoration: none;
}

.mobile-brand img { width: 25px; height: 25px; object-fit: contain; }

.mobile-main {
  width: min(640px, calc(100% - 36px));
  margin: 0 auto;
  padding: 28px 0 calc(54px + env(safe-area-inset-bottom));
}

.job-composer {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 16px 44px rgba(24, 24, 30, .09), 0 2px 8px rgba(24, 24, 30, .04);
  backdrop-filter: blur(18px) saturate(150%);
  text-align: left;
}

.job-composer:focus-within {
  border-color: #d8d0f4;
  box-shadow: 0 18px 48px rgba(62, 40, 133, .09), 0 0 0 4px rgba(111, 61, 244, .035);
}

.job-composer textarea {
  display: block;
  width: 100%;
  min-height: 98px;
  max-height: 180px;
  resize: none;
  padding: 20px 19px 9px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
}

.job-composer textarea::placeholder { color: #a3a3a7; }

.composer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 9px 9px;
}

.send-tools { display: flex; align-items: center; gap: 3px; min-width: 0; }

.composer-tool,
.voice-button,
.send-button {
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.composer-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  color: #55555c;
  font-size: 12px;
}

.composer-tool b { overflow: hidden; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.composer-tool:disabled { opacity: 1; cursor: default; }
.composer-tool:not(:disabled):hover, .voice-button:hover { background: #f1f1ef; }
.model-tool { max-width: 175px; }
.model-tool img { width: 17px; height: 17px; object-fit: contain; }
.model-tool > span { color: #9c9ca1; font-size: 10px; }

.voice-button {
  width: 36px;
  color: #55555c;
  font-size: 20px;
}

.voice-button.listening { background: var(--red-soft); color: var(--red); }

.send-button {
  display: grid;
  place-items: center;
  width: 38px;
  border-radius: 50%;
  background: #29292e;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

.send-button:disabled { background: #c8c8c7; cursor: default; }

.tasks-section { margin-top: 0; }

.task-tabs {
  display: flex;
  align-items: center;
  gap: 25px;
  border-bottom: 1px solid var(--line);
}

.task-tabs button {
  position: relative;
  min-height: 46px;
  padding: 0 1px;
  border: 0;
  background: transparent;
  color: #98989d;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.task-tabs button.active { color: var(--text); }
.task-tabs button.active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: #25252a;
  content: "";
}

.task-tabs button span {
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 9px;
}

.task-tabs .task-search { margin-left: auto; font-size: 21px; font-weight: 400; }
.task-tabs .task-search::after { display: none; }

.status-banner {
  margin: 16px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #76511e;
  font-size: 11px;
  line-height: 1.5;
}

.status-banner.preview { background: var(--purple-soft); color: #5e45a2; }
.status-banner.error { background: var(--red-soft); color: var(--red); }
.status-banner.success { background: var(--green-soft); color: var(--green); }

.notification-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 11px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  color: #66666c;
  font-size: 10px;
}

.notification-prompt button {
  min-height: 31px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: #29292e;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

.job-group { margin-top: 34px; }
.past-jobs { margin-top: 38px; }
.job-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
}
.job-group-header h2 { margin: 0; font-size: 14px; font-weight: 750; letter-spacing: -.025em; }
.job-group-header span {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 12px;
  background: #ececea;
  color: #77777d;
  font-size: 9px;
  font-weight: 750;
}

.task-list { display: grid; }

.task-row {
  display: block;
  width: 100%;
  border-bottom: 1px solid #e9e9e6;
  background: transparent;
}

.task-summary {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 78px;
  padding: 13px 4px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.task-summary:hover, .task-summary[aria-expanded="true"] { background: rgba(255, 255, 255, .52); }
.task-state { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; background: #efefed; }
.task-state i { width: 8px; height: 8px; border-radius: 50%; background: #99999d; }
.task-row[data-status="running"] .task-state,
.task-row[data-status="background"] .task-state { background: var(--purple-soft); }
.task-row[data-status="running"] .task-state i,
.task-row[data-status="background"] .task-state i { background: var(--purple); box-shadow: 0 0 0 4px rgba(111, 61, 244, .12); }
.task-row[data-status="waiting_for_human"] .task-state { background: var(--amber-soft); }
.task-row[data-status="waiting_for_human"] .task-state i { background: var(--amber); }
.task-row[data-status="completed"] .task-state,
.task-row[data-status="completed_unverified"] .task-state,
.task-row[data-status="ready"] .task-state { background: var(--green-soft); }
.task-row[data-status="completed"] .task-state i,
.task-row[data-status="completed_unverified"] .task-state i,
.task-row[data-status="ready"] .task-state i { background: var(--green); }
.task-row[data-status="failed"] .task-state,
.task-row[data-status="cancelled"] .task-state { background: var(--red-soft); }
.task-row[data-status="failed"] .task-state i,
.task-row[data-status="cancelled"] .task-state i { background: var(--red); }

.task-copy { display: grid; min-width: 0; gap: 5px; }
.task-copy strong { overflow: hidden; font-size: 13px; font-weight: 650; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.task-copy small { overflow: hidden; color: #929298; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.task-meta { display: grid; justify-items: end; gap: 5px; }
.task-meta em { color: #68686f; font-size: 10px; font-style: normal; }
.task-meta time { color: #aaaab0; font-size: 9px; }

.task-inline {
  display: grid;
  gap: 12px;
  padding: 0 4px 17px 47px;
}
.inline-update { margin: 0; color: #77777d; font-size: 10px; line-height: 1.55; }
.inline-attention,
.inline-result,
.inline-player {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 13px;
  background: var(--amber-soft);
}
.inline-result, .inline-player.connected { background: var(--green-soft); }
.inline-player { background: #f0eefb; }
.inline-player.media-only {
  gap: 0;
  padding: 0;
  background: transparent;
}
.inline-player .media-result {
  margin: 0;
}
.inline-attention strong, .inline-player strong { font-size: 11px; }
.inline-attention p, .inline-result p, .inline-player p { margin: 0; color: #696970; font-size: 10px; line-height: 1.55; }
.inline-result small { color: var(--green); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.inline-result a { color: #355f4a; font-size: 10px; font-weight: 700; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 3px; }
.inline-job-actions { margin-top: 0; }
.inline-button {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  font-size: 9px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.inline-button.primary { background: #29292e; color: #fff; }
.inline-button.quiet { background: rgba(255,255,255,.75); color: #4f4f55; }
.inline-button.danger { background: var(--red-soft); color: var(--red); }
.inline-button:disabled { opacity: .45; cursor: default; }
.inline-pairing-code { color: #29292e !important; font-size: 21px !important; font-weight: 800; letter-spacing: .16em; text-align: center; }
.inline-error { color: var(--red) !important; }

.empty-tasks { padding: 44px 10px; color: #96969b; text-align: center; }
.empty-tasks img { width: 34px; height: 34px; opacity: .48; }
.empty-tasks h3 { margin: 14px 0 6px; color: #55555b; font-size: 13px; }
.empty-tasks p { max-width: 340px; margin: 0 auto; font-size: 11px; line-height: 1.6; }

dialog { color: var(--text); }
dialog::backdrop { background: rgba(22, 22, 26, .32); backdrop-filter: blur(3px); }

.sheet-dialog {
  width: min(470px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.sheet-card {
  position: relative;
  overflow: auto;
  padding: 31px;
  border: 1px solid rgba(224, 224, 221, .9);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(20, 20, 25, .18);
}

.sheet-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f2f2ef;
  color: #77777d;
  font-size: 20px;
  cursor: pointer;
}

.sheet-mark { width: 34px; height: 34px; }
.sheet-kicker { margin: 19px 0 7px; color: var(--purple); font-size: 9px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.sheet-card h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.045em; }
.sheet-card > p:not(.sheet-kicker):not(.form-error) { margin: 10px 0 24px; color: #85858b; font-size: 12px; line-height: 1.6; }
.sheet-card label { display: block; margin-bottom: 7px; color: #74747a; font-size: 10px; font-weight: 700; }
.sheet-card input {
  width: 100%;
  height: 49px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: 0;
  background: #fbfbfa;
  font-size: 14px;
}
.sheet-card input:focus { border-color: #bcb1e1; box-shadow: 0 0 0 3px rgba(111, 61, 244, .06); }
.form-error { margin: 10px 0 0; color: var(--red); font-size: 11px; }

.primary-action,
.quiet-action,
.danger-action {
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.primary-action { background: #29292e; color: #fff; }
.sheet-card > .primary-action { width: 100%; margin-top: 14px; }
.quiet-action { background: #f0f0ed; color: #55555b; }
.sheet-card > .quiet-action { width: 100%; margin-top: 8px; background: transparent; color: #77777d; }
.danger-action { background: var(--red-soft); color: var(--red); }

.model-intro { margin-bottom: 14px !important; }
.model-options { display: grid; gap: 7px; }
.model-option {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}
.model-option:hover, .model-option.selected { border-color: #cec2f1; background: #faf8ff; }
.model-option.unavailable { opacity: .48; cursor: not-allowed; }
.model-option.unavailable:hover { border-color: var(--line); background: #fff; }
.model-option > img { width: 28px; height: 28px; object-fit: contain; }
.model-option > span { display: grid; gap: 3px; min-width: 0; }
.model-option strong { font-size: 12px; }
.model-option small { overflow: hidden; color: #929298; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.model-option > em { color: #77777d; font-size: 9px; font-style: normal; }

.quote-goal {
  max-height: 92px;
  overflow: auto;
  padding-right: 20px;
  color: #5f5f66 !important;
}

.quote-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}

.quote-facts div { min-height: 68px; padding: 13px 14px; background: #fafaf8; }
.quote-facts dt { color: #98989d; font-size: 8px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.quote-facts dd { margin: 7px 0 0; font-size: 11px; font-weight: 650; line-height: 1.4; }
.sheet-card > .quote-boundary { margin: 15px 0 0 !important; padding: 12px 13px; border-radius: 11px; background: var(--green-soft); color: #4d6e5b !important; }
.quote-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 8px; margin-top: 17px; }
.quote-actions button { width: 100%; }

.task-dialog {
  width: min(650px, 100%);
  height: min(860px, 100%);
  max-width: 100%;
  max-height: 100%;
  padding: 0;
  border: 0;
  border-radius: 25px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(18, 18, 22, .2);
}

.task-detail { display: grid; grid-template-rows:auto 1fr auto; height: 100%; }
.task-detail > header {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.task-back, .task-menu { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f2f2ef; cursor: pointer; }
.task-back { font-size: 26px; }
.task-detail > header div { display: grid; justify-items: center; gap: 2px; }
.task-detail > header small { color: #9a9a9f; font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.task-detail > header strong { font-size: 11px; }

.task-detail-main { overflow: auto; padding: 27px 27px 36px; }
.task-detail-main > h2 { margin: 0; font-size: 25px; font-weight: 600; letter-spacing: -.045em; line-height: 1.16; }
.task-detail-main > p { margin: 10px 0 23px; color: #74747a; font-size: 12px; line-height: 1.65; white-space: pre-wrap; }
.task-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.task-facts div { min-height: 68px; padding: 13px 14px; background: #fafaf8; }
.task-facts dt { color: #98989d; font-size: 8px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.task-facts dd { margin: 7px 0 0; font-size: 11px; font-weight: 650; }

.approval-card, .receipt-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: 14px;
}
.approval-card { background: var(--amber-soft); }
.receipt-card { background: var(--green-soft); }
.approval-card small, .receipt-card small { color: var(--amber); font-size: 8px; font-weight: 750; letter-spacing: .065em; text-transform: uppercase; }
.receipt-card small { color: var(--green); }
.approval-card h3, .receipt-card h3 { margin: 8px 0 6px; font-size: 14px; }
.approval-card p, .receipt-card p { margin: 0; color: #6e604a; font-size: 11px; line-height: 1.55; }
.receipt-card p { color: #4d6e5b; }
.approval-card code { display: block; overflow: auto; margin: 12px 0; padding: 10px; border-radius: 8px; background: rgba(255,255,255,.58); color: #6e604a; font-size: 9px; }
.approval-card > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.receipt-card ul { display: grid; gap: 8px; margin: 13px 0 0; padding: 0; color: #4d6e5b; font-size: 10px; line-height: 1.6; list-style: none; }
.receipt-card li:not(:has(.phone-action)) { margin-left: 17px; list-style: disc; }
.receipt-card li.media-result,
.inline-player .media-result {
  overflow: hidden;
  border: 1px solid rgba(43, 123, 89, .16);
  border-radius: 13px;
  background: #fff;
  list-style: none;
}
.receipt-card li.media-result { margin: 3px 0 0; }
.playback-controls { display: grid; gap: 10px; margin: 14px 0 22px; }
.playback-controls form { display: flex; gap: 8px; padding: 7px 7px 7px 13px; border: 1px solid #deded9; border-radius: 14px; background: #fff; }
.playback-controls input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #252529; font: inherit; font-size: 11px; }
.playback-controls form button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #29292e; color: #fff; font-size: 16px; }
.playback-buttons { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 7px; }
.playback-buttons button, .pair-player { min-height: 38px; border: 0; border-radius: 10px; background: #efefec; color: #343439; font-size: 10px; font-weight: 700; }
.pair-player { width: 100%; background: #29292e; color: #fff; }
.pairing-code, .playback-status { margin: 0; color: #77777c; font-size: 9px; line-height: 1.5; text-align: center; }
.pairing-code strong { color: #252529; font-size: 17px; letter-spacing: .16em; }
.media-player-shell {
  position: relative;
  width: 100%;
  min-height: 200px;
  aspect-ratio: 16 / 9;
  background: #111;
}
.media-player-shell > div:first-child,
.media-player-shell iframe { display: block; width: 100%; height: 100%; min-height: 200px; border: 0; }
.media-play {
  position: absolute;
  z-index: 2;
  inset: 50% auto auto 50%;
  min-width: 78px;
  min-height: 44px;
  padding: 0 18px;
  transform: translate(-50%, -50%);
  border: 0;
  border-radius: 22px;
  background: #fff;
  color: #202024;
  font-size: 11px;
  font-weight: 750;
  box-shadow: 0 7px 24px rgba(0,0,0,.25);
}
.media-unavailable {
  position: absolute;
  inset: 50% 18px auto;
  margin: 0;
  transform: translateY(-50%);
  color: #fff;
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}
.media-caption {
  display: grid;
  gap: 3px;
  padding: 12px 13px 13px;
  color: #242a26;
}
.media-caption strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.media-caption span { color: #7c877f; font-size: 9px; }
.phone-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(43, 123, 89, .18);
  border-radius: 11px;
  background: rgba(255, 255, 255, .72);
  color: #244f39;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}
.phone-action::after { content: "↗"; color: #668874; }

.timeline-section { margin-top: 26px; }
.timeline-section > h3 { margin: 0 0 14px; font-size: 12px; }
.timeline { display: grid; }
.timeline-item { position: relative; display: grid; grid-template-columns: 16px 1fr auto; gap: 9px; min-height: 55px; }
.timeline-item:not(:last-child)::before { position: absolute; top: 15px; bottom: -1px; left: 5px; width: 1px; background: var(--line); content: ""; }
.timeline-item > i { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 3px; border: 3px solid #f5f5f2; border-radius: 50%; background: #929298; }
.timeline-item.running > i, .timeline-item.progress > i { background: var(--purple); }
.timeline-item.completed > i, .timeline-item.receipt > i, .timeline-item.ready > i { background: var(--green); }
.timeline-item.waiting_for_human > i, .timeline-item.approval > i { background: var(--amber); }
.timeline-item span { display: grid; align-content: start; gap: 4px; }
.timeline-item strong { font-size: 10px; }
.timeline-item small { color: #96969b; font-size: 9px; line-height: 1.45; }
.timeline-item time { color: #aaaab0; font-size: 8px; }

.task-actions {
  display: flex;
  gap: 8px;
  padding: 13px 18px calc(13px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
}
.task-actions button { flex: 1; min-height: 42px; border: 0; border-radius: 10px; background: #efefec; font-size: 10px; font-weight: 700; cursor: pointer; }
.task-actions button:first-child { background: #29292e; color: #fff; }
.task-actions button.danger-action { flex: 0 0 auto; width: 68px; background: var(--red-soft); color: var(--red); }
.task-actions button:disabled { opacity: .45; cursor: default; }

@media (max-width: 700px) {
  .mobile-main { width: calc(100% - 28px); padding-top: 20px; }
  .job-composer textarea { min-height: 92px; padding: 17px 15px 7px; font-size: 15px; }
  .composer-bottom { align-items: flex-end; padding: 4px 8px 8px; }
  .model-tool { max-width: 150px; }
  .task-summary { grid-template-columns: 31px minmax(0, 1fr) auto; min-height: 73px; }
  .task-inline { padding-left: 42px; }
  .task-meta em { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sheet-dialog { width: 100%; max-height: calc(100% - 30px); margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .sheet-card { padding: 28px 22px calc(24px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .task-dialog { width: 100%; height: 100%; margin: 0; border-radius: 0; }
  .task-detail-main { padding: 24px 19px 34px; }
}

@media (max-width: 390px) {
  .mobile-main { width: calc(100% - 22px); }
  .task-inline { padding-left: 36px; }
}

@media (prefers-reduced-motion: no-preference) {
  .task-row[data-status="running"] .task-state i,
  .task-row[data-status="background"] .task-state i { animation: work-pulse 1.8s ease-in-out infinite; }
  @keyframes work-pulse { 50% { box-shadow: 0 0 0 7px rgba(111, 61, 244, 0); } }
}

/* The phone home is a single dispatcher; job history stays behind Activity. */
.composer-dock {
  position: relative;
  width: 100%;
  margin: 0;
}
.composer-dock .job-composer textarea { min-height: 116px; max-height: 210px; }
.composer-left { display: flex; align-items: center; min-width: 0; }
.attach-tool { width: 34px; padding: 0; font-size: 23px; font-weight: 350; }
.attachment-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 0 0 7px 12px;
  padding: 7px 8px 7px 11px;
  border: 1px solid #ddd9e9;
  border-radius: 10px;
  background: #fff;
  color: #5f5a6e;
  font-size: 9px;
  box-shadow: 0 5px 18px rgba(33,27,48,.07);
}
.attachment-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-chip button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: #f0eef5; color: #77717f; }

.activity-shell { margin-top: 16px; }
.activity-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 0 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: #66666c;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.activity-toggle-meta { display: inline-flex; align-items: center; gap: 9px; color: #99999e; }
.activity-caret { display: inline-block; font-size: 16px; line-height: 1; transition: transform 160ms ease; }
.activity-toggle[aria-expanded="true"] .activity-caret { transform: rotate(180deg); }
.activity-drawer { padding: 4px 0 24px; }
.activity-drawer .notification-prompt { margin-top: 12px; }
.activity-drawer .job-group { margin-top: 18px; }
.activity-drawer .past-jobs { margin-top: 28px; }

.task-dialog { width: min(780px, 100%); height: min(940px, 100%); }
.task-detail { grid-template-rows: auto auto minmax(0, 1fr) auto; }
.task-detail > header { background: rgba(255,255,255,.94); backdrop-filter: blur(18px); }
.task-menu { color: #77777d; font-size: 12px; letter-spacing: .08em; }
.task-view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 7px 18px 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.task-view-tabs button {
  position: relative;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #96969b;
  font-size: 10px;
  font-weight: 700;
}
.task-view-tabs button.active { color: #26262b; }
.task-view-tabs button.active::after { position: absolute; right: 18%; bottom: -1px; left: 18%; height: 2px; border-radius: 2px; background: #29292e; content: ""; }
.task-detail-main { min-height: 0; padding: 0; background: #fbfbfa; }
.task-chat-pane { min-height: 100%; padding: 22px 19px 32px; }
.task-work-pane { padding: 25px 20px 38px; }
.job-conversation { display: grid; gap: 18px; }
.chat-turn { display: grid; gap: 5px; max-width: 88%; }
.chat-turn.user { justify-self: end; justify-items: end; }
.chat-turn.assistant { justify-self: start; }
.chat-turn .turn-bubble { padding: 11px 13px; border-radius: 17px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-turn.user .turn-bubble { border-bottom-right-radius: 5px; background: #eeeef2; color: #29292e; }
.chat-turn.assistant .turn-bubble { padding: 0; background: transparent; color: #303036; }
.chat-turn small { color: #aaaab0; font-size: 8px; }
.chat-turn.assistant small { display: inline-flex; align-items: center; gap: 5px; }
.chat-turn.assistant small::before { width: 12px; height: 12px; background: url("assets/polyswap-mark.png?v=2") center/contain no-repeat; content: ""; }
.chat-progress {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  max-width: 88%;
  color: #85858b;
  font-size: 9px;
  line-height: 1.5;
}
.chat-progress i { width: 15px; height: 15px; background: url("assets/polyswap-mark.png?v=2") center/contain no-repeat; }
.chat-progress.working i { animation: work-spin 2s linear infinite; }
@keyframes work-spin { to { transform: rotate(360deg); } }
.chat-media { overflow: hidden; max-width: 100%; border: 1px solid rgba(43,123,89,.16); border-radius: 15px; background: #fff; }
.chat-media .media-result { list-style: none; }
.task-chat-pane .approval-card { margin-top: 22px; }
.task-chat-pane .playback-controls { margin-top: 22px; }

.work-summary { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.work-summary > small { color: #99999f; font-size: 8px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.work-summary h2 { margin: 8px 0 0; font-size: 20px; font-weight: 650; letter-spacing: -.035em; line-height: 1.3; }
.work-summary p { margin: 9px 0 0; color: #77777d; font-size: 10px; line-height: 1.65; white-space: pre-wrap; }

.task-composer-footer { padding: 10px 13px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(18px); }
.followup-composer { overflow: hidden; border: 1px solid #dededa; border-radius: 16px; background: #fff; box-shadow: 0 7px 24px rgba(30,30,35,.06); }
.followup-composer textarea { display: block; width: 100%; min-height: 48px; max-height: 112px; resize: none; padding: 13px 13px 5px; border: 0; outline: 0; background: transparent; color: #29292e; font-size: 12px; line-height: 1.5; }
.followup-composer > div { display: flex; align-items: center; justify-content: space-between; padding: 3px 6px 6px; }
.task-model-button { max-width: 70%; height: 31px; overflow: hidden; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; color: #626269; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.task-model-button:hover { background: #f1f1ef; }
.followup-send { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #29292e; color: #fff; font-size: 18px; font-weight: 750; }
.followup-send:disabled { background: #c8c8c7; }
.task-composer-footer .task-actions { margin-top: 7px; padding: 0; border: 0; background: transparent; }

@media (max-width: 700px) {
  .mobile-main { width: calc(100% - 28px); padding-top: 24px; padding-bottom: calc(44px + env(safe-area-inset-bottom)); }
  .task-chat-pane { padding: 21px 17px 30px; }
  .task-live-pane,
  .task-files-pane,
  .task-proof-pane { padding: 20px 17px 32px; }
}

/* A phone job is a durable room: conversation, live work, artifacts, and proof. */
.task-detail > header div { min-width: 0; }
.task-detail > header small {
  display: block;
  width: min(320px, 52vw);
  overflow: hidden;
  color: #4b4b51;
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}
.task-detail > header strong { color: #98989d; font-size: 9px; font-weight: 600; }
.task-view-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.task-view-tabs button { min-width: 0; }
.task-view-tabs button.active::after { right: 20%; left: 20%; background: var(--purple); }

.task-live-pane,
.task-files-pane,
.task-proof-pane { min-height: 100%; padding: 25px 20px 38px; }

.agent-live-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 17px;
  min-height: 126px;
  margin-bottom: 23px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid #e1ddec;
  border-radius: 18px;
  background:
    radial-gradient(circle at 16% 20%, rgba(111, 61, 244, .10), transparent 38%),
    linear-gradient(145deg, #fff, #f6f3ff);
}
.agent-live-card > div:last-child { display: grid; min-width: 0; gap: 5px; }
.agent-live-card small,
.pane-heading > small,
.criteria-card > small {
  color: #7d6bb0;
  font-size: 8px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.agent-live-card strong { font-size: 13px; font-weight: 700; line-height: 1.45; }
.agent-live-card span { color: #8b8796; font-size: 8px; line-height: 1.5; }

.live-orbs {
  position: relative;
  width: 66px;
  height: 66px;
}
.live-orbs i {
  position: absolute;
  top: 25px;
  left: 25px;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(255,255,255,.82);
  border-radius: 50%;
  box-shadow: inset 2px 2px 5px rgba(255,255,255,.76), 0 5px 10px rgba(45,35,70,.16);
  transform: translate(var(--orb-x), var(--orb-y));
}
.live-orbs i:nth-child(1) { --orb-x: 0px; --orb-y: -25px; background: #ff781f; }
.live-orbs i:nth-child(2) { --orb-x: 21px; --orb-y: -12px; background: #ffc51b; }
.live-orbs i:nth-child(3) { --orb-x: 21px; --orb-y: 13px; background: #24c6a4; }
.live-orbs i:nth-child(4) { --orb-x: 0px; --orb-y: 25px; background: #208ce8; }
.live-orbs i:nth-child(5) { --orb-x: -21px; --orb-y: 13px; background: #7244ef; }
.live-orbs i:nth-child(6) { --orb-x: -21px; --orb-y: -12px; background: #f32686; }
.agent-live-card[data-status="completed"] .live-orbs,
.agent-live-card[data-status="completed_unverified"] .live-orbs,
.agent-live-card[data-status="failed"] .live-orbs,
.agent-live-card[data-status="cancelled"] .live-orbs { filter: saturate(.72); }

.pane-heading { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.pane-heading h2 { margin: 8px 0 0; font-size: 21px; font-weight: 670; letter-spacing: -.04em; line-height: 1.25; }
.pane-heading p { margin: 8px 0 0; color: #85858b; font-size: 10px; line-height: 1.65; }

.workspace-facts,
.proof-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--line);
}
.workspace-facts div,
.proof-facts div { min-height: 67px; padding: 13px; background: #fff; }
.workspace-facts dt,
.proof-facts dt { color: #a0a0a5; font-size: 7px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.workspace-facts dd,
.proof-facts dd { margin: 7px 0 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 680; line-height: 1.4; }

.artifact-list { display: grid; gap: 8px; }
.artifact-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 65px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}
.artifact-row > i { color: #aaaab0; font-size: 8px; font-style: normal; }
.artifact-row > span { display: grid; min-width: 0; gap: 4px; }
.artifact-row strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.artifact-row small { overflow: hidden; color: #96969c; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.artifact-row em { color: #9993aa; font-size: 8px; font-style: normal; }
a.artifact-row:hover { border-color: #d9d1ee; background: #fbfaff; }
.artifact-empty {
  display: grid;
  gap: 6px;
  padding: 24px 18px;
  border: 1px dashed #dcdbd6;
  border-radius: 14px;
  color: #8e8e94;
  text-align: center;
}
.artifact-empty strong { color: #55555b; font-size: 10px; }
.artifact-empty span { font-size: 9px; line-height: 1.55; }

.criteria-card { margin-top: 18px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.criteria-card ul { display: grid; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.criteria-card li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; color: #5f5f65; font-size: 9px; line-height: 1.5; }
.criteria-card li i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 9px; font-style: normal; font-weight: 800; }
.task-proof-pane .receipt-card { margin-top: 18px; }

@media (prefers-reduced-motion: no-preference) {
  .agent-live-card[data-status="queued"] .live-orbs,
  .agent-live-card[data-status="claimed"] .live-orbs,
  .agent-live-card[data-status="running"] .live-orbs,
  .agent-live-card[data-status="background"] .live-orbs { animation: live-orbit 8s linear infinite; }
  .agent-live-card[data-status="running"] .live-orbs i,
  .agent-live-card[data-status="background"] .live-orbs i { animation: orb-breathe 1.9s ease-in-out infinite alternate; }
  .agent-live-card[data-status="running"] .live-orbs i:nth-child(2),
  .agent-live-card[data-status="background"] .live-orbs i:nth-child(2) { animation-delay: -.35s; }
  .agent-live-card[data-status="running"] .live-orbs i:nth-child(3),
  .agent-live-card[data-status="background"] .live-orbs i:nth-child(3) { animation-delay: -.7s; }
  .agent-live-card[data-status="running"] .live-orbs i:nth-child(4),
  .agent-live-card[data-status="background"] .live-orbs i:nth-child(4) { animation-delay: -1.05s; }
  .agent-live-card[data-status="running"] .live-orbs i:nth-child(5),
  .agent-live-card[data-status="background"] .live-orbs i:nth-child(5) { animation-delay: -1.4s; }
  .agent-live-card[data-status="running"] .live-orbs i:nth-child(6),
  .agent-live-card[data-status="background"] .live-orbs i:nth-child(6) { animation-delay: -1.75s; }
  @keyframes live-orbit { to { transform: rotate(360deg); } }
  @keyframes orb-breathe { to { width: 18px; height: 18px; margin: -1px; filter: saturate(1.12); } }
}

@media (max-width: 390px) {
  .task-view-tabs { padding-right: 8px; padding-left: 8px; }
  .task-view-tabs button { font-size: 9px; }
  .agent-live-card { grid-template-columns: 67px minmax(0, 1fr); gap: 12px; padding: 15px; }
}
