.home-surface {
  --home-rule: #d0d7e2;
  --home-soft-ink: #475973;
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  color: var(--ink);
}
.home-intro {
  margin-bottom: 20px;
  max-width: 760px;
}
.home-intro h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.13;
  letter-spacing: -1.6px;
}
.home-delegation {
  padding: 22px 24px 18px;
  border: 1px solid #c3cdda;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 5px 22px #19283c05;
}
.conversation-prediction { float: right; display: inline-flex; align-items: center; gap: 8px; font-size: 11px; }
.conversation-prediction button { font-size: inherit; padding: 0; }
.home-delegation label {
  font-size: 13px;
  color: var(--ink);
  margin: 0 0 8px;
}
.home-delegation textarea {
  border: 0;
  box-shadow: none;
  border-radius: 2px;
  padding: 0;
  min-height: 65px;
  font-size: 15px;
  line-height: 1.65;
  background: transparent;
}
.home-delegation textarea:focus {
  box-shadow: none;
}
.home-delegation textarea::placeholder {
  color: #7b90ae;
}
.home-delegation-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.home-primary {
  border: 1px solid var(--teal);
  border-radius: 4px;
  background: var(--teal);
  color: #fff;
  padding: 11px 16px;
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
}
.home-primary:hover {
  background: #172f51;
}
.conversation-stop { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; padding: 0; border: 1px solid var(--teal); border-radius: 50%; background: var(--teal); color: #fff; cursor: pointer; }
.conversation-stop:hover { background: #172f51; }
.conversation-stop:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.conversation-stop:disabled { opacity: .5; cursor: default; }
.conversation-stop > span { width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
.home-secondary {
  border: 1px solid #c0cad9;
  border-radius: 4px;
  padding: 10px 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
}
.home-scope {
  margin: 9px 2px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.home-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.home-section-heading h2 {
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.6px;
  margin: 0;
}
.home-matter-list,
.home-live-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.home-matter-caption {
  display: block;
  color: #5c7496;
  font-size: 12px;
  margin: 0 0 6px;
}
.home-title-button {
  display: inline;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.home-title-button:hover {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.home-text-button {
  padding: 0;
  border: 0;
  color: var(--teal);
  background: transparent;
  font-size: 12px;
  text-align: left;
  line-height: 1.6;
}
.home-text-button:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.home-matters {
  margin-top: 30px;
}
.home-matter-list {
  border-top: 1px solid var(--home-rule);
  margin-top: 18px;
}
.home-matter-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto;
  align-items: start;
  gap: 28px;
  padding: 21px 0;
  border-bottom: 1px solid var(--home-rule);
}
.home-matter-identity {
  min-width: 0;
  overflow-wrap: anywhere;
}
.home-matter-identity h3 {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 600;
}
.home-matter-identity p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.home-matter-update p {
  font-size: 12px;
  line-height: 1.75;
  margin: 0 0 8px;
  color: #546b8a;
}
.home-assignments {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--home-rule);
}
.home-live-list {
  margin-top: 15px;
}
.home-refresh-status {
  color: var(--muted);
  font-size: 13px;
  margin: 8px 0;
}
.home-live-assignment {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  text-align: left;
  padding: 15px 0;
  border: 0;
  border-bottom: 1px solid var(--home-rule);
  background: transparent;
  color: var(--ink);
}
.home-live-assignment:hover .home-live-title {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.home-live-title {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}
.home-live-status {
  color: var(--muted);
  font-size: 12px;
}
.home-live-arrow {
  color: var(--teal);
}
.home-empty {
  padding: 17px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
@media (max-width: 1150px) {
  .home-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
  .home-matter-row {
    grid-template-columns: minmax(210px, .95fr) minmax(0, 1fr);
    gap: 20px;
  }
}
@media (max-width: 580px) {
  .home-intro h1 {
    font-size: 35px;
    letter-spacing: -1.8px;
  }
  .home-delegation {
    padding: 19px 17px 16px;
  }
  .home-delegation textarea {
    font-size: 14px;
    min-height: 85px;
  }
  .home-delegation-bottom {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
  }
  .home-primary {
    align-self: flex-start;
  }
  .home-matter-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .home-live-assignment {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
  }
  .home-live-status {
    grid-column: 1;
    grid-row: 2;
  }
  .home-live-arrow {
    grid-column: 2;
    grid-row: 1 / 3;
  }
}
.home-delegation select {
  width: auto;
  max-width: 100%;
  min-height: 36px;
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
}
.home-delegation select:focus-visible {
  outline: 3px solid #6b89b3;
  outline-offset: 3px;
}
.home-conversations { margin: 16px 0; font-size: 13px; color: var(--muted); }
.home-conversations ul { padding-left: 18px; max-height: 160px; overflow-y: auto; }
.home-conversations li { margin: 8px 0; }
.conversation-surface { max-width: 850px; }
.conversation-surface .home-intro h1 { font-size: 40px; }
.conversation-messages { display: grid; gap: 16px; margin: 22px 0; }
.conversation-turn { padding: 16px 20px; border-radius: 7px; background: var(--paper); border: 1px solid #d0d7e2; }
.conversation-turn p:last-of-type { white-space: pre-wrap; font-size: 14px; line-height: 1.75; margin: 0; overflow-wrap: anywhere; }
.conversation-user { margin-left: 40px; background: #e7ebf1; }
.conversation-assistant { margin-right: 40px; }
.conversation-streaming-chunk { animation: conversation-text-fade 280ms ease-out; }
@keyframes conversation-text-fade { from { opacity: 0; } to { opacity: 1; } }
.conversation-progress { padding: 12px 14px; border-left: 2px solid #8fa1bb; border-radius: 4px; background: #f0f2f6; font-size: 13px; line-height: 1.5; }
.conversation-progress-status { margin: 0 0 8px; color: var(--teal); font-weight: 600; }
.conversation-progress ol { margin: 0; padding-left: 18px; }
.conversation-progress li + li { margin-top: 8px; }
.conversation-progress small { display: block; color: var(--muted); font-size: 11px; }
.conversation-progress a { text-underline-offset: 2px; }
.conversation-progress-history { margin-top: 10px; }
.conversation-progress-history > summary { cursor: pointer; font-size: 11px; color: var(--teal); }
.conversation-progress-history[open] > ol { margin-top: 8px; }
.approach-history { border-top: 1px solid var(--line); padding-top: 10px; }
.approach-history-item { margin: 10px 0; }
.conversation-approach { display: grid; gap: 12px; }
.conversation-approach .approach-summary { font-size: 15px; line-height: 1.5; margin: 12px 0; }
.approach-steps { padding-left: 20px; margin: 10px 0; font-size: 14px; line-height: 1.5; }
.approach-steps li + li { margin-top: 6px; }
.approach-scope { font-size: 13px; margin: 12px 0; }
.approach-automatic { display: flex; gap: 5px; align-items: center; flex: none; margin: 0 8px; font-size: 11px; white-space: nowrap; cursor: pointer; }
.approach-automatic input { width: 14px; height: 14px; margin: 0; accent-color: var(--teal); }
.conversation-approach .hint { font-size: 12px; line-height: 1.5; }
.conversation-approach h3 { cursor: pointer; }
.conversation-work { position: relative; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.conversation-work p { flex-basis: 100%; margin: 0; }
.conversation-work a { text-decoration: none; }
.conversation-directions { flex-basis: 100%; display: grid; gap: 12px; }
.conversation-directions h2 { font-size: 16px; margin: 0; }
.conversation-direction { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid #d0d7e2; border-radius: 7px; background: var(--paper); }
.conversation-direction .saved-instruction { white-space: pre-wrap; overflow-wrap: anywhere; }
.conversation-direction summary { cursor: pointer; }
.conversation-direction-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.conversation-direction button:disabled { opacity: .5; cursor: default; }
@media (max-width: 580px) {
  .conversation-user { margin-left: 14px; }
  .conversation-assistant { margin-right: 14px; }
  .conversation-surface .home-intro h1 { font-size: 32px; }
}

.home-new-investigation { margin: 18px 0; }
.home-new-investigation > h3, .home-conversations > h3, .home-history > h3 { cursor: pointer; color: var(--teal); font-size: 14px; padding: 8px 0; }
.home-new-investigation .home-delegation { margin-top: 12px; }
.home-history { margin-top: 20px; }
.home-matter-update { text-align: right; }
@media (max-width: 580px) { .home-matter-update { text-align: left; } .home-intro h1 { font-size: 30px; } }

.workspace > main:has(> #home-view:not([hidden]) > .home-dashboard) {
  position: relative;
  padding-top: 20px;
}
main:has(> #home-view:not([hidden]) > .home-dashboard) > .app-help {
  position: absolute;
  top: 20px;
  right: clamp(22px, 5vw, 80px);
  margin: 0;
}
.home-dashboard .home-intro {
  max-width: none;
  padding-right: 75px;
  margin-bottom: 10px;
}
.home-dashboard .home-new-investigation,
.home-dashboard .home-conversations {
  margin: 0 0 10px;
}

.home-dashboard .home-matters {
  margin-top: 12px;
}
.home-dashboard .home-section-heading {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}
.home-dashboard .home-matter-list {
  margin-top: 8px;
}
.home-dashboard .home-delegation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 12px;
  padding: 14px 16px;
  margin-top: 4px;
}
.home-dashboard .home-delegation label,
.home-dashboard .home-delegation textarea {
  grid-column: 1 / -1;
  margin: 0;
}
.home-dashboard .home-delegation textarea {
  min-height: 54px;
}
.home-dashboard .home-delegation select,
.home-dashboard .home-delegation-bottom {
  margin: 0;
}
@media (max-width: 580px) {
  .home-dashboard .home-delegation {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-dashboard .home-delegation-bottom {
    justify-self: end;
  }
}
.conversation-message-progress { padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; overflow: hidden; }
.conversation-message-progress > summary { display: flex; align-items: center; gap: 10px; padding: 11px 13px; cursor: pointer; list-style: none; color: var(--ink); }
.conversation-message-progress > summary::-webkit-details-marker { display: none; }
.conversation-message-progress > summary::after { content: ''; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); flex: 0 0 auto; margin: 0 2px 3px 1px; }
.conversation-message-progress[open] > summary::after { transform: rotate(225deg); margin-top: 5px; }
.conversation-message-progress > summary:focus-visible { outline-offset: -3px; border-radius: 9px; }
.message-progress-indicator { display: grid; place-items: center; width: 16px; height: 16px; flex: 0 0 16px; border: 1.5px solid #bac6d5; border-radius: 50%; color: var(--teal); font-size: 11px; line-height: 1; }
[data-status="working"] > summary .message-progress-indicator { border-color: #d6dfeb; border-top-color: var(--teal); animation: message-progress-spin 1.1s linear infinite; }
[data-status="completed"] > summary .message-progress-indicator::after { content: '✓'; }
[data-status="failed"] > summary .message-progress-indicator::after { content: '!'; }
[data-status="waiting"] > summary .message-progress-indicator::after { content: '·'; }
.message-progress-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.message-progress-title { font-size: 12px; font-weight: 600; }
.message-progress-latest { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.message-progress-count { flex: 0 0 auto; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.conversation-message-progress[open] > ol, .message-progress-history > ol { margin: 0; padding: 12px 16px 10px 34px; list-style: none; }
.conversation-message-progress[open] > ol { border-top: 1px solid var(--line); max-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.message-progress-history { border-top: 1px solid var(--line); }
.message-progress-history > summary { padding: 8px 13px; cursor: pointer; font-size: 11px; color: var(--teal); }
.message-progress-history > ol { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.conversation-message-progress li { position: relative; padding: 0 0 9px 5px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.conversation-message-progress li + li { margin-top: 0; }
.conversation-message-progress li:last-child { padding-bottom: 0; }
.message-progress-check::before { content: '·'; position: absolute; left: -20px; top: 1px; display: grid; place-items: center; width: 14px; height: 14px; font-size: 12px; line-height: 1; }
.conversation-message-progress li[data-status="completed"] > .message-progress-check::before { content: '✓'; color: var(--teal); }
.conversation-message-progress li[data-status="failed"] > .message-progress-check::before { content: '!'; color: #9a481f; border: 1px solid currentColor; border-radius: 50%; }
.conversation-message-progress li[data-status="interrupted"] > .message-progress-check::before { content: '−'; color: #7c6144; border: 1px solid currentColor; border-radius: 50%; }
.conversation-message-progress li[data-current="true"] { color: var(--ink); }
.conversation-message-progress li[data-status="running"] > .message-progress-check::before { content: ''; border: 1.5px solid #d6dfeb; border-top-color: var(--teal); border-radius: 50%; animation: message-progress-spin 1.1s linear infinite; }
.conversation-message-progress .message-progress-reused { display: inline; margin-left: 6px; font-size: 10px; }
@keyframes message-progress-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .conversation-streaming-chunk { animation: none; }
  [data-status="working"] > summary .message-progress-indicator, .conversation-message-progress li[data-status="running"] > .message-progress-check::before { animation: none; }
}

.conversation-elapsed, .conversation-answer-time { font-variant-numeric: tabular-nums; }
.conversation-answer-time { display: block; margin-top: 8px; }
