@font-face {
  font-family: "Geist";
  src: url("./assets/fonts/geist-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #171717;
  --strong: #09090b;
  --muted: #f5f5f5;
  --muted-2: #f4f4f5;
  --muted-foreground: #737373;
  --border: #e5e5e5;
  --divider: #e4e4e7;
  --sidebar: #fafafa;
  --sidebar-foreground: #404040;
  --secondary-container: #e8def8;
  --secondary: #625b71;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Geist", ui-sans-serif, system-ui, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  margin: 0;
  font: inherit;
}

button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: default;
  opacity: 0.62;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

.ui-icon {
  display: block;
  width: 16px;
  height: 16px;
}

.review-shell {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 100svh;
  overflow: hidden;
  border-radius: 24px;
  background: var(--background);
  box-shadow: inset 0 0 0 1px var(--border);
}

.desktop-layout {
  display: none;
}

.mobile-layout {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) 61px;
  height: 100svh;
  min-height: 100svh;
}

.mobile-page {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: 11px;
  padding: 20px 16px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.mobile-page::-webkit-scrollbar {
  display: none;
}

.page-header,
.detail-back-header {
  display: flex;
  min-width: 0;
  min-height: 36px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-header h1 {
  color: var(--strong);
  font-size: 28px;
  font-weight: 600;
  line-height: 32px;
  letter-spacing: -0.02em;
}

.page-header p {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.more-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
}

.back-button {
  min-height: 36px;
  padding-top: 7px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  line-height: 20px;
}

.primary-button,
.secondary-button,
.small-button,
.text-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.primary-button {
  padding: 0 14px;
  background: var(--foreground);
  color: white;
}

.secondary-button {
  width: fit-content;
  padding: 0 13px;
  border: 1px solid var(--border);
  background: white;
}

.small-button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

.text-button {
  padding: 0 8px;
}

.header-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading {
  display: flex;
  min-height: 22px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading h2 {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.section-heading > span:not(.pill) {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.pill {
  display: inline-grid;
  min-width: 24px;
  height: 20px;
  place-items: center;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: white;
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
}

.danger-pill {
  border: 0;
  background: var(--danger-soft);
  color: var(--danger);
}

.overline {
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
}

.mobile-nav {
  display: grid;
  width: 100%;
  min-width: 0;
  height: 61px;
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
  background: white;
}

.mobile-nav-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding-top: 5px;
  color: var(--sidebar-foreground);
  font-size: 12px;
  line-height: 16px;
  text-align: center;
}

.mobile-nav-icon {
  display: grid;
  width: 54px;
  height: 31px;
  place-items: center;
  border-radius: var(--radius-full);
}

.mobile-nav-icon .ui-icon {
  width: 21px;
  height: 21px;
}

.mobile-nav-item.is-active .mobile-nav-icon {
  background: var(--secondary-container);
}

.home-fleet,
.home-tasks {
  display: flex;
  flex-direction: column;
}

.home-fleet {
  gap: 5px;
}

.compact-alert {
  display: grid;
  min-width: 0;
  height: 70px;
  min-height: 70px;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.compact-alert .alert-icon {
  margin-top: 2px;
}

.compact-alert > div,
.evidence-alert > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.compact-alert strong,
.evidence-alert strong {
  font-size: 14px;
  font-weight: 500;
  line-height: 18px;
}

.compact-alert span,
.evidence-alert span {
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 18px;
}

.compact-alert .small-button {
  align-self: center;
}

.home-fleet-row {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.home-fleet-row strong,
.home-task-row strong {
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.home-fleet-row span {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 15px;
}

.home-task-row,
.desktop-task-row,
.record-row {
  display: flex;
  min-height: 56px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  border-bottom: 1px solid var(--divider);
}

.home-task-row {
  min-height: 48px;
}

.home-task-row strong,
.desktop-task-row strong,
.record-row strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.home-task-row span,
.desktop-task-row span,
.record-row span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.home-callout {
  display: flex;
  min-height: 57px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.callout-top {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.callout-top strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.callout-top small {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 15px;
  white-space: nowrap;
}

.home-email {
  display: flex;
  min-height: 62px;
  flex-direction: column;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.home-email strong {
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.home-email > span:last-child {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.communication-callout-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.communication-state {
  flex: none;
  color: var(--foreground);
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
}

.communication-rationale {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 15px;
}

.home-communication-callouts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--foreground);
  font-size: 13px;
  line-height: 18px;
}

.search-input::placeholder {
  color: #a1a1aa;
}

.segmented-tabs {
  display: grid;
  height: 28px;
  gap: 4px;
}

.segmented-tabs button {
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.segmented-tabs button.is-active {
  border-color: var(--foreground);
  background: var(--foreground);
  color: white;
}

.work-tabs,
.communication-tabs {
  grid-template-columns: repeat(3, 1fr);
}

.day-tabs {
  grid-template-columns: repeat(2, 1fr);
}

.mobile-record-list {
  display: flex;
  flex-direction: column;
}

.task-detail,
.fleet-detail {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.detail-title-row {
  display: flex;
  min-height: 58px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-title-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.detail-title-row h2 {
  color: var(--strong);
  font-size: 24px;
  font-weight: 600;
  line-height: 28px;
  letter-spacing: -0.02em;
}

.desktop-detail-more {
  display: none;
}

.metadata-grid {
  display: grid;
}

.metadata-item,
.key-value-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
  line-height: 16px;
}

.metadata-item span,
.key-value-row span {
  color: var(--muted-foreground);
}

.metadata-item strong,
.key-value-row strong {
  font-weight: 600;
  text-align: right;
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-section h3,
.schedule-day h3,
.ask-conversation h3,
.ask-context-rail h3,
.communication-results h2 {
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
}

.detail-section p,
.history-lines,
.file-row span,
.related-work-row span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 17px;
}

.file-row,
.related-work-row {
  display: flex;
  min-height: 56px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 0 8px;
  border-bottom: 1px solid var(--divider);
}

.file-row strong,
.related-work-row strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.history-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fleet-summary {
  display: flex;
  min-height: 46px;
  flex-direction: column;
  gap: 4px;
}

.fleet-summary strong {
  font-size: 15px;
  line-height: 20px;
}

.fleet-summary span,
.page-helper {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.mobile-fleet-roster {
  display: flex;
  flex-direction: column;
}

.fleet-roster-row {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid var(--divider);
}

.fleet-roster-row strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
}

.fleet-roster-row span,
.fleet-roster-row b {
  font-size: 12px;
  line-height: 16px;
}

.fleet-roster-row span {
  color: var(--muted-foreground);
}

.fleet-roster-row b {
  font-weight: 600;
}

.is-danger {
  color: var(--danger) !important;
}

.evidence-alert {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
}

.fleet-unknown {
  min-height: 76px;
  align-items: center;
}

.fleet-explanation {
  min-height: 78px;
}

.fleet-record-section {
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
}

.fleet-observation-section {
  padding-top: 0;
  border-top: 0;
}

.fleet-section-heading,
.fleet-event-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.fleet-section-heading > span,
.fleet-event-title > span,
.fleet-event-meta,
.confirmation-line,
.fleet-source-line span,
.fleet-record-list small {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 15px;
}

.record-boundary {
  color: var(--muted-foreground);
}

.record-boundary strong {
  color: var(--foreground);
}

.maintenance-status {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-left: 3px solid var(--muted-foreground);
  background: var(--muted);
}

.maintenance-status strong {
  font-size: 12px;
  line-height: 16px;
}

.maintenance-status span {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 15px;
}

.fleet-fact-list,
.fleet-event-list {
  display: flex;
  flex-direction: column;
}

.fleet-record-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: maintenance-item;
}

.fleet-record-list li {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
  counter-increment: maintenance-item;
}

.fleet-record-list li::before {
  content: counter(maintenance-item, decimal-leading-zero);
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 13px;
}

.fleet-record-list strong,
.fleet-event-title strong,
.event-evidence > strong,
.event-adjustment > strong {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.fleet-record-list span,
.fleet-event p,
.event-evidence span,
.event-adjustment span {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 16px;
}

.fleet-event {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 0;
  border-bottom: 1px solid var(--divider);
}

.fleet-event p,
.confirmation-line {
  margin: 0;
}

.performed-work {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding-left: 18px;
  color: var(--foreground);
  font-size: 11px;
  line-height: 16px;
}

.event-evidence,
.event-adjustment {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  border-left: 2px solid var(--divider);
}

.event-evidence > a {
  display: flex;
  width: fit-content;
  flex-direction: column;
  gap: 1px;
  color: var(--foreground);
  text-decoration: none;
}

.event-evidence > a span {
  color: var(--foreground);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.event-evidence > a small {
  color: var(--muted-foreground);
  font-size: 10px;
  line-height: 14px;
}

.fleet-source-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fleet-source-line a,
.fleet-source-line strong {
  width: fit-content;
  color: var(--foreground);
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.schedule-summary,
.schedule-title-line {
  display: flex;
  min-height: 40px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.schedule-summary strong {
  font-size: 15px;
  line-height: 20px;
}

.schedule-summary > span:not(.pill) {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.schedule-day {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.period-list,
.appointment-list,
.address-risks {
  display: flex;
  flex-direction: column;
}

.period-row {
  display: grid;
  min-height: 30px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  line-height: 16px;
}

.period-row strong {
  font-weight: 600;
}

.period-row span,
.period-row small {
  color: var(--muted-foreground);
}

.period-row span.is-open {
  color: var(--foreground);
  font-weight: 600;
}

.period-row small {
  text-align: right;
}

.appointment-row {
  display: grid;
  min-height: 54px;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--divider);
  font-size: 12px;
  line-height: 16px;
}

.appointment-row > strong {
  font-weight: 600;
}

.appointment-row > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.appointment-row b {
  font-weight: 600;
}

.appointment-row span:not(.pill) {
  color: var(--muted-foreground);
}

.address-risks > div {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  line-height: 16px;
}

.address-risks span {
  color: var(--muted-foreground);
}

.communication-results {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.communication-result {
  display: flex;
  min-height: 91px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  border-bottom: 1px solid var(--divider);
}

.communication-result > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.channel-label {
  display: inline-grid;
  min-width: 42px;
  height: 20px;
  place-items: center;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  line-height: 15px;
}

.communication-result strong,
.communication-result b {
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.communication-result time,
.communication-result > span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.thread-back {
  min-height: 24px;
}

.thread-back .back-button {
  padding-top: 0;
  min-height: 24px;
}

.communication-thread {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.communication-thread header h2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 28px;
}

.communication-thread header p {
  display: flex;
  flex-direction: column;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 17px;
}

.thread-retrieved::before {
  content: "";
}

.message {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  line-height: 18px;
}

.message span {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.message-user {
  width: min(100%, 274px);
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--muted);
}

.message-external {
  padding: 0 1px;
}

.thread-attachment {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding-left: 10px;
}

.thread-attachment strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 18px;
}

.thread-attachment span {
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 18px;
}

.ask-conversation {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ask-user-request {
  display: flex;
  min-height: 72px;
  align-items: center;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

@media (max-width: 799px) {
  .mobile-page:has(.home-fleet) .page-header h1 {
    font-size: 24px;
  }

  .schedule-day .period-list,
  .schedule-day .appointment-list,
  .schedule-day .address-risks {
    gap: 8px;
  }
}

.ask-synthesis {
  font-size: 13px;
  line-height: 18px;
}

.fact-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fact-list > div {
  display: flex;
  min-height: 38px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 0 8px;
}

.fact-list strong {
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
}

.fact-list span {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.ask-changed,
.recommended-next,
.source-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ask-changed > strong {
  font-size: 12px;
  line-height: 16px;
}

.ask-changed > span,
.recommended-next p {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.ask-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.ask-local-message {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border-radius: var(--radius-md);
  background: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.ask-local-message small {
  color: var(--muted-foreground);
}

.modal-scrim {
  position: fixed;
  z-index: 30;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 16px 10px;
  background: rgba(0, 0, 0, 0.22);
}

.confirm-modal {
  display: flex;
  width: min(358px, 100%);
  min-height: 286px;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.confirm-modal h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 24px;
}

.confirm-modal > strong {
  font-size: 14px;
  line-height: 19px;
}

.confirm-modal > span,
.confirm-modal p {
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 17px;
}

.confirm-modal p {
  margin-top: auto;
}

.modal-actions {
  justify-content: flex-end;
}

.review-popover {
  position: fixed;
  z-index: 40;
  top: 64px;
  right: 16px;
  width: min(280px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
  font-size: 13px;
  line-height: 18px;
}

.review-popover p {
  margin-top: 4px;
  color: var(--muted-foreground);
}

.review-toast {
  position: fixed;
  z-index: 50;
  right: 16px;
  bottom: 76px;
  left: 16px;
  max-width: 440px;
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid #262626;
  border-radius: var(--radius-md);
  background: var(--foreground);
  color: white;
  font-size: 12px;
  line-height: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.review-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 800px) {
  .review-shell {
    min-height: 100vh;
    border-radius: 16px;
  }

  .mobile-layout {
    display: none;
  }

  .desktop-layout {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .desktop-sidebar {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    gap: 24px;
    padding: 24px 16px;
    border-right: 1px solid var(--border);
    background: var(--sidebar);
  }

  .desktop-brand {
    display: flex;
    height: 43px;
    flex-direction: column;
    gap: 2px;
  }

  .desktop-brand strong {
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
  }

  .desktop-brand span {
    color: var(--muted-foreground);
    font-size: 12px;
    line-height: 16px;
  }

  .desktop-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .desktop-nav-item {
    display: flex;
    width: 100%;
    height: 36px;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-foreground);
    font-size: 14px;
    line-height: 20px;
  }

  .desktop-nav-item.is-active {
    background: var(--muted);
  }

  .desktop-sign-out {
    margin-top: auto;
    color: var(--muted-foreground);
  }

  .desktop-nav-item .ui-icon {
    width: 17px;
    height: 17px;
  }

  .desktop-page {
    min-width: 0;
    padding: 32px;
  }

  .page-header {
    min-height: 58px;
  }

  .page-header h1 {
    font-size: 28px;
    line-height: 34px;
  }

  .desktop-heading h2 {
    font-size: 18px;
    line-height: 24px;
  }

  .home-desktop-grid {
    display: grid;
    grid-template-columns: minmax(0, 752px) 360px;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
  }

  .home-ledger {
    display: flex;
    flex-direction: column;
    gap: 30px;
  }

  .desktop-task-row {
    min-height: 64px;
  }

  .home-fleet-table-head,
  .home-fleet-table-row {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) 220px;
    align-items: center;
    gap: 16px;
  }

  .home-fleet-table-head {
    height: 40px;
    margin-top: 8px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--muted-2);
    color: var(--muted-foreground);
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
  }

  .home-fleet-table-row {
    min-height: 58px;
    padding: 0 12px;
    border-bottom: 1px solid var(--divider);
    font-size: 13px;
    line-height: 18px;
  }

  .home-fleet-table-row strong {
    font-weight: 600;
  }

  .home-fleet-table-row span {
    color: var(--muted-foreground);
  }

  .home-context-rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .desktop-schedule-callout {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    gap: 7px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: var(--muted);
  }

  .desktop-schedule-callout h2 {
    margin-top: 4px;
    font-size: 22px;
    line-height: 28px;
  }

  .desktop-schedule-callout > strong {
    font-size: 14px;
    line-height: 20px;
  }

  .desktop-schedule-callout p {
    color: var(--muted-foreground);
    font-size: 13px;
    line-height: 18px;
  }

  .desktop-schedule-callout .secondary-button {
    margin-top: auto;
  }

  .desktop-email-callout {
    display: flex;
    min-height: 150px;
    flex-direction: column;
    gap: 6px;
    padding: 18px 0;
    border-top: 1px solid var(--border);
  }

  .desktop-email-callout > span:not(.overline) {
    color: var(--muted-foreground);
    font-size: 13px;
    line-height: 18px;
  }

  .desktop-email-callout .communication-state {
    color: var(--foreground);
    font-size: 11px;
    line-height: 15px;
  }

  .desktop-email-callout .communication-rationale {
    font-size: 12px;
    line-height: 16px;
  }

  .desktop-email-callout strong {
    font-size: 14px;
    line-height: 20px;
  }

  .home-context-rail .home-communication-callouts {
    gap: 0;
  }

  .desktop-search {
    width: 260px;
  }

  .work-tabs {
    width: 360px;
    margin-top: 20px;
  }

  .workbench {
    display: grid;
    width: 100%;
    max-width: 1136px;
    min-height: 760px;
    grid-template-columns: 360px minmax(0, 752px);
    margin-top: 20px;
  }

  .master-list {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  .master-list h2 {
    margin-bottom: 4px;
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
  }

  .detail-pane {
    min-width: 0;
    padding-left: 24px;
    border-left: 1px solid var(--divider);
  }

  .task-detail {
    max-width: 728px;
    gap: 18px;
  }

  .detail-title-row {
    min-height: 68px;
  }

  .detail-title-row h2 {
    font-size: 22px;
    line-height: 28px;
  }

  .desktop-detail-more {
    display: block;
  }

  .metadata-grid {
    grid-template-columns: 160px 180px minmax(0, 260px);
    gap: 24px;
  }

  .metadata-item {
    min-height: 48px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
    border-bottom: 0;
  }

  .metadata-item strong {
    text-align: left;
  }

  .detail-section {
    gap: 10px;
  }

  .file-row,
  .related-work-row {
    width: 100%;
    padding-left: 8px;
  }

  .page-helper {
    margin-top: 20px;
  }

  .fleet-workbench {
    display: grid;
    width: 100%;
    max-width: 1136px;
    grid-template-columns: minmax(0, 752px) 360px;
    gap: 24px;
    align-items: start;
    margin-top: 20px;
  }

  .fleet-table-head,
  .fleet-table-row {
    display: grid;
    grid-template-columns: 140px 200px 170px minmax(0, 242px);
    align-items: center;
  }

  .fleet-table-head {
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--muted-2);
    color: var(--muted-foreground);
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
  }

  .fleet-table-row {
    min-height: 64px;
    padding: 0 12px;
    border-bottom: 1px solid var(--divider);
    font-size: 13px;
    line-height: 18px;
  }

  .fleet-table-row strong {
    font-weight: 600;
  }

  .fleet-table-row span:nth-child(3) {
    color: var(--muted-foreground);
  }

  .fleet-detail {
    gap: 16px;
    overflow: hidden;
  }

  .fleet-detail .detail-title-row {
    min-height: 58px;
  }

  .schedule-desktop-grid {
    display: grid;
    width: 100%;
    max-width: 1136px;
    grid-template-columns: repeat(2, minmax(0, 556px));
    gap: 24px;
    margin-top: 20px;
  }

  .schedule-day {
    gap: 10px;
  }

  .schedule-day > h2,
  .schedule-title-line h2 {
    font-size: 20px;
    font-weight: 600;
    line-height: 26px;
  }

  .day-summary {
    color: var(--muted-foreground);
    font-size: 13px;
    line-height: 18px;
  }

  .period-row {
    min-height: 38px;
  }

  .appointment-row {
    grid-template-columns: 66px minmax(0, 1fr) auto;
  }

  .communication-workbench {
    display: grid;
    width: 100%;
    max-width: 1136px;
    min-height: 720px;
    grid-template-columns: 380px minmax(0, 732px);
    gap: 24px;
    margin-top: 20px;
  }

  .communication-master {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
  }

  .communication-detail {
    min-width: 0;
    padding-left: 24px;
    border-left: 1px solid var(--divider);
  }

  .communication-thread header h2 {
    font-size: 24px;
    line-height: 30px;
  }

  .communication-thread header p {
    flex-direction: row;
  }

  .thread-retrieved::before {
    content: " · ";
  }

  .message-user {
    width: min(100%, 560px);
  }

  .thread-attachment {
    width: 360px;
  }

  .ask-desktop-grid {
    display: grid;
    width: 100%;
    max-width: 1136px;
    grid-template-columns: minmax(0, 744px) 360px;
    gap: 32px;
    margin-top: 20px;
  }

  .ask-conversation {
    min-width: 0;
    gap: 10px;
  }

  .ask-user-request {
    width: 560px;
  }

  .ask-context-rail {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .source-list {
    gap: 10px;
  }

  .source-list > div {
    display: flex;
    min-height: 30px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
  }

  .source-list span {
    color: var(--muted-foreground);
  }

  .ask-composer {
    grid-template-columns: minmax(0, 650px) 86px;
    margin-top: 8px;
  }

  .modal-scrim {
    align-items: flex-start;
    padding: min(29.3vh, 300px) 0 0;
  }

  .confirm-modal {
    width: 420px;
    min-height: 310px;
    padding: 24px;
  }

  .review-toast {
    bottom: 24px;
  }
}

@media (min-width: 800px) and (max-width: 1180px) {
  .desktop-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .home-desktop-grid,
  .fleet-workbench,
  .communication-workbench {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .ask-desktop-grid,
  .conversation-workbench {
    grid-template-columns: minmax(0, 1fr);
  }

  .ask-user-request {
    width: 100%;
  }

  .workbench {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .schedule-desktop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Live Leo integration states and controls */
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}

.home-usefulness {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 28px;
  padding-top: 12px;
}

.home-usefulness > div,
.home-review-note {
  min-width: 0;
}

.home-focus-heading {
  margin-bottom: 2px;
}

.home-focus-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.home-focus-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--divider);
}

.home-focus-item:first-child {
  border-top: 1px solid var(--divider);
}

.home-focus-copy {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.home-focus-copy h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 23px;
}

.home-focus-copy p {
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.home-focus-recommendation {
  margin-top: 4px;
  color: var(--foreground) !important;
}

.home-clear-state {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
  padding: 28px 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.home-clear-state h2 {
  max-width: 520px;
  font-size: 22px;
  line-height: 29px;
}

.home-clear-state p,
.home-review-note span {
  max-width: 620px;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 19px;
  overflow-wrap: anywhere;
}

.home-clear-state.is-limited h2 {
  font-size: 19px;
  line-height: 26px;
}

.home-review-note {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 0;
  font-size: 13px;
  line-height: 18px;
}

.home-browse {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.home-browse > .overline {
  margin-bottom: 5px;
}

.home-browse button {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider);
  color: var(--foreground);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  text-align: left;
}

.home-browse button span {
  color: var(--muted-foreground);
  font-size: 20px;
  font-weight: 400;
}

textarea,
select {
  margin: 0;
  font: inherit;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.more-button,
.back-button,
.primary-button,
.secondary-button,
.small-button,
.text-button,
.segmented-tabs button,
.mobile-nav-item {
  min-height: 44px;
}

.more-button {
  min-width: 44px;
}

.search-input,
.home-fleet-row,
.home-task-row,
.desktop-task-row,
.record-row {
  min-height: 44px;
}

.button-link {
  text-decoration: none;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.page-state,
.section-state,
.empty-state,
.inline-error,
.action-receipt,
.home-recommendation,
.read-only-note {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  font-size: 13px;
  line-height: 18px;
}

.page-state {
  min-height: 150px;
  align-items: flex-start;
  justify-content: center;
}

.page-state span,
.section-state span,
.empty-state span,
.action-receipt small,
.muted-copy,
.read-only-note {
  color: var(--muted-foreground);
}

.page-state.is-error,
.inline-error,
.section-state.is-warning {
  border-color: #fecaca;
  background: #fff7f7;
}

.inline-error {
  color: #991b1b;
}

.action-receipt {
  position: relative;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border-color: #d8d0e6;
  background: #faf8fd;
}

.action-receipt > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.receipt-dismiss {
  align-self: flex-start;
}

.home-recommendation p {
  color: var(--foreground);
}

@media (min-width: 800px) {
  .home-usefulness.is-desktop {
    display: grid;
    width: min(100%, 1080px);
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: start;
    gap: 64px;
    padding-top: 18px;
  }

  .home-focus-item {
    min-height: 150px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 24px 0;
  }

  .home-focus-item .primary-button {
    flex: none;
  }

  .home-clear-state {
    min-height: 280px;
  }
}

.record-form-wrap,
.record-form,
.inline-form,
.attachment-form {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.record-form-wrap {
  width: min(100%, 760px);
}

.record-form label,
.inline-form label,
.attachment-form label,
.confirm-modal label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.record-form input,
.record-form select,
.record-form textarea,
.inline-form textarea,
.confirm-modal textarea,
.live-composer textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--foreground);
  resize: vertical;
}

.form-grid,
.reminder-fields {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.checkbox-field {
  min-height: 44px;
  flex-direction: row !important;
  align-items: center;
  align-self: end;
  cursor: pointer;
}

.checkbox-field input {
  width: 22px;
  min-height: 22px;
}

.metadata-grid dt,
.metadata-grid dd {
  margin: 0;
}

.metadata-grid dt {
  color: var(--muted-foreground);
  font-size: 12px;
}

.metadata-grid dd {
  font-size: 13px;
  font-weight: 600;
}

.file-picker {
  display: inline-flex !important;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
}

.file-picker input,
.composer-attach input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.file-policy,
.composer-help,
.optional-label {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
}

.selected-file-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.selected-file-list li {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 9px;
  border-radius: var(--radius-sm);
  background: var(--muted);
  font-size: 12px;
}

.communication-search,
.mobile-search-form {
  display: flex;
  min-width: 0;
  gap: 8px;
}

.communication-search .search-input,
.mobile-search-form .search-input {
  flex: 1;
}

.read-only-note {
  background: var(--muted);
}

.conversation-workbench {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  gap: 24px;
  margin-top: 20px;
}

.conversation-list {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.conversation-list-header,
.conversation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.conversation-list-item {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}

.conversation-list-item.is-active {
  border-color: #d8d0e6;
  background: #faf8fd;
}

.conversation-list-item span,
.conversation-heading span {
  color: var(--muted-foreground);
  font-size: 12px;
}

.live-conversation {
  min-width: 0;
  min-height: calc(100svh - 150px);
}

.conversation-messages {
  display: flex;
  min-height: 280px;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
}

.conversation-message {
  display: flex;
  width: min(86%, 680px);
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 20px;
  white-space: pre-wrap;
}

.conversation-message.is-user {
  align-self: flex-end;
  background: var(--muted);
}

.conversation-message.is-leo {
  align-self: flex-start;
  border: 1px solid var(--border);
}

.conversation-message small {
  color: var(--muted-foreground);
}

.message-receipt {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.live-composer {
  position: relative;
  display: flex;
  grid-template-columns: none;
  flex-direction: column;
  gap: 7px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.composer-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) 44px auto;
  gap: 8px;
  align-items: end;
}

.composer-attach {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.reference-menu {
  position: absolute;
  z-index: 10;
  right: 0;
  bottom: calc(100% - 8px);
  left: 0;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
}

.reference-menu button {
  display: flex;
  width: 100%;
  min-height: 48px;
  flex-direction: column;
  justify-content: center;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}

.reference-menu span {
  color: var(--muted-foreground);
  font-size: 12px;
}

.selected-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.composer-retention {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 16px;
}

.composer-retention input {
  width: 16px;
  height: 16px;
}

.reference-token {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid #d8d0e6;
  border-radius: var(--radius-full);
  background: #faf8fd;
  font-size: 12px;
}

.danger-text {
  color: var(--danger);
}

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

.app-content[aria-hidden="true"] {
  pointer-events: none;
}

@media (max-width: 799px) {
  .mobile-layout {
    grid-template-rows: minmax(0, 1fr) 68px;
  }

  .mobile-nav {
    height: 68px;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .form-grid,
  .reminder-fields,
  .action-receipt {
    grid-template-columns: minmax(0, 1fr);
  }

  .action-receipt {
    align-items: flex-start;
    flex-direction: column;
  }

  .conversation-workbench {
    display: flex;
    margin-top: 0;
  }

  .live-conversation {
    min-height: calc(100svh - 160px);
  }
}

@media (max-width: 359px) {
  .compact-alert {
    height: auto;
    min-height: 96px;
    grid-template-columns: 16px minmax(0, 1fr);
    padding: 9px 10px;
  }

  .compact-alert .small-button {
    grid-column: 2;
    justify-self: start;
  }

  .button-row,
  .header-actions {
    flex-wrap: wrap;
  }

  .composer-row {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .composer-row .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .review-toast {
    transition: none;
  }
}
