/* source/styles.css */
:root {
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: #e8ebf2;
  background: #080a0f;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 50% -20%,
      #24214a 0,
      #0b0d13 36%,
      #080a0f 70%);
}
button,
input,
textarea {
  font: inherit;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid #9b8eff;
  outline-offset: 2px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid #272b39;
  border-radius: 22px;
  background: #10131b;
  box-shadow: 0 30px 90px #0008;
  display: grid;
  gap: 22px;
}
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background:
    linear-gradient(
      145deg,
      #8c7bff,
      #5f4ae6);
  font-weight: 900;
  color: #fff;
}
.brand-mark.small {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: .16em;
  color: #9a91d8;
  font-weight: 800;
  margin: 0 0 6px;
}
.login-card h1,
.thread-head h1 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -.03em;
}
.muted {
  color: #9299aa;
  line-height: 1.55;
}
.mini {
  font-size: 12px;
}
.login-card label {
  display: grid;
  gap: 8px;
  color: #bfc5d2;
  font-size: 14px;
}
.login-card input {
  border: 1px solid #34394a;
  background: #0b0e15;
  color: #fff;
  border-radius: 12px;
  padding: 13px 14px;
}
.primary,
.ghost,
.danger-ghost,
.starter-grid button {
  border-radius: 10px;
  cursor: pointer;
}
.primary {
  border: 0;
  padding: 13px 16px;
  background: #8172f5;
  color: #fff;
  font-weight: 800;
}
.primary:disabled {
  opacity: .5;
}
.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
header {
  height: 66px;
  border-bottom: 1px solid #1d2130;
  background: #0b0e15ef;
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
}
.brand > div {
  display: grid;
}
.brand span {
  font-size: 12px;
  color: #8f96a8;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.secure-dot {
  font-size: 12px;
  color: #8ba795;
}
.ghost {
  background: transparent;
  color: #b9c0cf;
  padding: 8px 10px;
  border: 1px solid #2b3040;
}
.history-toggle {
  display: none;
}
.workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 66px);
}
.history {
  border-right: 1px solid #1b1f2b;
  background: #0a0d13;
  position: sticky;
  top: 66px;
  height: calc(100vh - 66px);
  overflow: auto;
  padding: 16px 12px;
}
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #c8ceda;
  padding: 4px 7px 12px;
}
.history-head span {
  font-size: 11px;
  color: #7d8493;
}
.history nav {
  display: grid;
  gap: 5px;
}
.history nav button {
  display: grid;
  gap: 5px;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: #bac0cd;
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
}
.history nav button:hover {
  background: #121722;
  border-color: #262c3c;
}
.history nav button span {
  font-size: 12px;
  line-height: 1.35;
}
.history nav button small {
  color: #6f7788;
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: #7b8393;
}
.dot.completed {
  background: #5fb77c;
}
.dot.running,
.dot.retry_wait {
  background: #d0ad55;
}
.dot.failed {
  background: #e26978;
}
.thread-root {
  min-width: 0;
}
.thread-viewport {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 38px 24px 190px;
}
.thread-head {
  text-align: center;
  padding: 12px 0 30px;
}
.thread-head h1 {
  font-size: 33px;
}
.messages {
  display: grid;
  gap: 26px;
}
.message {
  max-width: 91%;
  display: grid;
  gap: 8px;
  scroll-margin-top: 100px;
}
.message.user {
  justify-self: end;
}
.message.assistant {
  justify-self: start;
  width: 100%;
}
.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #81889a;
  font-weight: 700;
}
.message.user .message-meta {
  justify-content: flex-end;
}
.message-text {
  white-space: pre-wrap;
  line-height: 1.65;
  font-size: 15px;
}
.message.user .message-text {
  background: #6e5fe5;
  color: #fff;
  border-radius: 18px 18px 5px 18px;
  padding: 12px 15px;
}
.state,
.attempt {
  padding: 3px 8px;
  border: 1px solid #34394a;
  border-radius: 999px;
  font-size: 10px;
  color: #bfc4d1;
}
.state-completed {
  border-color: #28533b;
  color: #77d49a;
}
.state-failed {
  border-color: #61323b;
  color: #ff8795;
}
.state-running,
.state-queued,
.state-retry_wait {
  border-color: #5b4e28;
  color: #e0c46f;
}
.timeline {
  margin-top: 8px;
  border-left: 1px solid #2c3140;
  padding-left: 15px;
  display: grid;
  gap: 8px;
}
.timeline-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  gap: 8px;
  align-items: center;
  color: #868e9f;
  font-size: 12px;
}
.timeline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8172f5;
  margin-left: -19px;
}
.timeline-row time {
  font-size: 10px;
  color: #5f6676;
}
.notice {
  margin-top: 8px;
  padding: 9px 11px;
  border: 1px solid #544a2a;
  background: #17150e;
  border-radius: 9px;
  color: #d8c67e;
  font-size: 12px;
}
.notice.warn {
  border-color: #69414a;
  background: #1b1115;
  color: #e7a3ae;
}
.evidence {
  margin-top: 9px;
  border: 1px solid #282e3d;
  border-radius: 10px;
  background: #0d1118;
}
.evidence summary {
  cursor: pointer;
  padding: 10px 12px;
  color: #aeb6c5;
  font-size: 12px;
  font-weight: 700;
}
.evidence-grid {
  border-top: 1px solid #282e3d;
  padding: 10px;
  display: grid;
  gap: 10px;
}
.evidence-grid > div {
  display: grid;
  gap: 5px;
}
.evidence-grid b {
  font-size: 11px;
  color: #8f97a8;
}
.evidence pre {
  max-height: 240px;
  overflow: auto;
  margin: 0;
  background: #080b10;
  border-radius: 7px;
  padding: 8px;
  color: #aeb8ca;
  font-size: 10px;
  white-space: pre-wrap;
}
.evidence code {
  color: #f0c778;
  font-size: 11px;
}
.danger-ghost {
  justify-self: start;
  margin-top: 5px;
  background: #26151a;
  color: #ff8795;
  border: 1px solid #5c2934;
  padding: 7px 10px;
}
.approval-card {
  margin-top: 10px;
  border: 1px solid #735d25;
  background: #19160f;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
  max-width: 650px;
}
.approval-head {
  display: flex;
  justify-content: space-between;
  color: #f1d27a;
}
.approval-head span {
  font-size: 10px;
  border: 1px solid #665522;
  border-radius: 999px;
  padding: 3px 7px;
}
.approval-summary {
  color: #e9e2cf;
  font-size: 14px;
}
.approval-detail {
  display: flex;
  gap: 10px;
  font-size: 12px;
  color: #8e94a2;
}
.approval-detail b {
  color: #c9ced8;
}
.approval-card pre {
  margin: 0;
  background: #0f1117;
  border: 1px solid #2a2f3c;
  border-radius: 9px;
  padding: 9px;
  color: #bbc3d2;
  overflow: auto;
  font-size: 11px;
}
.approval-actions {
  display: flex;
  gap: 8px;
}
.approval-actions button {
  border-radius: 9px;
  padding: 9px 12px;
  font-weight: 800;
  cursor: pointer;
}
.approve {
  border: 0;
  background: #d0ae4f;
  color: #17130a;
}
.reject {
  background: #2b2023;
  color: #ff9eaa;
  border: 1px solid #5b3139;
}
.approval-card small {
  color: #82785f;
}
.attachment-summary {
  font-size: 11px;
  color: #a9b1c2;
}
.composer-zone {
  position: fixed;
  bottom: 0;
  left: 260px;
  right: 0;
  padding: 18px 20px 24px;
  background: linear-gradient(transparent, #080a0f 30%);
  z-index: 20;
}
.composer-zone > * {
  width: min(870px, 100%);
  margin-left: auto;
  margin-right: auto;
}
.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  border: 1px solid #2c3141;
  background: #11151e;
  border-radius: 18px;
  padding: 9px 10px;
  box-shadow: 0 16px 55px #0009;
}
.composer-input {
  flex: 1;
  resize: none;
  max-height: 180px;
  min-height: 43px;
  border: 0;
  background: transparent;
  color: #eef1f7;
  outline: none;
  padding: 11px 8px;
}
.attach,
.send {
  border: 0;
  cursor: pointer;
  border-radius: 11px;
  min-width: 42px;
  height: 42px;
}
.attach {
  background: #1b2030;
  color: #b5bdd0;
  font-size: 23px;
}
.send {
  background: #8172f5;
  color: #fff;
  font-weight: 800;
  padding: 0 15px;
}
.send.cancel {
  background: #3d2930;
  color: #ffabb5;
}
.composer-note {
  text-align: center;
  color: #5f6675;
  font-size: 10px;
  padding-top: 7px;
}
.upload-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
}
.upload-list span {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #1a1f2c;
  border: 1px solid #303649;
  border-radius: 999px;
  padding: 6px 10px;
  color: #bac1d0;
  font-size: 12px;
}
.upload-list button {
  border: 0;
  background: transparent;
  color: #8f97a9;
  cursor: pointer;
}
.uploading {
  font-size: 11px;
  color: #9ca5b8;
  margin-bottom: 6px;
}
.error-box {
  background: #32181f;
  border: 1px solid #64303c;
  color: #ff9cab;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}
.error-box.compact {
  margin-top: 6px;
}
.empty {
  text-align: center;
  color: #777f91;
  padding: 38px;
}
.starter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.starter-grid button {
  padding: 18px;
  text-align: left;
  background: #121722;
  border: 1px solid #282e3e;
  color: #cbd1de;
}
.starter-grid button:hover {
  border-color: #5f54a7;
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .history {
    position: fixed;
    top: 66px;
    left: 0;
    bottom: 0;
    width: min(82vw, 310px);
    height: auto;
    z-index: 29;
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 24px 0 60px #0009;
  }
  .history.open {
    transform: translateX(0);
  }
  .history-toggle {
    display: inline-block;
  }
  .composer-zone {
    left: 0;
  }
}
@media (max-width: 680px) {
  header {
    padding: 0 12px;
  }
  .secure-dot {
    display: none;
  }
  .thread-viewport {
    padding: 24px 13px 180px;
  }
  .thread-head h1 {
    font-size: 27px;
  }
  .message {
    max-width: 97%;
  }
  .starter-grid {
    grid-template-columns: 1fr;
  }
  .composer-zone {
    padding: 14px 9px 16px;
  }
  .composer-note {
    display: none;
  }
  .approval-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .evidence pre {
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.new-chat {
  font-size: 12px;
  padding: 6px 9px;
  border: 1px solid #38354d;
  border-radius: 8px;
  background: #191827;
  color: #ddd;
  cursor: pointer;
}
.conversation-list {
  max-height: 34vh;
  overflow: auto;
  border-bottom: 1px solid #262534;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.conversation-list button.selected {
  background: #26233c;
  border-color: #7657e8;
}
.conversation-list button small {
  display: block;
  color: #8d8aa0;
  margin-top: 4px;
}
.work-head {
  margin-top: 8px;
}
.search-box {
  position: relative;
  margin: 0 4px 10px;
}
.search-box input {
  width: 100%;
  border: 1px solid #2b3040;
  background: #0f131b;
  color: #dce1eb;
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 12px;
}
.search-results {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: 40px;
  max-height: 320px;
  overflow: auto;
  background: #10141d;
  border: 1px solid #303649;
  border-radius: 10px;
  box-shadow: 0 18px 50px #000b;
  padding: 5px;
}
.search-results button {
  width: 100%;
  display: grid;
  gap: 3px;
  text-align: left;
  border: 0;
  background: transparent;
  color: #d8dce5;
  padding: 8px;
  border-radius: 7px;
  cursor: pointer;
}
.search-results button:hover {
  background: #1b2130;
}
.search-results b {
  font-size: 11px;
}
.search-results span {
  font-size: 11px;
  color: #9fa7b8;
}
.search-results small {
  font-size: 9px;
  color: #6f7788;
}
.status-pill {
  border: 1px solid #304036;
  background: #101812;
  color: #a9cdb4;
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
}
.status-pill.warn {
  border-color: #5b4930;
  background: #1b160e;
  color: #e1c07b;
}
.provider-panel {
  position: fixed;
  z-index: 45;
  right: 18px;
  top: 72px;
  width: min(430px, calc(100vw - 36px));
  padding: 15px;
  border: 1px solid #303648;
  border-radius: 14px;
  background: #11151e;
  box-shadow: 0 18px 60px #0009;
  display: grid;
  gap: 9px;
}
.provider-panel div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
}
.provider-panel b {
  color: #cdd3df;
}
.provider-panel span {
  color: #99a2b4;
  text-align: right;
}
.provider-panel small {
  border-top: 1px solid #292f3e;
  padding-top: 9px;
  color: #747e90;
  line-height: 1.45;
}
.notice.info {
  border-color: #30465e;
  background: #0f1822;
  color: #9fc4e7;
}
.offline-banner {
  position: fixed;
  z-index: 46;
  top: 66px;
  left: 260px;
  right: 0;
  text-align: center;
  padding: 8px 12px;
  background: #291d0e;
  border-bottom: 1px solid #65471f;
  color: #edc27b;
  font-size: 12px;
}
.offline-banner + .provider-panel {
  top: 104px;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid #9b8cff;
  outline-offset: 2px;
}
.composer :disabled,
.new-chat:disabled {
  cursor: not-allowed;
  opacity: .48;
}
@media (max-width: 900px) {
  .offline-banner {
    left: 0;
  }
}
@media (max-width: 680px) {
  .status-pill {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .header-actions {
    gap: 5px;
  }
  .provider-panel {
    right: 8px;
    width: calc(100vw - 16px);
  }
  .provider-panel div {
    display: grid;
    gap: 3px;
  }
  .provider-panel span {
    text-align: left;
    overflow-wrap: anywhere;
  }
}
.conversation-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-radius: 9px;
  border: 1px solid transparent;
}
.conversation-row.selected {
  background: #26233c;
  border-color: #7657e8;
}
.conversation-open {
  min-width: 0;
}
.conversation-actions {
  display: flex;
  padding-right: 4px;
}
.conversation-actions button {
  border: 0;
  background: transparent;
  color: #7f8799;
  padding: 5px;
  cursor: pointer;
}
.conversation-actions button:hover {
  color: #ddd;
}
.attachment-history {
  margin: 8px 4px 12px;
  border: 1px solid #272d3b;
  border-radius: 9px;
  padding: 7px;
}
.attachment-history summary {
  cursor: pointer;
  color: #9fa7b7;
  font-size: 11px;
}
.attachment-history summary span {
  float: right;
}
.attachment-history p {
  display: grid;
  gap: 2px;
  margin: 7px 0;
  padding-top: 6px;
  border-top: 1px solid #202633;
  color: #aeb5c4;
  font-size: 10px;
}
.attachment-history p.deleted {
  opacity: .48;
}
.attachment-history small {
  color: #737c8e;
}
