/* Custom tweaks on top of Tailwind. Keep this file small. */

html,
body {
  height: 100%;
}

/* ---------- App shell ---------- */
.app-topbar {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 3rem;
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid rgb(226 232 240);
  background: white;
  flex-shrink: 0;
}
.dark .app-topbar {
  border-bottom-color: rgb(30 41 59);
  background: rgb(15 23 42);
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 13rem;
  max-width: 18rem;
}
.app-brand-mark {
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 auto;
  border-radius: 0.4rem;
  background: linear-gradient(135deg, rgb(99 102 241), rgb(217 70 239));
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.14);
}
.app-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}
.app-subtitle {
  margin-top: 0.15rem;
  max-width: 14.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.65rem;
  color: rgb(100 116 139);
}
.dark .app-subtitle {
  color: rgb(148 163 184);
}
.app-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.app-nav::-webkit-scrollbar {
  display: none;
}
.nav-btn,
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.8rem;
  border-radius: 0.375rem;
  border: 1px solid transparent;
  padding: 0.34rem 0.7rem;
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: rgb(71 85 105);
}
.nav-btn:hover,
.toolbar-btn:hover {
  background: rgb(241 245 249);
  color: rgb(15 23 42);
}
.dark .nav-btn,
.dark .toolbar-btn {
  color: rgb(148 163 184);
}
.dark .nav-btn:hover,
.dark .toolbar-btn:hover {
  background: rgb(30 41 59);
  color: rgb(226 232 240);
}
.nav-btn.active {
  background: rgb(238 242 255);
  color: rgb(79 70 229);
  border-color: rgb(199 210 254);
}
.dark .nav-btn.active {
  background: rgb(49 46 129 / 0.4);
  color: rgb(199 210 254);
  border-color: rgb(67 56 202);
}
.toolbar-btn {
  border-color: rgb(203 213 225);
  background: white;
  color: rgb(51 65 85);
}
.dark .toolbar-btn {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
  color: rgb(226 232 240);
}
.viewer-search {
  flex: 1 1 18rem;
  min-width: 12rem;
  max-width: 28rem;
  margin-left: auto;
}
.viewer-filter {
  width: 100%;
  height: 2rem;
  border-radius: 0.45rem;
  border: 1px solid rgb(203 213 225);
  background: rgb(248 250 252);
  padding: 0 0.75rem;
  font-size: 0.82rem;
  color: rgb(15 23 42);
}
.viewer-filter::placeholder {
  color: rgb(148 163 184);
}
.viewer-filter:focus {
  outline: none;
  border-color: rgb(99 102 241);
  box-shadow: 0 0 0 2px rgb(165 180 252 / 0.35);
}
.dark .viewer-filter {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
  color: rgb(226 232 240);
}
.dark .viewer-filter::placeholder {
  color: rgb(100 116 139);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* ---------- Viewer layout ---------- */
.viewer-layout {
  display: grid;
  grid-template-columns: minmax(18rem, 21rem) minmax(0, 1fr);
  min-height: 0;
  flex: 1 1 auto;
}
.viewer-sidebar {
  min-width: 0;
  overflow-y: auto;
  border-right: 1px solid rgb(226 232 240);
  background: white;
}
.dark .viewer-sidebar {
  border-right-color: rgb(30 41 59);
  background: rgb(15 23 42);
}
.viewer-content {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  background: rgb(248 250 252);
}
.dark .viewer-content {
  background: rgb(2 6 23);
}
.viewer-tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  min-height: 2.45rem;
  border-bottom: 1px solid rgb(226 232 240);
  background: white;
  padding: 0 0.9rem;
  flex-shrink: 0;
}
.dark .viewer-tabs {
  border-bottom-color: rgb(30 41 59);
  background: rgb(15 23 42);
}
#run-meta {
  max-width: min(42vw, 48rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.viewer-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1.25rem;
}
.viewer-empty-state {
  display: grid;
  place-content: center;
  min-height: 100%;
  gap: 0.25rem;
  color: rgb(100 116 139);
  text-align: center;
}
.dark .viewer-empty-state {
  color: rgb(148 163 184);
}
.viewer-empty-kicker {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.viewer-empty-title {
  font-size: 0.95rem;
  font-weight: 650;
  color: rgb(51 65 85);
}
.dark .viewer-empty-title {
  color: rgb(203 213 225);
}
.viewer-empty-meta {
  font-size: 0.75rem;
}
.viewer-empty-actions {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

/* ---------- Login ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.login-main {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgb(248 250 252);
}
.dark .login-main {
  background: rgb(2 6 23);
}
.login-panel {
  width: min(100%, 24rem);
  border: 1px solid rgb(226 232 240);
  border-radius: 0.5rem;
  background: white;
  padding: 1.1rem;
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.08);
}
.dark .login-panel {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42);
  box-shadow: 0 16px 36px rgb(0 0 0 / 0.24);
}
.login-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(99 102 241);
}
.dark .login-kicker {
  color: rgb(165 180 252);
}
.login-title {
  margin-top: 0.15rem;
  font-size: 1.25rem;
  font-weight: 750;
}
.login-form {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
}
.login-label {
  display: grid;
  gap: 0.25rem;
  font-size: 0.76rem;
  font-weight: 650;
  color: rgb(71 85 105);
}
.dark .login-label {
  color: rgb(203 213 225);
}
.auth-field {
  width: 100%;
  height: 2.25rem;
  border-radius: 0.42rem;
  border: 1px solid rgb(203 213 225);
  background: rgb(248 250 252);
  padding: 0 0.65rem;
  font-size: 0.86rem;
  color: rgb(15 23 42);
}
.auth-field:focus {
  outline: none;
  border-color: rgb(99 102 241);
  box-shadow: 0 0 0 2px rgb(165 180 252 / 0.35);
}
.dark .auth-field {
  border-color: rgb(51 65 85);
  background: rgb(2 6 23);
  color: rgb(226 232 240);
}
.login-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  border-radius: 0.42rem;
  background: rgb(79 70 229);
  color: white;
  font-size: 0.82rem;
  font-weight: 700;
}
.login-submit:hover {
  background: rgb(99 102 241);
}
.login-status {
  min-height: 1rem;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: rgb(100 116 139);
}
.login-status[data-kind="error"] {
  color: rgb(220 38 38);
}
.dark .login-status {
  color: rgb(148 163 184);
}
.dark .login-status[data-kind="error"] {
  color: rgb(252 165 165);
}

/* ---------- Tabs ---------- */
.tab-btn {
  padding: 0.55rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgb(100 116 139);
  border-bottom: 2px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
.tab-btn:hover {
  color: rgb(15 23 42);
}
.dark .tab-btn {
  color: rgb(148 163 184);
}
.dark .tab-btn:hover {
  color: rgb(226 232 240);
}
.tab-btn.tab-active {
  color: rgb(79 70 229);
  border-color: rgb(79 70 229);
}
.dark .tab-btn.tab-active {
  color: rgb(165 180 252);
  border-color: rgb(129 140 248);
}
.tab-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---------- Sidebar run cards ---------- */
.sidebar-summary {
  padding: 0.75rem 0.8rem;
  border-bottom: 1px solid rgb(226 232 240);
  background: rgb(248 250 252);
}
.dark .sidebar-summary {
  border-bottom-color: rgb(30 41 59);
  background: rgb(15 23 42);
}
.sidebar-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.sidebar-summary-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(71 85 105);
}
.dark .sidebar-summary-title {
  color: rgb(148 163 184);
}
.sidebar-summary-count {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgb(15 23 42);
}
.dark .sidebar-summary-count {
  color: rgb(226 232 240);
}
.sidebar-summary-meta {
  margin-top: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.68rem;
  color: rgb(100 116 139);
}
.dark .sidebar-summary-meta {
  color: rgb(148 163 184);
}
.sidebar-empty {
  padding: 0.9rem;
  font-size: 0.82rem;
  color: rgb(100 116 139);
}
.dark .sidebar-empty {
  color: rgb(148 163 184);
}
.run-list {
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem;
}
.run-card {
  cursor: pointer;
  border-radius: 0.5rem;
  padding: 0.5rem 0.55rem;
  border: 1px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease;
}
.run-card:hover {
  background: rgb(241 245 249);
}
.dark .run-card:hover {
  background: rgb(30 41 59);
}
.run-card.active {
  background: rgb(238 242 255);
  border-color: rgb(165 180 252);
}
.dark .run-card.active {
  background: rgb(49 46 129 / 0.35);
  border-color: rgb(99 102 241);
}
.run-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.5rem;
}
.run-card-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgb(51 65 85);
}
.dark .run-card-title {
  color: rgb(226 232 240);
}
.run-card-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.run-card-meta {
  margin-top: 0.28rem;
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.25rem 0.45rem;
  font-size: 0.66rem;
  line-height: 1.25;
  color: rgb(100 116 139);
}
.dark .run-card-meta {
  color: rgb(148 163 184);
}
.run-card-meta span {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-card-meta .mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.task-group-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(71 85 105);
  background: rgb(248 250 252);
  border-bottom: 1px solid rgb(226 232 240);
  cursor: pointer;
  user-select: none;
}
.dark .task-group-header {
  color: rgb(148 163 184);
  background: rgb(15 23 42);
  border-bottom-color: rgb(30 41 59);
}
.task-group-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.task-group-toggle {
  flex: 0 0 auto;
  width: 0.8rem;
  color: rgb(100 116 139);
}
.task-group-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-group-count {
  min-width: 1.7rem;
  justify-content: center;
}

@media (max-width: 980px) {
  .app-topbar {
    flex-wrap: wrap;
  }
  .app-brand {
    min-width: 11rem;
  }
  .viewer-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
  }
  .viewer-layout {
    grid-template-columns: minmax(15rem, 18rem) minmax(0, 1fr);
  }
  #run-meta {
    display: none;
  }
}

@media (max-width: 720px) {
  .viewer-layout {
    grid-template-columns: 1fr;
  }
  .viewer-sidebar {
    max-height: 34vh;
    border-right: 0;
    border-bottom: 1px solid rgb(226 232 240);
  }
  .dark .viewer-sidebar {
    border-bottom-color: rgb(30 41 59);
  }
  .viewer-main {
    padding: 0.9rem;
  }
}

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  font-weight: 500;
}

/* Score chip colors */
.score-chip {
  min-width: 2.4rem;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.score-good {
  background: rgb(220 252 231);
  color: rgb(21 128 61);
  border-color: rgb(134 239 172);
}
.score-mid {
  background: rgb(254 249 195);
  color: rgb(161 98 7);
  border-color: rgb(253 224 71);
}
.score-bad {
  background: rgb(254 226 226);
  color: rgb(185 28 28);
  border-color: rgb(252 165 165);
}
.score-na {
  background: rgb(241 245 249);
  color: rgb(100 116 139);
  border-color: rgb(226 232 240);
}
.dark .score-good {
  background: rgb(6 78 59 / 0.5);
  color: rgb(134 239 172);
  border-color: rgb(6 95 70);
}
.dark .score-mid {
  background: rgb(113 63 18 / 0.5);
  color: rgb(253 224 71);
  border-color: rgb(133 77 14);
}
.dark .score-bad {
  background: rgb(127 29 29 / 0.4);
  color: rgb(252 165 165);
  border-color: rgb(153 27 27);
}
.dark .score-na {
  background: rgb(30 41 59);
  color: rgb(148 163 184);
  border-color: rgb(51 65 85);
}

.badge-gold {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #78350f;
  border: 1px solid #b45309;
}

/* ---------- Task management status ---------- */
.tm-status-strip {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.tm-status-pill {
  display: inline-flex;
  align-items: center;
  max-width: 13rem;
  padding: 0.1rem 0.45rem;
  border-radius: 0.375rem;
  border: 1px solid;
  font-size: 0.62rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tm-status-pill code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
}
.tm-status-ok {
  background: rgb(220 252 231);
  color: rgb(21 128 61);
  border-color: rgb(134 239 172);
}
.tm-status-warn {
  background: rgb(254 243 199);
  color: rgb(146 64 14);
  border-color: rgb(252 211 77);
}
.tm-status-bad {
  background: rgb(254 226 226);
  color: rgb(185 28 28);
  border-color: rgb(252 165 165);
}
.tm-status-neutral {
  background: rgb(241 245 249);
  color: rgb(71 85 105);
  border-color: rgb(203 213 225);
}
.tm-status-info {
  background: rgb(219 234 254);
  color: rgb(30 64 175);
  border-color: rgb(147 197 253);
}
.dark .tm-status-ok {
  background: rgb(20 83 45 / 0.35);
  color: rgb(134 239 172);
  border-color: rgb(22 101 52);
}
.dark .tm-status-warn {
  background: rgb(120 53 15 / 0.35);
  color: rgb(253 230 138);
  border-color: rgb(154 52 18);
}
.dark .tm-status-bad {
  background: rgb(127 29 29 / 0.35);
  color: rgb(252 165 165);
  border-color: rgb(153 27 27);
}
.dark .tm-status-neutral {
  background: rgb(30 41 59);
  color: rgb(203 213 225);
  border-color: rgb(51 65 85);
}
.dark .tm-status-info {
  background: rgb(30 58 138 / 0.35);
  color: rgb(147 197 253);
  border-color: rgb(30 64 175);
}

/* ---------- Tool badges ---------- */
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.tool-bash {
  background: rgb(17 24 39);
  color: rgb(134 239 172);
  border-color: rgb(31 41 55);
}
.tool-read_file {
  background: rgb(219 234 254);
  color: rgb(30 64 175);
  border-color: rgb(147 197 253);
}
.tool-save_grounding {
  background: rgb(237 233 254);
  color: rgb(91 33 182);
  border-color: rgb(196 181 253);
}
.tool-retrieve_groundings {
  background: rgb(224 231 255);
  color: rgb(55 48 163);
  border-color: rgb(165 180 252);
}
.tool-write_todos {
  background: rgb(254 243 199);
  color: rgb(133 77 14);
  border-color: rgb(252 211 77);
}
.tool-execute_code {
  background: rgb(207 250 254);
  color: rgb(14 116 144);
  border-color: rgb(103 232 249);
}
.tool-install_dependencies {
  background: rgb(254 226 226);
  color: rgb(153 27 27);
  border-color: rgb(252 165 165);
}
.tool-unknown {
  background: rgb(241 245 249);
  color: rgb(51 65 85);
  border-color: rgb(203 213 225);
}

.dark .tool-read_file {
  background: rgb(30 58 138 / 0.4);
  color: rgb(147 197 253);
  border-color: rgb(30 64 175);
}
.dark .tool-save_grounding {
  background: rgb(76 29 149 / 0.4);
  color: rgb(196 181 253);
  border-color: rgb(91 33 182);
}
.dark .tool-retrieve_groundings {
  background: rgb(55 48 163 / 0.4);
  color: rgb(165 180 252);
  border-color: rgb(67 56 202);
}
.dark .tool-write_todos {
  background: rgb(113 63 18 / 0.4);
  color: rgb(253 224 71);
  border-color: rgb(133 77 14);
}
.dark .tool-execute_code {
  background: rgb(22 78 99 / 0.4);
  color: rgb(165 243 252);
  border-color: rgb(14 116 144);
}
.dark .tool-install_dependencies {
  background: rgb(127 29 29 / 0.4);
  color: rgb(252 165 165);
  border-color: rgb(153 27 27);
}
.dark .tool-unknown {
  background: rgb(30 41 59);
  color: rgb(203 213 225);
  border-color: rgb(51 65 85);
}

/* ---------- Trajectory step cards ---------- */
.step-card {
  position: relative;
  border: 1px solid rgb(226 232 240);
  border-radius: 0.6rem;
  background: white;
  overflow: hidden;
}
.dark .step-card {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42);
}
.step-card.step-error {
  border-left: 3px solid rgb(220 38 38);
}

.step-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  background: rgb(248 250 252);
  border-bottom: 1px solid rgb(226 232 240);
  cursor: pointer;
  user-select: none;
}
.dark .step-head {
  background: rgb(15 23 42);
  border-bottom-color: rgb(30 41 59);
}

.step-index {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  color: rgb(100 116 139);
  min-width: 2.1rem;
  text-align: right;
  flex-shrink: 0;
}
.dark .step-index {
  color: rgb(148 163 184);
}

.step-body {
  padding: 0.75rem;
  display: grid;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.step-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgb(100 116 139);
  margin-bottom: 0.25rem;
}
.dark .step-label {
  color: rgb(148 163 184);
}

/* ---------- Code blocks ---------- */
.code-block {
  position: relative;
  border-radius: 0.5rem;
  overflow: auto;
  max-height: 32rem;
  background: rgb(15 23 42);
  border: 1px solid rgb(30 41 59);
}
.code-block pre,
.code-block code {
  margin: 0;
  padding: 0.75rem 0.85rem;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.77rem;
  line-height: 1.5;
  background: transparent !important;
  color: rgb(226 232 240);
  white-space: pre;
}
.code-block code.wrap,
.code-block pre.wrap {
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal {
  background: rgb(10 15 26);
  color: rgb(209 213 219);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.77rem;
  padding: 0.75rem 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 0.5rem;
  max-height: 32rem;
  overflow: auto;
  border: 1px solid rgb(30 41 59);
}

.copy-btn {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 500;
  color: rgb(203 213 225);
  background: rgb(30 41 59);
  border: 1px solid rgb(51 65 85);
  border-radius: 0.35rem;
  cursor: pointer;
}
.copy-btn:hover {
  background: rgb(51 65 85);
}

.truncate-fade {
  position: relative;
}
.truncate-fade.collapsed::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3rem;
  background: linear-gradient(to bottom, transparent, rgb(15 23 42));
  pointer-events: none;
}

/* ---------- Metric tiles ---------- */
.metric-tile {
  border: 1px solid rgb(226 232 240);
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
  background: white;
}
.dark .metric-tile {
  border-color: rgb(30 41 59);
  background: rgb(15 23 42);
}

.score-bar-track {
  height: 0.45rem;
  background: rgb(226 232 240);
  border-radius: 9999px;
  overflow: hidden;
}
.dark .score-bar-track {
  background: rgb(30 41 59);
}
.score-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 200ms ease;
}

/* ---------- Markdown content (final answer) ---------- */
.prose-answer {
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: none;
}
.prose-answer h1,
.prose-answer h2,
.prose-answer h3 {
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}
.prose-answer h1 {
  font-size: 1.35rem;
}
.prose-answer h2 {
  font-size: 1.15rem;
  border-bottom: 1px solid rgb(226 232 240);
  padding-bottom: 0.3rem;
}
.dark .prose-answer h2 {
  border-bottom-color: rgb(30 41 59);
}
.prose-answer h3 {
  font-size: 1rem;
}
.prose-answer p {
  margin: 0.7em 0;
}
.prose-answer ul,
.prose-answer ol {
  margin: 0.6em 0;
  padding-left: 1.4em;
}
.prose-answer li {
  margin: 0.2em 0;
}
.prose-answer code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82em;
  background: rgb(241 245 249);
  color: rgb(190 24 93);
  padding: 0.1em 0.35em;
  border-radius: 0.3em;
}
.dark .prose-answer code {
  background: rgb(30 41 59);
  color: rgb(244 114 182);
}
.prose-answer pre {
  margin: 0.8em 0;
  border-radius: 0.5rem;
  overflow: auto;
  background: rgb(15 23 42);
  border: 1px solid rgb(30 41 59);
}
.prose-answer pre code {
  background: transparent;
  color: rgb(226 232 240);
  padding: 0.8rem;
  display: block;
  font-size: 0.8rem;
  line-height: 1.55;
}
.prose-answer blockquote {
  margin: 0.8em 0;
  padding: 0.3em 0.9em;
  border-left: 3px solid rgb(165 180 252);
  color: rgb(71 85 105);
  background: rgb(248 250 252);
  border-radius: 0.25rem;
}
.dark .prose-answer blockquote {
  border-left-color: rgb(99 102 241);
  background: rgb(15 23 42);
  color: rgb(148 163 184);
}
.prose-answer table {
  border-collapse: collapse;
  width: 100%;
  margin: 0.8em 0;
  font-size: 0.85rem;
}
.prose-answer th,
.prose-answer td {
  border: 1px solid rgb(226 232 240);
  padding: 0.45em 0.7em;
  text-align: left;
}
.dark .prose-answer th,
.dark .prose-answer td {
  border-color: rgb(30 41 59);
}
.prose-answer th {
  background: rgb(248 250 252);
  font-weight: 600;
}
.dark .prose-answer th {
  background: rgb(15 23 42);
}
.prose-answer a {
  color: rgb(79 70 229);
  text-decoration: underline;
}
.dark .prose-answer a {
  color: rgb(165 180 252);
}

/* ---------- Todo status icons ---------- */
.todo-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 9999px;
  flex-shrink: 0;
  margin-top: 0.3rem;
}
.todo-pending {
  background: rgb(203 213 225);
}
.todo-in_progress {
  background: rgb(250 204 21);
  box-shadow: 0 0 0 3px rgb(250 204 21 / 0.25);
}
.todo-completed {
  background: rgb(34 197 94);
}

/* ---------- Misc ---------- */
.divider {
  height: 1px;
  background: rgb(226 232 240);
}
.dark .divider {
  background: rgb(30 41 59);
}

.kbd {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  padding: 0.05rem 0.3rem;
  border: 1px solid rgb(203 213 225);
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  background: rgb(248 250 252);
  color: rgb(51 65 85);
}
.dark .kbd {
  border-color: rgb(51 65 85);
  background: rgb(15 23 42);
  color: rgb(203 213 225);
}

/* Scrollbar polish */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgb(203 213 225);
  border-radius: 9999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.dark *::-webkit-scrollbar-thumb {
  background: rgb(51 65 85);
  background-clip: padding-box;
  border: 2px solid transparent;
}
