:root {
  color-scheme: light;
  --text: #172033;
  --text-strong: #101828;
  --muted: #667085;
  --subtle: #98a2b3;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --soft: #f2f4f7;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --blue: #0a66ff;
  --blue-soft: #edf4ff;
  --green: #137a4f;
  --green-soft: #ecf8f2;
  --amber: #a15c00;
  --amber-soft: #fff7e8;
  --red: #d92d20;
  --red-soft: #fff1f0;
  --navy: #26364a;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font-size: 16px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
select {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(10, 102, 255, 0.24);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  color: var(--text-strong);
}

.hidden,
[hidden] {
  display: none !important;
}

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

.collection-shell {
  width: min(1500px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 28px 64px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 250, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand-cluster,
.topbar-actions,
.brand,
.product-context,
.quiet-link,
.heading-actions,
.primary-button,
.secondary-button,
.privacy-strip,
.search-field {
  display: flex;
  align-items: center;
}

.brand-cluster,
.topbar-actions {
  gap: 12px;
}

.brand {
  gap: 10px;
  color: var(--text-strong);
  font-size: 1.05rem;
  font-weight: 760;
  text-decoration: none;
}

.brand img {
  width: 28px;
  height: 28px;
}

.product-context {
  min-height: 38px;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.product-context strong {
  color: var(--text-strong);
  font-size: 0.88rem;
}

.product-context small {
  color: var(--muted);
  font-size: 0.75rem;
}

.connection-pill,
.stage-pill {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.76rem;
  font-weight: 760;
  white-space: nowrap;
}

.connection-pill.is-live {
  border-color: #cfe9dc;
  color: var(--green);
  background: var(--green-soft);
}

.connection-pill.is-preview {
  border-color: #f1d7aa;
  color: var(--amber);
  background: var(--amber-soft);
}

.quiet-link {
  min-height: 38px;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 680;
  text-decoration: none;
}

.quiet-link:hover {
  background: var(--soft);
}

.quiet-link svg,
.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}

.access-gate {
  width: min(530px, 100%);
  margin: 9vh auto 0;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(16, 24, 40, 0.09);
}

.gate-mark {
  display: grid;
  width: 46px;
  height: 46px;
  margin-bottom: 28px;
  place-items: center;
  border: 1px solid #cfddf8;
  border-radius: 11px;
  color: var(--blue);
  background: var(--blue-soft);
}

.gate-mark svg {
  width: 22px;
  height: 22px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.access-gate h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 5vw, 2.55rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.access-gate > p:not(.eyebrow, .form-error) {
  margin-bottom: 26px;
  color: var(--muted);
  line-height: 1.55;
}

.access-gate form {
  display: grid;
  gap: 13px;
}

.account-help-link {
  width: fit-content;
  color: var(--green);
  font-size: .75rem;
  font-weight: 750;
  text-decoration: none;
}

label {
  display: grid;
  gap: 7px;
}

label > span,
.project-switcher label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
}

input,
select,
textarea {
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text-strong);
  background: var(--surface);
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.45;
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle);
}

.primary-button,
.secondary-button {
  min-height: 42px;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  padding: 0 15px;
  font-size: 0.88rem;
  font-weight: 760;
  text-decoration: none;
}

.primary-button {
  border: 1px solid var(--blue);
  color: var(--surface);
  background: var(--blue);
}

.primary-button:hover {
  border-color: #075ee9;
  background: #075ee9;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--text-strong);
  background: var(--surface);
}

.secondary-button:hover {
  background: var(--soft);
}

.access-gate .primary-button {
  min-height: 49px;
  margin-top: 4px;
}

.form-error {
  margin: 10px 0 0;
  color: var(--red);
  font-size: 0.86rem;
  font-weight: 650;
}

.workspace {
  padding-top: 46px;
}

.workspace-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 34px;
  margin-bottom: 20px;
}

.workspace-heading h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.45rem, 5vw, 4.6rem);
  font-weight: 610;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.workspace-heading > div:first-child > p:last-child {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.52;
}

.heading-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.workspace-status {
  display: block;
  min-height: 20px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.8rem;
}

.workspace-status.is-error {
  color: var(--red);
}

.project-switcher {
  display: grid;
  grid-template-columns: minmax(210px, 0.72fr) minmax(300px, 1.6fr) minmax(170px, auto);
  gap: 20px;
  align-items: center;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.collection-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  padding: 13px 15px;
  border: 1px solid #cfddf8;
  border-radius: 10px;
  background: var(--blue-soft);
}

.collection-actions > div {
  display: grid;
  min-width: 220px;
  margin-right: auto;
  gap: 3px;
}

.collection-actions > div strong {
  color: var(--text-strong);
  font-size: 0.88rem;
}

.collection-actions > div span {
  color: #526b92;
  font-size: 0.76rem;
  line-height: 1.4;
}

.workbook-foundation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  margin: 12px 0;
  padding: 14px 15px;
  border: 1px solid #cfe9dc;
  border-radius: 10px;
  background: var(--green-soft);
}

.workbook-foundation > svg {
  width: 22px;
  height: 22px;
  color: #287458;
}

.workbook-foundation > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.workbook-foundation strong {
  overflow: hidden;
  color: var(--text-strong);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbook-foundation > div > span {
  color: #3f6e5b;
  font-size: 0.76rem;
  line-height: 1.4;
}

#workbookFoundationFields {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

#workbookFoundationFields span {
  padding: 3px 7px;
  border: 1px solid #b9dccb;
  border-radius: 999px;
  color: #236148;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.67rem;
  font-weight: 720;
}

.project-switcher > div:first-child {
  display: grid;
  gap: 7px;
}

.project-identity {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
}

.project-identity strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text-strong);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-identity > span:last-child {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.82rem;
}

.role-identity {
  display: grid;
  gap: 4px;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.role-identity span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
  text-transform: uppercase;
}

.role-identity strong {
  color: var(--text-strong);
  font-size: 0.9rem;
}

.stage-pill {
  border-color: #cfddf8;
  color: #155eef;
  background: var(--blue-soft);
}

.privacy-strip {
  gap: 12px;
  margin: 12px 0 18px;
  padding: 13px 16px;
  border: 1px solid #cfe9dc;
  border-radius: 9px;
  color: var(--green);
  background: var(--green-soft);
}

.tracker-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.tracker-edit-guide {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #cfddf8;
  border-radius: 8px;
  color: #345ea8;
  background: var(--blue-soft);
}

.tracker-edit-guide > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.tracker-edit-guide > div {
  display: grid;
  gap: 2px;
}

.tracker-edit-guide strong {
  color: #214a8a;
  font-size: 0.82rem;
}

.tracker-edit-guide span {
  font-size: 0.77rem;
  line-height: 1.4;
}

.tracker-section.is-editing {
  border-color: #9bbcf5;
  box-shadow: 0 0 0 3px rgba(10, 102, 255, 0.08);
}

.tracker-section {
  scroll-margin-top: 88px;
}

.privacy-strip svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

.privacy-strip div {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.privacy-strip strong {
  font-size: 0.88rem;
}

.privacy-strip span {
  color: #3f6e5b;
  font-size: 0.82rem;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-card {
  min-height: 146px;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.metric-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
  text-transform: uppercase;
}

.metric-card header svg {
  width: 18px;
  height: 18px;
}

.metric-card.is-blue header svg,
.metric-card.is-blue .metric-value {
  color: var(--blue);
}

.metric-card.is-good header svg,
.metric-card.is-good .metric-value {
  color: var(--green);
}

.metric-card.is-attention header svg,
.metric-card.is-attention .metric-value {
  color: var(--amber);
}

.metric-value {
  display: block;
  margin-bottom: 7px;
  color: var(--text-strong);
  font-size: clamp(1.72rem, 3vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.04em;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.demographics-section {
  margin-bottom: 18px;
}

.demographics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.demographic-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
}

.demographic-card > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.demographic-card > header strong {
  color: var(--text-strong);
  font-size: 0.86rem;
}

.demographic-card > header span {
  color: var(--muted);
  font-size: 0.74rem;
}

.demographic-list {
  display: grid;
  gap: 7px;
}

.demographic-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(90px, 1.7fr) auto;
  gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.75rem;
}

.demographic-row i {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #dfe4ea;
}

.demographic-row i::after {
  display: block;
  width: var(--coverage, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  content: "";
}

.operations-section {
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin-bottom: 7px;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.section-summary {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.stage-card {
  min-height: 95px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.stage-card strong {
  display: block;
  margin-bottom: 11px;
  color: var(--text-strong);
  font-size: 1.45rem;
}

.stage-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.stage-card.is-live {
  border-color: #cfddf8;
  background: var(--blue-soft);
}

.stage-card.is-live strong {
  color: var(--blue);
}

.stage-card.is-good {
  border-color: #cfe9dc;
  background: var(--green-soft);
}

.stage-card.is-good strong {
  color: var(--green);
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 12px;
}

.attention-card {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
}

.attention-card i {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  color: var(--amber);
  background: var(--amber-soft);
}

.attention-card i svg {
  width: 17px;
  height: 17px;
}

.attention-card div {
  display: grid;
  gap: 2px;
}

.attention-card strong {
  color: var(--text-strong);
  font-size: 0.88rem;
}

.attention-card span {
  color: var(--muted);
  font-size: 0.76rem;
}

.table-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) 190px 190px;
  gap: 8px;
  margin-bottom: 12px;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  color: var(--subtle);
}

.search-field input {
  width: 100%;
  padding-left: 38px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 1140px;
  border-collapse: collapse;
}

thead {
  background: var(--soft);
}

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

th {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  color: var(--text);
  font-size: 0.82rem;
}

th:last-child,
td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  width: 92px;
  min-width: 92px;
  background: var(--surface);
  box-shadow: -8px 0 14px -12px rgba(16, 24, 40, 0.35);
}

th:last-child {
  z-index: 3;
  background: var(--soft);
}

tbody tr:hover td:last-child {
  background: #fafbfc;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafbfc;
}

.number-cell {
  color: var(--text-strong);
  font-weight: 760;
  white-space: nowrap;
}

.muted-cell {
  color: var(--subtle);
}

.status-chip {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.72rem;
  font-weight: 740;
  white-space: nowrap;
}

.status-chip.is-blue {
  color: #155eef;
  background: var(--blue-soft);
}

.status-chip.is-green {
  color: var(--green);
  background: var(--green-soft);
}

.status-chip.is-amber {
  color: var(--amber);
  background: var(--amber-soft);
}

.status-chip.is-red {
  color: var(--red);
  background: var(--red-soft);
}

.row-button {
  display: inline-flex;
  min-width: 68px;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.75rem;
  font-weight: 750;
}

.row-button:hover {
  color: var(--blue);
  background: var(--blue-soft);
}

.row-button svg {
  width: 14px;
  height: 14px;
}

.mobile-register {
  display: none;
}

.empty-state {
  margin: 18px 0 0;
  padding: 24px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  text-align: center;
}

.two-column-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.worker-list,
.activity-list {
  display: grid;
  gap: 8px;
}

.worker-row,
.activity-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
}

.worker-row {
  grid-template-columns: minmax(140px, 1fr) minmax(130px, auto) auto;
}

.worker-row div,
.activity-row div {
  display: grid;
  gap: 3px;
}

.worker-row strong,
.activity-row strong {
  color: var(--text-strong);
  font-size: 0.85rem;
}

.worker-row span,
.worker-row small,
.activity-row span,
.activity-row time {
  color: var(--muted);
  font-size: 0.75rem;
}

.worker-load {
  min-width: 92px;
}

.worker-load i {
  display: block;
  height: 5px;
  margin-top: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #dfe4ea;
}

.worker-load i::after {
  display: block;
  width: var(--worker-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  content: "";
}

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

.activity-row > i {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
}

.activity-row > i svg {
  width: 16px;
  height: 16px;
}

dialog {
  width: min(760px, calc(100% - 28px));
  max-height: min(88vh, 900px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.22);
}

dialog::backdrop {
  background: rgba(16, 24, 40, 0.42);
  backdrop-filter: blur(5px);
}

dialog form {
  padding: 25px;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.dialog-header h2 {
  margin-bottom: 5px;
  font-size: 1.55rem;
  letter-spacing: -0.025em;
}

.dialog-header span {
  color: var(--muted);
  font-size: 0.82rem;
}

.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}

.icon-button:hover {
  background: var(--soft);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

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

.stepper span {
  display: flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-size: 0.78rem;
  font-weight: 720;
}

.stepper i {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-style: normal;
  font-size: 0.68rem;
}

.stepper span.active {
  color: #155eef;
  background: var(--blue-soft);
}

.stepper span.active i {
  border-color: var(--blue);
  color: var(--surface);
  background: var(--blue);
}

fieldset {
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 17px;
  color: var(--text-strong);
  font-size: 1rem;
  font-weight: 760;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.full-width {
  grid-column: 1 / -1;
}

label small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.4;
}

.onboarding-note {
  display: flex;
  gap: 11px;
  margin-top: 17px;
  padding: 13px;
  border: 1px solid #cfddf8;
  border-radius: 8px;
  color: #345ea8;
  background: var(--blue-soft);
  font-size: 0.8rem;
  line-height: 1.45;
}

.onboarding-note.success {
  border-color: #cfe9dc;
  color: #3f6e5b;
  background: var(--green-soft);
}

.onboarding-note svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.access-list {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.access-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) auto auto auto;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.access-row > div {
  display: grid;
  gap: 2px;
}

.access-row strong {
  color: var(--text-strong);
  font-size: 0.84rem;
}

.access-row span {
  color: var(--muted);
  font-size: 0.74rem;
}

.access-row.is-inactive {
  opacity: 0.58;
}

.access-create {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.access-dialog {
  width: min(1040px, calc(100% - 28px));
}

.worker-candidate-summary {
  display: grid;
  gap: 3px;
  margin: 12px 0 16px;
  padding: 12px 14px;
  border: 1px solid #cfe4dc;
  border-radius: 8px;
  background: #f0f7f4;
}

.worker-candidate-summary strong {
  color: var(--green);
  font-size: .84rem;
}

.worker-candidate-summary span {
  color: var(--muted);
  font-size: .75rem;
}

.access-create small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 500;
  line-height: 1.45;
}

.access-code-result {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #cfe9dc;
  border-radius: 8px;
  color: var(--green);
  background: var(--green-soft);
}

.access-code-result strong {
  color: #0f5c3c;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
}

.access-code-result a {
  width: fit-content;
  margin-top: 6px;
  color: #0f5c3c;
  font-size: 0.84rem;
  font-weight: 900;
}

.integration-status {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--soft);
}

.integration-status strong {
  color: var(--text-strong);
  font-size: 0.9rem;
}

.integration-status span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.integration-status.is-connected {
  border-color: #cfe9dc;
  background: var(--green-soft);
}

.google-connect-action {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 17px;
  padding: 14px 15px;
  border: 1px solid #cfddf8;
  border-radius: 9px;
  background: var(--blue-soft);
}

.google-connect-action > div {
  display: grid;
  flex: 1;
  gap: 3px;
}

.google-connect-action strong,
.google-cloud-setup strong {
  color: var(--text-strong);
  font-size: 0.86rem;
}

.google-connect-action span {
  color: #526b92;
  font-size: 0.75rem;
  line-height: 1.4;
}

.google-cloud-setup {
  display: grid;
  gap: 12px;
  margin-bottom: 17px;
  padding: 15px;
  border: 1px solid #e7d9b5;
  border-radius: 9px;
  background: #fffaf0;
}

.google-cloud-setup > div {
  display: grid;
  gap: 3px;
}

.google-cloud-setup ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: #725a27;
  font-size: 0.76rem;
  line-height: 1.45;
}

.google-cloud-setup label {
  display: grid;
  gap: 6px;
}

.google-cloud-setup label span {
  color: #725a27;
  font-size: 0.7rem;
  font-weight: 740;
  text-transform: uppercase;
}

.google-cloud-setup code {
  overflow-wrap: anywhere;
  padding: 8px 9px;
  border: 1px solid #e7d9b5;
  border-radius: 6px;
  color: #58461f;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.7rem;
}

.sheet-link {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
  padding: 0 13px;
  border: 1px solid #cfddf8;
  border-radius: 8px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 0.84rem;
  font-weight: 760;
  text-decoration: none;
}

.sheet-link svg {
  width: 17px;
  height: 17px;
}

.agent-dialog {
  width: min(1160px, calc(100% - 28px));
  height: min(88dvh, 880px);
  max-height: 880px;
  overflow: hidden;
}

.agent-dialog .agent-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  height: 100%;
  padding: 0;
}

.agent-dialog .dialog-header {
  margin: 0;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.agent-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.8fr);
  min-height: 0;
  overflow: hidden;
}

.agent-conversation {
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto auto;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #fbfcfe;
}

.agent-conversation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 17px 20px 13px;
}

.agent-conversation-heading h3 {
  margin: 2px 0 0;
  color: var(--text-strong);
  font-size: 1rem;
}

.agent-scope-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cfe9dc;
  border-radius: 999px;
  padding: 5px 9px;
  color: #287458;
  background: var(--green-soft);
  font-size: 0.7rem;
  font-weight: 760;
  white-space: nowrap;
}

.agent-scope-pill svg {
  width: 14px;
  height: 14px;
}

.agent-messages {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 20px 20px;
  scrollbar-gutter: stable;
}

.agent-message {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  max-width: 88%;
}

.agent-message.user {
  justify-self: end;
  grid-template-columns: minmax(0, 1fr) 30px;
}

.agent-message > i {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--blue);
  background: var(--surface);
}

.agent-message.user > i {
  grid-column: 2;
  grid-row: 1;
  color: #287458;
}

.agent-message > i svg {
  width: 15px;
  height: 15px;
}

.agent-message > div {
  border: 1px solid var(--line);
  border-radius: 4px 12px 12px;
  padding: 10px 12px;
  background: var(--surface);
  box-shadow: 0 2px 7px rgba(16, 24, 40, 0.04);
}

.agent-message.user > div {
  grid-column: 1;
  grid-row: 1;
  border-color: #c9dafb;
  border-radius: 12px 4px 12px 12px;
  background: var(--blue-soft);
}

.agent-message strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text-strong);
  font-size: 0.72rem;
}

.agent-message p {
  margin: 0;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.5;
}

.agent-prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 10px;
}

.agent-prompt-suggestions button,
.agent-preview-heading button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.7rem;
  font-weight: 700;
}

.agent-prompt-suggestions button:hover,
.agent-preview-heading button:hover {
  border-color: #b6caf0;
  color: var(--blue);
}

.agent-composer {
  display: grid;
  gap: 7px;
  margin: 0 20px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 11px;
  background: var(--surface);
  box-shadow: 0 7px 18px rgba(16, 24, 40, 0.06);
}

.agent-composer > label {
  color: var(--text-strong);
  font-size: 0.72rem;
  font-weight: 780;
}

.agent-composer textarea {
  min-height: 62px;
  resize: vertical;
  border: 0;
  padding: 0;
  outline: 0;
  background: transparent;
  line-height: 1.45;
}

.agent-composer > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agent-composer small {
  color: var(--muted);
  font-size: 0.68rem;
}

.agent-composer .primary-button {
  flex: 0 0 auto;
}

.agent-context {
  min-width: 0;
  overflow-y: auto;
  padding: 18px;
  background: var(--surface);
}

.agent-context-card,
.agent-folder-card {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 13px;
  background: var(--soft);
}

.agent-context-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.agent-context-heading strong {
  display: block;
  color: var(--text-strong);
  font-size: 0.84rem;
}

.agent-context-heading > svg {
  width: 18px;
  color: var(--blue);
}

.agent-context-card > span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.agent-attachment-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.agent-folder-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border-style: dashed;
  border-color: #9bbcf5;
  background: var(--blue-soft);
}

.agent-folder-card input {
  position: fixed;
  left: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.agent-folder-card > svg {
  width: 20px;
  color: var(--blue);
}

.agent-folder-card > span {
  display: grid;
  gap: 2px;
}

.agent-folder-card strong {
  color: var(--text-strong);
  font-size: 0.8rem;
}

.agent-folder-card small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.agent-folder-card b {
  color: var(--blue);
  font-size: 0.72rem;
}

.agent-excel-card {
  border-color: #9ed3bd;
  background: var(--green-soft);
}

.agent-excel-card > svg,
.agent-excel-card b {
  color: #287458;
}

.agent-workbook-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.agent-workbook-categories span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 7px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.65rem;
  font-weight: 720;
}

.agent-workbook-categories svg {
  width: 13px;
  height: 13px;
  color: var(--blue);
}

.agent-workbook-categories b {
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 999px;
  color: var(--surface);
  background: var(--blue);
  font-size: 0.6rem;
}

.agent-summary {
  display: block;
  margin: 12px 1px 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}

.agent-preview {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}

.agent-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  background: var(--soft);
}

.agent-preview-heading > div {
  display: grid;
  gap: 2px;
}

.agent-preview-heading strong {
  color: var(--text-strong);
  font-size: 0.8rem;
}

.agent-preview-heading span {
  color: var(--muted);
  font-size: 0.7rem;
}

.agent-preview-heading button {
  flex: 0 0 auto;
}

.agent-proposal-list {
  max-height: 290px;
  overflow: auto;
}

.agent-proposal {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.agent-proposal:first-child {
  border-top: 0;
}

.agent-proposal > input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin-top: 1px;
  accent-color: var(--blue);
}

.agent-proposal > span {
  display: grid;
  gap: 2px;
}

.agent-proposal strong {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  color: var(--text-strong);
  font-size: 0.76rem;
}

.agent-proposal strong em {
  border-radius: 999px;
  padding: 3px 6px;
  color: var(--blue);
  background: var(--blue-soft);
  font-style: normal;
  font-size: 0.58rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.agent-proposal small {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.4;
}

.agent-warnings {
  padding: 10px 12px;
  border-top: 1px solid #f1d7aa;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 0.7rem;
  line-height: 1.45;
}

.agent-dialog .form-error {
  margin: 0;
  padding: 10px 24px;
  border-top: 1px solid #f5cccc;
  border-radius: 0;
}

.agent-dialog .dialog-actions {
  margin: 0;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1050px) {
  .agent-dialog {
    width: min(900px, calc(100% - 20px));
  }

  .agent-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.8fr);
  }

  .workspace-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-actions {
    justify-content: flex-start;
  }

  .project-switcher {
    grid-template-columns: minmax(200px, 0.8fr) minmax(280px, 1.3fr);
  }

  .collection-actions {
    flex-wrap: wrap;
  }

  .collection-actions > div {
    width: 100%;
    flex-basis: 100%;
  }

  .role-identity {
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
    text-align: left;
  }

  .stage-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .google-connect-action {
    align-items: stretch;
    flex-direction: column;
  }

  .google-connect-action .primary-button {
    justify-content: center;
  }

  .agent-dialog {
    height: min(94dvh, 940px);
    max-height: 94dvh;
  }

  .agent-layout {
    display: block;
    overflow-y: auto;
  }

  .agent-conversation {
    min-height: 560px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .agent-context {
    overflow: visible;
  }

  .agent-conversation-heading,
  .agent-messages,
  .agent-prompt-suggestions {
    padding-inline: 16px;
  }

  .agent-composer {
    margin-inline: 16px;
  }

  .agent-composer > div {
    align-items: stretch;
    flex-direction: column;
  }

  .agent-composer .primary-button {
    width: 100%;
  }

  .agent-dialog .dialog-header,
  .agent-dialog .dialog-actions {
    padding-inline: 16px;
  }

  .collection-shell {
    padding: 0 16px 42px;
  }

  .topbar {
    min-height: 64px;
  }

  .product-context,
  .connection-pill,
  .quiet-link span {
    display: none;
  }

  .quiet-link {
    width: 38px;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--surface);
  }

  .access-gate {
    margin-top: 5vh;
    padding: 26px 21px;
  }

  .workspace {
    padding-top: 32px;
  }

  .workspace-heading h1 {
    font-size: 2.65rem;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .primary-button,
  .heading-actions .secondary-button {
    flex: 1 1 160px;
  }

  .project-switcher {
    grid-template-columns: 1fr;
  }

  .project-identity,
  .role-identity {
    grid-column: 1;
  }

  .privacy-strip {
    align-items: flex-start;
  }

  .privacy-strip div {
    display: grid;
    gap: 4px;
  }

  .workbook-foundation {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
  }

  .workbook-foundation .secondary-button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .metric-strip,
  .attention-grid,
  .demographics-grid,
  .two-column-band {
    grid-template-columns: 1fr;
  }

  .metric-card {
    min-height: 128px;
  }

  .operations-section {
    padding: 18px;
  }

  .section-heading {
    display: grid;
    gap: 7px;
  }

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

  .table-toolbar {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    display: none;
  }

  .mobile-register {
    display: grid;
    gap: 9px;
  }

  .assignment-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
  }

  .assignment-card header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
  }

  .assignment-card header div {
    display: grid;
    gap: 3px;
  }

  .assignment-card header strong {
    color: var(--text-strong);
    font-size: 0.96rem;
  }

  .assignment-card header span {
    color: var(--muted);
    font-size: 0.76rem;
  }

  .assignment-card dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0;
  }

  .assignment-card dl div {
    min-width: 0;
  }

  .assignment-card dt {
    color: var(--muted);
    font-size: 0.67rem;
    font-weight: 760;
    text-transform: uppercase;
  }

  .assignment-card dd {
    margin: 3px 0 0;
    overflow: hidden;
    color: var(--text-strong);
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .worker-row {
    grid-template-columns: 1fr auto;
  }

  .worker-load {
    grid-column: 1 / -1;
  }

  dialog form {
    padding: 20px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .collection-actions .primary-button,
  .collection-actions .secondary-button {
    flex: 1 1 145px;
  }

  .tracker-heading-actions {
    justify-content: flex-start;
  }

  .access-row {
    grid-template-columns: 1fr auto;
  }

  .access-row > div:nth-child(2) {
    grid-column: 1;
  }

  .access-row > div:nth-child(3) {
    grid-column: 1;
  }

  .full-width {
    grid-column: 1;
  }

  .stepper span {
    justify-content: center;
    font-size: 0;
  }

  .stepper i {
    font-size: 0.68rem;
  }

  .dialog-actions {
    flex-wrap: wrap;
  }

  .dialog-actions .primary-button,
  .dialog-actions .secondary-button {
    flex: 1 1 130px;
  }
}

@media (max-width: 430px) {
  .brand span {
    display: none;
  }

  .metric-strip {
    gap: 9px;
  }

  .stage-strip {
    grid-template-columns: 1fr;
  }

  .assignment-card dl {
    grid-template-columns: 1fr;
  }
}
