:root {
  --ink: #17191c;
  --muted: #71767f;
  --line: #e8e7e3;
  --paper: #f7f7f5;
  --white: #fff;
  --violet: #6c63e8;
  --violet-soft: #f0eefc;
  --green: #318255;
  --red: #b9574d;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #222;
  color: #fff;
  font-size: 11px;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

/* The shell intentionally mirrors Jonty's focused Agent workspace. */
.v3-shell { min-height: 100vh; background: #f7f7f5; }
.v3-workspace { width: 100%; margin: 0; }
.v3-topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  height: 66px;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0 24px;
  border-bottom: 1px solid #e3e1dd;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
}
.v3-brand {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1f1e1b;
  cursor: pointer;
}
.v3-brand > img {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 8px;
  object-fit: cover;
}
.v3-brand strong { font-size: 17px; letter-spacing: -.3px; }
.account-slot {
  position: relative;
  display: flex;
  justify-content: flex-end;
}
.v4-account {
  display: flex;
  max-width: 250px;
  align-items: center;
  gap: 9px;
  padding: 5px 8px 5px 5px;
  border: 1px solid #e0ddd7;
  border-radius: 10px;
  background: #fff;
  color: #393631;
  text-align: left;
  cursor: pointer;
}
.v4-account > span {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 8px;
  background: #242327;
  color: #fff;
  font-size: 9px;
  font-weight: 750;
}
.v4-account p {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  margin: 0;
}
.v4-account strong { font-size: 10px; }
.v4-account small {
  overflow: hidden;
  max-width: 155px;
  color: #8a867f;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v4-account b { color: #928e87; font-size: 9px; }
.account-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  overflow: hidden;
  padding: 8px;
  border: 1px solid #e1ded8;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(35,35,30,.12);
}
.account-menu > div { padding: 7px 8px 10px; border-bottom: 1px solid #efede9; }
.account-menu strong, .account-menu small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu strong { color: #34312d; font-size: 10px; }
.account-menu small { margin-top: 4px; color: #8a867f; font-size: 8px; }
.account-menu button {
  width: 100%;
  margin-top: 6px;
  padding: 9px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4f4a44;
  font-size: 9px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.account-menu button:hover { background: #f4f2ee; }

.v3-agent {
  display: flex;
  width: min(1040px, 100%);
  height: calc(100vh - 66px);
  margin: 0 auto;
  flex-direction: column;
  overflow: hidden;
  padding: 14px 24px;
}
.v3-chat {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #e2dfda;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(45,41,34,.04);
}
.v4-chat {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}
.v6-chat-toolbar {
  display: grid;
  min-height: 46px;
  flex: 0 0 46px;
  grid-template-columns: 92px minmax(0,1fr) 92px;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  border-bottom: 1px solid #ebe8e3;
  background: rgba(255,255,255,.96);
}
.v6-chat-toolbar > strong {
  overflow: hidden;
  color: #605c56;
  font-size: 9px;
  font-weight: 650;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v6-chat-toolbar > button {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #6c6760;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}
.v6-chat-toolbar > button:first-child { justify-self: start; }
.v6-chat-toolbar > button:last-child { justify-self: end; }
.v6-chat-toolbar > button:hover, .v6-chat-toolbar > button.active { background: #f1efeb; color: #37332e; }
.v6-chat-toolbar > button:disabled { opacity: .5; cursor: default; }
.v6-chat-toolbar > button span {
  display: grid;
  min-width: 17px;
  height: 17px;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #e9e6e1;
  color: #77716a;
  font-size: 7px;
}

.v6-history-layer {
  position: absolute;
  z-index: 20;
  inset: 46px 0 0;
  display: flex;
  background: rgba(41,38,33,.14);
  backdrop-filter: blur(1px);
}
.v6-history-drawer {
  display: flex;
  width: min(340px,88%);
  min-width: 0;
  flex-direction: column;
  background: #fff;
  box-shadow: 12px 0 32px rgba(40,36,30,.12);
}
.v6-history-drawer > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  border-bottom: 1px solid #ebe8e3;
}
.v6-history-drawer > header strong, .v6-history-drawer > header small { display: block; }
.v6-history-drawer > header strong { color: #34312c; font-size: 10px; }
.v6-history-drawer > header small { margin-top: 3px; color: #969088; font-size: 7px; }
.v6-history-drawer > header button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #77716a;
  font-size: 15px;
  cursor: pointer;
}
.v6-history-drawer > header button:hover { background: #f1efeb; }
.v6-history-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  padding: 10px;
}
.v6-history-list > button {
  display: block;
  width: 100%;
  overflow: hidden;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.v6-history-list > button:hover { background: #f6f4f1; }
.v6-history-list > button.selected { border-color: #ddd8f2; background: #f7f5ff; }
.v6-history-list > button:disabled { cursor: wait; }
.v6-history-list strong, .v6-history-list span, .v6-history-list small { display: block; }
.v6-history-list strong, .v6-history-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v6-history-list strong { color: #3d3933; font-size: 9px; }
.v6-history-list span { margin-top: 4px; color: #77716a; font-size: 8px; }
.v6-history-list small { margin-top: 6px; color: #9a958d; font-size: 7px; }
.v6-history-list > p, .v6-restoring-chat { margin: 0; padding: 16px; color: #928d86; font-size: 8px; text-align: center; }
.history-meta { display: flex !important; align-items: center; gap: 5px; }
.history-running { color: #675bb6 !important; }
.history-running::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #786bd8;
  content: "";
  animation: work-dot 1.2s ease-in-out infinite;
}

.v3-chat-stream {
  display: grid;
  min-height: 0;
  flex: 1;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 30px;
  scroll-behavior: smooth;
}
.v3-message {
  display: flex;
  max-width: 760px;
  align-self: start;
  align-items: flex-start;
  gap: 11px;
}
.v3-message > .agent-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 9px;
  object-fit: cover;
}
.v3-message > div { min-width: 0; }
.v3-message strong { color: #292722; font-size: 12px; }
.v3-message p { margin: 6px 0 0; color: #5f5c56; font-size: 12px; line-height: 1.6; }
.v3-message.user {
  max-width: 610px;
  justify-self: end;
  align-items: center;
  flex-direction: row;
}
.v3-message.user > div {
  display: flex;
  min-height: 28px;
  align-items: center;
  padding: 5px 10px;
  border-radius: 13px 13px 3px 13px;
  background: #f0eefc;
}
.v3-message.user > div p { margin: 0; color: #393544; line-height: 1.5; white-space: pre-wrap; }
.v3-message.user > .user-mark {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  background: #343238;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
}
.v3-message.compact { margin-top: -7px; }

.v7-agent-answer { display: grid; gap: 8px; min-width: 0; }
.v7-agent-answer > p, .v7-answer-point p { margin: 0; }
.v7-agent-answer strong { color: #34312d; font-weight: 720; }
.v7-agent-answer a { color: #6257b4; text-decoration-color: #cfc9ee; text-underline-offset: 2px; }
.v7-agent-answer a:hover { text-decoration-color: #6257b4; }
.v7-answer-point { display: flex; align-items: flex-start; gap: 9px; }
.v7-answer-point > i {
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  margin-top: 8px;
  border-radius: 50%;
  background: #8b7fe0;
}
.v7-answer-point.numbered > i {
  display: grid;
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  place-items: center;
  margin-top: 1px;
  border-radius: 7px;
  background: #f0eefb;
  color: #675bb6;
  font-size: 8px;
  font-style: normal;
  font-weight: 750;
}
.citation-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 1px 0 0 39px; }
.citation-row a, .citation-row span {
  max-width: 220px;
  overflow: hidden;
  padding: 5px 8px;
  border: 1px solid #e1ddd7;
  border-radius: 999px;
  background: #faf9f7;
  color: #68625b;
  font-size: 8px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.citation-row a:hover { border-color: #d3ccef; color: #5e53aa; }

.v7-agent-activity {
  width: min(640px,calc(100% - 42px));
  margin-left: 39px;
  overflow: hidden;
  border: 1px solid #e5e1ef;
  border-radius: 13px;
  background: linear-gradient(145deg,#fbfaff 0%,#fff 72%);
  box-shadow: 0 7px 22px rgba(46,37,75,.045);
}
.v7-agent-activity > header, .v7-agent-activity > summary {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.v7-agent-activity > summary { cursor: pointer; list-style: none; }
.v7-agent-activity > summary::-webkit-details-marker { display: none; }
.v7-agent-activity > header > p, .v7-agent-activity > summary > p {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  margin: 0;
}
.v7-agent-activity > header strong, .v7-agent-activity > summary strong {
  overflow: hidden;
  color: #3e3949;
  font-size: 10px;
  font-weight: 720;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v7-agent-activity > header small, .v7-agent-activity > summary small { color: #928b9d; font-size: 8px; }
.v7-work-orb {
  position: relative;
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 9px;
  background: #282431;
  color: #b7adff;
  font-size: 9px;
  font-weight: 800;
}
.v7-agent-activity.live .v7-work-orb::after {
  position: absolute;
  inset: -4px;
  border: 1px solid rgba(113,96,225,.22);
  border-radius: 12px;
  content: "";
  animation: work-pulse 1.8s ease-out infinite;
}
.v7-work-orb > i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a99dfb;
  box-shadow: 0 0 0 4px rgba(169,157,251,.12);
}
.v7-working-dots { display: flex; align-items: center; gap: 3px; padding: 0 4px; }
.v7-working-dots i { width: 4px; height: 4px; border-radius: 50%; background: #8c81d7; animation: work-dot 1.2s ease-in-out infinite; }
.v7-working-dots i:nth-child(2) { animation-delay: .15s; }
.v7-working-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes work-pulse { 0% { opacity: .9; transform: scale(.86); } 75%,100% { opacity: 0; transform: scale(1.28); } }
@keyframes work-dot { 0%,65%,100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }
.v7-activity-list { position: relative; display: grid; padding: 0 12px 11px 25px; }
.v7-activity-list::before { position: absolute; top: 4px; bottom: 17px; left: 35px; width: 1px; background: #e3dfee; content: ""; }
.v7-activity-row { position: relative; display: flex; min-width: 0; align-items: center; gap: 9px; padding: 6px 0; }
.v7-activity-state {
  z-index: 1;
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1px solid #dcd6eb;
  border-radius: 50%;
  background: #fff;
  color: #7569c4;
  font-size: 8px;
  font-weight: 800;
}
.v7-activity-row.running .v7-activity-state::after { width: 6px; height: 6px; border-radius: 50%; background: #7769d9; content: ""; animation: work-dot 1.2s ease-in-out infinite; }
.v7-activity-row.failed .v7-activity-state { border-color: #efcbc6; background: #fff7f6; color: var(--red); }
.v7-activity-row > p { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 2px; margin: 0; }
.v7-activity-row strong { color: #56505f; font-size: 9px; font-weight: 650; }
.v7-activity-row small { overflow: hidden; color: #958f9c; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.v7-activity-chevron { color: #96909c; font-size: 13px; transition: transform 160ms ease; }
.v7-agent-activity[open] .v7-activity-chevron { transform: rotate(180deg); }
.v7-agent-activity.saved { border-color: #ebe8e3; background: #faf9f7; box-shadow: none; }
.v7-agent-activity.saved .v7-work-orb { width: 24px; height: 24px; flex-basis: 24px; border-radius: 50%; background: #e9f4ed; color: var(--green); }
.v7-agent-activity.saved.failed .v7-work-orb { background: #fbecea; color: var(--red); }

.agent-artifact, .portfolio-review {
  display: flex;
  width: min(640px,calc(100% - 42px));
  margin-left: 39px;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid #ded9ed;
  border-radius: 13px;
  background: linear-gradient(145deg,#f8f6ff,#fff);
}
.artifact-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 10px;
  background: #ece8fc;
  color: #6659b5;
  font-size: 15px;
}
.agent-artifact > p, .portfolio-review > div { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 3px; margin: 0; }
.agent-artifact small, .portfolio-review small { color: #918a9c; font-size: 7px; font-weight: 750; letter-spacing: .07em; }
.agent-artifact strong, .portfolio-review strong { overflow: hidden; color: #393442; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.agent-artifact span, .portfolio-review span { color: #77707e; font-size: 8px; }
.agent-artifact > button, .portfolio-review button {
  padding: 7px 9px;
  border: 1px solid #d8d2e9;
  border-radius: 8px;
  background: #fff;
  color: #5d53a4;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}
.agent-artifact > button:hover, .portfolio-review button:hover { background: #f3f0fd; }
.portfolio-review { display: block; background: #fffdf8; border-color: #e8ddc8; }
.portfolio-review > header { display: flex; align-items: center; gap: 11px; }
.portfolio-table { margin-top: 12px; overflow-x: auto; border: 1px solid #eee7dc; border-radius: 9px; }
.portfolio-row { display: grid; min-width: 520px; grid-template-columns: 1.2fr .75fr 1fr 1fr 28px; gap: 7px; align-items: center; padding: 7px 9px; border-bottom: 1px solid #f1ebe2; }
.portfolio-row:last-child { border-bottom: 0; }
.portfolio-row.header { background: #f8f5ef; color: #918a80; font-size: 7px; font-weight: 700; }
.portfolio-row input { width: 100%; min-width: 0; padding: 5px 6px; border: 1px solid #e2dcd2; border-radius: 6px; color: #403b35; font-size: 8px; outline: 0; }
.portfolio-row input:focus { border-color: #aaa1dc; box-shadow: 0 0 0 2px rgba(108,99,232,.08); }
.portfolio-row button { display: grid; width: 24px; height: 24px; place-items: center; padding: 0; color: #9c6b63; }
.portfolio-warning { margin: 9px 0 0; color: #8b6d3d; font-size: 8px; line-height: 1.5; }
.portfolio-actions { display: flex; justify-content: flex-end; margin-top: 11px; }
.portfolio-actions button { min-width: 120px; padding: 9px 12px; border: 0; background: #29262e; color: #fff; }

.v3-composer-wrap {
  position: sticky;
  z-index: 5;
  bottom: 0;
  flex: 0 0 auto;
  padding: 12px 18px 14px;
  border-top: 1px solid #ebe8e3;
  background: rgba(255,255,255,.96);
}
.v3-composer {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  padding: 12px 11px 9px;
  border: 1px solid #dcd8d1;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 5px 18px rgba(45,41,34,.07);
}
.v3-composer textarea {
  width: 100%;
  min-height: 50px;
  max-height: 211px;
  overflow-y: hidden;
  resize: none;
  padding: 3px 5px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #292825;
  font-size: 11px;
  line-height: 1.55;
}
.v3-composer textarea::placeholder { color: #aaa59e; }
.v5-composer-controls { display: flex; width: 100%; min-height: 34px; align-items: center; gap: 8px; }
.v4-upload-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5e5b56;
  cursor: pointer;
}
.v4-upload-button:hover { background: #f0efec; }
.v4-upload-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.v4-upload-button > span { font-size: 18px; line-height: 1; }
.v5-composer-note { color: #a19c95; font-size: 7px; }
.v5-composer-spacer { flex: 1; }
.v3-composer button.send {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  margin: 0 3px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #292825;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}
.v3-composer button.send:disabled { background: #d3d1cc; cursor: default; }
.v4-uploaded-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; padding: 0 5px; }
.v4-uploaded-files > span {
  display: flex;
  max-width: 260px;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid #ddd9d2;
  border-radius: 7px;
  background: #f8f7f4;
  color: #625e57;
  font-size: 8px;
}
.v4-uploaded-files i { color: #6c63e8; font-style: normal; }
.v4-uploaded-files button { display: grid; width: 15px; height: 15px; place-items: center; margin-left: 2px; padding: 0; border: 0; border-radius: 50%; background: #e8e5df; color: #77716a; cursor: pointer; }

.auth-layer, .artifact-layer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(30,28,25,.32);
  backdrop-filter: blur(5px);
}
.auth-card {
  position: relative;
  width: min(410px,100%);
  padding: 35px 32px 27px;
  border: 1px solid #e4e0d9;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(40,35,30,.18);
  text-align: center;
}
.auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #77716a;
  font-size: 17px;
  cursor: pointer;
}
.auth-close:hover { background: #f1efeb; }
.auth-mark { display: block; width: 42px; height: 42px; margin: 0 auto 20px; border-radius: 13px; object-fit: cover; }
.auth-entry > small, .auth-code > small { color: #8b8494; font-size: 8px; font-weight: 750; letter-spacing: .12em; }
.auth-card h1 { margin: 9px 0 8px; color: #2d2a27; font-size: 22px; letter-spacing: -.5px; }
.auth-entry > p:first-of-type, .auth-code > p:first-of-type { max-width: 320px; margin: 0 auto 21px; color: #77716a; font-size: 10px; line-height: 1.55; }
.auth-code > p:first-of-type strong { color: #4b4851; }
.google-button { display: flex; min-height: 44px; justify-content: center; }
.auth-rule { display: flex; align-items: center; gap: 10px; margin: 15px 0; color: #99958f; font-size: 8px; }
.auth-rule::before, .auth-rule::after { height: 1px; flex: 1; background: #ebe8e3; content: ""; }
.auth-email-form { text-align: left; }
.auth-email-form label, .auth-code-form label { display: block; margin-bottom: 7px; color: #62676d; font-size: 8px; font-weight: 650; text-align: left; }
.auth-email-form > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; }
.auth-email-form input, .auth-code-form input {
  width: 100%;
  height: 43px;
  padding: 0 12px;
  border: 1px solid #dcd9e3;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: #34313b;
  font-size: 10px;
}
.auth-email-form input:focus, .auth-code-form input:focus { border-color: #8d82dd; box-shadow: 0 0 0 3px #f0eefc; }
.auth-email-form button, .auth-code-form button {
  height: 43px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: #252329;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}
.auth-email-form button:disabled, .auth-code-form button:disabled { background: #c8c8c3; cursor: default; }
.auth-status { min-height: 16px; margin: 9px auto 0 !important; color: #8b8580 !important; font-size: 8px !important; line-height: 1.45; }
.auth-terms { margin: 9px auto 0 !important; color: #aaa49d !important; font-size: 7px !important; line-height: 1.5 !important; }
.auth-terms a { color: #6b61b4; }
.auth-sent-icon { display: inline-grid; width: 34px; height: 34px; margin: 0 auto 14px; place-items: center; border-radius: 11px; background: #eeebff; color: #6657c6; font-size: 14px; font-weight: 800; }
.auth-code-form input { height: 48px; padding-left: 18px; font-size: 16px; font-weight: 700; letter-spacing: .45em; text-align: center; }
.auth-code-form button { width: 100%; margin-top: 9px; }
.auth-code-actions { display: flex; justify-content: center; gap: 17px; margin-top: 16px; }
.auth-code-actions button { padding: 0; border: 0; background: transparent; color: #6657c6; font-size: 8px; font-weight: 700; cursor: pointer; }
.auth-code-actions button:disabled { color: #aaa5bc; cursor: default; }
.auth-cancel { margin-top: 9px; padding: 7px 10px; border: 0; background: transparent; color: #928d86; font-size: 8px; cursor: pointer; }

.artifact-sheet {
  display: flex;
  width: min(760px,100%);
  max-height: min(760px,calc(100vh - 40px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2ded8;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(40,35,30,.18);
}
.artifact-sheet > header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid #ebe8e3; }
.artifact-sheet > header small { color: #82788e; font-size: 8px; font-weight: 750; letter-spacing: .1em; }
.artifact-sheet > header h2 { margin: 6px 0 0; color: #322e35; font-size: 18px; }
.artifact-sheet > header button { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #77716a; font-size: 17px; cursor: pointer; }
.artifact-sheet > header button:hover { background: #f1efeb; }
.artifact-content { overflow-y: auto; padding: 22px; color: #504b46; }
.artifact-summary { margin: 0 0 18px; padding: 15px; border-radius: 12px; background: #f7f5ff; color: #45404b; font-size: 11px; line-height: 1.65; }
.artifact-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(130px,1fr)); gap: 8px; margin-bottom: 20px; }
.artifact-metrics div { padding: 11px; border: 1px solid #e9e5df; border-radius: 10px; }
.artifact-metrics small, .artifact-metrics strong { display: block; }
.artifact-metrics small { color: #98918a; font-size: 7px; }
.artifact-metrics strong { margin-top: 5px; color: #37332e; font-size: 12px; }
.artifact-section { padding: 16px 0; border-top: 1px solid #eeeae5; }
.artifact-section h3 { margin: 0 0 8px; color: #37332e; font-size: 12px; }
.artifact-section p, .artifact-section li { color: #5f5a54; font-size: 10px; line-height: 1.65; }
.artifact-section p { margin: 0; white-space: pre-wrap; }
.artifact-section ul { margin: 9px 0 0; padding-left: 18px; }
.artifact-sources { margin-top: 19px; padding-top: 17px; border-top: 1px solid #eeeae5; }
.artifact-sources h3 { margin: 0 0 9px; font-size: 11px; }
.artifact-sources a, .artifact-sources span { display: block; margin-top: 6px; color: #6257b4; font-size: 9px; text-decoration: none; }

.toast {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  max-width: 320px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #29262e;
  color: #fff;
  box-shadow: 0 12px 35px rgba(30,28,26,.2);
  font-size: 9px;
}

@media (max-width: 680px) {
  .v3-topbar { grid-template-columns: 1fr auto; padding: 0 12px; }
  .v3-brand strong, .v4-account p, .v4-account b { display: none; }
  .v4-account { padding: 4px; border: 0; background: transparent; }
  .v4-account > span { width: 32px; height: 32px; flex-basis: 32px; }
  .account-menu { right: -2px; }
  .v3-agent { padding: 10px; }
  .v3-chat { border-radius: 13px; }
  .v6-chat-toolbar { grid-template-columns: 85px minmax(0,1fr) 85px; padding-inline: 10px; }
  .v6-history-drawer { width: 100%; }
  .v3-chat-stream { gap: 20px; padding: 20px 14px; }
  .v3-message.user { max-width: 88%; }
  .v7-agent-activity, .agent-artifact, .portfolio-review { width: calc(100% - 39px); margin-left: 39px; }
  .v7-activity-list { padding-left: 21px; }
  .v7-activity-list::before { left: 31px; }
  .v3-composer-wrap { padding: 10px; }
  .v3-composer { min-height: 96px; }
  .v5-composer-note { display: none; }
  .citation-row { margin-left: 39px; }
  .auth-layer { align-items: end; padding: 10px; }
  .auth-card { max-height: calc(100vh - 20px); overflow-y: auto; padding-inline: 22px; }
  .auth-email-form > div { grid-template-columns: 1fr; }
  .auth-email-form button { width: 100%; }
  .artifact-layer { padding: 10px; }
  .artifact-sheet { max-height: calc(100vh - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
