@font-face {
  font-family: Montserrat;
  src: url('/assets/fonts/montserrat-cyrillic-variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: Montserrat;
  src: url('/assets/fonts/montserrat-latin-variable.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #141719;
  --ink-soft: #3f4549;
  --black: #090a0b;
  --black-soft: #121416;
  --red: #e32318;
  --red-dark: #bb1d15;
  --canvas: #f1f2f2;
  --surface: #ffffff;
  --surface-muted: #f7f7f6;
  --surface-strong: #e7e9e9;
  --line: #d8dcde;
  --line-strong: #aeb4b7;
  --muted: #62696d;
  --dark-muted: #a7adb0;
  --success: #35b674;
  --danger: #b72e24;
  --shadow: 0 18px 50px rgba(12, 15, 17, .18);
  color: var(--ink);
  background: var(--canvas);
  font-family: Montserrat, Arial, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
}

body {
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select { font: inherit; color: inherit; }

button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }

* {
  scrollbar-width: thin;
  scrollbar-color: #a9afb2 transparent;
}

*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: 8px; background: #a9afb2; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }
::selection { background: var(--red); color: #fff; }
[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;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: -80px;
  left: 16px;
  border-radius: 6px;
  background: #fff;
  padding: 10px 14px;
}

.skip-link:focus { top: 16px; }

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.environment-badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  gap: 7px;
  border: 1px solid #4b5053;
  border-radius: 999px;
  padding: 4px 10px;
  color: #f6f6f5;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.environment-badge i,
.mode-label i {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(53, 182, 116, .12);
}

.environment-badge--dark { border-color: #62676a; }

.button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 9px 17px;
  font-weight: 650;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.button--primary { background: var(--ink); color: #fff; }
.button--primary:hover { background: #000; }
.button--secondary { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.button--secondary:hover { border-color: var(--ink); }
.button--wide { display: flex; width: 100%; min-height: 52px; align-items: center; justify-content: space-between; padding-inline: 18px; }
.button--ghost { border-color: #565b5e; color: #fff; }
.button--ghost:hover { border-color: #fff; background: #181b1d; }
.button--small { min-height: 34px; padding: 6px 12px; font-size: 11px; }

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  transition: background .16s ease, color .16s ease;
}

.icon-button:hover { background: rgba(255, 255, 255, .08); }
.icon-button--light { border: 1px solid #3d4144; }

.alert {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
}

.alert--error { border: 1px solid #dfaaa5; background: #fff0ee; color: #75180f; }

/* Authentication */

.auth-view {
  min-height: 100dvh;
  background: var(--surface);
}

.auth-header {
  display: flex;
  height: 84px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #282b2d;
  background: var(--black);
  padding: 12px clamp(24px, 4vw, 64px);
  color: #fff;
}

.auth-header img { width: 48px; height: 55px; }

.auth-layout {
  display: grid;
  min-height: calc(100dvh - 84px);
  grid-template-columns: minmax(460px, 1.05fr) minmax(420px, .95fr);
}

.auth-story {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  background: var(--black-soft);
  padding: clamp(48px, 6vw, 92px);
  color: #fff;
}

.auth-story::before {
  position: absolute;
  top: clamp(48px, 6vw, 92px);
  left: clamp(48px, 6vw, 92px);
  width: 48px;
  height: 2px;
  background: var(--red);
  content: '';
}

.auth-story h2 {
  max-width: 700px;
  margin: 44px 0 0;
  font-size: clamp(44px, 5.5vw, 82px);
  font-weight: 690;
  letter-spacing: -.035em;
  line-height: .98;
}

.auth-story p {
  max-width: 440px;
  margin: 26px 0 0;
  color: #bbc0c2;
  font-size: 14px;
  line-height: 1.75;
}

.auth-story .auth-story__signal {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: #d9dcdd;
  font-size: 11px;
}

.auth-story__signal span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: clamp(32px, 6vw, 92px);
}

.login-card { width: 100%; max-width: 430px; }

.login-card h1 {
  margin: 0;
  font-size: clamp(32px, 3.7vw, 48px);
  font-weight: 680;
  letter-spacing: -.03em;
  line-height: 1.08;
}

.auth-copy {
  margin: 18px 0 30px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.login-card .alert { margin-bottom: 20px; }
.field { display: block; margin: 18px 0; }
.field span { display: block; margin-bottom: 8px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }

.field input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 0 15px;
}

.field input:hover { border-color: #777e82; }
.field input:focus { border-color: var(--ink); outline: 0; box-shadow: 0 0 0 3px rgba(20, 23, 25, .1); }

.access-note {
  margin: 24px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

/* Workspace shell */

.workspace { height: 100dvh; overflow: hidden; background: var(--canvas); }

.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  height: 68px;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid #282b2d;
  background: var(--black);
  padding: 8px 18px;
  color: #fff;
}

.brand {
  display: flex;
  min-width: 220px;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand img { width: 38px; height: 44px; }
.brand span { display: flex; flex-direction: column; }
.brand strong { font-size: 13px; font-weight: 680; }
.brand small { margin-top: 1px; color: var(--dark-muted); font-size: 9px; }

.topbar__meta { display: flex; flex: 1; align-items: center; gap: 14px; }
.coverage-compact { color: var(--dark-muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.account { display: flex; align-items: center; gap: 12px; }
.account__name { max-width: 220px; overflow: hidden; color: #e6e8e9; font-size: 11px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.sources-button,
.mobile-only { display: none; }

.workspace-grid {
  display: grid;
  height: calc(100dvh - 68px);
  grid-template-columns: 248px minmax(520px, 1fr) 360px;
}

/* Conversation rail */

.conversation-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #282b2d;
  background: #101214;
  color: #fff;
}

.rail-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #282b2d;
  padding: 14px 14px 14px 18px;
}

.rail-header h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.conversation-list { flex: 1; overflow: auto; padding: 10px 8px; }

.conversation-item {
  width: 100%;
  margin: 2px 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 12px 11px;
  color: #c9cdcf;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.conversation-item:hover { background: #191c1e; color: #fff; }
.conversation-item.is-active { border-color: #353a3d; background: #202326; color: #fff; }
.conversation-item.is-active::before { display: inline-block; width: 5px; height: 5px; margin: 0 7px 1px 0; border-radius: 50%; background: var(--red); content: ''; }
.conversation-item strong { display: inline; font-size: 11px; font-weight: 650; }
.conversation-item span { display: block; margin: 5px 0 0 12px; color: #8f9699; font-size: 9px; font-variant-numeric: tabular-nums; }
.job-list-item strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.conversation-empty { padding: 24px 12px; color: #909699; font-size: 11px; line-height: 1.7; }

.rail-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px solid #282b2d;
  padding: 16px 18px;
  color: #959b9e;
  font-size: 9px;
}

.status-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--success); }

/* Main conversation */

.chat-main {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  background: var(--canvas);
}

.workspace-view {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.chat-heading {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .8);
  padding: 14px clamp(22px, 3vw, 40px);
}

.heading-primary {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 18px;
}

.view-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 3px;
}

.view-switch button {
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 5px 11px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.view-switch button[aria-selected="true"] {
  background: var(--black);
  color: #fff;
  box-shadow: 0 2px 7px rgba(10, 12, 13, .16);
}

.chat-heading h1 {
  flex: 1;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  margin: 0;
  font-size: clamp(19px, 1.8vw, 23px);
  font-weight: 660;
  letter-spacing: -.025em;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.chat-alert { margin: 14px clamp(22px, 3vw, 40px) 0; }

.messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 32px clamp(22px, 4vw, 56px) 28px;
  scroll-behavior: smooth;
}

.empty-state {
  max-width: 720px;
  margin: min(11vh, 92px) auto 28px;
  text-align: center;
}

.empty-state__logo { display: block; width: 44px; height: 50px; margin: 0 auto 22px; }

.empty-state h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 44px);
  font-weight: 660;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.empty-state > p {
  max-width: 590px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
}

.suggestions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
}

.suggestions button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 13px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 560;
  transition: border-color .16s ease, color .16s ease, transform .16s ease;
}

.suggestions button:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }

.message {
  display: grid;
  max-width: 880px;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  margin: 0 auto 24px;
}

.message--user { grid-template-columns: minmax(0, 700px); justify-content: end; }

.message__avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  background: var(--black);
}

.message__avatar img { width: 26px; height: 30px; object-fit: contain; }
.message__body { min-width: 0; }

.message--assistant .message__body {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 17px 18px 18px;
}

.message__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.message__meta strong { color: var(--ink); font-size: 10px; font-weight: 680; }
.message__meta .answer-method { border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; background: var(--surface-muted); }

.message__text {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.72;
  overflow-wrap: anywhere;
}

.message__text p { margin: 0 0 10px; }
.message__text p:last-child { margin-bottom: 0; }
.message__text ul,
.message__text ol { margin: 8px 0 10px; padding-left: 21px; }
.message__text li { margin: 5px 0; padding-left: 2px; }

.message--user .message__body {
  border-radius: 8px;
  background: #e2e4e4;
  padding: 13px 15px;
}

.message--user .message__meta { justify-content: flex-end; margin-bottom: 7px; }

.inline-citation {
  display: inline-grid;
  min-width: 28px;
  min-height: 22px;
  place-items: center;
  border: 1px solid #c6cacc;
  border-radius: 5px;
  background: var(--surface-muted);
  padding: 1px 5px;
  color: var(--red-dark);
  font-size: 9px;
  font-weight: 720;
  vertical-align: 1px;
}

.inline-citation:hover { border-color: var(--red); }
.message__sources { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.source-chip {
  min-height: 30px;
  border: 1px solid #c5c9cb;
  border-radius: 6px;
  background: var(--surface-muted);
  padding: 5px 9px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 650;
}

.source-chip:hover { border-color: var(--red); color: var(--red-dark); }
.message__thinking { color: var(--ink-soft); font-size: 11px; }
.typing { display: inline-flex; gap: 4px; margin-left: 8px; vertical-align: 1px; }
.typing span { width: 4px; height: 4px; border-radius: 50%; background: var(--red); animation: pulse .9s infinite alternate cubic-bezier(.16, 1, .3, 1); }
.typing span:nth-child(2) { animation-delay: .16s; }
.typing span:nth-child(3) { animation-delay: .32s; }

@keyframes pulse { to { opacity: .22; transform: translateY(-2px); } }

/* Composer */

.composer {
  border-top: 1px solid var(--line);
  background: rgba(247, 247, 246, .98);
  padding: 11px clamp(18px, 3vw, 38px) 13px;
}

.composer__inner { max-width: 920px; margin: 0 auto; }
.filter-row { display: flex; align-items: end; gap: 9px; margin-bottom: 8px; }
.filter-row label { display: flex; align-items: center; gap: 7px; }
.filter-row label span { color: var(--muted); font-size: 9px; }

.filter-row select {
  height: 32px;
  max-width: 170px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 26px 0 9px;
  font-size: 10px;
}

.filter-row select:hover { border-color: #7c8386; }

.text-button {
  min-height: 32px;
  border: 0;
  background: transparent;
  padding: 0 4px;
  color: var(--muted);
  font-size: 9px;
  text-decoration: underline;
  text-decoration-color: #a4aaad;
  text-underline-offset: 3px;
}

.text-button:hover { color: var(--ink); text-decoration-color: var(--ink); }

.composer-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 9px 9px 9px 14px;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.composer-box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 23, 25, .08); }

.composer textarea {
  width: 100%;
  min-height: 49px;
  max-height: 150px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 5px 0;
  font-size: 12px;
  line-height: 1.55;
}

.composer textarea::placeholder { color: #787f82; opacity: 1; }
.composer-actions { display: flex; flex-direction: column; align-items: end; justify-content: space-between; gap: 7px; }
.composer-actions > span { color: #777e82; font-size: 8px; font-variant-numeric: tabular-nums; }

.send-button {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: var(--black);
  padding: 7px 11px 7px 13px;
  color: #fff;
  font-size: 10px;
  font-weight: 680;
  transition: background .16s ease, transform .16s ease;
}

.send-button:hover { background: #24282a; transform: translateY(-1px); }
.send-button .icon { width: 15px; height: 15px; }
.composer-note { margin: 6px 2px 0; color: var(--muted); font-size: 8px; }

/* Multi-step work */

.work-view { background: var(--canvas); }

.work-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: clamp(24px, 4vw, 52px) clamp(22px, 5vw, 72px) 64px;
}

.work-start,
.job-detail { width: min(900px, 100%); margin: 0 auto; }

.work-intro {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.work-intro__mark { border-radius: 6px; background: var(--red); }

.work-intro h2 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 670;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.work-intro p {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.job-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(18px, 3vw, 30px);
}

.job-modes {
  display: grid;
  margin: 0 0 24px;
  padding: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  border: 0;
}

.job-modes legend,
.job-brief > span {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 680;
}

.job-modes legend { grid-column: 1 / -1; }

.job-mode {
  position: relative;
  display: grid;
  min-height: 118px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 15px;
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.job-mode:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.job-mode.is-active { border-color: var(--ink); background: #fff; box-shadow: inset 0 -3px 0 var(--red); }
.job-mode input { position: absolute; opacity: 0; pointer-events: none; }

.job-mode__icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
}

.job-mode__icon .icon { width: 16px; height: 16px; }
.job-mode strong { margin-top: 10px; font-size: 12px; font-weight: 690; }
.job-mode small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.job-brief { display: block; }

.job-brief textarea {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: 0;
  background: var(--surface-muted);
  padding: 14px 15px;
  font-size: 12px;
  line-height: 1.65;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.job-brief textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(20, 23, 25, .08); }
.job-brief textarea::placeholder { color: #777e82; opacity: 1; }

.job-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
}

.job-filters { margin: 0; }
.work-submit { display: inline-flex; min-width: 188px; align-items: center; justify-content: space-between; gap: 18px; }
.work-submit .icon { width: 16px; height: 16px; }
.job-note { margin: 13px 0 0; color: var(--muted); font-size: 9px; }

.job-detail__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}

.job-detail__header h2 {
  max-width: 760px;
  margin: 10px 0 0;
  font-size: clamp(24px, 2.25vw, 31px);
  font-weight: 670;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.job-detail__header p { margin: 9px 0 0; color: var(--muted); font-size: 10px; }

.job-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  background: #e5f5ec;
  padding: 5px 9px;
  color: #176139;
  font-size: 9px;
  font-weight: 700;
}

.job-status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ''; }
.job-status.is-running { background: #fff3dd; color: #8a5500; }
.job-status.is-failed { background: #fff0ee; color: var(--danger); }

.job-section {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: clamp(18px, 3vw, 26px);
}

.job-section__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.job-section__heading h3 { margin: 0; font-size: 15px; font-weight: 680; }
.job-section__heading span { color: var(--muted); font-size: 9px; }
.job-steps { margin: 4px 0 0; padding: 0; list-style: none; }

.job-step {
  position: relative;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 15px 0;
}

.job-step + .job-step { border-top: 1px solid #eceeee; }

.job-step__number {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--black);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
}

.job-step strong { display: block; font-size: 11px; font-weight: 680; }
.job-step p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.job-step__state { color: #22754a; font-size: 9px; font-weight: 680; white-space: nowrap; }

.job-answer { padding-top: 18px; color: var(--ink); font-size: 13px; line-height: 1.75; }
.job-answer p { margin: 0 0 11px; }
.job-answer ul,
.job-answer ol { margin: 9px 0 12px; padding-left: 22px; }
.job-answer li { margin: 6px 0; }

.job-gaps {
  margin-top: 18px;
  border: 1px solid #ead7a6;
  border-radius: 6px;
  background: #fff8e9;
  padding: 12px 14px;
  color: #594313;
  font-size: 10px;
  line-height: 1.65;
}

/* Evidence panel */

.sources-panel {
  position: relative;
  z-index: 20;
  display: flex;
  min-width: 0;
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--surface-muted);
}

.sources-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 14px 18px;
}

.sources-header h2 { margin: 0; font-size: 17px; font-weight: 650; letter-spacing: -.015em; }

.sources-header h2 span {
  display: inline-grid;
  min-width: 25px;
  height: 25px;
  margin-left: 5px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 10px;
  font-weight: 620;
  vertical-align: 2px;
}

.sources-close { display: none; }
.source-list { flex: 1; min-height: 0; overflow: auto; padding: 12px; }

.source-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: rgba(255, 255, 255, .45);
  padding: 20px;
  color: var(--muted);
}

.source-empty span { color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.source-empty p { margin: 8px 0 0; font-size: 9px; line-height: 1.65; }

.source-card {
  margin-bottom: 9px;
  scroll-margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
  transition: border-color .16s ease, transform .16s ease;
}

.source-card:hover { border-color: #b6bbbe; transform: translateY(-1px); }
.source-card.is-active { border-color: var(--red); }
.source-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.source-id {
  display: grid;
  width: 29px;
  height: 25px;
  flex: 0 0 29px;
  place-items: center;
  border-radius: 5px;
  background: var(--black);
  color: #fff;
  font-size: 9px;
  font-weight: 720;
}

.source-brand { flex: 1; overflow: hidden; color: var(--muted); font-size: 9px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.source-card h3 { margin: 11px 0 8px; font-size: 12px; font-weight: 680; line-height: 1.42; }
.source-meta { display: flex; flex-wrap: wrap; gap: 5px; }

.source-meta span {
  border-radius: 5px;
  background: var(--surface-strong);
  padding: 3px 7px;
  color: var(--ink-soft);
  font-size: 8px;
}

.source-excerpt {
  display: -webkit-box;
  overflow: hidden;
  margin: 12px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: #4b5154;
  font-size: 10px;
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 10;
}

.source-excerpt.is-expanded { display: block; overflow: visible; }

.source-toggle {
  min-height: 30px;
  margin-top: 9px;
  border: 0;
  border-radius: 5px;
  background: var(--surface-strong);
  padding: 5px 8px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 650;
}

.source-toggle:hover { background: #dde0e1; color: var(--ink); }

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.source-link:hover { color: var(--red-dark); }
.source-link .icon { width: 13px; height: 13px; }

.coverage-panel {
  border-top: 1px solid var(--line);
  padding: 12px 16px 15px;
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.coverage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 9px; }
.coverage-grid div { border-left: 1px solid #c7cbcd; padding-left: 7px; }
.coverage-grid strong { display: block; color: var(--ink); font-size: 13px; font-weight: 680; }
.scrim { display: none; }

@media (max-width: 1280px) {
  .workspace-grid { grid-template-columns: 236px minmax(460px, 1fr); }

  .sources-panel {
    position: fixed;
    top: 68px;
    right: 0;
    bottom: 0;
    width: min(390px, 92vw);
    transform: translateX(105%);
    box-shadow: var(--shadow);
    transition: transform .22s cubic-bezier(.16, 1, .3, 1);
  }

  .workspace.sources-open .sources-panel { transform: none; }
  .sources-button,
  .sources-close { display: grid; }

  .workspace.sources-open .scrim,
  .workspace.rail-open .scrim {
    position: fixed;
    z-index: 15;
    inset: 68px 0 0;
    display: block;
    border: 0;
    background: rgba(7, 9, 10, .42);
  }

  .coverage-compact { display: none; }
}

@media (max-width: 900px) {
  .workspace-grid { display: block; height: calc(100dvh - 68px); }
  .mobile-only { display: grid; }

  .conversation-rail {
    position: fixed;
    z-index: 21;
    top: 68px;
    bottom: 0;
    left: 0;
    width: min(300px, 88vw);
    transform: translateX(-105%);
    box-shadow: var(--shadow);
    transition: transform .22s cubic-bezier(.16, 1, .3, 1);
  }

  .workspace.rail-open .conversation-rail { transform: none; }
  .chat-main { height: calc(100dvh - 68px); }
  .brand { min-width: 0; }
  .topbar__meta { margin-left: auto; }
  .work-scroll { padding-inline: 28px; }
}

@media (max-width: 760px) {
  .auth-header { height: 74px; padding: 10px 18px; }
  .auth-header img { width: 42px; height: 48px; }
  .auth-layout { display: block; min-height: calc(100dvh - 74px); }
  .auth-story { display: none; }
  .auth-panel { min-height: calc(100dvh - 74px); padding: 38px 24px; }

  .topbar { height: 64px; gap: 7px; padding: 8px 10px; }
  .brand { flex: 1; gap: 8px; }
  .brand img { width: 34px; height: 39px; }
  .brand strong { font-size: 11px; }
  .brand small,
  .topbar__meta,
  .account { display: none; }

  .workspace-grid { height: calc(100dvh - 64px); }
  .conversation-rail { top: 64px; }
  .sources-panel { top: 64px; }
  .workspace.sources-open .scrim,
  .workspace.rail-open .scrim { inset: 64px 0 0; }
  .chat-main { height: calc(100dvh - 64px); }

  .chat-heading { min-height: 62px; padding: 11px 15px; }
  .heading-primary { gap: 10px; }
  .chat-heading h1 { font-size: 16px; }
  .view-switch button { min-height: 28px; padding: 4px 8px; font-size: 9px; }
  .mode-label { display: none; }
  .messages { padding: 18px 13px 14px; }
  .empty-state { margin: 8vh auto 18px; }
  .empty-state__logo { width: 39px; height: 45px; margin-bottom: 18px; }
  .empty-state h2 { font-size: 29px; }
  .empty-state > p { font-size: 12px; }
  .suggestions { display: grid; margin-top: 22px; }
  .suggestions button { text-align: left; }

  .message { grid-template-columns: 29px minmax(0, 1fr); gap: 8px; margin-bottom: 18px; }
  .message--user { grid-template-columns: minmax(0, 1fr); margin-left: 28px; }
  .message__avatar { width: 29px; height: 29px; border-radius: 6px; }
  .message__avatar img { width: 22px; height: 26px; }
  .message--assistant .message__body { padding: 14px; }
  .message__text { font-size: 13px; line-height: 1.68; }

  .composer { padding: 8px 9px max(9px, env(safe-area-inset-bottom)); }
  .filter-row { overflow: auto; padding-bottom: 1px; }
  .filter-row label span { display: none; }
  .filter-row select { min-width: 124px; }
  .text-button { white-space: nowrap; }
  .composer-box { grid-template-columns: minmax(0, 1fr); padding: 8px 9px 7px 12px; }
  .composer textarea { min-height: 40px; }
  .composer-actions { flex-direction: row; align-items: center; }
  .send-button { margin-left: auto; }
  .composer-note { display: none; }
  .source-list { padding: 10px; }

  .work-scroll { padding: 20px 13px 36px; }
  .work-intro { gap: 13px; margin-bottom: 18px; }
  .work-intro h2 { font-size: 27px; }
  .job-detail__header h2 { font-size: 23px; }
  .job-form { padding: 14px; }
  .job-modes { grid-template-columns: 1fr; gap: 7px; }
  .job-mode { min-height: 78px; grid-template-columns: 31px minmax(0, 1fr); column-gap: 10px; padding: 12px; }
  .job-mode__icon { grid-row: 1 / 3; }
  .job-mode strong { margin-top: 0; }
  .job-mode small { margin-top: 1px; }
  .job-controls { display: block; }
  .job-filters { margin-bottom: 12px; }
  .work-submit { width: 100%; }
  .job-detail__header { display: block; }
  .job-detail__header .button { margin-top: 15px; }
  .job-step { grid-template-columns: 25px minmax(0, 1fr); }
  .job-step__state { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
