/* Small, scoped refinements shared by both release paths. */
.fast-ui .members-view {
  max-width: 1480px !important;
  padding: 0 !important;
}

/* The old first-child selector styled the removed toolbar. Never apply it to the grid. */
.fast-ui main .members-view:has(.member-card) > .w-full:first-child {
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
}

.fast-ui main .members-view:has(.member-card) > .w-full:first-child::before { content: none !important; }
.fast-ui.theme-light main .members-view,
.fast-ui.theme-light main .members-view > .w-full,
.fast-ui.theme-light main .members-view .grid:has(> .member-card) {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}
.fast-ui .members-view .grid:has(> .member-card) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
  align-items: stretch !important;
  gap: 14px !important;
}
.fast-ui .members-view .grid:has(> .member-card):not(:has(> .member-card:nth-child(5))) > .member-card,
.fast-ui .members-view .member-card {
  height: auto !important;
  min-height: 380px !important;
  max-height: min(760px, calc(100dvh - 72px)) !important;
  padding: 18px !important;
  border-radius: 20px !important;
  gap: 14px !important;
}
.fast-ui .member-card [class*="text-[8px]"],
.fast-ui .member-card [class*="text-[9px]"] { font-size: 11px !important; line-height: 1.5 !important; }
.fast-ui .member-card [class*="text-[10px]"] { font-size: 12px !important; }
.fast-ui .member-card [class*="text-[11px]"] { font-size: 13px !important; }
.fast-ui .member-card [class*="text-slate-600"] { color: var(--apple-secondary) !important; }
.fast-ui .member-card [class*="text-slate-700"] { color: var(--apple-tertiary) !important; }
.fast-ui .member-card [class*="max-w-[90px]"] { max-width: 160px !important; }
.fast-ui .member-card .overflow-y-auto { min-height: 0; overscroll-behavior: contain; }
.fast-ui .member-card [class*="group-hover:opacity-100"]:focus-visible { opacity: 1 !important; }

.fast-ui .audit-retention-note {
  color: var(--apple-secondary);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}
.fast-ui .audit-log-toolbar { gap: 16px; flex-wrap: wrap; }
.fast-ui .audit-log-filters { min-width: 0; max-width: 100%; padding: 3px; }
.fast-ui .audit-filter-button { min-height: 34px; font-size: 12px !important; }
.fast-ui .audit-log-body p { font-size: 12px; line-height: 1.5; }
.fast-ui .audit-log-entry { content-visibility: auto; contain-intrinsic-size: auto 72px; }

.fast-ui .project-list-panel button[title],
.fast-ui .queue-row-tools button { min-width: 32px; min-height: 32px; }
.fast-ui .project-list-panel input:focus-visible { outline-offset: -2px; }
.fast-ui .fixed.inset-0 > .relative { overscroll-behavior: contain; }
.fast-ui .fixed.inset-0 > .relative > [class*="border-t"] {
  flex-shrink: 0;
  padding: 16px 24px !important;
  gap: 10px !important;
}
.fast-ui .fixed.inset-0 > .relative > [class*="border-t"] button {
  min-height: 44px;
  padding: 10px 14px !important;
  font-size: 13px;
}
.fast-ui .project-paused > * { opacity: .78 !important; }
.fast-ui button { touch-action: manipulation; }

@media (max-width: 639px) {
  .fast-ui .members-view .grid:has(> .member-card) > .member-card { min-height: 0 !important; max-height: 640px !important; }
  .fast-ui .project-list-panel button[title],
  .fast-ui .queue-row-tools button { min-width: 40px; min-height: 40px; }
  .fast-ui .fixed.inset-0 > .relative > [class*="border-t"] {
    display: flex !important;
    flex-wrap: wrap;
    padding: 12px 16px !important;
  }
  .fast-ui .fixed.inset-0 > .relative > [class*="border-t"] button {
    flex: 1 1 110px;
    width: auto !important;
  }
  .fast-ui .audit-log-time { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .fast-ui *, .fast-ui *::before, .fast-ui *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Dashboard and history: quiet surfaces, legible type, one blue interaction accent. */
.fast-ui {
  --work-surface: #13171d;
  --work-surface-hover: #191f27;
  --work-header: #191e26;
  --work-line: rgba(168, 187, 211, .085);
  --work-muted: #8b97a8;
  --work-title: #ecf1f8;
  --work-accent: #76b5ff;
}
.fast-ui.theme-light {
  --work-surface: #ffffff;
  --work-surface-hover: #f5f8fc;
  --work-header: #f8f9fc;
  --work-line: rgba(33, 52, 78, .085);
  --work-muted: #6a7687;
  --work-title: #202b3b;
  --work-accent: #176bd1;
}
.fast-ui .dashboard-stats { gap: 14px !important; }
.fast-ui .dashboard-stats > div {
  background: var(--work-surface) !important;
  border: 1px solid var(--work-line) !important;
  border-radius: 16px !important;
  min-height: 100px;
  padding: 18px 20px !important;
  box-shadow: none !important;
}
.fast-ui .dashboard-stats > div::before { display: none !important; }
.fast-ui .dashboard-stats > div > div:first-child { margin-bottom: 10px !important; }
.fast-ui .dashboard-stats > div > div:first-child > span {
  color: var(--work-muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: .025em !important;
}
.fast-ui .dashboard-stats > div > div:last-child > span:first-child {
  font-size: 30px !important;
  font-weight: 600 !important;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
}
.fast-ui .dashboard-stats > div > div:last-child > span:last-child { color: var(--work-muted) !important; }
.fast-ui .dashboard-controls {
  background: var(--work-surface) !important;
  border: 1px solid var(--work-line) !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  margin-top: 22px !important;
}
.fast-ui .dashboard-controls .global-search-input {
  background: var(--work-header) !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  color: var(--work-title) !important;
  font-size: 13px !important;
  min-height: 42px;
}
.fast-ui .dashboard-controls .global-search-input:focus {
  border-color: rgba(86, 157, 244, .45) !important;
  outline: none !important;
}
.fast-ui .dashboard-controls input::placeholder { color: var(--work-muted) !important; }
.fast-ui .dashboard-filter-row > div,
.fast-ui .dashboard-filter-row select {
  background: var(--work-header) !important;
  border-radius: 10px !important;
  border: 0 !important;
}
.fast-ui .dashboard-filter-row button { font-weight: 500 !important; }
.fast-ui .dashboard-filter-row button[class~="bg-indigo-500"] {
  background: #344355 !important;
  color: #eef5ff !important;
  border-radius: 7px !important;
}
.fast-ui.theme-light .dashboard-filter-row button[class~="bg-indigo-500"] {
  background: #ffffff !important;
  color: #176bd1 !important;
  box-shadow: 0 1px 4px rgba(25, 48, 80, .12) !important;
}
.fast-ui .project-list-panel {
  background: var(--work-surface) !important;
  border: 1px solid var(--work-line) !important;
  border-radius: 18px !important;
  box-shadow: none !important;
  margin-top: 22px !important;
}
.fast-ui .project-list-panel thead,
.fast-ui .project-list-panel thead tr { background: var(--work-header) !important; }
.fast-ui .project-list-panel th {
  color: var(--work-muted) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
}
.fast-ui .project-list-panel th:first-child { border-radius: 17px 0 0 0; }
.fast-ui .project-list-panel th:last-child { border-radius: 0 17px 0 0; }
.fast-ui .project-list-panel tbody tr { border-color: var(--work-line) !important; }
.fast-ui .project-list-panel tbody tr:hover { background: var(--work-surface-hover) !important; }
.fast-ui .project-list-panel h4 {
  color: var(--work-title) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
}
.fast-ui .project-list-panel td:not(:first-child) { font-variant-numeric: tabular-nums; }
.fast-ui .project-list-panel td:nth-child(3) { white-space: nowrap; }
.fast-ui .project-list-panel td:first-child .relative { flex-shrink: 0; }
.fast-ui .project-list-panel td:first-child .relative span { white-space: nowrap; }
.fast-ui.theme-light .project-list-panel tbody tr[class] { background: transparent !important; }
.fast-ui.theme-light .project-list-panel tbody tr[class]:hover { background: var(--work-surface-hover) !important; }
.fast-ui.theme-light .project-list-panel td:nth-child(3) [class*="bg-emerald"] {
  background: #edf5f1 !important;
  border-color: transparent !important;
  color: #397e67 !important;
}
.fast-ui .project-list-panel td:first-child [class*="shadow-lg"] { box-shadow: none !important; }
.fast-ui .project-list-panel td:first-child .relative > [class*="cursor-pointer"]:not(:has(span)) {
  background: transparent !important;
  border: 1px dashed var(--work-muted) !important;
  opacity: .65;
  min-width: 26px;
  min-height: 26px;
  justify-content: center;
}
.fast-ui .project-list-panel td:first-child .relative > [class*="cursor-pointer"]:not(:has(span)) > div {
  background: transparent !important;
  color: var(--work-muted) !important;
  box-shadow: none !important;
}
.fast-ui .project-list-panel td:first-child .relative > [class*="cursor-pointer"]:hover { opacity: 1; }
.fast-ui .project-list-panel td:last-child div:has(> button[title="作废项目"]) {
  background: transparent !important;
  border: 0 !important;
  gap: 2px !important;
  padding: 0 !important;
}
.fast-ui .project-list-panel td:last-child button[title] {
  background: transparent !important;
  color: var(--work-muted) !important;
  border-radius: 8px !important;
  min-width: 30px;
  min-height: 32px;
}
.fast-ui .project-list-panel td:last-child button[title]:hover { background: var(--work-header) !important; }
.fast-ui .project-list-panel td:last-child button[title="结项"]:hover { color: #34d399 !important; }
.fast-ui .project-list-panel td:last-child button[title="退回分配栏"]:hover { color: #fbbf24 !important; }
.fast-ui .project-list-panel td:last-child button[title="作废项目"]:hover { color: #fb7185 !important; }
.fast-ui .project-list-panel td:last-child button:not([title]) {
  color: var(--work-accent) !important;
  border-color: transparent !important;
  background: rgba(76, 145, 232, .085) !important;
  border-radius: 8px !important;
  font-weight: 500 !important;
}

.fast-ui .audit-log-view { max-width: 1240px !important; }
.fast-ui .audit-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 0;
}
.fast-ui .audit-page-heading h2 {
  color: var(--work-title) !important;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: -.035em;
  font-weight: 600;
}
.fast-ui .audit-page-heading .audit-retention-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--work-muted);
  font-size: 11px;
}
.fast-ui .audit-page-heading .audit-retention-note::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #59b995;
}
.fast-ui .audit-log-toolbar { padding: 2px 0 6px; }
.fast-ui .audit-log-filters { gap: 6px !important; padding: 2px; }
.fast-ui .audit-filter-button {
  color: var(--work-muted) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  padding: 7px 12px !important;
  font-weight: 500 !important;
  min-height: 34px;
}
.fast-ui .audit-filter-button span {
  color: inherit !important;
  opacity: .6;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.fast-ui .audit-filter-button:hover { background: var(--work-header) !important; }
.fast-ui .audit-filter-button[data-selected="true"] {
  background: rgba(76, 145, 232, .12) !important;
  color: var(--work-accent) !important;
  border-color: rgba(86, 157, 244, .17) !important;
}
.fast-ui .audit-log-day-group > div:first-child {
  margin-bottom: 9px !important;
  padding: 0 3px;
  min-height: 26px;
  gap: 9px !important;
}
.fast-ui .audit-log-day-group > div:first-child h3 {
  color: var(--work-title) !important;
  font-size: 12px;
  font-weight: 500;
}
.fast-ui .audit-log-day-group > div:first-child span { color: var(--work-muted) !important; }
.fast-ui .audit-log-day-group > div:first-child > div { display: none; }
.fast-ui .audit-log-list {
  border: 1px solid var(--work-line) !important;
  border-radius: 16px;
  background: var(--work-surface) !important;
}
.fast-ui .audit-log-list .audit-log-entry {
  grid-template-columns: 48px 48px minmax(0, 1fr) 84px !important;
  padding: 17px 20px !important;
  gap: 16px !important;
  min-height: 82px;
  contain-intrinsic-size: auto 82px;
  border-color: var(--work-line) !important;
}
.fast-ui .audit-log-list .audit-log-entry:hover { background: var(--work-surface-hover) !important; }
.fast-ui .audit-log-time { color: var(--work-muted) !important; font-size: 11px; }
.fast-ui .audit-log-action-badge { width: 42px; border-radius: 6px; font-weight: 500; }
.fast-ui .audit-log-title-row { flex-wrap: wrap; column-gap: 12px; row-gap: 2px; }
.fast-ui .audit-log-title-row strong {
  color: var(--work-title) !important;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .005em;
}
.fast-ui .audit-log-actor,
.fast-ui .audit-log-actor::before { color: var(--work-muted) !important; font-size: 11px; }
.fast-ui .audit-log-body p {
  color: var(--work-muted) !important;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.65;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.fast-ui .audit-log-actions button:not(.audit-log-delete-button) {
  color: var(--work-muted) !important;
  background: transparent !important;
  border: 1px solid var(--work-line) !important;
  font-size: 11px;
  font-weight: 500;
  border-radius: 8px !important;
}
.fast-ui .audit-log-actions button:not(.audit-log-delete-button):hover {
  color: var(--work-accent) !important;
  border-color: rgba(86, 157, 244, .35) !important;
  background: rgba(76, 145, 232, .08) !important;
}
@media (min-width: 1280px) {
  .fast-ui .project-list-panel { --assignee-lane: 280px; }
  .fast-ui .project-list-panel table tbody tr,
  .fast-ui .project-list-panel table tbody td { height: auto !important; }
  .fast-ui .project-list-panel table tbody td:first-child > div { height: auto !important; min-height: 48px; }
  .fast-ui .project-list-panel table tbody td:first-child > div > div.flex-1 {
    height: auto !important;
    grid-template-columns: minmax(0, 1fr) var(--assignee-lane) !important;
    grid-template-rows: auto auto !important;
    column-gap: 20px !important;
  }
  .fast-ui .project-list-panel table tbody td:first-child > div > div.flex-1 > :nth-child(1) { flex-wrap: wrap; row-gap: 5px; }
  .fast-ui .project-list-panel table tbody td:first-child > div > div.flex-1 > :nth-child(3) {
    flex-wrap: wrap !important;
    gap: 6px !important;
    min-height: 42px;
    padding-left: 16px;
    border-color: var(--work-line) !important;
  }
  .fast-ui .project-list-panel table tbody td:first-child > div > div.flex-1 > :nth-child(3) > :last-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .fast-ui .project-list-panel table th:first-child::after {
    left: calc(100% - var(--assignee-lane) - 8px) !important;
    transform: translateY(-50%) !important;
  }
}

/* Every row reserves identical tracks, regardless of name length or occupied slots. */
.fast-ui .project-list-panel table tbody .project-assignees {
  display: grid !important;
  grid-template-columns: repeat(3, 80px) !important;
  grid-template-rows: 32px auto !important;
  align-items: center !important;
  justify-content: start !important;
  gap: 5px 8px !important;
}
.fast-ui .project-list-panel .project-assignees > .relative {
  width: 80px;
  min-width: 0;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fast-ui .project-list-panel .project-assignees > .relative:nth-child(1) { grid-column: 1; }
.fast-ui .project-list-panel .project-assignees > .relative:nth-child(2) { grid-column: 2; }
.fast-ui .project-list-panel .project-assignees > .relative:nth-child(3) { grid-column: 3; }
.fast-ui .project-list-panel .project-assignees > .relative > [class*="cursor-pointer"] {
  width: 80px;
  min-height: 30px;
  padding: 4px 7px !important;
  gap: 6px !important;
  justify-content: flex-start;
  box-sizing: border-box;
}
.fast-ui .project-list-panel .project-assignees > .relative > [class*="cursor-pointer"]:not(:has(span)) {
  width: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0 !important;
  justify-content: center;
}
.fast-ui .project-list-panel .project-assignees > .relative > [class*="cursor-pointer"] > div {
  flex-shrink: 0;
}
.fast-ui .project-list-panel .project-assignees > .relative > [class*="cursor-pointer"] > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fast-ui .project-list-panel .project-assignees > :last-child:not(.relative) {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 1280px) and (max-width: 1499px) {
  /* Stack the ownership lane below the title rather than squeezing the title. */
  .fast-ui .project-list-panel table tbody td:first-child > div > div.flex-1 {
    display: flex !important;
    flex-direction: column;
    align-items: stretch !important;
    gap: 3px !important;
  }
  .fast-ui .project-list-panel table tbody td:first-child > div > div.flex-1 > :nth-child(n) {
    align-self: stretch !important;
    width: 100%;
    justify-content: flex-start;
  }
  .fast-ui .project-list-panel table tbody td:first-child > div > div.flex-1 > .project-assignees {
    padding-left: 0 !important;
    border-left: 0 !important;
    margin-top: 5px !important;
    min-height: 0 !important;
  }
  .fast-ui .project-list-panel table th:first-child::after { content: none !important; }
  .fast-ui .project-list-panel table th { white-space: nowrap; }
}
@media (max-width: 700px) {
  .fast-ui .audit-page-heading h2 { font-size: 21px; }
  .fast-ui .audit-page-heading { gap: 10px; }
  .fast-ui .audit-log-list .audit-log-entry {
    grid-template-columns: 42px 44px minmax(0, 1fr) !important;
    gap: 8px 10px !important;
    padding: 14px !important;
  }
  .fast-ui .audit-log-title-row strong { white-space: normal; font-size: 13px; }
  .fast-ui .audit-log-actor { display: block; }
  .fast-ui .audit-log-body { grid-column: 1 / -1; grid-row: 2; }
  .fast-ui .audit-log-actions { grid-column: 3; grid-row: 1; justify-content: flex-end; }
  .fast-ui .audit-log-actions button { min-height: 36px; }
  .fast-ui .audit-log-body p { -webkit-line-clamp: 3; }
}
@media (max-width: 639px) {
  .fast-ui .dashboard-stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .fast-ui .dashboard-stats > div { min-height: 86px; padding: 14px !important; text-align: left; }
  .fast-ui .dashboard-stats > div > div:first-child { justify-content: space-between !important; }
  .fast-ui .dashboard-controls { margin-top: 16px !important; }
  .fast-ui .project-list-panel { margin-top: 16px !important; }
  .fast-ui .mobile-project-card { background: var(--work-surface); }
}

/* Important legacy utility rules require the base layer for mobile overrides. */
@layer base {
  @media (max-width: 639px) {
    .fast-ui .dashboard-stats {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 10px !important;
    }
    .fast-ui .dashboard-stats > div {
      padding: 14px !important;
      text-align: left !important;
      min-height: 86px !important;
    }
    .fast-ui .dashboard-stats > div > div:first-child {
      justify-content: space-between !important;
      margin-bottom: 8px !important;
    }
    .fast-ui .dashboard-stats span[class*="tracking-widest"] {
      font-size: 11px !important;
      line-height: 1.4 !important;
    }
    .fast-ui .dashboard-stats span[class*="text-xl"] {
      font-size: 28px !important;
      line-height: 1 !important;
    }
  }
}
