:root {
  --bg:#f5f7fb;
  --card:#fff;
  --text:#172033;
  --muted:#526176;
  --line:#dbe2ea;
  --primary:#3157d5;
  --primary-dark:#2645ad;
  --danger:#c73535;
  --radius:12px;
}

.password-control {
  display:flex;
  gap:8px;
  align-items:center;
}

.password-control input {
  min-width:0;
  flex:1;
}

.password-control button {
  flex-shrink:0;
  min-height:44px;
}

textarea {
  width:100%;
  min-width:0;
  border:1px solid #bcc7d6;
  border-radius:8px;
  background:#fff;
  padding:10px 12px;
  font:inherit;
  color:inherit;
  resize:vertical;
}

.evaluation-form {
  display:grid;
  gap:16px;
}

.evaluation-form > button {
  justify-self:start;
}

.run-context dt {
  color:var(--muted);
  font-weight:650;
  margin-top:12px;
}

.run-context dd {
  margin:4px 0 16px;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.test-workspace {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(300px,420px);
  gap:24px;
  align-items:start;
}

.test-workspace .chat-stage {
  min-height:480px;
}

.alert.info {
  background:#eaf0ff;
  border-color:#cbd8ff;
  color:#27334b;
}

.badge.result-passed {
  background:#d9f4e7;
  color:#176944;
}

.badge.result-failed {
  background:#ffe6e6;
  color:#8e2525;
}

.badge.result-inconclusive {
  background:#fff5cf;
  color:#854b08;
}

.pagination {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:20px 0;
  color:var(--muted);
}

.conversation-rows {
  display:grid;
  gap:12px;
}

.conversation-rows .conversation-card {
  display:grid;
  grid-template-columns:170px minmax(0,1fr) 210px auto;
  align-items:center;
  gap:18px;
  padding:18px;
}

.conversation-rows .conversation-card h3 {
  margin:0;
}

.conversation-rows .conversation-card p {
  margin:4px 0;
}

.conversation-rows .conversation-card .button {
  margin:0;
  align-self:center;
}

.conversation-row-main {
  min-width:0;
}

@media (max-width:1000px) {
  .conversation-rows .conversation-card {
  grid-template-columns:130px minmax(0,1fr);
}

.conversation-rows .conversation-card .button {
  justify-self:start;
}


}

@media (max-width:700px) {
  .conversation-rows .conversation-card {
  grid-template-columns:1fr;
  gap:8px;
}


}

@media (max-width:850px) {
  .test-workspace {
  grid-template-columns:1fr;
}

.test-workspace .chat-stage {
  min-height:0;
}


}

* {
  box-sizing:border-box;
}

body {
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
}

a {
  color:var(--primary);
  text-decoration:none;
}

a:hover {
  text-decoration:underline;
}

.topbar {
  min-height:62px;
  padding:0 max(20px,calc((100% - 1120px)/2));
  background:#111a2e;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

.topbar a {
  color:#fff;
}

.brand {
  font-weight:750;
  letter-spacing:-.02em;
}

nav {
  display:flex;
  align-items:center;
  gap:18px;
  font-size:.9rem;
}

.container {
  width:min(1120px,calc(100% - 32px));
  margin:34px auto 70px;
}

footer {
  text-align:center;
  color:var(--muted);
  font-size:.8rem;
  padding:22px;
}

h1,h2 {
  line-height:1.15;
  letter-spacing:-.025em;
}

h1 {
  font-size:clamp(1.8rem,4vw,2.5rem);
  margin:.35rem 0;
}

h2 {
  font-size:1.15rem;
}

.muted, small {
  color:var(--muted);
}

small {
  display:block;
  margin-top:5px;
}

.card {
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:0 4px 16px rgba(20,35,65,.04);
}

.auth-card,.form-card {
  max-width:620px;
  margin:50px auto;
}

.auth-card form,.form-card form {
  display:grid;
  gap:16px;
}

label {
  display:grid;
  gap:6px;
  font-weight:650;
  font-size:.92rem;
}

input,select {
  width:100%;
  border:1px solid #bcc7d6;
  border-radius:8px;
  background:#fff;
  padding:10px 12px;
  font:inherit;
  color:inherit;
}

input:focus,select:focus {
  outline:3px solid rgba(49,87,213,.16);
  border-color:var(--primary);
}

button,.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:8px;
  padding:10px 15px;
  background:var(--primary);
  color:#fff;
  font:inherit;
  font-weight:700;
  cursor:pointer;
  min-height:44px;
}

button:hover,.button:hover {
  background:var(--primary-dark);
  text-decoration:none;
}

button.secondary,.button.secondary {
  background:#e9edf5;
  color:#27334b;
}

button.danger,.button.danger {
  background:var(--danger);
}

button.small,.button.small {
  padding:6px 10px;
  font-size:.83rem;
}

.link-button {
  padding:0;
  color:#fff;
  background:transparent;
  font-weight:500;
}

.link-button:hover {
  background:transparent;
  text-decoration:underline;
}

.inline {
  display:inline-flex!important;
  align-items:center;
  gap:8px;
}

.actions {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
}

.page-heading,.card-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}

.page-heading {
  margin-bottom:24px;
}

.grid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));
  gap:18px;
}

.project-card h2 {
  margin:16px 0 8px;
}

.project-card.archived {
  border-style:dashed;
}

.badge {
  display:inline-block;
  border-radius:999px;
  background:#e8edf5;
  color:#334155;
  padding:3px 9px;
  font-size:.72rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.badge.admin {
  background:#fee7c6;
  color:#874c05;
}

.badge.reviewer {
  background:#e4defe;
  color:#5036a2;
}

.badge.tester {
  background:#d9f4e7;
  color:#176944;
}

.badge.archived {
  background:#e6e8ec;
  color:#555;
}

.badge.imported {
  background:#dcecff;
  color:#205789;
}

.badge.warning {
  background:#ffe5bf;
  color:#854b08;
}

.alert {
  border:1px solid #f1c66d;
  background:#fff7dc;
  padding:12px 15px;
  border-radius:8px;
  margin:16px 0;
}

.alert.error {
  border-color:#efb3b3;
  background:#fff0f0;
  color:#8e2525;
}

.breadcrumbs {
  color:var(--muted);
  font-size:.9rem;
  margin-bottom:20px;
}

.copy-row {
  display:flex;
  gap:8px;
}

.copy-row input {
  font-family:ui-monospace,monospace;
}

.top-gap {
  margin-top:12px;
}

.table-wrap {
  position:relative;
  overflow-x:auto;
  max-width:100%;
}

table {
  width:100%;
  border-collapse:collapse;
}

th,td {
  text-align:left;
  padding:12px 10px;
  border-bottom:1px solid var(--line);
  vertical-align:middle;
}

th {
  color:var(--muted);
  font-size:.76rem;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.danger-zone {
  border-color:#eebbbb;
  margin-top:22px;
}

.delete-form {
  margin-top:20px;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:end;
  gap:12px;
}

.two-cols {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.chat-stage {
  min-height:350px;
}

.empty {
  text-align:center;
  padding:46px 24px;
}

.section-heading {
  margin-top:34px;
}

.project-conversations {
  margin-top:30px;
}

.project-conversations > .page-heading {
  margin-bottom:14px;
}

.export-form {
  display:grid;
  gap:18px;
}

.conversation-selector {
  max-height:430px;
  overflow-y:auto;
  border-top:1px solid var(--line);
  margin-top:14px;
}

.check-row {
  display:flex;
  grid-template-columns:none;
  flex-direction:row;
  align-items:flex-start;
  gap:12px;
  padding:12px 4px;
  border-bottom:1px solid var(--line);
  cursor:pointer;
}

.check-row input {
  width:18px;
  height:18px;
  margin-top:3px;
  flex:0 0 auto;
}

.check-row span {
  min-width:0;
}

.secret-export .alert {
  margin-bottom:0;
}

.import-error[hidden] {
  display:none;
}

.conversation-card {
  display:flex;
  flex-direction:column;
}

.conversation-card .button {
  margin-top:auto;
  align-self:flex-start;
}

.conversation-summary {
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:20px;
  margin-bottom:24px;
}

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

.message-list {
  display:grid;
  align-content:start;
  gap:14px;
  max-height:65vh;
  min-height:320px;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
  padding:18px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#eef2f8;
}

.message-list:focus {
  outline:3px solid rgba(49,87,213,.16);
}

.message {
  width:min(78%,760px);
  padding:14px 16px;
  border-radius:14px;
  border:1px solid var(--line);
  background:#fff;
}

.message.incoming {
  justify-self:start;
  border-bottom-left-radius:4px;
}

.message.outgoing {
  justify-self:end;
  background:#eaf0ff;
  border-color:#cbd8ff;
  border-bottom-right-radius:4px;
}

.message.activity {
  width:100%;
  justify-self:center;
  background:transparent;
  color:var(--muted);
  text-align:center;
  border-style:dashed;
}

.message.private {
  background:#fff5cf;
  border-color:#ecd476;
}

.message-meta {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:9px;
  color:var(--muted);
  font-size:.78rem;
  margin-bottom:7px;
}

.message-meta strong {
  color:var(--text);
}

.message-content {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}

.attachments {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:10px;
}

@media (max-width:700px) {
  .topbar {
  padding:12px 16px;
  align-items:flex-start;
}

.topbar nav {
  flex-wrap:wrap;
  justify-content:flex-end;
}

.page-heading,.card-row {
  align-items:flex-start;
  flex-direction:column;
}

.two-cols,.delete-form {
  grid-template-columns:1fr;
}

.copy-row {
  flex-direction:column;
}

.container {
  margin-top:22px;
}


}

/* Incremental layout and interaction improvements. */
[hidden] {
  display:none!important;
}

:focus-visible {
  outline:3px solid var(--primary);
  outline-offset:3px;
}

.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:absolute;
  top:-100px;
  left:16px;
  z-index:100;
  background:#fff;
  padding:12px;
  border-radius:8px;
}

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

.topbar [aria-current="page"] {
  text-decoration:underline;
  text-underline-offset:5px;
}

.account-name {
  overflow-wrap:anywhere;
}

.account-menu {
  position:relative;
}

.account-menu > summary {
  padding:8px 12px;
  border:1px solid #64748b;
  border-radius:8px;
  color:#fff;
}

.account-menu[open] > summary {
  margin-bottom:0;
}

.account-menu-panel {
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  width:min(310px,calc(100vw - 32px));
  padding:10px;
  background:var(--card);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:0 12px 36px rgba(20,35,65,.18);
  z-index:20;
}

.account-menu-identity {
  padding:10px;
  border-bottom:1px solid var(--line);
  margin-bottom:6px;
  overflow-wrap:anywhere;
}

.account-menu-identity strong {
  display:block;
}

.account-menu-identity .badge {
  margin-top:8px;
}

.topbar .account-menu-panel a,.account-menu-panel button {
  display:block;
  width:100%;
  padding:10px;
  border-radius:6px;
  color:var(--text);
  background:transparent;
  font-weight:500;
  text-align:left;
}

.topbar .account-menu-panel a:hover,.account-menu-panel button:hover {
  background:#eaf0ff;
  text-decoration:none;
}

.account-menu-group {
  border-top:1px solid var(--line);
  margin-top:6px;
  padding:10px 10px 2px;
  color:var(--muted);
  font-size:.75rem;
}

.account-menu-panel form {
  border-top:1px solid var(--line);
  margin-top:6px;
  padding-top:6px;
}

.account-profile dt {
  font-weight:650;
  color:var(--muted);
  margin-top:16px;
}

.account-profile dd {
  margin:4px 0;
  overflow-wrap:anywhere;
}

@media (max-width:700px) {
  .topbar .account-menu {
  margin-left:auto;
}

.account-menu-panel {
  right:0;
}


}

.page-heading > div:first-child {
  min-width:0;
}

h1,h2,h3,.project-card,.conversation-card,td,.breadcrumbs {
  overflow-wrap:anywhere;
}

h3 {
  font-size:1rem;
  margin-top:0;
}

.conversation-card h3 {
  margin:16px 0 0;
}

.project-card {
  display:flex;
  flex-direction:column;
}

.project-card > .button {
  margin-top:auto;
  align-self:flex-start;
}

.filter-bar {
  display:flex;
  align-items:end;
  flex-wrap:wrap;
  gap:14px;
  margin-bottom:18px;
  padding:18px;
}

.filter-bar label:first-child {
  flex:1 1 260px;
}

.filter-bar label {
  flex:0 1 180px;
  min-width:0;
}

.project-tabs {
  display:flex;
  overflow-x:auto;
  gap:4px;
  border-bottom:1px solid var(--line);
  margin-bottom:24px;
}

.project-tabs a {
  flex:0 0 auto;
  padding:12px 16px;
  border-bottom:3px solid transparent;
  color:var(--muted);
  font-weight:650;
  white-space:nowrap;
}

.project-tabs a:hover {
  color:var(--primary);
  background:#eaf0ff;
  text-decoration:none;
}

.project-tabs a[aria-current="page"] {
  color:var(--primary);
  border-bottom-color:var(--primary);
  background:#eaf0ff;
}

.section-stack {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:24px;
}

.section-stack > section {
  min-width:0;
}

.section-stack section[id] {
  scroll-margin-top:20px;
}

.section-stack h2 {
  margin-top:0;
}

.section-stack .page-heading {
  margin-bottom:14px;
}

.invite-panel {
  margin:20px 0;
  padding:18px;
  background:var(--bg);
  border:1px solid var(--line);
  border-radius:8px;
}

.invite-panel label {
  margin-bottom:6px;
}

.empty.compact {
  padding:16px;
}

.alert.success {
  background:#edf9f1;
  border-color:#a8d9b8;
  color:#18562d;
}

.alert p {
  margin:8px 0;
}

fieldset {
  min-width:0;
  margin:0;
  padding:18px;
  border:1px solid var(--line);
  border-radius:8px;
  display:grid;
  gap:18px;
}

legend {
  padding:0 6px;
  font-weight:700;
}

.field small {
  margin-top:6px;
}

.field-error {
  color:#8e2525;
  font-weight:600;
  margin:6px 0 0;
}

input[aria-invalid="true"] {
  border-color:var(--danger);
}

.form-card {
  margin-top:24px;
}

details {
  border-radius:8px;
}

details.danger-zone {
  padding:16px;
  border:1px solid #eebbbb;
}

summary {
  cursor:pointer;
  font-weight:650;
}

summary::marker {
  color:var(--muted);
}

details[open] > summary {
  margin-bottom:12px;
}

button:disabled {
  opacity:.65;
  cursor:wait;
}

.inline select {
  width:auto;
  min-width:100px;
}

@media (max-width:700px) {
  .topbar {
  flex-wrap:wrap;
  gap:10px;
}

.topbar nav {
  width:100%;
  justify-content:flex-start;
  gap:12px;
}

.conversation-summary {
  grid-template-columns:1fr;
  gap:14px;
}

.conversation-summary strong {
  overflow-wrap:anywhere;
}

.filter-bar {
  align-items:stretch;
}

.filter-bar label,.filter-bar label:first-child {
  flex:1 1 100%;
}

.card {
  padding:18px;
}

.actions {
  width:100%;
}

.message {
  width:92%;
}

.message-list {
  padding:12px;
}

button.small,.button.small {
  min-height:44px;
}

.table-wrap td:first-child {
  min-width:150px;
}

.copy-row input {
  min-width:0;
}

.form-card,.auth-card {
  margin:24px auto;
}


}

.copy-row input {
  flex:1;
  min-width:0;
  width:auto;
}

.copy-row button {
  flex-shrink:0;
  white-space:nowrap;
}

@media (max-width:700px) {
  .copy-row input {
  width:100%;
}


}

.filter-bar .filter-field {
  flex:0 1 180px;
  min-width:0;
  display:grid;
  gap:6px;
}

.filter-bar .filter-field label {
  flex:none;
}

@media (max-width:700px) {
  .filter-bar .filter-field {
  flex:1 1 100%;
}


}

.table-wrap .badge,.table-wrap th {
  white-space:nowrap;
}

.table-hint {
  display:none;
}

@media (max-width:700px) {
  .table-wrap table {
  min-width:620px;
}

.table-hint {
  display:block;
  font-size:.85rem;
}


}

.project-metrics {
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin:8px 0;
}

.project-metrics a {
  padding:8px 10px;
  background:var(--bg);
  border-radius:8px;
  font-size:.85rem;
}

.project-metrics strong {
  font-size:1rem;
}

.report-counts {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(120px,1fr));
  gap:18px;
}

.report-counts div {
  display:grid;
  gap:5px;
}

.report-counts strong {
  font-size:1.8rem;
}

.report-counts span {
  color:var(--muted);
}

.table-wrap pre {
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  max-width:500px;
  font-size:.8rem;
}

.run-mobile-label {
  display:none;
}

@media (max-width:700px) {
  .run-table-wrap {
    overflow:visible;
  }

  .table-wrap .run-table {
    display:block;
    min-width:0;
    width:100%;
  }

  .run-table thead {
    position:absolute;
    width:1px;
    height:1px;
    overflow:hidden;
    clip-path:inset(50%);
    white-space:nowrap;
  }

  .run-table tbody {
    display:grid;
    gap:16px;
  }

  .run-table tbody tr {
    display:grid;
    grid-template-columns:minmax(0,1fr);
    padding:12px;
    border:1px solid var(--line);
    border-radius:10px;
  }

  .table-wrap .run-table tbody td {
    display:block;
    min-width:0;
    padding:8px 0;
    border:0;
    overflow-wrap:anywhere;
  }

  .run-mobile-label {
    display:block;
    margin-bottom:4px;
    color:var(--muted);
    font-size:.85rem;
    font-weight:600;
  }
}

@media print {
  .topbar,footer,.breadcrumbs,.skip-link,.report-actions,[data-action-feedback] {
  display:none!important;
}

body {
  background:white;
}

.container {
  width:100%;
  margin:0;
}

.card {
  box-shadow:none;
}

.report-entry {
  break-inside:avoid;
}

.section-stack {
  display:block;
}

.report-entry {
  margin-top:14px;
}


}

.thread-controls {
  margin:20px 0;
  display:grid;
  gap:14px;
}

.thread-match {
  box-shadow:inset 0 0 0 2px #854b08;
}

.thread-current {
  outline:3px solid var(--primary);
  outline-offset:3px;
}

.attachment-preview {
  display:block;
  max-width:240px;
  max-height:200px;
  width:100%;
  object-fit:contain;
  margin-bottom:6px;
  border-radius:6px;
}

