:root {
  --ink: #171717;
  --muted: #656565;
  --muted-2: #8a8a8a;
  --line: #dedbd7;
  --line-soft: #ece9e5;
  --canvas: #f6f5f2;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --surface-subtle: #faf9f7;
  --nav: #111111;
  --nav-muted: #b5b5b5;
  /* Legacy variable names now point to the GSR brand palette. */
  --brand-solid: #78131c;
  --brand-solid-hover: #5f0f16;
  --green: #78131c;
  --green-dark: #5f0f16;
  --green-soft: #f8eaec;
  --sand: #f2e6e8;
  --orange: #78131c;
  --rust: #9a2631;
  --warning: #a96112;
  --danger: #b83b22;
  --success: #257a4a;
  --success-soft: #e8f5ed;
  --shadow: 0 1px 2px rgba(20, 20, 20, 0.04), 0 8px 28px rgba(20, 20, 20, 0.06);
  --radius: 14px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

/* Streamlined Customer Form handoff and payment-choice UI. */
.customer-action-shell { max-width: 720px; }
.customer-action-hero { text-align: center; }
.customer-action-card { padding: clamp(1.25rem, 4vw, 2rem); }
.payment-choice-heading { margin-bottom: 1.25rem; }
.payment-choice-list { display: grid; gap: .75rem; margin: 1rem 0; }
.payment-choice-card {
    align-items: flex-start; border: 1px solid var(--line); border-radius: 14px;
    cursor: pointer; display: flex; gap: .8rem; padding: 1rem;
    transition: border-color .15s ease, background .15s ease;
}
.payment-choice-card:has(input:checked) {
    background: var(--green-soft); border-color: var(--green);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 18%, transparent);
}
.payment-choice-card input { flex: 0 0 auto; margin-top: .2rem; }
.payment-choice-card span { display: grid; gap: .3rem; }
.payment-choice-card small { color: var(--muted); line-height: 1.45; }
.payment-default-copy {
    background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 35%, var(--line));
    border-radius: 14px; color: var(--ink); font-size: 1rem; font-weight: 700;
    line-height: 1.5; margin-bottom: .5rem; padding: 1rem;
}
.payment-method-picker { margin: 0 0 1.25rem; }
.payment-method-picker summary {
    color: var(--muted); cursor: pointer; font-size: .9rem; padding: .45rem .2rem;
    text-decoration: underline; text-underline-offset: 3px;
}
.amount-due-highlight strong { color: var(--green); font-size: 1.25rem; }

html[data-theme="dark"] {
  --ink: #f4f4f4;
  --muted: #b5b5b5;
  --muted-2: #8f8f8f;
  --line: #3c3c3c;
  --line-soft: #2c2c2c;
  --canvas: #0f0f0f;
  --surface: #1a1a1a;
  --surface-raised: #1f1f1f;
  --surface-subtle: #151515;
  --nav: #050505;
  --nav-muted: #a7a7a7;
  --brand-solid: #8f1823;
  --brand-solid-hover: #a8222f;
  --green: #f06c75;
  --green-dark: #ff9aa1;
  --green-soft: #32171a;
  --sand: #342124;
  --orange: #f06c75;
  --rust: #e25560;
  --warning: #e5a64f;
  --danger: #ff9b86;
  --success: #72c995;
  --success-soft: #173223;
  --shadow: 0 1px 2px rgba(0, 0, 0, .22), 0 14px 38px rgba(0, 0, 0, .24);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: color 160ms ease, background-color 160ms ease;
}

button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }

.theme-toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(20, 38, 31, .06);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease, transform 140ms ease;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--green); transform: translateY(-1px); }
.theme-toggle:focus-visible { outline: 3px solid color-mix(in srgb, var(--green) 40%, transparent); outline-offset: 2px; }
.theme-toggle-icon { grid-area: 1 / 1; font-size: 16px; line-height: 1; transition: opacity 140ms ease, transform 180ms ease; }
.theme-toggle-sun { opacity: 0; transform: rotate(-35deg) scale(.7); }
html[data-theme="dark"] .theme-toggle-moon { opacity: 0; transform: rotate(35deg) scale(.7); }
html[data-theme="dark"] .theme-toggle-sun { opacity: 1; transform: rotate(0) scale(1); }
.theme-toggle-floating { position: fixed; z-index: 50; top: 18px; right: 18px; }
.page-utility-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 9px; }

.auth-page { background: #ecf0ec; }

.auth-shell {
  display: grid;
  grid-template-columns: minmax(360px, 0.92fr) minmax(480px, 1.08fr);
  min-height: 100vh;
}

.auth-story {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 52px clamp(40px, 6vw, 92px);
  color: white;
  background:
    radial-gradient(circle at 76% 72%, rgba(120, 19, 28, 0.34) 0 12%, transparent 13%),
    radial-gradient(circle at 76% 72%, transparent 0 25%, rgba(255,255,255,0.07) 25.3% 25.8%, transparent 26.1%),
    linear-gradient(145deg, #242424 0%, #111111 62%, #050505 100%);
}

.auth-story::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -210px;
  bottom: -180px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
}

.auth-brand, .brand, .mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 37px;
  height: 37px;
  border-radius: 10px 10px 10px 3px;
  background: var(--brand-solid);
  color: white;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.brand-name {
  display: block;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 14px;
}

.brand-subtitle {
  display: block;
  margin-top: 2px;
  color: var(--nav-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.auth-story-copy {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: auto 0;
}

.auth-story h1 {
  max-width: 520px;
  margin: 14px 0 22px;
  font-size: clamp(46px, 5vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  font-weight: 650;
}

.auth-story-copy > p:last-child {
  max-width: 480px;
  margin: 0;
  color: #c5d1cb;
  font-size: 17px;
  line-height: 1.65;
}

.auth-status {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  color: #aabbb3;
  font-size: 12px;
}

.status-dot, .quiet-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #66c394;
  box-shadow: 0 0 0 4px rgba(102, 195, 148, 0.12);
}

.auth-form-panel {
  display: grid;
  place-items: center;
  padding: 48px clamp(32px, 7vw, 110px);
  background: #fbfcfa;
}

.auth-form-wrap { width: min(100%, 410px); }
.mobile-brand { display: none; margin-bottom: 54px; }
.mobile-brand .brand-name { color: var(--ink); }

.eyebrow {
  margin: 0 0 9px;
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow-light { color: #ef9aa1; }

.auth-form-wrap h2 {
  margin: 0;
  font-size: 32px;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.form-intro {
  margin: 12px 0 34px;
  color: var(--muted);
  font-size: 14px;
}

.form-alert {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #e6c8bc;
  border-radius: 10px;
  color: #8b3f29;
  background: #fff5f1;
  font-size: 13px;
  line-height: 1.45;
}

.console-messages { display: grid; gap: 8px; margin-bottom: 18px; }
.console-message { padding: 12px 14px; border: 1px solid #b8ddc6; border-radius: 10px; color: var(--success); background: var(--success-soft); font-size: 10px; font-weight: 650; }
.console-message.error { border-color: #e3c2b7; color: #8b3f29; background: #fff5f1; }

.auth-form { display: grid; gap: 20px; }
.field-group { display: grid; gap: 8px; }

.field-group label {
  font-size: 13px;
  font-weight: 650;
}

.field-group input {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid #d7ddd8;
  border-radius: 10px;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field-group input::placeholder { color: #a2aaa6; }

.field-group input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(120, 19, 28, 0.16);
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 17px;
  border: 0;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease;
}

.button-primary { color: white; background: var(--brand-solid); }
.button-primary:not(:disabled):hover { background: var(--brand-solid-hover); transform: translateY(-1px); }
.button-secondary { border: 1px solid var(--line); background: white; }
.button-full { width: 100%; min-height: 51px; margin-top: 5px; }
.button:disabled { cursor: not-allowed; opacity: 0.72; }
.button[aria-disabled="true"] { pointer-events: none; opacity: 0.78; }

.action-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: action-spin 700ms linear infinite;
}

.action-wait-note,
.handoff-finished-note {
  margin: 9px 0 0;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

@keyframes action-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .action-spinner { animation: none; }
}

.auth-help {
  margin: 24px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.console-layout { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 252px;
  display: flex;
  flex-direction: column;
  color: white;
  background: var(--nav);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-close { display: none; }

.nav-list { padding: 28px 13px; }

.nav-label {
  margin: 0 12px 11px;
  color: #8f8f8f;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  margin: 3px 0;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--nav-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 540;
  transition: color 130ms ease, background 130ms ease;
}

.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active { color: white; background: rgba(255,255,255,0.09); }

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -13px;
  width: 3px;
  height: 22px;
  border-radius: 0 3px 3px 0;
  background: var(--brand-solid);
}

.nav-more { margin-top: 3px; }
.nav-more > summary { cursor: pointer; list-style: none; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary.active::before { display: none; }
.nav-more-items { display: grid; margin: 3px 0 7px 17px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,.12); }
.nav-subitem { min-height: 39px; }
.nav-chevron { margin-left: auto; font-size: 15px; transition: transform 140ms ease; }
.nav-more[open] .nav-chevron { transform: rotate(180deg); }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 20px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-solid);
  font-size: 10px;
  font-weight: 800;
}
.nav-badge-muted { color: #ddd; background: rgba(255,255,255,.1); }

.nav-icon {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 7px;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.nav-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.local-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 9px;
  background: rgba(255,255,255,0.04);
}

.local-badge strong, .local-badge small, .user-meta strong, .user-meta small { display: block; }
.local-badge strong { font-size: 11px; }
.local-badge small { margin-top: 3px; color: #82968d; font-size: 9px; }

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
}

.avatar, .topbar-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  color: #65401f;
  background: #ecd1b4;
  font-size: 12px;
  font-weight: 800;
}

.user-meta { min-width: 0; flex: 1; }
.user-meta strong { overflow: hidden; color: #eef3f0; font-size: 11px; text-overflow: ellipsis; }
.user-meta small { margin-top: 2px; color: #81968c; font-size: 9px; }

.signout-button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  color: #83988e;
  background: transparent;
  cursor: pointer;
}

.signout-button:hover { color: white; background: rgba(255,255,255,0.06); }
.sidebar-scrim { display: none; }

.main-shell { min-height: 100vh; margin-left: 252px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
}

.topbar-title { font-size: 13px; font-weight: 700; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-avatar { display: none; width: 32px; height: 32px; }

.build-pill, .stage-badge {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.menu-button {
  display: none;
  width: 36px;
  height: 36px;
  padding: 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.menu-button span { display: block; height: 1px; margin: 4px 0; background: var(--ink); }

.content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 38px clamp(24px, 3.4vw, 54px) 64px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 29px;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 37px);
  line-height: 1.15;
  letter-spacing: -0.042em;
  font-weight: 680;
}

.page-description { margin: 9px 0 0; color: var(--muted); font-size: 13px; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-bottom: 14px;
}

.stat-card, .panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card { min-height: 142px; padding: 20px; }
.stat-card-top { display: flex; justify-content: space-between; align-items: center; }
.stat-card-top p { margin: 0; color: var(--muted); font-size: 11px; font-weight: 650; }
.trend-placeholder { color: var(--muted-2); font-size: 11px; }
.stat-value { display: block; margin: 13px 0 10px; font-size: 31px; letter-spacing: -0.04em; }
.stat-detail { display: flex; align-items: center; gap: 7px; color: var(--muted-2); font-size: 9px; }
.quiet-dot { width: 5px; height: 5px; box-shadow: none; background: #a6b4ad; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel { padding: 22px; }

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

.panel-heading h2 { margin: 0; font-size: 16px; letter-spacing: -0.02em; }
.panel-heading .eyebrow { margin-bottom: 6px; font-size: 8px; }
.stage-badge { min-height: 21px; color: #8b5e32; background: #f6ebdd; font-size: 8px; }

.workflow-track { display: grid; gap: 0; padding: 3px 0; }

.workflow-step { display: flex; align-items: center; gap: 13px; min-height: 42px; }
.workflow-step > div { display: grid; gap: 3px; }
.workflow-step strong { font-size: 11px; }
.workflow-step small { color: var(--muted-2); font-size: 9px; }

.step-number {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted-2);
  background: white;
  font-size: 8px;
  font-weight: 750;
}

.workflow-step.current .step-number { border-color: var(--brand-solid); color: white; background: var(--brand-solid); }
.workflow-connector { width: 1px; height: 11px; margin-left: 14px; background: var(--line); }

.readiness-list { display: grid; }

.readiness-item {
  display: grid;
  grid-template-columns: 27px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 51px;
  border-top: 1px solid var(--line-soft);
}

.readiness-item:first-child { border-top: 0; }
.readiness-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: #7d8983; background: #eef1ef; font-size: 11px; }
.readiness-icon.ready { color: var(--success); background: var(--success-soft); }
.readiness-item strong, .readiness-item small { display: block; }
.readiness-item strong { font-size: 10px; }
.readiness-item small { margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.item-status { color: var(--muted-2); font-size: 8px; font-weight: 700; }
.item-status.ready { color: var(--success); }

.activity-panel { padding-bottom: 17px; }
.activity-panel .panel-heading { margin-bottom: 9px; }
.text-button { border: 0; color: var(--muted-2); background: transparent; font-size: 9px; }

.empty-state { text-align: center; }
.empty-state.compact { display: flex; align-items: center; gap: 14px; min-height: 76px; padding: 13px 15px; border-radius: 10px; background: #f7f9f7; text-align: left; }
.empty-state.compact strong { font-size: 11px; }
.empty-state p { margin: 5px 0 0; color: var(--muted-2); font-size: 9px; line-height: 1.5; }

.empty-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--green);
  background: white;
  font-size: 15px;
}

.table-panel { padding: 0; overflow: hidden; }

.table-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  min-height: 68px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.search-placeholder {
  width: min(300px, 100%);
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-2);
  background: #fafbfa;
  font-size: 10px;
}

.filter-button { min-height: 35px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: white; font-size: 10px; }
.filter-button:disabled { opacity: 0.75; }

.table-header {
  display: grid;
  grid-template-columns: repeat(var(--columns), minmax(120px, 1fr));
  min-width: 700px;
  min-height: 42px;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted-2);
  background: #fafbfa;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-wrap { overflow-x: auto; }
.table-empty { min-width: 700px; min-height: 330px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px; }
.table-empty .empty-icon { margin-bottom: 15px; }
.table-empty strong { font-size: 14px; }
.table-empty p { max-width: 340px; margin: 8px 0 19px; font-size: 10px; }
.table-empty .button { min-height: 36px; font-size: 10px; }

.record-count {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 650;
}

.task-columns,
.contractor-columns {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) minmax(170px, 1.2fr) minmax(90px, .65fr) minmax(95px, .7fr) minmax(150px, 1fr);
  min-width: 780px;
}

.task-columns {
  grid-template-columns: minmax(190px, 1.3fr) minmax(90px, .6fr) minmax(135px, .9fr) minmax(92px, .62fr) minmax(120px, .8fr) minmax(150px, 1fr);
  min-width: 940px;
}

.table-primary,
.table-subtitle { display: block; }
.table-primary { font-size: 10px; }
.table-subtitle { margin-top: 4px; color: var(--muted-2); font-size: 8px; font-weight: 500; }
.task-summary-list,
.status-summary-list,
.planned-summary-list { display: grid; gap: 9px; }
.task-summary-item,
.status-summary-list > span,
.planned-summary-list > span { display: block; }
.task-summary-item + .task-summary-item,
.status-summary-list > span + span,
.planned-summary-list > span + span { padding-top: 9px; border-top: 1px solid var(--line-soft); }
.task-workflow-status { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; font-size: 8px; font-weight: 750; white-space: nowrap; }
.task-workflow-status.scheduled { color: #51615a; background: #edf1ef; }
.task-workflow-status.in-progress { color: #825516; background: #fff2d9; }
.task-workflow-status.complete { color: #286143; background: #e5f3ea; }
.table-row.task-columns { padding-top: 13px; padding-bottom: 13px; }

.table-body { min-width: 780px; }

.table-row {
  align-items: center;
  min-height: 61px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 10px;
}

.table-row:last-child { border-bottom: 0; }
.table-row > strong { font-size: 11px; }
.table-muted { color: var(--muted-2); }
.phone-value { font-variant-numeric: tabular-nums; }

.source-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-subtle);
  font-size: 8px;
  font-weight: 750;
}

.status-badge.active { color: var(--success); background: var(--success-soft); }

.form-page { width: min(100%, 1050px); }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 24px; color: var(--muted); font-size: 11px; font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--green); }
.form-page-heading { margin-bottom: 25px; }

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr);
  align-items: start;
  gap: 16px;
}

.product-form-panel { padding: 28px; }
.product-form { display: grid; gap: 24px; }

.form-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line-soft);
}

.form-section-heading h2 { margin: 1px 0 5px; font-size: 15px; }
.form-section-heading p { margin: 0; color: var(--muted-2); font-size: 10px; }

.form-step {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border-radius: 8px;
  color: white;
  background: var(--brand-solid);
  font-size: 8px;
  font-weight: 750;
}

.product-form .field-group input {
  height: 47px;
  background: #fbfcfb;
}

.field-help { color: var(--muted-2); font-size: 9px; line-height: 1.45; }
.field-error { color: #9d432c; font-size: 9px; font-weight: 650; }
.field-error + .field-error { margin-top: -4px; }

.review-confirmation-actions { display: grid; justify-items: start; gap: 12px; margin-top: 20px; }

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 22px;
  border-top: 1px solid var(--line-soft);
}

.form-aside { display: grid; gap: 12px; }

.info-card,
.security-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

.info-card { padding: 22px; }
.info-icon { display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 17px; border-radius: 9px; color: var(--green); background: var(--green-soft); font-size: 14px; }
.info-card h2 { margin: 0 0 16px; font-size: 13px; }
.info-card ol { display: grid; gap: 12px; margin: 0; padding-left: 17px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.info-card li::marker { color: var(--green); font-weight: 750; }

.security-note { display: flex; align-items: flex-start; gap: 10px; padding: 15px; color: var(--muted); background: #f8faf8; box-shadow: none; }
.security-note > span { color: var(--green); font-size: 8px; }
.security-note p { margin: 0; font-size: 8px; line-height: 1.55; }
.security-note strong { display: block; margin-bottom: 2px; color: var(--ink); font-size: 9px; }

.success-page { width: min(100%, 770px); margin: 36px auto 0; text-align: center; }
.success-mark { display: grid; place-items: center; width: 48px; height: 48px; margin: 0 auto 18px; border-radius: 50%; color: white; background: var(--success); box-shadow: 0 0 0 9px var(--success-soft); font-size: 19px; font-weight: 750; }
.success-page h1 { margin: 0; font-size: clamp(29px, 4vw, 39px); letter-spacing: -0.045em; }
.success-intro { margin: 10px 0 25px; color: var(--muted); font-size: 12px; }
.success-card { padding: 0; overflow: hidden; text-align: left; }

.success-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
  background: #fafbfa;
}

.success-details > div { padding: 18px 20px; border-left: 1px solid var(--line); }
.success-details > div:first-child { border-left: 0; }
.success-details span, .success-details strong { display: block; }
.success-details span { margin-bottom: 7px; color: var(--muted-2); font-size: 8px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.success-details strong { font-size: 11px; }
.link-field-group { padding: 23px; }
.link-field-group label { display: block; margin-bottom: 8px; font-size: 10px; font-weight: 700; }
.link-field-group small { display: block; margin-top: 8px; color: var(--muted-2); font-size: 8px; }

.copy-field { display: flex; gap: 8px; }
.copy-field input { min-width: 0; flex: 1; height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: #f8faf8; font-size: 9px; outline: none; }
.copy-field .button { flex: 0 0 auto; }
.copy-field .button.copied { background: #184e3b; }
.success-actions { display: flex; justify-content: center; gap: 9px; margin-top: 18px; }

.import-success-page { width: min(100%, 860px); }
.import-note { margin: 10px 0; text-align: left; }
.imported-task-list { display: grid; gap: 12px; margin-top: 22px; text-align: left; }
.imported-task-card { padding: 22px; }
.imported-task-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.imported-task-heading h2 { margin: 0; font-size: 16px; }
.imported-task-heading p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 9px; }
.text-link { display: inline-block; margin-top: 11px; color: var(--green); font-size: 9px; font-weight: 700; text-decoration: none; }

.contractor-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 15%, rgba(120, 19, 28, .10), transparent 26%),
    radial-gradient(circle at 85% 85%, rgba(20, 20, 20, .05), transparent 25%),
    var(--canvas);
}

.contractor-shell { width: min(100% - 36px, 500px); margin: 0 auto; padding: 30px 0 60px; }
.contractor-shell.wide { width: min(100% - 36px, 750px); }

.contractor-brand { display: flex; align-items: center; gap: 11px; min-height: 45px; margin-bottom: clamp(38px, 8vh, 72px); }
.contractor-brand > .gsr-brand-lockup { flex: 1; }
.contractor-brand small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.contractor-language-form { margin: 0; }
.contractor-language-form select { min-height: 34px; max-width: 112px; padding: 0 28px 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background-color: var(--surface); font: inherit; font-size: 12px; cursor: pointer; }
.contractor-language-form select:focus { outline: 2px solid color-mix(in srgb, var(--orange) 55%, transparent); outline-offset: 2px; }
html[data-theme="dark"] .contractor-language-form select { color-scheme: dark; }

.verified-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 8px; font-weight: 750; }

.contractor-card { padding: clamp(28px, 6vw, 45px); border: 1px solid var(--line); border-radius: 18px; background: white; box-shadow: 0 18px 55px rgba(18, 39, 31, .08); }
.contractor-card .eyebrow { margin-bottom: 8px; }
.contractor-card h1 { margin: 0; font-size: clamp(27px, 6vw, 36px); line-height: 1.08; letter-spacing: -.045em; }
.contractor-intro { margin: 14px 0 24px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.contractor-intro strong { color: var(--ink); }

.verification-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 23px; border-radius: 12px; color: var(--green); background: var(--green-soft); font-size: 13px; font-weight: 800; letter-spacing: .12em; }

.test-code-note { margin: 0 0 22px; padding: 13px 14px; border: 1px solid #ead7c1; border-radius: 10px; color: #765133; background: #fbf5ed; font-size: 9px; line-height: 1.5; }
.test-code-note > span { display: inline-flex; margin-right: 6px; padding: 2px 5px; border-radius: 4px; color: white; background: var(--brand-solid); font-size: 7px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }

.verification-form { display: grid; gap: 17px; }
.code-field input { height: 56px; text-align: center; letter-spacing: .35em; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
.contractor-security { margin: 20px 0 0; color: var(--muted-2); font-size: 8px; text-align: center; }

.placeholder-card { padding: clamp(30px, 7vw, 55px); }
.placeholder-card > .status-badge { margin-bottom: 24px; }
.placeholder-card h1 { max-width: 550px; }
.placeholder-card .contractor-intro { max-width: 610px; }

.placeholder-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 31px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfa; overflow: hidden; }
.placeholder-grid > div { padding: 17px; border-left: 1px solid var(--line); }
.placeholder-grid > div:first-child { border-left: 0; }
.placeholder-grid span, .placeholder-grid strong { display: block; }
.placeholder-grid span { margin-bottom: 6px; color: var(--muted-2); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.placeholder-grid strong { font-size: 11px; }
.unavailable-card { text-align: left; }

.customer-payment-columns {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(70px, .5fr) minmax(90px, .7fr) minmax(150px, 1fr) minmax(180px, 1.25fr);
  min-width: 760px;
}

.row-actions { display: flex; align-items: center; gap: 6px; }

.mini-action {
  min-height: 29px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: var(--brand-solid);
  font-size: 8px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.mini-action.secondary { border: 1px solid var(--line); color: var(--muted); background: white; }
.mini-action.copied { background: var(--green-dark); }

.contractor-shell.workspace-wide { width: min(100% - 36px, 880px); }

.contractor-messages { display: grid; gap: 8px; margin: -34px 0 24px; }
.contractor-message { padding: 13px 15px; border: 1px solid #b8ddc6; border-radius: 10px; color: var(--success); background: var(--success-soft); font-size: 10px; font-weight: 650; }
.contractor-message.error { border-color: #e3c2b7; color: #8b3f29; background: #fff5f1; }

.contractor-task-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.contractor-task-hero h1 { margin: 0; font-size: clamp(30px, 6vw, 45px); letter-spacing: -.05em; }
.task-record-name { margin: 9px 0 0; color: var(--muted); font-size: 11px; }
.task-photo-summary { min-width: 110px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 11px; background: white; text-align: right; }
.task-photo-summary strong, .task-photo-summary span { display: block; }
.task-photo-summary strong { font-size: 20px; }
.task-photo-summary span { margin-top: 2px; color: var(--muted-2); font-size: 8px; }

.task-details-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.task-detail { display: flex; align-items: flex-start; gap: 12px; min-height: 105px; padding: 20px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
.task-detail:nth-child(-n+2) { border-top: 0; }
.task-detail:nth-child(odd) { border-left: 0; }
.task-detail-icon { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 auto; border-radius: 9px; color: var(--green); background: var(--green-soft); font-size: 7px; font-weight: 800; }
.task-detail div { min-width: 0; }
.task-detail small, .task-detail strong, .task-detail div > span { display: block; }
.task-detail small { margin-bottom: 6px; color: var(--muted-2); font-size: 7px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.task-detail strong { font-size: 10px; line-height: 1.5; }
.task-detail div > span, .task-detail a { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; text-decoration: none; }
.task-detail a { display: inline-block; color: var(--green); }
.preserve-lines { white-space: pre-line; }

.task-jump-list {
  display: flex;
  gap: 8px;
  margin: 18px 0 32px;
  overflow-x: auto;
}

.task-jump-list a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.task-jump-list a span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 10px;
}

.contractor-task-list { display: grid; gap: 34px; }

.contractor-task-block {
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid #cad5cf;
  border-radius: 20px;
  background: rgba(255, 255, 255, .45);
}

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

.contractor-task-block-heading h2 {
  margin: 0;
  font-size: clamp(23px, 4vw, 31px);
  letter-spacing: -.04em;
}

.contractor-task-block-heading p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.task-count-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-soft);
  font-size: 8px;
  font-weight: 750;
}

.task-schedule-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 17px 19px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}

.task-schedule-card small,
.task-schedule-card strong,
.task-schedule-card div > span { display: block; }
.task-schedule-card small { margin-bottom: 5px; color: var(--muted-2); font-size: 7px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.task-schedule-card strong { font-size: 10px; }
.task-schedule-card div > span { margin-top: 3px; color: var(--muted); font-size: 8px; }

.task-documents-card { margin-bottom: 28px; padding: clamp(20px, 4vw, 28px); border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: var(--shadow); }
.all-task-documents { margin-top: 14px; }
.document-task-group + .document-task-group { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.document-task-group > h3 { margin: 0 0 9px; font-size: 10px; }
.task-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.task-section-heading h2, .task-section-heading h3 { margin: 0; font-size: 15px; }
.task-document-list { display: grid; gap: 8px; }
.task-document { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; color: var(--ink); background: #fafbfa; text-decoration: none; transition: border-color 130ms ease, background 130ms ease; }
.task-document:hover { border-color: #b8cbc1; background: #f4f9f6; }
.task-document > span:nth-child(2) { min-width: 0; flex: 1; }
.task-document strong, .task-document small { display: block; }
.task-document strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.task-document small { margin-top: 4px; color: var(--muted-2); font-size: 7px; }
.document-icon { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 8px; color: #8a462f; background: #f7e9e4; font-size: 7px; font-weight: 850; }
.photo-workflow-heading { margin: 38px 0 17px; }
.photo-workflow-heading h2, .photo-workflow-heading h3 { margin: 0; font-size: 21px; }
.photo-workflow-heading > p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 10px; }

.photo-stage-list { display: grid; gap: 14px; }

.photo-stage-card {
  padding: clamp(20px, 4vw, 29px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: var(--shadow);
}

.photo-stage-card.completion { border-color: #d7c8b7; }
.photo-stage-heading { display: flex; align-items: flex-start; gap: 13px; }
.photo-stage-heading > div { flex: 1; }
.photo-stage-number { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px; color: var(--green); background: var(--green-soft); font-size: 8px; font-weight: 800; }
.completion .photo-stage-number { color: #875225; background: #f7eadb; }
.stage-title-line { display: flex; align-items: center; gap: 8px; }
.stage-title-line h2, .stage-title-line h3 { margin: 0; font-size: 14px; }
.photo-stage-heading p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.photo-count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; color: var(--green); background: var(--green-soft); font-size: 8px; font-weight: 750; }

.stage-empty { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 82px; margin: 18px 0; border: 1px dashed #d9e0dc; border-radius: 10px; color: var(--muted-2); background: #fafbfa; font-size: 9px; }
.stage-empty span { color: #9aaba3; font-size: 15px; }

.photo-grid { display: grid; gap: 9px; }
.contractor-photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 18px 0; }
.photo-tile { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #f5f7f5; }
.photo-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #e9eeeb; }
.photo-tile figcaption { padding: 7px 8px; color: var(--muted-2); background: white; font-size: 7px; }
.photo-corner-action { position: absolute; z-index: 2; top: 6px; right: 6px; margin: 0; }
.photo-corner-action button,
.photo-corner-action label { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 1px solid rgba(255, 255, 255, .88); border-radius: 50%; color: white; background: rgba(24, 35, 30, .82); box-shadow: 0 2px 8px rgba(20, 30, 25, .2); cursor: pointer; font: inherit; font-size: 17px; line-height: 1; }
.photo-corner-action.replace label { background: rgba(35, 89, 61, .9); font-size: 15px; }
.photo-corner-action input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.photo-corner-action.is-uploading { opacity: .55; pointer-events: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.completion-trigger-note { display: flex; align-items: flex-start; gap: 10px; margin: 17px 0; padding: 12px 13px; border: 1px solid #ead8c2; border-radius: 9px; color: #785539; background: #fbf5ed; }
.completion-trigger-note > span { font-size: 13px; }
.completion-trigger-note p { margin: 0; font-size: 8px; line-height: 1.55; }
.completion-trigger-note strong { display: block; margin-bottom: 2px; color: #5e3e25; font-size: 9px; }

.stage-upload-form { margin-top: 17px; }
.photo-picker { display: flex; align-items: center; gap: 11px; min-height: 61px; padding: 10px 13px; border: 1px dashed #b9c8c1; border-radius: 10px; background: #fafcfa; cursor: pointer; transition: border-color 130ms ease, background 130ms ease; }
.photo-picker:hover { border-color: var(--green); background: #f4f9f6; }
.photo-picker input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.photo-picker-icon { display: grid; place-items: center; width: 33px; height: 33px; flex: 0 0 auto; border-radius: 9px; color: white; background: var(--brand-solid); font-size: 15px; }
.photo-picker strong, .photo-picker small { display: block; }
.photo-picker strong { font-size: 10px; }
.photo-picker small { margin-top: 4px; color: var(--muted-2); font-size: 8px; }
.upload-selection { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.upload-selection[hidden] { display: none; }
.upload-selection > span { color: var(--muted); font-size: 9px; }
.upload-selection .button { min-height: 37px; font-size: 9px; }
.stage-upload-form.is-uploading .photo-picker { opacity: .58; pointer-events: none; }
.stage-upload-form.is-uploading .upload-selection > span { color: var(--ink); font-weight: 700; }

.task-acceptance-action { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; padding: 19px; border: 1px solid #d8c5aa; border-radius: 14px; background: #fff9f0; }
.task-acceptance-action.signed { border-color: #bcdaca; background: #edf7f1; }
.task-acceptance-action h3 { margin: 0; font-size: 14px; }
.task-acceptance-action p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.acceptance-actions { display: grid; gap: 8px; min-width: 230px; }
.acceptance-actions .mini-action { min-height: 34px; }
.acceptance-actions.prominent { width: min(100%, 330px); min-width: 280px; }
.acceptance-actions.prominent form { margin: 0; }
.acceptance-actions.prominent .button { width: 100%; min-height: 50px; }
.sms-delivery-state { margin: 0; color: var(--muted); font-size: 9px; text-align: center; }
.sms-delivery-state.error { color: var(--danger); }
.completion-check { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 50%; color: white; background: var(--success); font-size: 25px; }
.completion-check.small { width: 36px; height: 36px; font-size: 16px; }

.customer-review-callout {
  margin: 0 0 24px;
  padding: clamp(20px, 4vw, 28px);
  border: 2px solid var(--orange);
  border-radius: 18px;
  background: color-mix(in srgb, var(--green-soft) 78%, var(--surface));
  box-shadow: 0 14px 38px rgba(120, 19, 28, .14);
}
.customer-review-callout-heading { display: flex; align-items: flex-start; gap: 14px; }
.customer-review-callout-heading > div { min-width: 0; }
.customer-review-callout h2 { margin: 0; font-size: clamp(22px, 4vw, 31px); letter-spacing: -.035em; }
.customer-review-callout-heading p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.customer-review-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 12px; color: white; background: var(--brand-solid); font-size: 19px; font-weight: 900; }
.customer-review-ready-list { display: grid; gap: 10px; margin-top: 20px; }
.customer-review-ready-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px; border: 1px solid color-mix(in srgb, var(--orange) 32%, var(--line)); border-radius: 13px; background: var(--surface); }
.customer-review-ready-row > div:first-child { min-width: 0; }
.customer-review-ready-row strong, .customer-review-ready-row small { display: block; }
.customer-review-ready-row strong { font-size: 13px; }
.customer-review-ready-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }

.customer-page { min-height: 100vh; background: #f5f7f4; }
.customer-topbar { border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.customer-topbar-inner { width: min(100% - 36px, 1050px); min-height: 78px; display: flex; align-items: center; gap: 11px; margin: 0 auto; padding: 7px 0; }
.customer-topbar-inner > .gsr-brand-lockup { flex: 1; }
.customer-topbar small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.secure-page-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 8px; font-weight: 750; }

.customer-shell { width: min(100% - 36px, 1050px); margin: 0 auto; padding: clamp(42px, 7vw, 80px) 0 70px; }
.customer-hero { max-width: 680px; margin-bottom: 42px; }
.customer-hero h1 { margin: 0; font-size: clamp(36px, 6vw, 58px); line-height: 1.02; letter-spacing: -.055em; }
.customer-hero > p:last-child { max-width: 600px; margin: 17px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.customer-section { padding: clamp(23px, 4vw, 34px); border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: var(--shadow); }
.customer-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.customer-section-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.customer-photo-stage + .customer-photo-stage { margin-top: 30px; padding-top: 27px; border-top: 1px solid var(--line-soft); }
.customer-stage-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.customer-stage-title h3 { margin: 0; font-size: 12px; }
.customer-stage-title span { color: var(--muted-2); font-size: 8px; }
.customer-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.customer-photo-tile figcaption { padding: 9px 10px; font-size: 8px; }

.customer-next-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.customer-next-grid.customer-payment-only { grid-template-columns: minmax(0, 1fr); }
.customer-placeholder-panel { padding: clamp(23px, 4vw, 32px); border: 1px solid var(--line); border-radius: 17px; background: white; box-shadow: var(--shadow); }
.placeholder-panel-icon { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 20px; border-radius: 10px; color: var(--green); background: var(--green-soft); font-size: 15px; }
.placeholder-panel-icon.payment { color: #875225; background: #f7eadb; font-weight: 800; }
.customer-placeholder-panel h2 { margin: 0; font-size: 17px; }
.customer-placeholder-panel > p:not(.eyebrow) { min-height: 34px; margin: 8px 0 18px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.skeleton-lines { display: grid; gap: 8px; min-height: 71px; margin-bottom: 17px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fafbfa; }
.skeleton-lines span { display: block; width: 100%; height: 6px; border-radius: 999px; background: #e7ece9; }
.skeleton-lines span:nth-child(2) { width: 83%; }
.skeleton-lines span:nth-child(3) { width: 61%; }
.payment-placeholder { display: flex; align-items: center; justify-content: space-between; min-height: 71px; margin-bottom: 17px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 9px; background: #fafbfa; }
.payment-placeholder span { color: var(--muted-2); font-size: 9px; }
.payment-placeholder strong { font-size: 23px; }
.customer-messages { margin-bottom: 18px; }
.milestone-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -20px 0 20px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; }
.milestone-progress strong { font-size: 9px; }
.status-badge.waiting { color: #875225; background: #f7eadb; }
.customer-task-stack { display: grid; gap: 16px; }
.customer-acceptance-card .customer-section-heading small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.signature-form { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.signature-form .field-group { margin-bottom: 17px; }
.signature-form label:not(.acceptance-check) { display: block; margin-bottom: 7px; color: var(--ink); font-size: 9px; font-weight: 750; }
.signature-form input[type="text"] { width: 100%; min-height: 47px; padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: white; font: inherit; }
.signature-field { margin-bottom: 16px; }
.signature-field canvas { display: block; width: 100%; height: 180px; border: 1px solid #aebbb5; border-radius: 10px; background: white; touch-action: none; cursor: crosshair; }
.signature-field canvas.signature-missing { border-color: #a84a32; box-shadow: 0 0 0 2px rgba(168,74,50,.12); }
.signature-field .mini-action { margin-top: 8px; min-height: 30px; }
.acceptance-check { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.acceptance-check input { margin-top: 2px; }
.field-error { display: block; margin-top: 5px; color: #9a3827; font-size: 8px; }
.signed-record { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 22px; padding: 14px 16px; border-radius: 10px; color: var(--success); background: var(--success-soft); }
.signed-record strong { font-size: 10px; }
.signed-record span { font-size: 8px; }
.milestone-payment-panel { margin-top: 16px; }
.handoff-return { margin-top: 16px; }
.handoff-complete-page { display: grid; min-height: 100vh; place-items: center; padding: 22px; }
.handoff-complete-card { width: min(100%, 520px); padding: clamp(30px, 7vw, 52px); border: 1px solid var(--line); border-radius: 20px; background: white; box-shadow: var(--shadow); text-align: center; }
.handoff-complete-card .completion-check { margin: 0 auto 22px; }
.handoff-complete-card h1 { margin: 0; font-size: 42px; }
.handoff-complete-card > p:not(.eyebrow) { margin: 13px 0 24px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.handoff-complete-card .handoff-payment-note { padding: 12px; border-radius: 9px; background: var(--green-soft); }
.legacy-pages-panel { margin-top: 18px; }
.customer-evidence-error { margin: -6px 0 18px; }
.customer-acceptance-wording { margin-bottom: 16px; }
.customer-acceptance-wording h2 { margin: 4px 0 10px; }
.customer-acceptance-wording > p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.customer-task-documents { margin-bottom: 16px; }
.customer-document-list { display: grid; gap: 8px; }
.customer-document-list .task-document { min-height: 60px; }
.customer-document-list .task-document span:last-child { display: grid; gap: 3px; }
.customer-document-list .task-document small { color: var(--muted-2); font-size: 8px; }
.work-summary-card { margin-top: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.work-summary-business { display: grid; grid-template-columns: 1.1fr .9fr; border-bottom: 1px solid var(--line); }
.work-summary-business > div { display: grid; align-content: start; gap: 5px; min-height: 104px; padding: 18px; }
.work-summary-business > div:last-child { justify-items: center; border-left: 1px solid var(--line); background: var(--green-soft); text-align: center; }
.work-summary-business strong { font-size: 12px; }
.work-summary-business span { color: var(--muted); font-size: 8px; line-height: 1.45; }
.work-summary-addresses { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line-soft); }
.work-summary-addresses > div { display: grid; align-content: start; gap: 5px; min-height: 118px; padding: 16px 18px; }
.work-summary-addresses > div + div { border-left: 1px solid var(--line-soft); }
.work-summary-addresses small,
.work-summary-meta small,
.signature-date small { color: var(--muted-2); font-size: 8px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.work-summary-addresses strong { font-size: 10px; }
.work-summary-addresses span { color: var(--muted); font-size: 9px; line-height: 1.5; }
.work-summary-meta { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.work-summary-meta > span { display: grid; gap: 5px; padding: 13px 18px; }
.work-summary-meta > span + span { border-left: 1px solid var(--line-soft); }
.work-summary-meta strong { font-size: 9px; }
.work-summary-lines { display: grid; }
.work-summary-line { display: grid; grid-template-columns: minmax(0, 1fr) 130px; border-bottom: 1px solid var(--line-soft); }
.work-summary-line span { padding: 11px 18px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.work-summary-line span + span { border-left: 1px solid var(--line-soft); text-align: right; }
.work-summary-line.heading { background: var(--green-soft); }
.work-summary-line.heading span { color: var(--ink); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.work-summary-disclaimer { margin: 0; padding: 14px 18px; color: var(--muted-2); font-size: 8px; font-style: italic; line-height: 1.5; }
.signature-date { display: flex; justify-content: space-between; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 9px; }
.signature-date strong { font-size: 9px; }
.evidence-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.evidence-status { display: grid; gap: 4px; }

html[data-theme="dark"] .auth-page,
html[data-theme="dark"] .customer-page { background: var(--canvas); }
html[data-theme="dark"] .auth-form-panel { background: #151515; }
html[data-theme="dark"] .auth-story {
  background:
    radial-gradient(circle at 76% 72%, rgba(255, 130, 66, .2) 0 12%, transparent 13%),
    radial-gradient(circle at 76% 72%, transparent 0 25%, rgba(255,255,255,.04) 25.3% 25.8%, transparent 26.1%),
    linear-gradient(145deg, #242424 0%, #111111 62%, #050505 100%);
}
html[data-theme="dark"] .contractor-page {
  background:
    radial-gradient(circle at 15% 15%, rgba(255, 130, 66, .1), transparent 26%),
    radial-gradient(circle at 85% 85%, rgba(255, 255, 255, .025), transparent 25%),
    var(--canvas);
}
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .customer-topbar { background: rgba(20, 20, 20, .96); }
html[data-theme="dark"] .theme-toggle { box-shadow: 0 2px 12px rgba(0, 0, 0, .2); }

html[data-theme="dark"] .auth-form-panel,
html[data-theme="dark"] .field-group input,
html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .step-number,
html[data-theme="dark"] .filter-button,
html[data-theme="dark"] .form-card,
html[data-theme="dark"] .contractor-card,
html[data-theme="dark"] .mini-action.secondary,
html[data-theme="dark"] .task-photo-summary,
html[data-theme="dark"] .task-details-card,
html[data-theme="dark"] .task-schedule-card,
html[data-theme="dark"] .contractor-task-block,
html[data-theme="dark"] .task-documents-card,
html[data-theme="dark"] .photo-stage-card,
html[data-theme="dark"] .photo-tile figcaption,
html[data-theme="dark"] .customer-section,
html[data-theme="dark"] .customer-placeholder-panel,
html[data-theme="dark"] .milestone-progress,
html[data-theme="dark"] .signature-form input[type="text"],
html[data-theme="dark"] .handoff-complete-card { background: var(--surface); }

html[data-theme="dark"] .work-summary-line.heading,
html[data-theme="dark"] .work-summary-business > div:last-child { background: var(--green-soft); }

html[data-theme="dark"] .empty-state.compact,
html[data-theme="dark"] .search-placeholder,
html[data-theme="dark"] .table-header,
html[data-theme="dark"] .readiness-icon,
html[data-theme="dark"] .security-note,
html[data-theme="dark"] .success-card,
html[data-theme="dark"] .copy-field input,
html[data-theme="dark"] .placeholder-grid,
html[data-theme="dark"] .task-document,
html[data-theme="dark"] .stage-empty,
html[data-theme="dark"] .photo-picker,
html[data-theme="dark"] .skeleton-lines,
html[data-theme="dark"] .payment-placeholder { background: #151515; }

html[data-theme="dark"] .task-document:hover,
html[data-theme="dark"] .photo-picker:hover { background: #24201e; }
html[data-theme="dark"] .photo-tile,
html[data-theme="dark"] .photo-tile img { background: #111111; }
html[data-theme="dark"] .skeleton-lines span { background: #333333; }

html[data-theme="dark"] .form-alert,
html[data-theme="dark"] .console-message.error,
html[data-theme="dark"] .contractor-message.error {
  border-color: #70463a;
  color: #f0a993;
  background: #321f1a;
}
html[data-theme="dark"] .console-message,
html[data-theme="dark"] .contractor-message,
html[data-theme="dark"] .task-acceptance-action.signed {
  border-color: #315c43;
  color: var(--success);
  background: var(--success-soft);
}
html[data-theme="dark"] .test-code-note,
html[data-theme="dark"] .completion-trigger-note,
html[data-theme="dark"] .task-acceptance-action {
  border-color: #5b4635;
  color: #d8b28e;
  background: #2b211a;
}
html[data-theme="dark"] .completion-trigger-note strong { color: #edc6a1; }
html[data-theme="dark"] .photo-stage-card.completion { border-color: #594636; }
html[data-theme="dark"] .completion .photo-stage-number,
html[data-theme="dark"] .placeholder-panel-icon.payment,
html[data-theme="dark"] .status-badge.waiting,
html[data-theme="dark"] .stage-badge {
  color: #e2b47e;
  background: #38291d;
}
html[data-theme="dark"] .document-icon { color: #e1a18c; background: #38231e; }
html[data-theme="dark"] .task-workflow-status.scheduled { color: #b5c1bb; background: #29332e; }
html[data-theme="dark"] .task-workflow-status.in-progress { color: #efc47d; background: #3a2d1b; }
html[data-theme="dark"] .task-workflow-status.complete { color: #9ed5b7; background: #203b2e; }
html[data-theme="dark"] .signature-field canvas { border-color: #71827a; }
html[data-theme="dark"] input { caret-color: var(--green); }
html[data-theme="dark"] input::placeholder { color: #777777; }
html[data-theme="dark"] .customer-review-callout { background: #211812; box-shadow: 0 14px 38px rgba(0, 0, 0, .3); }
html[data-theme="dark"] .customer-review-ready-row { background: #171717; }

@media (max-width: 580px) {
  .theme-toggle-floating { top: 12px; right: 12px; }
  .page-utility-actions { gap: 6px; }
  .contractor-brand .gsr-logo, .customer-topbar .gsr-logo { width: 142px; }
  .contractor-brand .gsr-logo-surface, .customer-topbar .gsr-logo-surface { padding: 4px 5px; }
  .verified-badge, .secure-page-badge { padding: 0 7px; }
}

/* Shared operations copilot workspace. */
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  border-radius: 7px;
  color: white;
  background: var(--brand-solid);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }
.assistant-page { overflow: hidden; }
.assistant-page .assistant-content {
  width: 100%;
  height: calc(100dvh - 66px);
  margin: 0;
  padding: 0;
  overflow: hidden;
}
.assistant-content > .console-messages {
  position: absolute;
  z-index: 55;
  top: 78px;
  right: 22px;
  width: min(460px, calc(100% - 44px));
  margin: 0;
  box-shadow: var(--shadow);
}
.assistant-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  height: 100%;
  min-width: 0;
  background: var(--canvas);
}
.assistant-thread-rail {
  position: relative;
  z-index: 3;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--surface-subtle);
}
.assistant-rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 13px;
}
.assistant-rail-close { display: none; }
.assistant-new-chat-form { padding: 0 12px 11px; }
.assistant-new-chat-form button {
  width: 100%;
  min-height: 39px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}
.assistant-new-chat-form button span { padding: 0 8px 0 4px; color: var(--orange); }
.assistant-pinned-link,
.assistant-thread-link {
  display: flex;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}
.assistant-pinned-link {
  align-items: center;
  gap: 10px;
  margin: 0 8px 9px;
  padding: 10px;
  border-radius: 8px;
}
.assistant-pinned-link:hover,
.assistant-pinned-link.active,
.assistant-thread-link:hover,
.assistant-thread-link.active { background: var(--surface); }
.assistant-pin-icon { color: var(--orange); }
.assistant-pinned-link > span:last-child { display: grid; min-width: 0; gap: 2px; }
.assistant-pinned-link strong { font-size: 14px; font-weight: 600; }
.assistant-pinned-link small { color: var(--muted); font-size: 12px; }
.assistant-rail-search { padding: 0 12px 8px; }
.assistant-rail-search label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
}
.assistant-rail-search label:focus-within {
  border-color: color-mix(in srgb, var(--orange) 62%, var(--line));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 15%, transparent);
}
.assistant-rail-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}
.assistant-thread-list { min-height: 0; flex: 1; overflow-y: auto; padding: 3px 8px 12px; }
.assistant-thread-list-label { margin: 8px 8px 6px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.assistant-thread-link { display: grid; gap: 3px; padding: 10px; border-radius: 8px; }
.assistant-thread-title-row { display: flex; min-width: 0; align-items: center; gap: 7px; font-size: 13px; line-height: 1.3; }
.assistant-thread-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assistant-thread-link small { color: var(--muted); font-size: 11px; }
.assistant-thread-link.unread .assistant-thread-title { font-weight: 620; }
.assistant-unread-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: var(--orange); }
.assistant-thread-empty { margin: 13px 9px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.assistant-rail-footer { display: flex; justify-content: space-between; gap: 10px; padding: 13px 16px; border-top: 1px solid var(--line-soft); }
.assistant-rail-footer a { color: var(--muted); font-size: 12px; text-underline-offset: 3px; }
.assistant-rail-open,
.assistant-rail-scrim { display: none; }

.assistant-workspace {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: var(--canvas);
}
.assistant-workspace-header {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 88px;
  padding: 16px clamp(20px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.assistant-workspace-header > div { min-width: 0; flex: 1; }
.assistant-workspace-header .eyebrow { margin-bottom: 3px; }
.assistant-workspace-header h1 { overflow: hidden; margin: 0; font-size: clamp(23px, 2.4vw, 31px); font-weight: 620; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.assistant-workspace-header p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.assistant-readonly-badge { flex: 0 0 auto; color: var(--muted); font-size: 12px; }
.current-operations-scroll,
.assistant-transcript { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.current-operations-scroll { padding: 24px clamp(20px, 3vw, 42px) 54px; }
.current-rollout-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 13px;
}
.current-rollout-state strong { color: var(--ink); font-weight: 600; }
.current-rollout-state a { flex: 0 0 auto; color: var(--orange); }
.operations-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.operations-overview > div { display: grid; gap: 5px; padding: 17px 18px; border-left: 1px solid var(--line-soft); }
.operations-overview > div:first-child { border-left: 0; }
.operations-overview span { color: var(--muted); font-size: 12px; }
.operations-overview strong { font-size: 27px; font-weight: 550; letter-spacing: -.03em; }
.operations-overview small { color: var(--muted); font-size: 11px; }
.current-operations-section { margin-top: 25px; }
.current-operations-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 9px; }
.current-operations-section-heading h2 { margin: 0; font-size: 18px; font-weight: 600; }
.current-operations-section-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.current-operations-section-heading > a { color: var(--orange); font-size: 13px; text-underline-offset: 3px; }
.current-issue-list,
.current-activity-list { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.current-issue-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
}
.current-issue-row:last-child { border-bottom: 0; }
.current-issue-row:hover,
.current-activity-list a:hover { background: var(--surface-subtle); }
.current-issue-marker { width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: var(--warning); }
.current-issue-row.level-error .current-issue-marker { background: var(--danger); }
.current-issue-main { display: grid; min-width: 0; gap: 3px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.current-issue-title { color: var(--ink); font-size: 14px; }
.current-issue-main small { color: var(--muted); font-size: 12px; }
.current-issue-row time,
.current-activity-list time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.current-prompt-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.current-prompt-list button {
  width: 100%;
  min-height: 62px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}
.current-prompt-list button:hover { border-color: color-mix(in srgb, var(--orange) 50%, var(--line)); }
.current-prompt-list button span { color: var(--orange); }
.current-activity-list a { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.current-activity-list a:last-child { border-bottom: 0; }
.notification-tabs { display: flex; gap: 6px; margin: 14px 0; flex-wrap: wrap; }
.notification-tabs a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 13px; }
.notification-tabs a[aria-current] { background: var(--surface-raised); border-color: var(--ink); font-weight: 600; }
.notification-tabs span { color: var(--muted); margin-left: 5px; }
.notification-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.notification-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.notification-filters input, .notification-filters select, .notification-filters button { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; }
.notification-filters button { cursor: pointer; min-height: 36px; }
.notification-explanation { font-size: 12px; line-height: 1.6; color: var(--muted); }
.notification-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.notification-row { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.notification-row:last-child { border-bottom: 0; }
.notification-when { display: grid; align-content: start; justify-items: start; gap: 7px; line-height: 1.5; }
.notification-status { display: inline-block; border-radius: 5px; padding: 2px 6px; background: var(--surface-subtle); border: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.notification-status.status-delivered { color: var(--success); background: var(--success-soft); }
.notification-status.status-held, .notification-status.status-failed, .notification-status.status-undelivered { color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); }
.notification-main { display: grid; align-content: start; gap: 4px; overflow-wrap: anywhere; }
.notification-title { font-weight: 600; color: var(--ink); }
.notification-main small { color: var(--muted); line-height: 1.5; }
.notification-reason { margin: 4px 0 0; color: var(--muted); line-height: 1.5; }
.notification-detail { align-self: start; color: var(--orange); font-size: 12px; }
.notification-footer { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 12px; }
.notification-footer nav { display: flex; gap: 12px; }
@media (max-width: 650px) {
  .notification-row { grid-template-columns: 94px minmax(0, 1fr); gap: 10px; padding: 12px; }
  .notification-detail { grid-column: 2; }
  .notification-filters label { flex: 1 1 130px; min-width: 0; }
  .notification-filters input, .notification-filters select { width: 100%; min-width: 0; box-sizing: border-box; }
}
.current-activity-list a > span { display: grid; gap: 3px; min-width: 0; }
.current-activity-title { color: var(--ink); font-size: 14px; }
.current-activity-list small { color: var(--muted); font-size: 12px; }
.current-operations-empty { padding: 28px 18px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); }
.current-operations-empty p { margin: 0; font-size: 14px; }

.assistant-chat-title { min-width: 0; }
.assistant-chat-actions { position: relative; flex: 0 0 auto; }
.assistant-chat-actions > summary { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; list-style: none; }
.assistant-chat-actions > summary::-webkit-details-marker { display: none; }
.assistant-chat-actions > div { position: absolute; z-index: 5; top: 43px; right: 0; display: grid; gap: 10px; width: 260px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); }
.assistant-chat-actions button { padding: 0; border: 0; color: var(--orange); background: transparent; cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.assistant-rename-form { display: grid; gap: 7px; }
.assistant-rename-form label { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.assistant-rename-form input { width: 100%; min-height: 36px; padding: 0 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface-raised); }
.assistant-rename-form button { justify-self: start; }
.assistant-transcript { padding: clamp(24px, 4vw, 48px); scroll-padding-bottom: 30px; }
.assistant-transcript .chat-message { max-width: 900px; content-visibility: auto; contain-intrinsic-size: auto 110px; }
.assistant-transcript .chat-message-body > p { overflow-wrap: anywhere; font-size: 14px; }
.assistant-transcript .chat-message-meta,
.assistant-transcript .chat-message-meta strong { font-size: 12px; }
.assistant-message-error { display: block; margin-top: 5px; color: var(--danger); font-size: 12px; }
.assistant-earlier-messages { display: flex; max-width: 900px; align-items: center; justify-content: space-between; gap: 16px; margin: 0 auto 26px; }
.assistant-earlier-messages a { color: var(--orange); font-size: 13px; text-underline-offset: 3px; }
.assistant-earlier-messages small { color: var(--muted); font-size: 11px; }
.assistant-message-sources { margin-top: 10px; color: var(--muted); font-size: 12px; }
.assistant-message-sources summary { width: fit-content; cursor: pointer; color: var(--muted); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 38%, transparent); text-underline-offset: 3px; }
.assistant-message-sources ul { display: grid; gap: 7px; margin: 9px 0 0; padding: 0; list-style: none; }
.assistant-message-sources li { display: grid; gap: 1px; }
.assistant-message-sources a { width: fit-content; max-width: 100%; overflow-wrap: anywhere; color: var(--ink); text-underline-offset: 3px; }
.assistant-message-sources span { color: var(--muted); font-size: 11px; }
.assistant-new-activity {
  position: sticky;
  z-index: 4;
  top: 0;
  display: flex;
  max-width: 900px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 0 auto 18px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line));
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
}
.assistant-new-activity[hidden] { display: none; }
.assistant-new-activity button { padding: 0; border: 0; color: var(--orange); background: transparent; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
.assistant-history-limit { justify-content: flex-start; }
.assistant-archived-notice { max-width: 900px; margin: 0 auto 25px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 13px; }
.assistant-workspace > .chat-composer { padding: 13px clamp(20px, 3vw, 42px) calc(13px + env(safe-area-inset-bottom)); }
.assistant-workspace > .chat-composer textarea { max-height: 180px; min-height: 68px; font-size: 14px; }
.assistant-workspace > .chat-composer-footer small { font-size: 12px; }

@media (max-width: 1180px) {
  .assistant-shell { grid-template-columns: minmax(0, 1fr); }
  .assistant-thread-rail {
    position: fixed;
    z-index: 70;
    inset: 66px auto 0 252px;
    width: min(330px, calc(100vw - 252px));
    transform: translateX(calc(-100% - 252px));
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
  }
  .assistant-rail-open { display: inline-flex; flex: 0 0 auto; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 12px; }
  .assistant-rail-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 20px; }
  .assistant-rail-scrim { position: fixed; z-index: 65; inset: 66px 0 0 252px; width: auto; height: auto; border: 0; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; }
  .assistant-threads-open .assistant-thread-rail { transform: translateX(0); }
  .assistant-threads-open .assistant-rail-scrim { display: block; opacity: 1; pointer-events: auto; }
}

@media (max-width: 820px) {
  .assistant-thread-rail { left: 0; width: min(340px, 90vw); transform: translateX(-110%); }
  .assistant-rail-scrim { left: 0; }
  .assistant-workspace-header { min-height: 82px; padding: 13px 16px; }
  .assistant-readonly-badge { display: none; }
  .current-operations-scroll { padding: 18px 14px 44px; }
  .operations-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-overview > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--line-soft); }
  .operations-overview > div:nth-child(4) { border-top: 1px solid var(--line-soft); }
  .current-prompt-list { grid-template-columns: 1fr; }
  .assistant-transcript { padding: 22px 14px; }
}

@media (max-width: 580px) {
  .assistant-workspace-header { align-items: flex-start; flex-wrap: wrap; }
  .assistant-workspace-header > div { order: 3; flex-basis: 100%; }
  .assistant-workspace-header h1 { font-size: 23px; }
  .assistant-chat-actions { margin-left: auto; }
  .current-operations-section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .current-issue-row { grid-template-columns: 8px minmax(0, 1fr); }
  .current-issue-row time { grid-column: 2; }
  .current-activity-list a { align-items: flex-start; flex-direction: column; gap: 4px; }
  .assistant-transcript .chat-message-avatar { display: none; }
  .assistant-transcript .chat-message-body { max-width: 93%; }
  .assistant-workspace > .chat-composer { padding-inline: 12px; }
  .assistant-workspace > .chat-composer textarea { resize: none; }
  .assistant-earlier-messages { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-thread-rail { transition: none; }
}

/* Contractor work page: one action, three workflow steps, restrained type. */
.contractor-page .contractor-messages {
  position: relative;
  z-index: 1;
  margin: 0 0 18px;
}
.contractor-page .contractor-message { font-weight: 500; }
.contractor-page .contractor-message { transition: opacity .2s ease, transform .2s ease; }
.contractor-page .contractor-message.is-dismissing { opacity: 0; transform: translateY(-4px); }
.contractor-page .contractor-work-hero h1,
.contractor-page .contractor-task-block-heading h2 { font-weight: 650; }
.contractor-page .contractor-work-hero { align-items: flex-start; }
.contractor-page .work-order-primary-facts .task-detail { min-height: 0; }
.contractor-page .work-order-primary-facts .task-detail small,
.contractor-page .task-schedule-card small,
.contractor-page .secondary-details .task-detail small { font-weight: 600; }
.contractor-page .work-order-primary-facts .task-detail strong,
.contractor-page .task-schedule-card strong { font-weight: 600; }
.work-address-link {
  display: inline-block;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.45;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 52%, transparent);
  text-underline-offset: 4px;
}
.work-address-link:hover { color: var(--orange); text-decoration-color: currentColor; }
.contractor-support-line {
  margin: 6px 2px 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.contractor-support-line a { color: var(--ink); font-weight: 600; }
.task-instructions {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.65;
}
.plan-change-warning {
  margin: 16px 0 0;
  padding: 13px 15px;
  border-left: 3px solid var(--orange);
  color: var(--muted);
  background: color-mix(in srgb, var(--orange) 7%, var(--surface));
  font-size: 14px;
  line-height: 1.55;
}
.contractor-page .contractor-workflow-status { font-weight: 600; }
.contractor-workflow-status.photos_complete,
.contractor-workflow-status.waiting_customer { color: #486b5a; background: #e7f0eb; }
.contractor-workflow-status.payment_pending { color: #80501f; background: #f7eadb; }
.contractor-workflow-status.declined { color: #933d32; background: #fae8e4; }

.contractor-page .contractor-task-progress { padding: 14px 16px; }
.contractor-step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.contractor-step-list li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
}
.contractor-step-list li > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--canvas);
  font-size: 13px;
}
.contractor-step-list small { font-size: 13px; font-weight: 500; line-height: 1.25; }
.contractor-step-list li.is-current { color: var(--ink); border-color: color-mix(in srgb, var(--ink) 32%, var(--line)); }
.contractor-step-list li.is-current > span { color: var(--ink); border-color: var(--ink); background: var(--surface); }
.contractor-step-list li.is-complete { color: var(--success); border-color: color-mix(in srgb, var(--success) 32%, var(--line)); }
.contractor-step-list li.is-complete > span { color: white; border-color: var(--success); background: var(--success); }

.task-primary-action {
  margin: 0 0 18px;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid color-mix(in srgb, var(--ink) 22%, var(--line));
  border-radius: 16px;
  background: var(--surface);
}
.task-primary-action.review_required,
.task-primary-action.review_in_progress,
.task-primary-action.payment_pending { border-width: 2px; border-color: var(--orange); }
.task-primary-action.complete { border-color: color-mix(in srgb, var(--success) 38%, var(--line)); }
.task-primary-action.declined { border-color: color-mix(in srgb, #b54c3c 42%, var(--line)); }
.task-primary-action h3 { margin: 4px 0 8px; font-size: clamp(23px, 4vw, 31px); font-weight: 650; line-height: 1.15; }
.task-primary-action > p:not(.eyebrow) { max-width: 650px; margin: 0 0 16px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.task-primary-action > small { display: block; margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.task-primary-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.task-primary-actions form { margin: 0; }
.task-upload-button { cursor: pointer; }
.task-upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.task-primary-action .upload-selection { margin-top: 12px; font-size: 14px; }

.contractor-page .photo-stage-card { padding: 18px; }
.contractor-page .stage-title-line h3 { font-weight: 600; }
.contractor-page .photo-step-done,
.contractor-page .photo-step-required,
.contractor-page .photo-step-waiting,
.contractor-page .photo-manage > summary { font-weight: 600; }
.contractor-page .stage-empty { min-height: 0; margin: 14px 0 0; font-size: 14px; }

.contractor-task-notes {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.3fr);
  gap: 18px 28px;
  margin-top: 20px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.contractor-task-notes h3 { margin: 3px 0 6px; font-size: 21px; font-weight: 600; }
.contractor-task-notes > div > p:last-child { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.contractor-task-notes ol { grid-column: 1 / -1; display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.contractor-task-notes li { padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.contractor-task-notes li p { margin: 0 0 5px; font-size: 15px; line-height: 1.5; }
.contractor-task-notes time { color: var(--muted); font-size: 12px; }
.contractor-task-notes form { display: grid; gap: 9px; align-content: start; }
.contractor-task-notes label { font-size: 14px; font-weight: 600; }
.contractor-task-notes textarea { min-height: 92px; resize: vertical; font: inherit; font-size: 16px; }
.contractor-task-notes .button { justify-self: start; }
.contractor-page .secondary-details .task-detail div > span { color: var(--ink); font-size: 14px; }

html[data-theme="dark"] .contractor-workflow-status.photos_complete,
html[data-theme="dark"] .contractor-workflow-status.waiting_customer { color: #b8d5c6; background: #26372f; }
html[data-theme="dark"] .contractor-workflow-status.payment_pending { color: #efc28f; background: #3b2b1e; }
html[data-theme="dark"] .contractor-workflow-status.declined { color: #efb1a8; background: #402622; }

@media (max-width: 700px) {
  .contractor-step-list { grid-template-columns: 1fr; gap: 6px; }
  .contractor-step-list li { min-height: 42px; }
  .task-primary-actions,
  .task-primary-actions form,
  .task-primary-actions .button,
  .task-primary-action > .button,
  .task-primary-action > form .button { width: 100%; }
  .contractor-task-notes { grid-template-columns: 1fr; }
  .contractor-task-notes ol { grid-column: auto; }
  .contractor-task-notes .button { width: 100%; }
}

@media (max-width: 580px) {
  .work-address-link { font-size: 16px; }
  .contractor-support-line { font-size: 14px; }
  .task-instructions,
  .task-primary-action > p:not(.eyebrow) { font-size: 15px; }
  .task-primary-action { padding: 19px 15px; }
  .task-primary-action h3 { font-size: 24px; }
}

/* Durable exception inbox mirrored to Odoo Discuss. */
.operations-alert-heading { align-items: flex-end; }
.alert-filter-tabs { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.alert-filter-tabs a { padding: 8px 11px; border-radius: 8px; color: var(--muted); font-size: 10px; font-weight: 800; text-decoration: none; }
.alert-filter-tabs a.active { color: white; background: var(--brand-solid); }
.operations-alert-list { display: grid; gap: 14px; }
.operations-alert-card { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 24px; padding: 22px; border-left: 4px solid var(--line); }
.operations-alert-card.severity-immediate { border-left-color: var(--danger); }
.operations-alert-card.severity-follow_up { border-left-color: var(--orange); }
.operations-alert-title-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.operations-alert-main h2 { margin: 10px 0 7px; font-size: 19px; }
.operations-alert-main > p { max-width: 820px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.alert-severity-badge { display: inline-flex; padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.alert-severity-badge.immediate { color: #8d2e1e; background: #ffe7e1; }
.alert-severity-badge.follow_up { color: #864510; background: #fff0df; }
.operations-alert-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 14px; color: var(--muted-2); font-size: 9px; }
.operations-alert-meta strong { color: var(--ink); }
.operations-alert-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.operations-alert-actions > .mini-action, .operations-alert-actions > form > .mini-action { width: 100%; justify-content: center; }
.alert-resolve-form { display: grid; gap: 6px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.alert-resolve-form label { color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.alert-resolve-form label span { font-weight: 500; text-transform: none; }
.alert-resolve-form textarea { width: 100%; resize: vertical; padding: 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font: inherit; font-size: 9px; }
.operations-alert-error { margin-top: 13px; color: var(--danger); font-size: 9px; }
.operations-alert-error summary { cursor: pointer; font-weight: 800; }
.operations-alert-error p { overflow-wrap: anywhere; }
.operations-alert-resolution { margin-top: 13px; padding: 10px 12px; border-radius: 9px; color: var(--muted); background: var(--canvas); font-size: 9px; line-height: 1.5; }
html[data-theme="dark"] .alert-severity-badge.immediate { color: #ffc0b5; background: #49241d; }
html[data-theme="dark"] .alert-severity-badge.follow_up { color: #ffd1a2; background: #4a301a; }

@media (max-width: 760px) {
  .operations-alert-heading { align-items: stretch; }
  .alert-filter-tabs { align-self: flex-start; }
  .operations-alert-card { grid-template-columns: 1fr; }
}

@media (max-width: 1080px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .auth-form-panel { min-height: 100vh; }
  .mobile-brand { display: flex; }

  .sidebar { transform: translateX(-100%); transition: transform 180ms ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .sidebar-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; color: #9fb0a8; background: transparent; font-size: 23px; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 15; width: 100%; height: 100%; border: 0; background: rgba(9, 20, 16, 0.5); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  .menu-open .sidebar-scrim { display: block; opacity: 1; pointer-events: auto; }
  .main-shell { margin-left: 0; }
  .topbar { padding: 0 20px; }
  .topbar-title { display: none; }
  .menu-button, .topbar-avatar { display: block; }
  .topbar-avatar { display: grid; }
  .content { padding: 30px 20px 50px; }
  .form-layout { grid-template-columns: 1fr; }
  .form-aside { grid-template-columns: 1fr 1fr; }
  .contractor-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .auth-form-panel { padding: 34px 24px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 20px; }
  .page-heading .button { width: 100%; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { min-height: 126px; }
  .panel { padding: 18px; }
  .table-panel { padding: 0; }
  .build-pill { display: none; }
  .table-tools { padding: 0 14px; }
  .form-aside { grid-template-columns: 1fr; }
  .form-actions { align-items: stretch; flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .success-details { grid-template-columns: 1fr; }
  .success-details > div { border-top: 1px solid var(--line); border-left: 0; }
  .success-details > div:first-child { border-top: 0; }
  .copy-field { flex-direction: column; }
  .copy-field .button { width: 100%; }
  .success-actions { flex-direction: column-reverse; }
  .success-actions .button { width: 100%; }
  .placeholder-grid { grid-template-columns: 1fr; }
  .placeholder-grid > div { border-top: 1px solid var(--line); border-left: 0; }
  .placeholder-grid > div:first-child { border-top: 0; }
  .contractor-brand { margin-bottom: 36px; }
  .verified-badge { font-size: 0; }
  .verified-badge::after { content: "✓"; font-size: 9px; }
  .contractor-messages { margin-top: -19px; }
  .contractor-task-hero { align-items: flex-start; flex-direction: column; }
  .contractor-task-block { padding: 17px; }
  .contractor-task-block-heading { flex-direction: column; gap: 10px; }
  .task-photo-summary { width: 100%; text-align: left; }
  .contractor-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .upload-selection { align-items: stretch; flex-direction: column; }
  .upload-selection .button { width: 100%; }
  .customer-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .customer-next-grid { grid-template-columns: 1fr; }
  .work-summary-business,
  .work-summary-addresses { grid-template-columns: 1fr; }
  .work-summary-business > div:last-child,
  .work-summary-addresses > div + div { border-top: 1px solid var(--line-soft); border-left: 0; }
  .work-summary-meta { grid-template-columns: 1fr; }
  .work-summary-meta > span + span { border-top: 1px solid var(--line-soft); border-left: 0; }
  .work-summary-line { grid-template-columns: minmax(0, 1fr) 92px; }
  .work-summary-line span { padding: 10px 12px; }
  .task-acceptance-action { align-items: stretch; flex-direction: column; }
  .task-acceptance-action .button { width: 100%; }
  .acceptance-actions { width: 100%; min-width: 0; }
  .customer-review-callout-heading { align-items: flex-start; }
  .customer-review-ready-row { align-items: stretch; flex-direction: column; }
  .acceptance-actions.prominent { width: 100%; min-width: 0; }
  .task-details-card { grid-template-columns: 1fr; }
  .task-detail { border-top: 1px solid var(--line-soft); border-left: 0; }
  .task-detail:first-child { border-top: 0; }
}

@media (max-width: 380px) {
  .contractor-photo-grid,
  .customer-photo-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.portal-auth-shell { padding-top: 8vh; }
.portal-auth-card { margin-top: 24px; }
.portal-secondary-action { margin-top: 10px; }
.portal-back-link { display: inline-flex; margin: -20px 0 20px; color: var(--green); font-size: 12px; font-weight: 700; text-decoration: none; }
.portal-dashboard-shell { padding-bottom: 80px; }
.portal-dashboard-header { margin-bottom: 26px; }
.portal-dashboard-header form { margin: 0; }
.portal-dashboard-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 18px; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.portal-dashboard-hero h1 { margin: 3px 0 8px; font-size: clamp(28px, 5vw, 42px); }
.portal-dashboard-hero p:last-child { margin: 0; color: var(--muted); }
.portal-task-counts { display: grid; grid-template-columns: repeat(2, auto); align-items: end; gap: 8px 22px; min-width: 190px; text-align: right; }
.portal-task-counts > span { display: grid; gap: 3px; }
.portal-task-counts strong { color: var(--green-dark); font-family: Georgia, serif; font-size: 34px; line-height: 1; }
.portal-task-counts small { color: var(--muted); font-size: 11px; font-style: normal; }
.portal-task-counts em { grid-column: 1 / -1; color: var(--rust); font-size: 11px; font-style: normal; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.portal-task-search { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 4px 8px; margin: 0 2px 15px; }
.portal-task-search-controls { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 6px; width: min(100%, 540px); }
.portal-task-search input { width: 100%; min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font: inherit; font-size: 13px; outline: none; }
.portal-task-search input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 16%, transparent); }
.portal-task-search .button { min-height: 38px; margin: 0; padding: 0 13px; font-size: 12px; }
.portal-task-search > p { flex-basis: 100%; margin: 1px 1px 0; color: var(--muted); font-size: 11px; text-align: right; }
.portal-schedule-section { margin-top: 24px; }
.portal-task-search + .portal-schedule-section { margin-top: 0; }
.portal-schedule-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 2px 12px; }
.portal-schedule-section-heading h2 { margin: 2px 0 0; font-size: 21px; }
.portal-schedule-section-heading p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.portal-schedule-section-heading > span { color: var(--muted); font-size: 12px; font-weight: 750; }
.portal-schedule-heading,
.portal-schedule-row { display: grid; grid-template-columns: minmax(235px, 1.35fr) 142px minmax(180px, 1fr) 130px 92px; align-items: center; gap: 18px; }
.portal-schedule-heading { padding: 0 16px 8px; color: var(--muted-2); font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.portal-schedule-list { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.portal-schedule-row { position: relative; min-height: 86px; padding: 15px 16px; color: var(--ink); background: var(--surface); text-decoration: none; transition: background 140ms ease, box-shadow 140ms ease; }
.portal-schedule-row + .portal-schedule-row { border-top: 1px solid var(--line-soft); }
.portal-schedule-row:hover { background: color-mix(in srgb, var(--orange) 5%, var(--surface)); }
.portal-row-main-link { position: absolute; z-index: 1; inset: 0; border-radius: inherit; }
.portal-row-main-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 48%, transparent); outline-offset: -3px; }
.portal-schedule-row.is-new { box-shadow: inset 4px 0 0 var(--orange); }
.portal-schedule-list.current { border-color: color-mix(in srgb, var(--orange) 32%, var(--line)); }
.portal-schedule-list.current .portal-schedule-row { min-height: 96px; }
.portal-schedule-list.upcoming .portal-schedule-row { background: color-mix(in srgb, var(--surface) 88%, var(--canvas)); }
.portal-schedule-order,
.portal-schedule-date,
.portal-schedule-task { display: grid; gap: 4px; min-width: 0; }
.portal-schedule-order-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.portal-schedule-order-heading > strong { color: var(--ink); font-size: 17px; font-weight: 850; line-height: 1.15; letter-spacing: .01em; }
.portal-customer-name { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 450; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.portal-schedule-order > small { overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.portal-directions-link { position: relative; z-index: 2; display: inline-block; width: fit-content; max-width: 100%; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.35; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 62%, transparent); text-underline-offset: 3px; text-overflow: ellipsis; white-space: nowrap; }
.portal-directions-link:hover { color: var(--orange); text-decoration-color: currentColor; }
.portal-directions-link:focus-visible { border-radius: 3px; outline: 2px solid var(--orange); outline-offset: 3px; }
.portal-schedule-date strong { color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.2; }
.portal-schedule-date small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.portal-schedule-date .portal-date-alert { color: var(--danger); font-weight: 800; }
.portal-schedule-date .portal-date-today { color: var(--orange); font-weight: 800; }
.portal-schedule-task small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.portal-task-name { font-size: 14px; font-weight: 450; line-height: 1.35; }
.portal-schedule-status { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
.portal-row-chevron { color: var(--orange); font-size: 25px; font-weight: 500; line-height: 1; text-align: right; }
.portal-row-action { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; color: var(--orange); font-size: 12px; font-weight: 550; white-space: nowrap; }
.portal-row-action span { font-size: 23px; line-height: 1; }
.portal-new-badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; color: #7f401c; background: #fff0d8; font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.task-status { display: inline-flex; padding: 6px 9px; border-radius: 999px; font-size: 11px; font-weight: 550; white-space: nowrap; }
.task-status.scheduled { color: #51615a; background: #edf1ef; }
.task-status.in-progress { color: #855516; background: #fff1d2; }
.task-status.due-today { color: #8d471e; background: #ffead7; }
.task-status.past-due { color: #972f2f; background: #fde4e4; }
.task-status.review-required { color: white; background: var(--brand-solid); }
.task-status.waiting-customer { color: #286143; background: #e5f3ea; }
.task-status.complete { color: #286143; background: #e5f3ea; }
.portal-completed-section { margin-top: 22px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow); }
.portal-completed-section > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; align-items: center; gap: 12px; padding: 17px 18px; cursor: pointer; list-style: none; }
.portal-completed-section > summary::-webkit-details-marker { display: none; }
.portal-completed-section > summary > span:first-child { display: grid; gap: 3px; }
.portal-completed-section > summary strong { font-size: 13px; }
.portal-completed-section > summary small { color: var(--muted); font-size: 9px; }
.portal-completed-count { display: inline-grid; place-items: center; min-width: 27px; height: 27px; padding: 0 8px; border-radius: 999px; color: var(--muted); background: var(--canvas); font-size: 10px; font-weight: 800; }
.portal-summary-chevron { color: var(--orange); font-size: 18px; text-align: center; transition: transform 160ms ease; }
.portal-completed-section[open] .portal-summary-chevron { transform: rotate(180deg); }
.portal-completed-section[open] > summary { border-bottom: 1px solid var(--line-soft); }
.portal-completed-section .portal-schedule-heading { padding-top: 14px; }
.portal-completed-section .portal-schedule-list { border: 0; border-radius: 0 0 15px 15px; box-shadow: none; }
.portal-empty-state { text-align: center; }
.portal-search-empty { margin-top: 18px; }
.portal-search-empty .button { margin-top: 13px; }
html[data-theme="dark"] .portal-new-badge { color: #ffd6aa; background: #4c321e; }
html[data-theme="dark"] .task-status.scheduled { color: #b5c1bb; background: #29332e; }
html[data-theme="dark"] .task-status.in-progress { color: #f0cb89; background: #44351f; }
html[data-theme="dark"] .task-status.due-today { color: #ffc08f; background: #4b2d1d; }
html[data-theme="dark"] .task-status.past-due { color: #ffb1aa; background: #4a2424; }
html[data-theme="dark"] .task-status.review-required { color: white; background: var(--brand-solid); }
html[data-theme="dark"] .task-status.waiting-customer { color: #9ed5b7; background: #203b2e; }
html[data-theme="dark"] .task-status.complete { color: #9ed5b7; background: #203b2e; }

/* Chat-first operations foundation. */
.chat-page-heading { margin-bottom: 22px; }
.assistant-mode-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--orange) 34%, var(--line));
  border-radius: 999px; color: var(--green-dark); background: var(--green-soft);
  font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
}
.assistant-mode-badge span { color: var(--orange); font-size: 9px; }
.operations-chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.operations-chat-panel { min-height: calc(100vh - 190px); padding: 0; overflow: hidden; }
.chat-transcript {
  min-height: 420px; max-height: calc(100vh - 370px); overflow-y: auto;
  padding: clamp(22px, 4vw, 42px); scroll-behavior: smooth;
}
.chat-welcome { display: grid; justify-items: center; max-width: 680px; margin: 6vh auto 0; text-align: center; }
.chat-welcome-mark {
  display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 17px;
  border-radius: 16px; color: white; background: linear-gradient(145deg, var(--brand-solid), var(--brand-solid-hover));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--orange) 24%, transparent);
  font-family: Georgia, serif; font-size: 25px; font-weight: 800;
}
.chat-welcome h2 { margin: 0 0 9px; font-size: clamp(22px, 3vw, 30px); }
.chat-welcome > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.chat-suggestions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
.chat-suggestions button {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); background: var(--surface); cursor: pointer; font-size: 10px;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}
.chat-suggestions button:hover { border-color: var(--orange); color: var(--ink); background: var(--green-soft); }
.chat-message { display: flex; gap: 12px; max-width: 820px; margin: 0 auto 22px; }
.chat-message-user { flex-direction: row-reverse; }
.chat-message-avatar {
  display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px;
  border-radius: 10px; color: white; background: var(--brand-solid); font-size: 11px; font-weight: 900;
}
.chat-message-user .chat-message-avatar { color: var(--ink); background: var(--sand); }
.chat-message-body { max-width: min(690px, calc(100% - 44px)); }
.chat-message-body > p {
  margin: 5px 0 0; padding: 12px 14px; border: 1px solid var(--line-soft);
  border-radius: 5px 15px 15px 15px; background: var(--canvas); font-size: 13px; line-height: 1.65;
}
.chat-message-user .chat-message-body > p { border-color: color-mix(in srgb, var(--orange) 24%, var(--line)); border-radius: 15px 5px 15px 15px; background: var(--green-soft); }
.chat-message-meta { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; }
.chat-message-meta strong { color: var(--ink); font-size: 10px; }
.chat-message-user .chat-message-meta { justify-content: flex-end; }
.chat-composer { padding: 14px; border-top: 1px solid var(--line-soft); background: color-mix(in srgb, var(--canvas) 64%, var(--surface)); }
.chat-composer textarea {
  display: block; width: 100%; min-height: 76px; resize: vertical; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface);
  font: inherit; font-size: 13px; line-height: 1.5; outline: none;
}
.chat-composer textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 16%, transparent); }
.chat-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.chat-composer-footer small { color: var(--muted); font-size: 9px; }
.chat-composer-footer .button { min-width: 92px; }
.operations-chat-sidebar { display: grid; gap: 18px; }
.chat-summary-panel, .chat-sms-panel { padding: 19px; }
.chat-summary-panel .panel-heading, .chat-sms-panel .panel-heading { margin-bottom: 14px; }
.chat-summary-panel h2, .chat-sms-panel h2 { font-size: 17px; }
.chat-stats-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--line-soft); }
.chat-stat { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; background: var(--surface); }
.chat-stat span { color: var(--muted); font-size: 10px; }
.chat-stat strong { font-size: 15px; }
.sms-conversation-list { display: grid; gap: 12px; }
.sms-conversation-row { display: block; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.sms-conversation-row:last-child { padding-bottom: 0; border-bottom: 0; }
.sms-conversation-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sms-conversation-title strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sms-state { flex: 0 0 auto; padding: 4px 6px; border-radius: 999px; color: var(--muted); background: var(--canvas); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.sms-state-needs_attention { color: #8a410f; background: #ffeadb; }
.sms-conversation-row p { margin: 7px 0 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.sms-conversation-row time { color: var(--muted-2); font-size: 8px; }
.compact-empty-copy { padding: 13px; border-radius: 10px; color: var(--muted); background: var(--canvas); font-size: 10px; line-height: 1.55; }
.compact-empty-copy p { margin: 0; }
html[data-theme="dark"] .sms-state-needs_attention { color: #ffd0aa; background: #462817; }

/* Admin-only contractor/customer SMS test bench. */
.lab-notice { margin: 0 0 18px; padding: 13px 16px; border: 1px solid color-mix(in srgb, var(--orange) 34%, var(--line)); border-radius: 12px; color: var(--muted); background: var(--green-soft); font-size: 11px; line-height: 1.55; }
.lab-notice strong { color: var(--ink); }
.lab-notice-error { border-color: #c76b55; background: #fff0ea; }
.messaging-lab-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.lab-conversation-panel { padding: 0; overflow: hidden; }
.lab-session-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line-soft); }
.lab-session-heading h2 { margin: 2px 0 5px; font-size: 20px; }
.lab-session-heading p:last-child { margin: 0; color: var(--muted); font-size: 10px; }
.lab-transcript { min-height: 380px; max-height: calc(100vh - 430px); overflow-y: auto; padding: 24px; background: color-mix(in srgb, var(--canvas) 70%, var(--surface)); }
.lab-message { max-width: 78%; margin: 0 0 16px; }
.lab-message-inbound { margin-left: auto; }
.lab-message p { margin: 4px 0; padding: 11px 13px; border: 1px solid var(--line-soft); border-radius: 4px 14px 14px 14px; background: var(--surface); font-size: 12px; line-height: 1.55; }
.lab-message-inbound p { border-color: color-mix(in srgb, var(--orange) 28%, var(--line)); border-radius: 14px 4px 14px 14px; background: var(--green-soft); }
.lab-message-meta { display: flex; gap: 8px; color: var(--muted-2); font-size: 8px; }
.lab-message-inbound .lab-message-meta { justify-content: flex-end; }
.lab-message-meta strong { color: var(--ink); font-size: 9px; }
.lab-message > small { display: block; color: var(--muted-2); font-size: 8px; }
.lab-message-inbound > small { text-align: right; }
.lab-composer { padding: 16px; border-top: 1px solid var(--line-soft); }
.lab-composer label { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 800; }
.lab-composer textarea, .lab-start-panel textarea, .lab-start-panel select { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font: inherit; font-size: 12px; }
.lab-composer textarea:focus, .lab-start-panel textarea:focus, .lab-start-panel select:focus { border-color: var(--orange); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 14%, transparent); }
.lab-composer-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 10px; }
.lab-composer > small { display: block; margin-top: 8px; color: var(--muted); font-size: 8px; }
.lab-photo-composer { display: grid; gap: 10px; background: var(--canvas); }
.lab-photo-composer > p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.lab-photo-fields { display: grid; grid-template-columns: 150px minmax(180px, 1fr); gap: 9px; }
.lab-photo-fields input[type="file"] { grid-column: 1 / -1; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface); }
.lab-photo-fields select, .lab-photo-fields input[type="text"] { padding: 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); }
.lab-context-card dl { display: grid; gap: 1px; margin: 12px 0 0; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--line-soft); }
.lab-context-card dl div { display: grid; gap: 3px; padding: 11px; background: var(--surface); }
.lab-context-card dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.lab-context-card dd { margin: 0; overflow-wrap: anywhere; font-size: 10px; font-weight: 700; }
.lab-safety-card h2, .lab-history-panel h2, .lab-start-panel h2 { margin: 3px 0 10px; font-size: 18px; }
.lab-safety-card ul { margin: 0; padding-left: 17px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.lab-start-panel { padding: clamp(22px, 4vw, 36px); }
.lab-start-panel .console-form { display: grid; gap: 18px; margin-top: 24px; }
.lab-start-panel .form-field { display: grid; gap: 7px; }
.lab-start-panel label { font-size: 10px; font-weight: 800; }
.lab-start-panel textarea { resize: vertical; }
.lab-history-list { display: grid; gap: 1px; margin-top: 15px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--line-soft); }
.lab-history-list article { display: grid; gap: 4px; padding: 11px; background: var(--surface); }
.lab-history-list strong { font-size: 9px; }
.lab-history-list span { color: var(--muted); font-size: 8px; }
.lab-phone-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.lab-persona-card { min-height: 100%; }
.lab-history-wide { grid-column: 1 / -1; }
.lab-candidate-list { display: grid; gap: 8px; margin-top: 14px; }
.lab-candidate-list > strong { font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.lab-candidate-list article { display: grid; gap: 3px; padding: 10px; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--surface); }
.lab-candidate-list article div { font-size: 9px; }
.lab-candidate-list span, .lab-candidate-list small { color: var(--muted); font-size: 8px; line-height: 1.45; }
html[data-theme="dark"] .lab-notice-error { background: #321f1a; }

/* Searchable contractor and customer conversation archive. */
.conversation-browser { padding: 0; overflow: hidden; }
.conversation-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(120px, auto)) auto auto;
  gap: 10px;
  align-items: end;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.conversation-filters > label { display: grid; gap: 6px; }
.conversation-filters > label > span { color: var(--muted-2); font-size: 8px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.conversation-filters select,
.conversation-search {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  font-size: 10px;
}
.conversation-filters select { padding: 0 30px 0 10px; }
.conversation-search { display: flex !important; align-items: center; gap: 8px !important; padding: 0 11px; }
.conversation-search > span { color: var(--muted-2); font-size: 18px !important; }
.conversation-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 10px; }
.conversation-result-summary { padding: 12px 20px; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; }
.conversation-rows { display: grid; }
.conversation-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 106px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  transition: background 140ms ease;
}
.conversation-row:hover { background: var(--green-soft); }
.conversation-row:last-child { border-bottom: 0; }
.conversation-avatar { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; color: #fff; background: #555; font-size: 13px; font-weight: 800; }
.conversation-avatar.role-contractor { background: var(--brand-solid); }
.conversation-avatar.role-customer { background: #257a4a; }
.conversation-avatar.role-unknown { background: var(--danger); }
.conversation-avatar.large { width: 52px; height: 52px; font-size: 17px; }
.conversation-row-main { display: grid; gap: 6px; min-width: 0; }
.conversation-row-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.conversation-row-title h1 { margin: 0; font-size: 23px; letter-spacing: -.03em; }
.conversation-row-title > strong { font-size: 11px; }
.conversation-role,
.conversation-test-badge,
.conversation-attention-badge,
.conversation-so {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.conversation-role { color: var(--muted); background: #efefed; }
.conversation-role.role-customer { color: var(--success); background: var(--success-soft); }
.conversation-role.role-contractor { color: var(--rust); background: var(--green-soft); }
.conversation-test-badge { color: #755718; background: #fff3c7; }
.conversation-attention-badge { color: var(--danger); background: #fce9e4; }
.conversation-so { color: var(--muted); background: var(--canvas); }
.conversation-row-context { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted-2); font-size: 8px; }
.conversation-preview { overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.conversation-preview.search-match { color: var(--ink); }
.conversation-row-time { display: flex; align-items: center; gap: 14px; color: var(--muted-2); text-align: right; }
.conversation-row-time time { display: grid; gap: 3px; font-size: 8px; }
.conversation-row-time small { font-size: 8px; }
.conversation-row-time > span { font-size: 22px; }
.conversation-empty { min-height: 280px; padding: 40px; }
.conversation-pagination { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; }
.conversation-pagination a { color: var(--orange); font-weight: 750; text-decoration: none; }
.conversation-identity-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 14px; }
.conversation-identity-main { display: flex; align-items: center; gap: 14px; }
.conversation-identity-main p { margin: 6px 0 0; color: var(--muted); font-size: 10px; }
.conversation-identity-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 7px; color: var(--muted-2); font-size: 8px; }
.conversation-search-notice { margin: 0 0 14px; padding: 11px 14px; border: 1px solid color-mix(in srgb, var(--orange) 35%, var(--line)); border-radius: 9px; background: var(--green-soft); font-size: 9px; }
.conversation-transcript { display: grid; gap: 18px; padding: 30px; }
.transcript-message { width: min(76%, 720px); scroll-margin: 100px; }
.transcript-message.direction-outbound { justify-self: end; }
.transcript-sender { display: flex; justify-content: space-between; gap: 12px; margin: 0 4px 6px; color: var(--muted-2); font-size: 8px; }
.transcript-sender strong { color: var(--muted); }
.transcript-bubble { padding: 13px 15px; border: 1px solid var(--line-soft); border-radius: 4px 14px 14px 14px; background: var(--canvas); }
.direction-outbound .transcript-bubble { border-color: color-mix(in srgb, var(--orange) 30%, var(--line)); border-radius: 14px 4px 14px 14px; background: var(--green-soft); }
.transcript-body { margin: 0; overflow-wrap: anywhere; font-size: 10px; line-height: 1.65; }
.transcript-body a { color: var(--orange); text-decoration: underline; overflow-wrap: anywhere; }
.transcript-body.muted { color: var(--muted-2); font-style: italic; }
.transcript-delivery { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 4px 0; color: var(--muted-2); font-size: 7px; }
.transcript-delivery span + span::before { content: "·"; margin-right: 8px; }
.transcript-media { margin: 10px 0 0; }
.transcript-media img { display: block; max-width: min(100%, 360px); max-height: 360px; border-radius: 10px; object-fit: cover; }
.transcript-media figcaption { margin-top: 6px; color: var(--muted-2); font-size: 7px; }
.historical-media-note { margin-top: 10px; padding: 9px 10px; border-radius: 8px; color: var(--muted); background: var(--surface); font-size: 8px; line-height: 1.45; }
.transcript-diagnostics { margin: 8px 4px 0; color: var(--muted); font-size: 8px; }
.transcript-diagnostics summary { cursor: pointer; }
.transcript-diagnostics dl { display: grid; gap: 5px; margin: 8px 0 0; padding: 10px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--surface); }
.transcript-diagnostics dl div { display: grid; grid-template-columns: 120px 1fr; gap: 8px; }
.transcript-diagnostics dt { color: var(--muted-2); }
.transcript-diagnostics dd { margin: 0; overflow-wrap: anywhere; }
.transcript-error { margin-top: 8px; color: var(--danger); font-size: 8px; }
.transcript-search-match { padding: 8px; border-radius: 12px; outline: 2px solid var(--orange); outline-offset: 3px; }

html[data-theme="dark"] .conversation-role,
html[data-theme="dark"] .conversation-so { background: #292929; }
html[data-theme="dark"] .conversation-test-badge { color: #f1cb68; background: #3b3012; }
html[data-theme="dark"] .conversation-attention-badge { color: #ffab99; background: #3b201a; }
html[data-theme="dark"] .conversation-filters select { color-scheme: dark; }

@media (max-width: 1120px) {
  .operations-chat-layout { grid-template-columns: 1fr; }
  .messaging-lab-layout { grid-template-columns: 1fr; }
  .lab-phone-picker { grid-template-columns: 1fr; }
  .operations-chat-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .operations-chat-panel { min-height: 620px; }
  .chat-transcript { max-height: 500px; }
  .conversation-filters { grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(120px, auto)); }
  .portal-schedule-heading,
  .portal-schedule-row { grid-template-columns: minmax(205px, 1.25fr) 120px minmax(150px, 1fr) 115px 78px; gap: 14px; }
}

@media (max-width: 760px) {
  .portal-schedule-heading { display: none; }
  .portal-schedule-list { border-radius: 13px; }
  .portal-schedule-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto auto; align-items: start; gap: 12px 14px; min-height: 0; padding: 18px 16px; }
  .portal-schedule-list.current .portal-schedule-row { min-height: 0; }
  .portal-schedule-order { grid-column: 1; grid-row: 1; }
  .portal-schedule-order-heading > strong { font-size: 18px; }
  .portal-customer-name { font-size: 14px; }
  .portal-schedule-order > small,
  .portal-directions-link { font-size: 13px; white-space: normal; }
  .portal-schedule-status { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .portal-schedule-date { grid-column: 1 / 3; grid-row: 2; display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 9px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
  .portal-schedule-date strong { font-size: 14px; }
  .portal-schedule-date small { font-size: 12px; }
  .portal-schedule-task { grid-column: 1 / 3; grid-row: 3; }
  .portal-row-chevron { grid-column: 2; grid-row: 4; align-self: center; }
  .portal-row-action { grid-column: 1 / 3; grid-row: 4; justify-content: center; min-height: 44px; border-radius: 10px; background: color-mix(in srgb, var(--orange) 10%, transparent); }
  .portal-completed-section { border-radius: 13px; }
}

@media (max-width: 580px) {
  .portal-auth-shell { padding-top: 22px; }
  .portal-dashboard-hero { align-items: flex-start; flex-direction: column; }
  .portal-task-counts { min-width: 0; text-align: left; }
  .portal-task-search { margin-bottom: 14px; }
  .portal-task-search-controls { grid-template-columns: minmax(0, 1fr) auto auto; width: 100%; }
  .operations-chat-sidebar { grid-template-columns: 1fr; }
  .operations-chat-panel { min-height: 560px; }
  .chat-transcript { min-height: 350px; padding: 20px 14px; }
  .chat-message-avatar { width: 28px; height: 28px; }
  .chat-message-body { max-width: calc(100% - 40px); }
  .chat-composer-footer { align-items: stretch; flex-direction: column; }
  .chat-composer-footer .button { width: 100%; }
  .lab-session-heading { flex-direction: column; }
  .lab-message { max-width: 92%; }
  .lab-composer-actions { align-items: stretch; flex-direction: column; }
  .lab-composer-actions .button { width: 100%; }
  .conversation-filters { grid-template-columns: 1fr; }
  .conversation-filters .button { width: 100%; }
  .conversation-row { grid-template-columns: 36px minmax(0, 1fr); padding: 14px; }
  .conversation-avatar { width: 36px; height: 36px; }
  .conversation-row-time { grid-column: 2; justify-content: flex-start; text-align: left; }
  .conversation-row-time > span { display: none; }
  .conversation-identity-card { align-items: flex-start; flex-direction: column; }
  .conversation-identity-meta { justify-content: flex-start; }
  .conversation-transcript { padding: 18px 12px; }
  .transcript-message { width: 92%; }
  .transcript-sender { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (max-width: 480px) {
  .portal-schedule-row { grid-template-rows: repeat(5, auto); }
  .portal-schedule-order { grid-column: 1 / 3; grid-row: 1; }
  .portal-schedule-status { grid-column: 1 / 3; grid-row: 2; justify-content: flex-start; }
  .portal-schedule-date { grid-row: 3; }
  .portal-schedule-task { grid-row: 4; }
  .portal-row-chevron,
  .portal-row-action { grid-row: 5; }
}

/* Mobile-first customer review. This layer intentionally leaves workflow
   behavior in the existing Django views and only reshapes its presentation. */
.customer-page { background: var(--canvas); }
.customer-page .customer-topbar { border: 0; background: transparent; }
.customer-topbar { position: relative; z-index: 20; }
.customer-topbar-inner { min-height: 72px; padding: 6px 0; }
.customer-topbar small { font-size: 11px; }
.customer-action-shell { max-width: 680px; padding: 24px 0 72px; }
.customer-action-hero { margin: 0 0 14px; text-align: left; }
.customer-action-hero h1 { max-width: 620px; font-size: clamp(34px, 6vw, 48px); line-height: 1.06; }
.customer-action-hero > p:last-child:not(.customer-order-subtitle) { max-width: 590px; margin-top: 13px; font-size: 15px; line-height: 1.55; }
.customer-action-hero .customer-category-title { font-size: clamp(26px, 4vw, 32px); line-height: 1.15; letter-spacing: -.03em; }
.customer-action-hero > p.customer-order-subtitle { margin: 1px 0 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.customer-flow-progress { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--muted-2); font-size: 12px; font-weight: 700; }
.customer-flow-progress span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.customer-flow-progress b { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 10px; }
.customer-flow-progress .active { color: var(--ink); }
.customer-flow-progress .active b { border-color: var(--brand-solid); color: white; background: var(--brand-solid); }
.customer-flow-progress i { width: 30px; height: 1px; background: var(--line); }
.customer-review-form { display: grid; gap: 14px; }
.customer-review-card { padding: 28px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.customer-invoice-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding-bottom: 16px; }
.customer-invoice-row > div { display: grid; gap: 7px; }
.customer-card-label { display: block; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.customer-amount { color: var(--ink); font-size: clamp(26px, 5vw, 32px); line-height: 1.1; letter-spacing: -.025em; }
.customer-invoice-meta { align-items: end; text-align: right; }
.customer-invoice-meta strong { font-size: 15px; }
.customer-document-link { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 62px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; text-decoration: none; transition: border-color 140ms ease, background 140ms ease; }
.customer-document-link:hover { border-color: var(--orange); background: color-mix(in srgb, var(--green-soft) 50%, var(--surface)); }
.customer-document-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 10px; color: var(--orange); background: var(--green-soft); font-size: 10px; font-weight: 850; }
.customer-document-link > span:first-child,
.customer-signature-summary > span:last-child { display: grid; gap: 3px; min-width: 0; }
.customer-document-link strong,
.customer-signature-summary strong { font-size: 14px; font-weight: 500; }
.customer-document-link small,
.customer-signature-summary small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.customer-payment-block { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.customer-payment-block > .customer-card-label { margin-bottom: 9px; }
.customer-payment-block .payment-default-copy { margin: 0; padding: 0; border: 0; border-radius: 0; color: var(--ink); background: transparent; box-shadow: none; font-size: 15px; font-weight: 500; line-height: 1.45; }
.customer-payment-block .payment-method-picker { margin: 6px 0 0; }
.customer-payment-block .payment-method-picker summary { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin-top: 4px; padding: 0 2px; color: var(--muted); font-size: 14px; font-weight: 500; list-style: none; text-decoration: none; }
.customer-payment-block .payment-method-picker summary::-webkit-details-marker { display: none; }
.customer-payment-block .payment-method-picker summary svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.customer-payment-block .payment-choice-list { gap: 10px; margin: 4px 0 0; }
.customer-payment-block .payment-choice-card { min-height: 76px; margin: 0; padding: 15px; }
.customer-payment-block .payment-choice-card input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--orange); }
.customer-payment-block .payment-choice-card strong { font-size: 15px; }
.customer-payment-block .payment-choice-card small { font-size: 13px; }
.customer-evidence-review .customer-document-link + .customer-document-link { margin-top: 8px; }
.customer-inline-alert,
.customer-state-message { font-size: 14px; line-height: 1.5; }
.customer-inline-alert { margin: 0 0 18px; padding: 12px 14px; border-radius: 10px; color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.customer-signature-summary { display: flex; align-items: center; gap: 13px; }
.customer-submit-dock { padding: 0; }
.customer-receipt-note { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; text-align: center; }
.customer-submit-dock .button { min-height: 56px; margin: 0; border-radius: 12px; font-size: 15px; }
.customer-submit-wait-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; }
.customer-submit-wait-note[hidden] { display: none; }
.customer-submit-dock .action-wait-note { margin-top: 10px; font-size: 12px; }
.customer-form-error { padding: 11px 13px; border-radius: 10px; background: color-mix(in srgb, var(--danger) 8%, var(--surface)); font-size: 12px; }
.customer-preparing-card,
.customer-outcome-card { text-align: center; }
.customer-preparing-card h2,
.customer-outcome-card h2 { margin: 0; font-size: 24px; letter-spacing: -.03em; }
.customer-preparing-card > p:last-child,
.customer-outcome-card > p { max-width: 470px; margin: 12px auto 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.customer-state-spinner { display: block; width: 42px; height: 42px; margin: 0 auto 20px; border: 3px solid var(--line); border-top-color: var(--orange); border-radius: 50%; animation: action-spin 800ms linear infinite; }
.customer-outcome-card .completion-check { margin: 0 auto 20px; }
.customer-balance-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 24px; padding: 18px; border-radius: 12px; background: var(--canvas); }
.customer-balance-row span { color: var(--muted); font-size: 13px; }
.customer-balance-row strong { color: var(--ink); font-size: 24px; }
.customer-payment-failed-card h2 { margin: 0; font-size: 26px; letter-spacing: -.03em; }
.customer-payment-failed-card > p:not(.eyebrow) { color: var(--muted); font-size: 15px; line-height: 1.6; }
.customer-payment-failed-card form { margin-top: 22px; }
.customer-payment-failed-card .button { min-height: 54px; margin-top: 14px; }
.customer-payment-complete-card .customer-payment-confirmation { color: var(--ink); font-size: 17px; line-height: 1.55; }
.customer-action-shell > .handoff-return { margin-top: 14px; min-height: 50px; }
.customer-support-line { margin: 26px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; text-align: center; }
.customer-support-line a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.customer-declined-card { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.customer-declined-card .eyebrow { color: var(--danger); }
.customer-unavailable-card .customer-unavailable-icon { display: grid; width: 54px; height: 54px; margin: 0 auto 20px; place-items: center; border-radius: 50%; color: white; background: var(--brand-solid); font-size: 24px; font-weight: 850; }
.customer-unavailable-card a { color: var(--orange); font-weight: 750; }

html[data-theme="dark"] .customer-review-card { background: var(--surface); }
html[data-theme="dark"] .customer-document-link:hover { background: #24201e; }
html[data-theme="dark"] .customer-inline-alert,
html[data-theme="dark"] .customer-form-error { background: #321f1a; }

@media (max-width: 580px) {
  .customer-topbar-inner { width: calc(100% - 24px); }
  .customer-topbar .brand-mark { width: 34px; height: 34px; }
  .customer-topbar .brand-name { font-size: 12px; }
  .customer-topbar small { font-size: 10px; }
  .customer-shell { width: calc(100% - 24px); padding: 12px 0 114px; }
  .customer-action-hero { margin-bottom: 10px; }
  .customer-action-hero .eyebrow { margin-bottom: 8px; font-size: 10px; }
  .customer-action-hero h1 { font-size: clamp(31px, 9vw, 38px); line-height: 1.07; }
  .customer-action-hero .customer-category-title { font-size: 27px; line-height: 1.08; }
  .customer-action-hero > p.customer-order-subtitle { font-size: 13px; }
  .customer-action-hero > p:last-child:not(.customer-order-subtitle) { margin-top: 10px; font-size: 14px; line-height: 1.5; }
  .customer-flow-progress { gap: 6px; margin-bottom: 8px; font-size: 11px; }
  .customer-flow-progress b { width: 22px; height: 22px; }
  .customer-flow-progress i { width: 14px; }
  .customer-review-card { padding: 18px; border-radius: 17px; }
  .customer-invoice-row { align-items: flex-start; padding-bottom: 14px; }
  .customer-amount { font-size: 27px; }
  .customer-invoice-meta strong { font-size: 13px; }
  .customer-document-link { min-height: 58px; }
  .customer-payment-block { margin-top: 16px; padding-top: 16px; }
  .customer-payment-block .payment-default-copy { font-size: 15px; }
  .customer-submit-dock { position: fixed; z-index: 12; right: 12px; bottom: max(8px, env(safe-area-inset-bottom)); left: 12px; }
  .customer-submit-dock .button { min-height: 48px; }
  .customer-receipt-note { margin-bottom: 11px; font-size: 12px; }
  .customer-submit-dock .action-wait-note { font-size: 11px; }
  .customer-preparing-card h2,
  .customer-outcome-card h2 { font-size: 22px; }
  .customer-preparing-card > p:last-child,
  .customer-outcome-card > p { font-size: 14px; }
}

@media (max-width: 360px) {
  .customer-flow-progress span { gap: 4px; }
  .customer-invoice-row { display: grid; gap: 12px; }
  .customer-invoice-meta { align-items: start; text-align: left; }
}

/* Console UI foundation: readable desktop density and token-driven surfaces. */
.console-page .topbar { background: color-mix(in srgb, var(--surface) 92%, transparent); }
.console-page .nav-label { font-size: 10px; }
.console-page .nav-icon { font-size: 9px; }
.console-page .local-badge strong,
.console-page .user-meta strong { font-size: 12px; }
.console-page .local-badge small,
.console-page .user-meta small { font-size: 11px; }
.console-page .button-secondary,
.console-page .filter-button,
.console-page .empty-icon,
.console-page .step-number,
.console-page .mini-action.secondary { background: var(--surface); }
.console-page .empty-state.compact,
.console-page .search-placeholder,
.console-page .table-header { background: var(--surface-subtle); }

.console-page .console-message { font-size: 13px; line-height: 1.45; }
.console-page .panel-heading .eyebrow { font-size: 11px; }
.console-page .stage-badge,
.console-page .source-badge,
.console-page .status-badge,
.console-page .task-workflow-status { font-size: 11px; }
.console-page .stat-detail,
.console-page .workflow-step small,
.console-page .empty-state p,
.console-page .text-button { font-size: 12px; }
.console-page .workflow-step strong,
.console-page .readiness-item strong { font-size: 13px; }
.console-page .readiness-item small,
.console-page .item-status { font-size: 12px; }

.console-page .table-tools { min-height: 72px; }
.console-page .table-tools > strong,
.console-page .table-tools > div > strong { font-size: 14px; }
.console-page .table-header {
  min-height: 46px;
  font-size: 11px;
  letter-spacing: .065em;
}
.console-page .table-row { min-height: 68px; font-size: 14px; }
.console-page .table-row > strong,
.console-page .table-primary { font-size: 14px; }
.console-page .table-subtitle { margin-top: 5px; font-size: 12px; line-height: 1.45; }
.console-page .record-count { font-size: 12px; }
.console-page .task-workflow-status,
.console-page .source-badge,
.console-page .status-badge { min-height: 26px; padding: 3px 9px; }
.console-page .mini-action { min-height: 34px; padding: 0 11px; font-size: 12px; }
.console-page .table-empty p,
.console-page .table-empty .button { font-size: 13px; }

.console-page .form-section-heading p,
.console-page .field-help,
.console-page .field-error,
.console-page .info-card ol,
.console-page .security-note p,
.console-page .link-field-group small,
.console-page .imported-task-heading p:last-child,
.console-page .text-link { font-size: 12px; }
.console-page .security-note strong { font-size: 13px; }
.console-page .security-note > span,
.console-page .form-step,
.console-page .success-details span { font-size: 11px; }

.console-page .operations-alert-main > p,
.console-page .operations-alert-meta,
.console-page .operations-alert-error,
.console-page .operations-alert-resolution,
.console-page .alert-resolve-form textarea { font-size: 13px; }
.console-page .alert-resolve-form label,
.console-page .alert-severity-badge { font-size: 11px; }
.console-page .alert-filter-tabs a { font-size: 12px; }

.console-page .conversation-filters > label > span { font-size: 11px; }
.console-page .conversation-filters select,
.console-page .conversation-search,
.console-page .conversation-search input { font-size: 13px; }
.console-page .conversation-result-summary,
.console-page .conversation-pagination { font-size: 12px; }
.console-page .conversation-row-title > strong { font-size: 14px; }
.console-page .conversation-role,
.console-page .conversation-test-badge,
.console-page .conversation-attention-badge,
.console-page .conversation-so { font-size: 10px; }
.console-page .conversation-row-context,
.console-page .conversation-row-time time,
.console-page .conversation-row-time small { font-size: 12px; }
.console-page .conversation-preview { font-size: 13px; }
.console-page .conversation-identity-main p,
.console-page .conversation-identity-meta,
.console-page .conversation-search-notice,
.console-page .transcript-sender,
.console-page .transcript-delivery,
.console-page .transcript-media figcaption,
.console-page .historical-media-note,
.console-page .transcript-diagnostics,
.console-page .transcript-error { font-size: 12px; }
.console-page .transcript-body { font-size: 14px; }

.console-page .assistant-mode-badge,
.console-page .chat-suggestions button,
.console-page .chat-message-meta,
.console-page .chat-composer-footer small,
.console-page .sms-conversation-row p,
.console-page .sms-conversation-row time { font-size: 12px; }

@media (max-width: 580px) {
  .console-page .content { padding: 26px 14px 46px; }
  .console-page.assistant-page .assistant-content { padding: 0; }
  .console-page .table-tools { min-height: 64px; padding: 0 14px; }
  .console-page .page-description { font-size: 14px; line-height: 1.5; }
}

/* Phase 2: status-led operations queues. */
.queue-panel { padding: 0; overflow: hidden; }
.queue-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 76px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.queue-search {
  display: flex;
  align-items: center;
  gap: 9px;
  width: min(520px, 100%);
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
}
.queue-search > span { font-size: 18px; }
.queue-search input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.queue-filter { display: grid; gap: 5px; }
.queue-filter > span,
.queue-label { color: var(--muted-2); font-size: 11px; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.queue-filter select { min-width: 145px; min-height: 42px; padding: 0 32px 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font-size: 13px; }
.queue-date-filter input { min-width: 148px; min-height: 42px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); font: inherit; font-size: 13px; }
.queue-count { margin-left: auto; white-space: nowrap; }
.queue-section-heading { display: flex; align-items: center; justify-content: space-between; min-height: 66px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); background: var(--surface-subtle); }
.queue-section-heading > div { display: grid; gap: 3px; }
.queue-section-heading strong { font-size: 14px; }
.queue-section-heading > div span { color: var(--muted); font-size: 12px; }
.queue-section-heading > span,
.completed-queue-count { display: inline-grid; place-items: center; min-width: 29px; height: 29px; padding: 0 8px; border-radius: 999px; color: var(--muted); background: var(--surface); font-size: 12px; font-weight: 800; }
.task-queue-list,
.approval-queue-list { display: grid; }
.queue-column-head { display: grid; align-items: center; gap: 20px; min-height: 38px; padding: 0 20px; border-bottom: 1px solid var(--line); color: var(--muted-2); background: var(--surface-subtle); font-size: 11px; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.task-queue-columns,
.task-queue-summary { grid-template-columns: minmax(230px, 1.45fr) minmax(145px, .85fr) minmax(180px, 1fr) minmax(105px, auto) 130px; }
.approval-queue-columns,
.approval-queue-summary { grid-template-columns: minmax(220px, 1.35fr) minmax(135px, .75fr) minmax(135px, .8fr) minmax(135px, .8fr) 125px; }
.task-queue-row,
.approval-queue-row { border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.task-queue-row:last-child,
.approval-queue-row:last-child { border-bottom: 0; }
.task-queue-summary { display: grid; align-items: center; gap: 20px; min-height: 106px; padding: 18px 20px; }
.task-queue-identity,
.task-queue-contractor,
.task-queue-schedule,
.approval-queue-identity,
.approval-form-type,
.approval-invoice-summary { display: grid; gap: 5px; min-width: 0; }
.queue-work-order { color: var(--ink); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.queue-inline-meta { color: var(--muted); font-size: 12px; }
.queue-customer { color: var(--ink); font-size: 14px; line-height: 1.35; }
.queue-value { color: var(--ink); font-size: 13px; font-weight: 500; line-height: 1.4; }
.queue-mobile-label { display: none; color: var(--muted-2); font-size: 11px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.task-queue-identity > span:last-child,
.approval-queue-identity > span:last-child,
.task-queue-contractor > span:last-child:not(.queue-value),
.task-queue-schedule > span:last-child:not(.queue-value),
.approval-invoice-summary > span:last-child { color: var(--muted); font-size: 12px; line-height: 1.45; }
.task-queue-state { display: grid; justify-items: start; gap: 6px; }
.task-queue-state small { color: var(--muted); font-size: 11px; }
.task-queue-primary-action .button,
.approval-primary-action .button { width: 100%; min-height: 40px; padding: 0 12px; white-space: nowrap; }
.queue-row-details { border-top: 1px solid var(--line-soft); background: var(--surface-subtle); }
.queue-row-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 20px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 750; list-style: none; }
.queue-row-details > summary::-webkit-details-marker { display: none; }
.queue-row-details > summary span:last-child { transition: transform 140ms ease; }
.queue-row-details[open] > summary span:last-child { transform: rotate(180deg); }
.queue-task-list { display: grid; padding: 0 20px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.queue-task-item { display: grid; grid-template-columns: minmax(220px, 1fr) 120px 130px; align-items: center; gap: 18px; min-height: 66px; border-bottom: 1px solid var(--line-soft); }
.queue-task-item:last-child { border-bottom: 0; }
.queue-task-item > div:first-child { display: grid; gap: 4px; }
.queue-task-name { color: var(--ink); font-size: 13px; font-weight: 500; }
.queue-task-item > div:first-child span:not(.queue-task-name),
.queue-task-date { color: var(--muted); font-size: 12px; }
.queue-detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.completed-queue { border-top: 1px solid var(--line); }
.completed-queue > summary,
.legacy-pages-collapsible > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 18px; align-items: center; gap: 12px; min-height: 68px; padding: 0 20px; cursor: pointer; list-style: none; }
.completed-queue > summary::-webkit-details-marker,
.legacy-pages-collapsible > summary::-webkit-details-marker { display: none; }
.completed-queue > summary > span:first-child,
.legacy-pages-collapsible > summary > span:first-child { display: grid; gap: 3px; }
.completed-queue > summary strong,
.legacy-pages-collapsible > summary strong { font-size: 14px; }
.completed-queue > summary small,
.legacy-pages-collapsible > summary small { color: var(--muted); font-size: 12px; }
.completed-queue-chevron,
.legacy-pages-collapsible > summary > span:last-child { color: var(--orange); transition: transform 140ms ease; }
.completed-queue[open] .completed-queue-chevron,
.legacy-pages-collapsible[open] > summary > span:last-child { transform: rotate(180deg); }
.queue-empty { min-height: 320px; padding: 44px 20px; }

.approval-toolbar { min-height: 72px; }
.approval-tabs { display: flex; gap: 5px; padding: 10px 20px; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface-subtle); }
.approval-tabs a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 11px; border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 750; text-decoration: none; white-space: nowrap; }
.approval-tabs a:hover { color: var(--ink); background: var(--surface); }
.approval-tabs a.active { color: white; background: var(--brand-solid); }
.approval-tabs a span { display: inline-grid; min-width: 21px; height: 21px; place-items: center; padding: 0 5px; border-radius: 999px; color: inherit; background: color-mix(in srgb, currentColor 12%, transparent); font-size: 10px; }
.approval-queue-summary { display: grid; align-items: center; gap: 20px; min-height: 104px; padding: 18px 20px; }
.approval-status-badge { display: inline-flex; align-items: center; min-height: 29px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--surface-subtle); font-size: 11px; font-weight: 800; line-height: 1.25; }
.approval-status-badge.needs_signature { color: #835116; background: #fff0d7; border-color: #e8c48e; }
.approval-status-badge.needs_payment { color: #275b82; background: #e8f4fc; border-color: #b9d7eb; }
.approval-status-badge.complete { color: #286143; background: #e5f3ea; border-color: #b7dcc7; }
.approval-status-badge.issues { color: #943d2a; background: #fff0eb; border-color: #e7b8ab; }
.approval-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: var(--line-soft); }
.approval-detail-grid > div { display: grid; align-content: start; gap: 6px; min-height: 118px; padding: 16px 20px; background: var(--surface); }
.approval-detail-value { color: var(--ink); font-size: 13px; font-weight: 500; }
.approval-detail-grid span:not(.queue-label):not(.approval-detail-value),
.approval-detail-grid li { color: var(--muted); font-size: 12px; line-height: 1.45; }
.approval-detail-grid ul { display: grid; gap: 4px; margin: 0; padding-left: 17px; }
.approval-inline-error,
.approval-detail-note { display: grid; gap: 4px; margin: 14px 20px 0; padding: 12px 14px; border-radius: 9px; font-size: 12px; line-height: 1.45; }
.approval-inline-error { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.approval-detail-note { color: var(--success); background: var(--success-soft); }
.legacy-pages-collapsible { margin-top: 16px; padding: 0; }

html[data-theme="dark"] .approval-status-badge.needs_signature { color: #ffd09a; background: #3c2b19; border-color: #70512d; }
html[data-theme="dark"] .approval-status-badge.needs_payment { color: #a9d7f5; background: #172d3c; border-color: #315873; }
html[data-theme="dark"] .approval-status-badge.complete { color: #9ed5b7; background: #203b2e; border-color: #315c43; }
html[data-theme="dark"] .approval-status-badge.issues { color: #ffb2a1; background: #3b201a; border-color: #70463a; }
html[data-theme="dark"] .queue-filter select,
html[data-theme="dark"] .queue-date-filter input { color-scheme: dark; }

/* The fixed desktop sidebar leaves less room than the viewport width suggests. */
@media (max-width: 1280px) {
  .task-queue-columns,
  .task-queue-summary { grid-template-columns: minmax(200px, 1.35fr) minmax(125px, .8fr) minmax(155px, 1fr) minmax(105px, auto) 124px; gap: 14px; }
  .approval-queue-columns,
  .approval-queue-summary { grid-template-columns: minmax(190px, 1.25fr) minmax(120px, .75fr) minmax(125px, .8fr) minmax(125px, .8fr) 115px; gap: 14px; }
}

@media (max-width: 820px) {
  .queue-toolbar { align-items: stretch; flex-wrap: wrap; }
  .queue-search { width: 100%; }
  .queue-count { width: 100%; margin-left: 0; }
  .queue-column-head { display: none; }
  .queue-mobile-label { display: block; }
  .task-queue-summary,
  .approval-queue-summary { grid-template-columns: minmax(0, 1fr) minmax(130px, .65fr); }
  .task-queue-schedule,
  .approval-invoice-summary { grid-column: 1; }
  .task-queue-state,
  .approval-status-summary { grid-column: 2; }
  .task-queue-primary-action,
  .approval-primary-action { grid-column: 2; grid-row: 1; }
  .approval-form-type { grid-column: 1; }
  .queue-task-item { grid-template-columns: minmax(0, 1fr) auto; }
  .queue-task-date { grid-column: 1 / 3; padding-bottom: 10px; }
  .approval-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 580px) {
  .queue-toolbar { padding: 14px; }
  .queue-filter { flex: 1; }
  .queue-filter select { width: 100%; }
  .queue-date-filter input { width: 100%; min-width: 0; }
  .queue-toolbar .button { flex: 1; }
  .approval-tabs { padding: 9px 14px; }
  .task-queue-summary,
  .approval-queue-summary { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 18px 14px; }
  .task-queue-contractor,
  .task-queue-schedule,
  .task-queue-state,
  .task-queue-primary-action,
  .approval-form-type,
  .approval-invoice-summary,
  .approval-status-summary,
  .approval-primary-action { grid-column: 1; grid-row: auto; }
  .task-queue-primary-action .button,
  .approval-primary-action .button { width: 100%; }
  .queue-row-details > summary { padding: 0 14px; }
  .queue-task-list { padding: 0 14px; }
  .queue-task-item { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .queue-detail-actions { padding: 12px 14px; }
  .approval-detail-grid > div { min-height: 0; padding: 15px 14px; }
  .approval-inline-error,
  .approval-detail-note { margin: 12px 14px 0; }
}

/* Phase 3: exception recovery and message-history triage. */
.attention-queue-panel { padding: 0; overflow: hidden; }
.attention-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  min-height: 76px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.attention-toolbar .queue-search { flex: 1; }
.attention-type-filter select { max-width: 220px; }
.attention-area-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 12px;
}
.attention-area-summary strong { color: var(--ink); }
.alert-area-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 11px;
  font-weight: 650;
}
.alert-area-badge.area-system { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, var(--surface)); }
.alert-area-badge.area-workflow_data { color: var(--ink); background: var(--surface-raised); }
.attention-tabs,
.conversation-quick-views {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}
.attention-tabs { min-height: 58px; padding: 9px 20px; }
.conversation-quick-views { min-height: 54px; padding: 8px 20px; }
.attention-tabs a,
.conversation-quick-views a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}
.attention-tabs a:hover,
.conversation-quick-views a:hover { color: var(--ink); background: var(--surface); }
.attention-tabs a.active,
.conversation-quick-views a.active { color: white; background: var(--brand-solid); }
.attention-tabs a span,
.conversation-quick-views a span {
  display: inline-grid;
  min-width: 21px;
  height: 21px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: inherit;
  background: color-mix(in srgb, currentColor 12%, transparent);
  font-size: 10px;
}
.attention-result-count { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.attention-queue-list { display: grid; }
.attention-queue-row { border-bottom: 1px solid var(--line-soft); border-left: 4px solid var(--line); background: var(--surface); }
.attention-queue-row:last-child { border-bottom: 0; }
.attention-queue-row.severity-immediate { border-left-color: var(--danger); }
.attention-queue-row.severity-follow_up { border-left-color: var(--orange); }
.attention-row-summary {
  display: grid;
  grid-template-columns: minmax(280px, 1.45fr) minmax(150px, .75fr) minmax(150px, .7fr) 150px;
  align-items: center;
  gap: 22px;
  min-height: 128px;
  padding: 20px;
}
.attention-row-identity,
.attention-row-context,
.attention-row-timing { display: grid; gap: 5px; min-width: 0; }
.attention-row-identity h2 { margin: 5px 0 0; font-size: 17px; line-height: 1.3; }
.attention-row-identity > p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.attention-row-context > strong,
.attention-row-timing > strong { font-size: 13px; }
.attention-row-context > span:last-child,
.attention-row-timing > span:last-child { color: var(--muted); font-size: 12px; line-height: 1.4; }
.attention-row-actions { display: grid; gap: 8px; }
.attention-row-actions .button { width: 100%; min-height: 38px; padding: 0 10px; white-space: nowrap; }
.attention-row-details { border-top: 1px solid var(--line-soft); background: var(--surface-subtle); }
.attention-row-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 20px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  list-style: none;
}
.attention-row-details > summary::-webkit-details-marker { display: none; }
.attention-row-details > summary span:last-child { color: var(--orange); transition: transform 140ms ease; }
.attention-row-details[open] > summary span:last-child { transform: rotate(180deg); }
.attention-detail-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line-soft);
  background: var(--line-soft);
}
.attention-detail-content > div { display: grid; align-content: start; gap: 7px; min-height: 126px; padding: 16px 20px; background: var(--surface); }
.attention-records > span:not(.queue-label),
.attention-delivery-error p,
.attention-resolution-note p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.attention-delivery-error p { color: var(--danger); }
.attention-detail-actions { gap: 10px !important; }
.attention-detail-actions > form > .button { width: 100%; }
.attention-resolve-form { display: grid; gap: 7px; }
.attention-resolve-form label { color: var(--muted-2); font-size: 11px; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.attention-resolve-form label span { font-weight: 500; letter-spacing: 0; text-transform: none; }
.attention-resolve-form textarea { width: 100%; resize: vertical; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); font: inherit; font-size: 13px; line-height: 1.45; }
.attention-empty { min-height: 320px; padding: 44px 20px; }
.status-badge.status-failed { color: var(--danger); }
.status-badge.status-resolved { color: var(--success); }

.conversation-latest-meta { color: var(--muted-2); font-size: 11px; }

@media (max-width: 1280px) {
  .attention-toolbar { align-items: stretch; flex-wrap: wrap; }
  .attention-toolbar .queue-search { width: 100%; flex-basis: 100%; }
  .attention-row-summary { grid-template-columns: minmax(260px, 1.35fr) minmax(150px, .75fr) minmax(145px, .7fr); }
  .attention-row-actions { grid-column: 2 / 4; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .attention-row-summary { grid-template-columns: minmax(0, 1fr) minmax(145px, .55fr); }
  .attention-row-timing { grid-column: 1; }
  .attention-row-actions { grid-column: 2; grid-row: 1 / 3; grid-template-columns: 1fr; }
  .attention-detail-content { grid-template-columns: 1fr; }
  .attention-detail-content > div { min-height: 0; }
}

@media (max-width: 580px) {
  .attention-toolbar { padding: 14px; }
  .attention-toolbar .queue-filter { flex: 1 1 145px; }
  .attention-toolbar .queue-filter select,
  .attention-toolbar .button { width: 100%; max-width: none; }
  .attention-tabs,
  .conversation-quick-views { padding: 8px 14px; }
  .attention-result-count { display: none; }
  .attention-row-summary { grid-template-columns: 1fr; gap: 16px; padding: 18px 14px; }
  .attention-row-context,
  .attention-row-timing,
  .attention-row-actions { grid-column: 1; grid-row: auto; }
  .attention-row-details > summary { padding: 0 14px; }
  .attention-detail-content > div { padding: 15px 14px; }
}

/* Compact exception inbox. Recovery controls remain behind each row. */
.attention-inbox { padding: 0; overflow: hidden; }
.attention-inbox-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(118px, auto);
  gap: 9px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.attention-search { min-height: 42px; }
.attention-search-button { min-height: 42px; }
.attention-filter-menu { position: relative; }
.attention-filter-menu > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  list-style: none;
}
.attention-filter-menu > summary::-webkit-details-marker { display: none; }
.attention-filter-menu > summary > span:last-child { color: var(--muted); transition: transform 140ms ease; }
.attention-filter-menu[open] > summary > span:last-child { transform: rotate(180deg); }
.attention-filter-count {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  margin-left: 3px;
  padding: 0 5px;
  border-radius: 999px;
  color: white;
  background: var(--brand-solid);
  font-size: 10px;
}
.attention-filter-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-subtle);
}
.attention-filter-menu[open] { grid-column: 1 / -1; }
.attention-filter-menu[open] > summary { width: max-content; min-width: 118px; margin-left: auto; }
.attention-filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.attention-inbox-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 48px;
  padding: 7px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}
.attention-inbox-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.gsr-brand-lockup { display: inline-flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 4px; }
.gsr-logo-surface { display: inline-flex; max-width: 100%; padding: 5px 7px; border: 1px solid rgba(120, 19, 28, .14); border-radius: 8px; background: #fff; }
.gsr-logo { display: block; width: 166px; max-width: 100%; height: auto; }
.gsr-brand-subtitle { color: var(--muted); font-size: 10px; font-weight: 550; letter-spacing: .04em; line-height: 1.2; }
.sidebar .gsr-logo { width: 154px; }
.sidebar .gsr-brand-subtitle { color: var(--nav-muted); }
.auth-story .gsr-logo { width: 230px; }
.auth-story .gsr-brand-subtitle { color: #d3c7c9; }
.mobile-brand .gsr-logo { width: 190px; }
.contractor-brand .gsr-logo, .customer-topbar .gsr-logo { width: 170px; }
.standalone-gsr-brand { display: flex; justify-content: center; margin: 0 0 24px; }
.standalone-gsr-brand .gsr-brand-lockup { align-items: center; }
.standalone-gsr-brand .gsr-logo { width: 210px; }
.attention-inbox-tabs a:hover { color: var(--ink); background: var(--surface); }
.attention-inbox-tabs a.active { color: var(--ink); background: var(--surface-raised); }
.attention-inbox-tabs a span {
  display: inline-grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 10px;
}
.attention-inbox-groups { display: grid; gap: 18px; padding: 18px; }
.attention-inbox-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}
.attention-inbox-group > header { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.attention-inbox-group > header h2 { margin: 0; font-size: 16px; font-weight: 650; }
.attention-inbox-group > header h2 span { margin-left: 5px; color: var(--muted); font-size: 12px; font-weight: 500; }
.attention-inbox-group > header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.attention-inbox-row { border-bottom: 1px solid var(--line-soft); background: var(--surface); }
.attention-inbox-row:last-child { border-bottom: 0; }
.attention-inbox-row-main {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 94px;
  padding: 14px 16px;
}
.attention-urgency-mark {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand-solid);
}
.attention-inbox-row.severity-immediate .attention-urgency-mark { background: var(--danger); }
.attention-inbox-identity { min-width: 0; }
.attention-inbox-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.attention-inbox-title h3 { margin: 0; font-size: 16px; font-weight: 650; line-height: 1.35; }
.attention-inbox-identity > p { max-width: 850px; margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.attention-inbox-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; color: var(--muted-2); font-size: 12px; }
.attention-inbox-meta > span:first-child { color: var(--ink); }
.attention-failed-badge {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 11%, var(--surface));
  font-size: 11px;
}
.attention-inbox-primary-action .button { min-width: 118px; min-height: 38px; padding: 0 12px; }
.attention-inbox-details { border-top: 1px solid var(--line-soft); background: var(--surface-subtle); }
.attention-inbox-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 16px 0 39px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  list-style: none;
}
.attention-inbox-details > summary::-webkit-details-marker { display: none; }
.attention-inbox-details > summary span:last-child { transition: transform 140ms ease; }
.attention-inbox-details[open] > summary span:last-child { transform: rotate(180deg); }
.attention-inbox-detail-content { display: grid; gap: 14px; padding: 16px 18px; border-top: 1px solid var(--line-soft); }
.attention-detail-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.attention-detail-meta > span { color: var(--muted); font-size: 12px; }
.attention-detail-meta > span > span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.attention-detail-message { padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.attention-detail-message > span { color: var(--muted-2); font-size: 11px; }
.attention-detail-message p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.attention-detail-error p { color: var(--danger); }
.attention-detail-links { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.attention-detail-actions { display: grid; gap: 10px; max-width: 620px; }
.attention-detail-actions > form > .button { width: auto; }
.attention-resolve-form { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px; align-items: end; }
.attention-resolve-form label { grid-column: 1 / -1; }
.attention-resolve-form textarea { min-height: 64px; }
.attention-resolve-form .button { min-height: 64px; }

@media (max-width: 850px) {
  .attention-filter-fields { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
}

@media (max-width: 580px) {
  .attention-page-heading { margin-bottom: 20px; }
  .attention-inbox-toolbar { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; }
  .attention-search-button { padding: 0 11px; }
  .attention-filter-menu { grid-column: 1 / -1; }
  .attention-filter-menu > summary,
  .attention-filter-menu[open] > summary { width: 100%; margin: 0; }
  .attention-filter-fields { grid-template-columns: 1fr; }
  .attention-filter-actions { flex-direction: column; }
  .attention-filter-actions .button { width: 100%; }
  .attention-inbox-tabs { padding: 7px 12px; }
  .attention-inbox-groups { gap: 14px; padding: 12px; }
  .attention-inbox-row-main { grid-template-columns: 10px minmax(0, 1fr); padding: 14px 13px; }
  .attention-inbox-primary-action { grid-column: 2; }
  .attention-inbox-primary-action .button { width: 100%; }
  .attention-inbox-details > summary { padding-left: 36px; }
  .attention-inbox-detail-content { padding: 14px; }
  .attention-resolve-form { grid-template-columns: 1fr; }
  .attention-resolve-form .button { min-height: 42px; width: 100%; }
}

/* Phase 4: low-frequency console pages and final interaction polish. */
.contractor-directory-panel { padding: 0; overflow: hidden; }
.contractor-directory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-subtle);
}
.contractor-directory-heading > div { display: grid; gap: 4px; }
.contractor-directory-heading strong { font-size: 14px; }
.contractor-directory-heading > div span { color: var(--muted); font-size: 12px; }
.contractor-directory-list { display: grid; }
.contractor-directory-row {
  display: grid;
  grid-template-columns: 44px minmax(190px, 1.2fr) minmax(105px, .55fr) minmax(85px, .45fr) minmax(145px, .75fr);
  align-items: center;
  gap: 18px;
  min-height: 92px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.contractor-directory-row:last-child { border-bottom: 0; }
.contractor-directory-avatar {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  color: white;
  background: linear-gradient(145deg, var(--brand-solid), var(--brand-solid-hover));
  font-size: 15px;
  font-weight: 850;
}
.contractor-directory-identity,
.contractor-directory-work,
.contractor-directory-source,
.contractor-directory-updated { display: grid; gap: 5px; min-width: 0; }
.contractor-directory-identity strong { font-size: 15px; }
.contractor-directory-identity span,
.contractor-directory-work > span:last-child,
.contractor-directory-updated > span:last-child { color: var(--muted); font-size: 12px; }
.contractor-directory-work > strong,
.contractor-directory-updated > strong { font-size: 13px; }
.contractor-directory-source { justify-items: start; }
.contractor-directory-empty { min-height: 320px; padding: 44px 20px; }

.operations-chat-panel { min-height: min(760px, calc(100vh - 190px)); }
.chat-sms-panel .sms-conversation-list { max-height: 590px; overflow-y: auto; padding-right: 4px; }
.assistant-mode-badge { white-space: nowrap; }

.console-page :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange) 55%, transparent);
  outline-offset: 2px;
}
.console-page :where(.queue-search, .conversation-search):focus-within {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 14%, transparent);
}
.console-page :where(.queue-search, .conversation-search) input:focus-visible { outline: 0; }

@media (max-width: 820px) {
  .contractor-directory-row {
    grid-template-columns: 44px minmax(0, 1fr) minmax(120px, .55fr);
  }
  .contractor-directory-work { grid-column: 3; grid-row: 1; }
  .contractor-directory-source { grid-column: 2; }
  .contractor-directory-updated { grid-column: 3; }
}

@media (max-width: 580px) {
  .contractor-directory-heading { align-items: flex-start; flex-direction: column; gap: 8px; padding: 16px 14px; }
  .contractor-directory-row { grid-template-columns: 42px minmax(0, 1fr); gap: 14px; padding: 17px 14px; }
  .contractor-directory-work,
  .contractor-directory-source,
  .contractor-directory-updated { grid-column: 2; grid-row: auto; }
  .contractor-directory-work,
  .contractor-directory-updated { grid-template-columns: minmax(110px, auto) 1fr; align-items: center; }
  .contractor-directory-work > span:last-child,
  .contractor-directory-work > strong,
  .contractor-directory-updated > strong,
  .contractor-directory-updated > span:last-child { justify-self: start; }
  .assistant-mode-badge { align-self: flex-start; white-space: normal; }
}

/* Contractor task workspace: task-first hierarchy and explicit customer handoff. */
.workspace-wide .contractor-brand { margin-bottom: 30px; }
.workspace-wide .portal-back-link { margin: 0 0 24px; }
.contractor-work-hero { align-items: center; margin-bottom: 20px; }
.contractor-work-hero h1 { max-width: 690px; font-size: clamp(32px, 5vw, 48px); line-height: 1.04; }
.contractor-work-hero .task-record-name { max-width: 610px; font-size: 13px; line-height: 1.55; }
.contractor-work-hero .task-photo-summary { min-width: 150px; padding: 15px 17px; background: var(--surface); }
.contractor-work-hero .task-photo-summary strong { color: var(--orange); font-size: 24px; }
.contractor-work-hero .task-photo-summary span { font-size: 10px; line-height: 1.4; }

.work-order-primary-facts {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(300px, 1.4fr);
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.work-order-primary-facts .task-detail { min-height: 118px; padding: 23px; border: 0; }
.work-order-primary-facts .task-detail + .task-detail { border-left: 1px solid var(--line-soft); }
.work-order-primary-facts .task-detail-icon { width: 39px; height: 39px; color: white; background: var(--brand-solid); font-size: 8px; }
.work-order-primary-facts .task-detail small { font-size: 9px; }
.work-order-primary-facts .task-detail strong { font-size: 15px; line-height: 1.45; }
.work-order-primary-facts .task-detail div > span { font-size: 11px; }

.secondary-details { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 12px; box-shadow: none; }
.secondary-details .task-detail { min-height: 88px; padding: 17px 18px; border-top: 0; border-left: 1px solid var(--line-soft); }
.secondary-details .task-detail:first-child { border-left: 0; }
.secondary-details .task-detail small { font-size: 8px; }
.secondary-details .task-detail strong { font-size: 12px; }
.secondary-details .task-detail div > span,
.secondary-details .task-detail a { font-size: 10px; }

.all-task-documents { margin: 12px 0 24px; }
.all-task-documents.compact-empty { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 17px 20px; box-shadow: none; }
.all-task-documents.compact-empty .task-section-heading { flex: 0 0 auto; margin: 0; }
.all-task-documents.compact-empty .task-section-heading .eyebrow { display: none; }
.all-task-documents.compact-empty .task-section-heading h2 { font-size: 13px; }
.documents-empty-line { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 11px; }
.documents-empty-line span { color: var(--orange); }
.task-document strong { font-size: 11px; }
.task-document small { font-size: 9px; }

.contractor-task-block { padding: clamp(22px, 4vw, 31px); border-color: var(--line); background: color-mix(in srgb, var(--surface) 82%, transparent); }
.contractor-task-block-heading { align-items: center; margin-bottom: 18px; }
.contractor-task-block-heading h2 { font-size: clamp(24px, 4vw, 32px); }
.contractor-workflow-status { display: inline-flex; align-items: center; min-height: 30px; padding: 0 11px; border-radius: 999px; font-size: 9px; font-weight: 850; letter-spacing: .025em; white-space: nowrap; }
.contractor-workflow-status.scheduled { color: var(--muted); background: var(--canvas); }
.contractor-workflow-status.in_progress { color: #875225; background: #f7eadb; }
.contractor-workflow-status.complete,
.contractor-workflow-status.signed { color: var(--success); background: var(--success-soft); }
.contractor-workflow-status.review_required { color: white; background: var(--brand-solid); }

.contractor-task-progress { margin-bottom: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); }
.contractor-task-progress > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.contractor-task-progress > div:first-child span { color: var(--muted); font-size: 10px; font-weight: 750; }
.contractor-task-progress > div:first-child strong { font-size: 12px; }
.contractor-progress-track { height: 7px; margin: 11px 0; overflow: hidden; border-radius: 999px; background: var(--line-soft); }
.contractor-progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-solid), var(--brand-solid-hover)); }
.contractor-task-progress p { margin: 0; color: var(--muted); font-size: 11px; }
.contractor-task-progress p span { color: var(--ink); font-weight: 800; }

.photo-stage-list { gap: 16px; }
.photo-stage-card { padding: clamp(20px, 4vw, 28px); box-shadow: none; }
.photo-stage-card.completion { border-width: 2px; }
.stage-title-line { justify-content: space-between; }
.stage-title-line h3 { font-size: 16px; }
.photo-stage-heading p { font-size: 11px; }
.photo-step-done,
.photo-step-required { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: 8px; font-weight: 850; white-space: nowrap; }
.photo-step-done { color: var(--success); background: var(--success-soft); }
.photo-step-required { color: #875225; background: #f7eadb; }
.stage-empty { min-height: 70px; font-size: 11px; }
.photo-picker { min-height: 68px; padding: 11px 14px; border-width: 2px; }
.photo-picker strong { font-size: 12px; }
.photo-picker small { font-size: 10px; }
.completion-trigger-note p { font-size: 10px; }
.completion-trigger-note strong { font-size: 11px; }

.customer-review-callout { scroll-margin-top: 16px; }
.customer-review-callout .eyebrow { color: #a84a20; }
.customer-review-callout-heading p:last-child { max-width: 680px; font-size: 12px; }
.action-wait-note { margin: 13px 0 0; color: var(--muted); font-size: 10px; text-align: right; }
.customer-review-mobile-dock { display: none; }

html[data-theme="dark"] .contractor-workflow-status.in_progress,
html[data-theme="dark"] .photo-step-required { color: #efc28f; background: #3b2b1e; }
html[data-theme="dark"] .contractor-workflow-status.scheduled { color: #b5c1bb; background: #29332e; }
html[data-theme="dark"] .contractor-task-block { background: rgba(25, 25, 25, .76); }
html[data-theme="dark"] .work-order-primary-facts,
html[data-theme="dark"] .contractor-task-progress { background: var(--surface); }

@media (max-width: 700px) {
  .workspace-wide .contractor-brand { margin-bottom: 24px; }
  .contractor-work-hero { align-items: flex-start; }
  .contractor-work-hero .task-photo-summary { width: 100%; text-align: left; }
  .work-order-primary-facts { grid-template-columns: 1fr; }
  .work-order-primary-facts .task-detail { min-height: 0; padding: 18px; }
  .work-order-primary-facts .task-detail + .task-detail { border-top: 1px solid var(--line-soft); border-left: 0; }
  .secondary-details { grid-template-columns: 1fr; }
  .secondary-details .task-detail { min-height: 0; border-top: 1px solid var(--line-soft); border-left: 0; }
  .secondary-details .task-detail:first-child { border-top: 0; }
  .all-task-documents.compact-empty { align-items: flex-start; flex-direction: column; gap: 7px; padding: 15px 17px; }
  .contractor-task-block-heading { align-items: flex-start; }
}

@media (max-width: 580px) {
  .contractor-shell.workspace-wide { width: min(100% - 24px, 880px); padding-top: 18px; }
  .workspace-wide .contractor-brand { margin-bottom: 20px; }
  .workspace-wide .portal-back-link { margin-bottom: 18px; }
  .contractor-work-hero { gap: 15px; }
  .contractor-work-hero h1 { font-size: 32px; }
  .contractor-work-hero .task-record-name { font-size: 12px; }
  .contractor-work-hero .task-photo-summary { padding: 12px 14px; }
  .contractor-work-hero .task-photo-summary strong { display: inline; margin-right: 5px; font-size: 18px; }
  .contractor-work-hero .task-photo-summary span { display: inline; font-size: 10px; }
  .customer-review-callout { padding: 18px; }
  .customer-review-callout-heading { gap: 11px; }
  .customer-review-icon { width: 36px; height: 36px; border-radius: 10px; font-size: 17px; }
  .customer-review-callout h2 { font-size: 24px; }
  .customer-review-callout-heading p:last-child { font-size: 11px; }
  .customer-review-ready-row { padding: 12px; }
  .action-wait-note { font-size: 9px; text-align: left; }
  .work-order-primary-facts .task-detail strong { font-size: 14px; }
  .contractor-task-block { padding: 14px; border-radius: 16px; }
  .contractor-task-block-heading h2 { font-size: 24px; }
  .contractor-task-progress { padding: 14px; }
  .contractor-task-progress > div:first-child { align-items: flex-start; flex-direction: column; gap: 4px; }
  .photo-stage-card { padding: 17px 14px; }
  .photo-stage-heading { gap: 10px; }
  .stage-title-line { align-items: flex-start; flex-direction: column; gap: 6px; }
  .photo-stage-heading p { font-size: 10px; }
  .photo-picker { min-height: 64px; }
  .has-review-dock .contractor-shell { padding-bottom: 150px; }
  .customer-review-mobile-dock.is-visible {
    position: fixed;
    z-index: 20;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--orange) 55%, var(--line));
    border-radius: 15px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    box-shadow: 0 18px 55px rgba(0, 0, 0, .28);
    backdrop-filter: blur(14px);
  }
  .customer-review-mobile-dock > div { display: grid; gap: 2px; min-width: 0; }
  .customer-review-mobile-dock > div strong { font-size: 11px; }
  .customer-review-mobile-dock > div span { color: var(--muted); font-size: 9px; }
  .customer-review-mobile-dock .button { min-height: 42px; padding: 0 13px; font-size: 9px; }
  .customer-review-other-link { grid-column: 1 / -1; color: var(--orange); font-size: 10px; font-weight: 800; text-align: center; text-decoration: none; }
}

/* Contractor workflow refinement: one clear next action, legible field typography. */
.contractor-page { font-size: 16px; }
.contractor-page .contractor-brand small,
.contractor-page .verified-badge { font-size: 12px; }
.contractor-page .eyebrow { font-size: 12px; letter-spacing: .08em; }
.contractor-page .button { min-height: 48px; padding: 0 18px; font-size: 14px; }
.contractor-page .contractor-message { font-size: 14px; line-height: 1.5; }

.contractor-work-hero .task-record-name { font-size: 16px; }
.contractor-work-hero .next-action-summary {
  display: grid;
  gap: 5px;
  min-width: min(100%, 245px);
  border: 2px solid color-mix(in srgb, var(--orange) 35%, var(--line));
}
.contractor-work-hero .next-action-summary span { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.contractor-work-hero .next-action-summary strong { color: var(--ink); font-size: 17px; line-height: 1.35; }

.work-order-primary-facts .task-detail small,
.contractor-page .task-schedule-card small,
.contractor-page .secondary-details .task-detail small { font-size: 12px; }
.work-order-primary-facts .task-detail strong { font-size: 17px; }
.work-order-primary-facts .task-detail div > span,
.contractor-page .task-schedule-card span,
.contractor-page .secondary-details .task-detail div > span,
.contractor-page .secondary-details .task-detail a { font-size: 14px; }
.contractor-page .secondary-details .task-detail strong { font-size: 15px; }

.customer-review-waiting {
  margin-bottom: 22px;
  padding: clamp(20px, 4vw, 28px);
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--success-soft) 56%, var(--surface));
}
.customer-review-waiting h2 { margin: 2px 0 6px; font-size: clamp(24px, 4vw, 32px); }
.customer-review-waiting .customer-review-callout-heading > div > p:last-child,
.customer-review-callout-heading > div > p:last-child { font-size: 15px; line-height: 1.55; }
.customer-review-icon.sent { color: var(--success); background: var(--success-soft); }
.customer-review-ready-row strong { font-size: 16px; }
.customer-review-ready-row small,
.contractor-page .sms-delivery-state { font-size: 13px; line-height: 1.45; }
.contractor-page .text-action { color: var(--orange); font-size: 14px; font-weight: 800; text-decoration: none; }
.contractor-page .action-wait-note { font-size: 13px; }

.contractor-page .task-document strong { font-size: 15px; }
.contractor-page .task-document small { font-size: 13px; }
.contractor-page .document-task-group h3 { font-size: 15px; }

.contractor-page .task-switcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 10px;
  margin: 22px 0 14px;
}
.contractor-page .task-switcher a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 4px 11px;
  min-height: 68px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}
.contractor-page .task-switcher a > span { grid-row: 1 / 3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--orange); background: var(--orange-soft); font-size: 12px; font-weight: 850; }
.contractor-page .task-switcher a > strong { min-width: 0; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.contractor-page .task-switcher a > .contractor-workflow-status { justify-self: start; min-height: 22px; padding: 0 8px; font-size: 11px; }
.contractor-page .task-switcher a.is-active { border-color: var(--orange); box-shadow: 0 0 0 2px color-mix(in srgb, var(--orange) 16%, transparent); }

.contractor-page details.task-workflow-panel { padding: 0; overflow: hidden; }
.contractor-page details.task-workflow-panel > summary { margin: 0; padding: 20px 24px; cursor: pointer; list-style: none; }
.contractor-page details.task-workflow-panel > summary::-webkit-details-marker { display: none; }
.contractor-page details.task-workflow-panel > summary::after { content: "+"; margin-left: 12px; color: var(--orange); font-size: 25px; line-height: 1; }
.contractor-page details.task-workflow-panel[open] > summary { border-bottom: 1px solid var(--line-soft); }
.contractor-page details.task-workflow-panel[open] > summary::after { content: "−"; }
.contractor-page .contractor-task-content { padding: 22px 24px 24px; }
.contractor-page .contractor-task-block-heading h2 { font-size: clamp(25px, 4vw, 33px); }
.contractor-page .contractor-task-block-heading p:last-child { font-size: 14px; }
.contractor-page .contractor-workflow-status { min-height: 32px; padding: 0 11px; font-size: 12px; }
.contractor-page .contractor-workflow-status.review_in_progress { color: white; background: var(--brand-solid); }
.contractor-page .contractor-workflow-status.waiting_customer { color: var(--success); background: var(--success-soft); }

.contractor-page .contractor-task-progress { padding: 18px 20px; }
.contractor-page .contractor-task-progress > div:first-child span { font-size: 13px; }
.contractor-page .contractor-task-progress > div:first-child strong { font-size: 16px; }
.contractor-page .contractor-task-progress p { font-size: 13px; }

.contractor-page .photo-stage-card { padding: 22px; }
.contractor-page .photo-stage-card.is-complete { border-color: color-mix(in srgb, var(--success) 28%, var(--line)); }
.contractor-page .photo-stage-card.is-blocked { border-style: dashed; background: color-mix(in srgb, var(--canvas) 70%, var(--surface)); }
.contractor-page .photo-stage-card.is-blocked .photo-stage-number { color: var(--muted); background: var(--line-soft); }
.contractor-page .photo-stage-number { width: 38px; height: 38px; font-size: 12px; }
.contractor-page .stage-title-line h3 { font-size: 19px; }
.contractor-page .photo-stage-heading p { font-size: 14px; line-height: 1.5; }
.contractor-page .photo-step-done,
.contractor-page .photo-step-required,
.contractor-page .photo-step-waiting { display: inline-flex; align-items: center; min-height: 27px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 850; white-space: nowrap; }
.contractor-page .photo-step-waiting { color: var(--muted); background: var(--line-soft); }
.contractor-page .photo-picker { min-height: 76px; }
.contractor-page .photo-picker strong { font-size: 15px; }
.contractor-page .photo-picker small,
.contractor-page .upload-selection,
.contractor-page .photo-tile figcaption { font-size: 13px; }
.contractor-page .photo-corner-action,
.contractor-page .photo-corner-action label,
.contractor-page .photo-corner-action button { width: 44px; height: 44px; }
.contractor-page .photo-manage { margin-top: 14px; }
.contractor-page .photo-manage > summary { display: inline-flex; min-height: 44px; align-items: center; color: var(--orange); font-size: 14px; font-weight: 800; cursor: pointer; }
.contractor-page .photo-manage[open] > summary { margin-bottom: 9px; }
.contractor-page .blocked-step-note,
.contractor-page .photo-lock-note { margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.contractor-page .completion-trigger-note p { font-size: 14px; }
.contractor-page .completion-trigger-note strong { font-size: 15px; }

.contractor-page .work-order-more-details { margin: 20px 0 32px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.contractor-page .work-order-more-details > summary { min-height: 54px; padding: 0 18px; display: flex; align-items: center; color: var(--ink); font-size: 15px; font-weight: 800; cursor: pointer; }
.contractor-page .work-order-more-details .secondary-details { margin: 0; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0 0 14px 14px; }

html[data-theme="dark"] .contractor-page .task-switcher a,
html[data-theme="dark"] .contractor-page .work-order-more-details { background: var(--surface); }
html[data-theme="dark"] .contractor-page .task-switcher a.is-active { color: var(--ink); background: color-mix(in srgb, var(--orange) 13%, var(--surface)); }
html[data-theme="dark"] .customer-review-waiting { background: color-mix(in srgb, var(--success) 9%, var(--surface)); }

@media (max-width: 700px) {
  .contractor-page .task-switcher { grid-template-columns: 1fr; }
  .contractor-page details.task-workflow-panel > summary { padding: 17px 15px; }
  .contractor-page .contractor-task-content { padding: 16px 14px 17px; }
}

@media (max-width: 580px) {
  .contractor-page .contractor-brand small,
  .contractor-page .verified-badge { font-size: 11px; }
  .contractor-work-hero .task-record-name { font-size: 15px; }
  .contractor-work-hero .next-action-summary { width: 100%; padding: 14px 15px; }
  .work-order-primary-facts .task-detail small { font-size: 12px; }
  .work-order-primary-facts .task-detail strong { font-size: 16px; }
  .customer-review-callout-heading > div > p:last-child,
  .customer-review-waiting .customer-review-callout-heading > div > p:last-child { font-size: 14px; }
  .customer-review-ready-row strong { font-size: 15px; }
  .contractor-page .task-switcher a { min-height: 72px; }
  .contractor-page .contractor-task-block-heading { gap: 10px; }
  .contractor-page .contractor-task-block-heading h2 { font-size: 25px; }
  .contractor-page .contractor-task-progress > div:first-child { gap: 6px; }
  .contractor-page .photo-stage-card { padding: 18px 14px; }
  .contractor-page .photo-stage-heading { gap: 11px; }
  .contractor-page .stage-title-line { align-items: flex-start; }
  .contractor-page .stage-title-line h3 { font-size: 18px; }
  .contractor-page .photo-stage-heading p { font-size: 14px; }
  .customer-review-mobile-dock > div strong { font-size: 13px; }
  .customer-review-mobile-dock > div span { font-size: 12px; }
  .customer-review-mobile-dock .button { min-height: 46px; padding: 0 14px; font-size: 12px; }
  .customer-review-other-link { font-size: 13px; }
}

/* Compact contractor work page: a practical checklist, without dashboard tiles. */
.compact-contractor-page .compact-work-shell {
  width: min(100% - 28px, 760px);
  padding: 22px 0 48px;
}
.compact-contractor-page .contractor-brand { margin-bottom: 22px; }
.compact-contractor-page .portal-back-link { margin: 0 0 18px; color: var(--orange); font-weight: 550; }
.compact-contractor-page .contractor-messages { margin: 0 0 16px; }
.compact-contractor-page .button { min-height: 42px; padding: 0 15px; font-size: 14px; }
.compact-contractor-page .button:disabled { color: var(--muted); background: var(--line-soft); opacity: 1; }
.end-user-admin-notice { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; margin: 0 0 16px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--warning) 42%, var(--line)); border-radius: 8px; color: var(--ink); background: color-mix(in srgb, var(--warning) 8%, var(--surface)); font-size: 14px; line-height: 1.4; }
.end-user-admin-notice strong { color: var(--warning); font-size: inherit; }
.customer-admin-back { display: inline-block; margin: 0 0 12px; color: var(--orange); font-size: 14px; text-decoration: none; }
.customer-admin-back:hover { text-decoration: underline; text-underline-offset: 3px; }

.compact-work-context { padding: 0 0 20px; border-bottom: 1px solid var(--line); }
.compact-work-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
.compact-work-title h1 { margin: 0; font-size: clamp(26px, 6vw, 34px); line-height: 1.1; }
.compact-work-title > span { color: var(--muted); font-size: 16px; }
.compact-address-link { display: inline-block; margin-top: 8px; color: var(--ink); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.compact-context-muted { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.compact-plans { margin-top: 18px; }
.compact-plans h2,
.compact-section-heading h2 { margin: 0; font-size: 19px; font-weight: 650; }
.compact-plan-group { margin-top: 10px; }
.compact-plan-task { display: block; margin-bottom: 4px; color: var(--muted); font-size: 13px; }
.compact-instructions { margin: 5px 0 7px; color: var(--ink); font-size: 15px; line-height: 1.5; }
.compact-document-links { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.compact-document-links a { display: inline-flex; align-items: center; gap: 7px; color: var(--orange); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; }
.compact-document-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.compact-document-name { color: inherit; font-size: inherit; }
.compact-support-line { margin: 16px 0 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.compact-support-line a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.compact-task-section { padding-top: 20px; }
.compact-task-selector-summary { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.compact-task-selector { position: relative; }
.compact-task-selector::after { content: ""; position: absolute; right: 16px; bottom: 17px; width: 9px; height: 9px; border-right: 2px solid var(--orange); border-bottom: 2px solid var(--orange); transform: rotate(45deg); pointer-events: none; }
.compact-task-select { width: 100%; min-height: 49px; margin-top: 6px; padding: 8px 44px 8px 12px; appearance: none; border: 1px solid color-mix(in srgb, var(--orange) 45%, var(--line)); border-radius: 8px; color: var(--ink); background-color: var(--surface-subtle); font: inherit; font-size: 23px; font-weight: 600; line-height: 1.25; cursor: pointer; transition: border-color 140ms ease, background-color 140ms ease; }
.compact-task-select:hover { border-color: var(--orange); background-color: var(--surface); }
.compact-task-select:focus { border-color: var(--orange); outline: 2px solid color-mix(in srgb, var(--orange) 28%, transparent); outline-offset: 2px; }
.compact-task-panel { margin-top: 4px; }
.compact-task-panel.is-single { margin-top: 0; }
.compact-task-panel[hidden] { display: none; }
.compact-task-heading { display: block; }
.compact-task-service { align-self: start; }
.compact-task-heading h3 { margin: 0; font-size: clamp(21px, 5vw, 27px); font-weight: 650; line-height: 1.2; }
.compact-task-heading p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.compact-task-meta { margin-top: 5px; color: var(--muted); font-size: 14px; line-height: 1.4; }

.compact-workflow-row { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.compact-step-number { padding-top: 2px; color: var(--muted); font-size: 15px; }
.compact-workflow-row.is-complete .compact-step-number { color: var(--success); }
.compact-workflow-row.is-disabled { color: var(--muted); }
.compact-step-body { min-width: 0; }
.compact-step-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.compact-step-title h4 { margin: 0; color: var(--ink); font-size: 17px; font-weight: 600; }
.compact-step-title > span { color: var(--muted); font-size: 13px; text-align: right; }
.compact-step-body > p { margin: 0 0 9px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.compact-step-body > small { display: block; margin-top: 7px; color: var(--muted); font-size: 13px; }
.compact-add-photo-form { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.compact-add-photo-form input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.compact-add-photo-form .button { cursor: pointer; }
.compact-review-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.compact-review-actions form { margin: 0; }

.compact-photo-details > summary,
.compact-legacy-photos > summary { display: inline-flex; min-height: 38px; align-items: center; color: var(--orange); font-size: 14px; cursor: pointer; }
.compact-photo-details[open] > summary,
.compact-legacy-photos[open] > summary { margin-bottom: 9px; }
.compact-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(125px, 1fr)); gap: 8px; margin-bottom: 9px; }
.compact-photo-grid .photo-tile { border-radius: 7px; }
.compact-photo-grid .photo-tile figcaption { font-size: 12px; }
.compact-legacy-photos { margin: 0 0 0 38px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }

.compact-task-notes { padding-top: 20px; }
.compact-task-notes h4 { margin: 0 0 9px; font-size: 18px; font-weight: 600; }
.compact-task-notes form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.compact-task-notes textarea { width: 100%; min-height: 66px; resize: vertical; }
.compact-task-notes ol { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.compact-task-notes li { padding-top: 9px; border-top: 1px solid var(--line-soft); }
.compact-task-notes li p { margin: 0; font-size: 14px; line-height: 1.45; }
.compact-task-notes time { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

html[data-theme="dark"] .compact-task-select { color-scheme: light; }
html[data-theme="dark"] .compact-task-select option {
  color: #171717;
  background: #fff;
}

@media (max-width: 580px) {
  .compact-contractor-page .compact-work-shell { width: min(100% - 24px, 760px); padding-top: 16px; }
  .compact-contractor-page .contractor-brand { margin-bottom: 18px; }
  .compact-contractor-page .verified-badge { display: none; }
  .compact-work-context { padding-bottom: 17px; }
  .compact-work-title { display: grid; gap: 3px; }
  .compact-work-title > span { font-size: 15px; }
  .compact-task-section { padding-top: 17px; }
  .compact-task-selector-summary { font-size: 12px; }
  .compact-task-selector::after { bottom: 16px; }
  .compact-task-select { min-height: 47px; font-size: 20px; }
  .compact-workflow-row { grid-template-columns: 22px minmax(0, 1fr); gap: 7px; padding: 14px 0; }
  .compact-step-title { gap: 8px; }
  .compact-review-actions { align-items: stretch; }
  .compact-review-actions .button,
  .compact-review-actions form { width: 100%; }
  .compact-legacy-photos { margin-left: 29px; }
  .compact-task-notes form { grid-template-columns: 1fr; }
  .compact-task-notes form .button { justify-self: start; }
}

/* Contractor work page: every Task remains visible and photo destinations are explicit. */
.contractor-work-page .work-page-shell { width: min(100% - 32px, 1040px); padding: 22px 0 88px; }
.work-page-context { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 28px 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.work-page-context h1 { margin: 2px 0 5px; font-size: clamp(34px, 6vw, 52px); font-weight: 600; line-height: 1; }
.work-page-context p { margin: 0; color: var(--muted); }
.work-page-eyebrow { margin: 0; color: var(--orange); font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.work-page-actions { display: grid; justify-items: end; gap: 8px; text-align: right; }
.work-page-actions span { max-width: 290px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.work-page-support { margin: 14px 2px 0; color: var(--muted); font-size: 14px; }
.work-page-support a { color: var(--ink); font-weight: 600; }
.work-page-task-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; margin: 24px 0; }
.work-page-task-index a { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 9px; min-height: 66px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); text-decoration: none; }
.work-page-task-index a > span { grid-row: 1 / 3; display: grid; place-items: center; align-self: center; width: 30px; height: 30px; border-radius: 9px; color: var(--orange); background: var(--orange-soft); font-size: 12px; font-weight: 600; }
.work-page-task-index strong { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.work-page-task-index small { color: var(--muted); font-size: 12px; }
.work-page-tasks { display: grid; gap: 26px; }
.work-task-card { scroll-margin-top: 18px; padding: 26px 28px 28px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 10px 32px rgb(20 18 16 / 5%); }
.work-task-card.is-linked { border-color: var(--orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 14%, transparent); }
.work-task-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.work-task-title p { margin: 0 0 3px; color: var(--orange); font-size: 13px; font-weight: 600; }
.work-task-title h2 { margin: 0; font-size: clamp(27px, 4vw, 37px); font-weight: 600; line-height: 1.12; }
.work-task-title span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }
.work-task-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.work-task-facts > div { display: grid; gap: 4px; }
.work-task-facts small { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.work-task-facts strong, .work-task-facts a { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.45; }
.work-task-details { padding: 15px 0; border-bottom: 1px solid var(--line-soft); }
.work-task-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 36px; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.work-task-details > summary::after { content: "+"; color: var(--orange); font-size: 22px; }
.work-task-details[open] > summary::after { content: "−"; }
.work-task-workflow { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.work-task-step { min-width: 0; padding: 20px 0; border-bottom: 1px solid var(--line-soft); }
.work-task-step.customer-step { grid-column: 1 / -1; }
.work-task-step.is-disabled { color: var(--muted); }
.work-task-step-heading { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; margin-bottom: 12px; }
.work-task-step-number { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--orange); background: var(--orange-soft); font-size: 12px; font-weight: 600; }
.work-task-step.is-complete .work-task-step-number { color: var(--success); background: var(--success-soft); }
.work-task-step-heading h4 { margin: 0; font-size: 18px; }
.work-task-step-heading p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.work-photo-details > summary { margin-bottom: 9px; color: var(--orange); font-size: 13px; font-weight: 600; cursor: pointer; }
.work-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 9px; margin: 0 0 12px; }
.work-photo-tile { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); }
.work-photo-tile > img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.work-photo-tile figcaption { padding: 7px 8px; color: var(--muted); font-size: 11px; }
.photo-move-selector { position: absolute; z-index: 2; top: 7px; left: 7px; display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 4px 7px; border-radius: 8px; color: #fff; background: rgb(20 18 16 / 82%); font-size: 10px; font-weight: 600; cursor: pointer; }
.photo-move-selector input { width: 16px; height: 16px; accent-color: var(--orange); }
.approval-task-scope { margin: 0 0 13px 44px; padding: 12px 14px; border-left: 3px solid var(--orange); border-radius: 0 9px 9px 0; background: var(--surface-subtle); }
.approval-task-scope strong { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.approval-task-scope ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.office-correction-note { margin: 14px 0 0; padding: 11px 13px; border-radius: 9px; color: var(--warning); background: color-mix(in srgb, var(--warning) 10%, var(--surface)); font-size: 13px; line-height: 1.45; }
.work-task-notes form { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; margin-top: 10px; }
.work-task-notes textarea { width: 100%; min-height: 68px; resize: vertical; }
.work-task-notes ol { margin: 13px 0 0; padding: 0; list-style: none; }
.work-task-notes li { padding: 9px 0; border-top: 1px solid var(--line-soft); }
.work-task-notes li p { margin: 0; }
.work-task-notes time { color: var(--muted); font-size: 11px; }
.photo-correction-bar { position: fixed; z-index: 30; right: 22px; bottom: 22px; display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: var(--surface); box-shadow: 0 16px 44px rgb(20 18 16 / 22%); }
.photo-correction-bar[hidden] { display: none; }
.work-page-dialog { width: min(92vw, 620px); max-height: 90vh; padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface); box-shadow: 0 28px 80px rgb(20 18 16 / 30%); }
.work-page-dialog::backdrop { background: rgb(20 18 16 / 58%); backdrop-filter: blur(2px); }
.work-page-dialog form { position: relative; display: grid; gap: 18px; padding: 28px; }
.work-page-dialog h2 { margin: 4px 36px 18px 0; font-size: 28px; }
.upload-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; width: calc(100% - 58px); margin: 2px 58px 0 0; }
.upload-progress > span { height: 5px; border-radius: 999px; background: var(--line); transition: background-color 160ms ease; }
.upload-progress > span.is-complete,
.upload-progress > span.is-current { background: var(--brand-solid); }
.work-page-dialog label:not(.work-photo-picker), .work-page-dialog fieldset { display: grid; gap: 7px; margin: 0 0 16px; font-size: 14px; font-weight: 600; }
.work-page-dialog select { width: 100%; min-height: 48px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--surface); font: inherit; }
.work-page-dialog fieldset { grid-template-columns: 1fr 1fr; padding: 0; border: 0; }
.work-page-dialog legend { grid-column: 1 / -1; margin-bottom: 7px; }
.work-page-dialog fieldset label { display: flex !important; align-items: center; min-height: 46px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.work-page-dialog fieldset label.photo-stage-option { display: grid !important; grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; row-gap: 2px; }
.photo-stage-option > input { grid-row: 1 / 3; }
.photo-stage-count { font-size: 12px; font-weight: 500; line-height: 1.25; }
.photo-stage-count.has-photos { color: var(--success); }
.photo-stage-count.is-empty { color: var(--warning); }
.work-page-dialog fieldset label.is-disabled { color: var(--muted); background: var(--line-soft); cursor: not-allowed; }
.work-page-dialog input[type="radio"] { width: 18px; height: 18px; accent-color: var(--orange); }
.dialog-close { position: absolute; z-index: 2; top: 18px; right: 20px; width: 42px; height: 42px; border: 0; border-radius: 50%; color: var(--ink); background: var(--line-soft); font-size: 25px; cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.dialog-help, .upload-destination-summary { margin: 0; padding: 11px 13px; border-radius: 9px; color: var(--muted); background: var(--surface-subtle); font-size: 13px; line-height: 1.45; }
.upload-destination-summary:empty { display: none; }
.upload-destination-summary strong { color: var(--ink); }
.work-photo-picker { display: grid; place-items: center; min-height: 150px; padding: 22px; border: 2px dashed color-mix(in srgb, var(--orange) 50%, var(--line)); border-radius: 13px; color: var(--orange); background: var(--orange-soft); cursor: pointer; text-align: center; }
.work-photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-preview-grid .work-photo-tile span { display: block; padding: 7px 8px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 700px) {
  .contractor-work-page .work-page-shell { width: min(100% - 22px, 1040px); padding-top: 14px; }
  .work-page-context { align-items: stretch; padding: 20px; }
  .work-page-actions { justify-items: stretch; text-align: left; }
  .work-page-task-index { grid-template-columns: 1fr; margin: 18px 0; }
  .work-task-card { padding: 20px 16px 22px; border-radius: 14px; }
  .work-task-workflow, .work-task-facts { grid-template-columns: 1fr; gap: 0; }
  .work-task-step.customer-step { grid-column: auto; }
  .photo-correction-bar { right: 11px; bottom: 11px; left: 11px; justify-content: space-between; }
}

@media (max-width: 520px) {
  .work-page-context, .work-task-heading { display: grid; }
  .work-page-actions .button { width: 100%; }
  .work-task-heading .status-badge,
  .work-task-facts > div { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
  .approval-task-scope { margin-left: 0; }
  .work-task-notes form { grid-template-columns: 1fr; }
  .work-task-notes form .button { justify-self: start; }
  .work-page-dialog form { padding: 24px 18px; }
  .work-page-dialog fieldset { grid-template-columns: 1fr; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

/* Persistent local review mode; enabled only with legacy-link local testing. */
.contractor-work-page.is-mobile-preview { width: min(390px, 100%); min-height: 100vh; margin: 0 auto; box-shadow: 0 0 0 1px var(--line), 0 18px 60px rgb(20 18 16 / 18%); }
.is-mobile-preview .work-page-shell { width: calc(100% - 22px); padding-top: 14px; }
.is-mobile-preview .work-page-context { display: grid; align-items: stretch; padding: 20px; }
.is-mobile-preview .work-page-actions { justify-items: stretch; text-align: left; }
.is-mobile-preview .work-page-actions .button { width: 100%; }
.is-mobile-preview .work-page-task-index { grid-template-columns: 1fr; margin: 18px 0; }
.is-mobile-preview .work-task-card { padding: 20px 16px 22px; border-radius: 14px; }
.is-mobile-preview .work-task-heading { display: grid; }
.is-mobile-preview .work-task-heading .status-badge,
.is-mobile-preview .work-task-workflow,
.is-mobile-preview .work-task-facts { grid-template-columns: 1fr; gap: 0; }
.is-mobile-preview .work-task-facts > div { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.is-mobile-preview .work-task-step.customer-step { grid-column: auto; }
.is-mobile-preview .approval-task-scope { margin-left: 0; }
.is-mobile-preview .work-task-notes form { grid-template-columns: 1fr; }
.is-mobile-preview .work-task-notes form .button { justify-self: start; }
.is-mobile-preview .photo-correction-bar { right: calc(50% - 184px); bottom: 11px; left: calc(50% - 184px); justify-content: space-between; }
.is-mobile-preview .work-page-dialog { width: 368px; }
.is-mobile-preview .work-page-dialog form { padding: 24px 18px; }
.is-mobile-preview .work-page-dialog fieldset { grid-template-columns: 1fr; }
.is-mobile-preview .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }

/* Keep the Contractor work page calm while preserving emphasis on actions and Task names. */
.contractor-work-page .button,
.contractor-work-page .status-badge,
.contractor-work-page .approval-task-scope strong { font-weight: 600; }
.contractor-work-page .work-task-step-heading h4 { font-weight: 600; }

/* Field-first Contractor layout: actions, details, then photo management. */
.contractor-work-page .work-page-shell { padding-top: 14px; }
.contractor-work-page .contractor-brand { margin-bottom: 14px; }
.contractor-work-page .work-page-context,
.contractor-work-page .work-page-section { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.contractor-work-page .work-page-context { display: grid; gap: 12px; padding: 18px; }
.critical-heading { display: grid; gap: 6px; }
.contractor-work-page .critical-heading h1 { margin: 0; font-size: clamp(32px, 10vw, 44px); font-weight: 600; line-height: 1; }
.critical-customer { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; color: var(--ink); font-size: 14px; line-height: 1.35; }
.critical-customer-name { font-weight: 500; }
.critical-customer-phone { color: var(--orange); white-space: nowrap; }
.critical-location { color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1.35; }
.critical-add-photos { width: 100%; }
.critical-review-list { display: grid; gap: 9px; }
.critical-review-action { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-subtle); }
.critical-review-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.critical-review-heading h2 { margin: 0; font-size: 16px; font-weight: 600; }
.critical-review-action > p { margin: 0; color: var(--muted); font-size: 13px; }
.critical-review-action > .critical-review-hint { margin-top: -2px; font-size: 12px; }
.critical-review-message-meta { color: var(--muted); font-size: 12px; line-height: 1.4; }
.critical-review-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.critical-review-buttons form { margin: 0; }
.critical-review-buttons .button { width: 100%; min-height: 42px; height: 100%; padding: 0 10px; font-size: 12px; text-align: center; }
.contractor-work-page .approval-task-scope { margin: 0; padding: 8px 10px; border-left-width: 2px; }
.contractor-work-page .approval-task-scope strong { font-size: 10px; }
.contractor-work-page .approval-task-scope ul { margin-top: 3px; font-size: 13px; }
.contractor-work-page .work-page-support { margin: 0; font-size: 13px; }

.contractor-work-page .work-page-section { margin-top: 12px; padding: 16px 18px; }
.work-page-section-title { margin: 0 0 8px; font-size: 21px; font-weight: 600; }
.work-page-detail-list { display: grid; }
.contractor-work-page .work-task-card { padding: 12px 0; border: 0; border-top: 1px solid var(--line-soft); border-radius: 0; box-shadow: none; }
.contractor-work-page .work-task-card:first-child { border-top: 0; }
.contractor-work-page .work-task-card.is-linked { border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }
.contractor-work-page .work-task-heading { align-items: center; padding: 0; border: 0; }
.contractor-work-page .work-task-heading h3 { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.25; }
.contractor-work-page .work-task-heading p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.contractor-work-page .work-task-details { padding: 8px 0 0; border: 0; }
.contractor-work-page .work-task-details > summary { width: max-content; min-height: 32px; color: var(--orange); font-size: 13px; font-weight: 500; }
.contractor-work-page .work-task-details > summary::after { margin-left: 7px; font-size: 18px; }
.contractor-work-page .compact-document-links { margin-top: 5px; }
.contractor-work-page .work-task-layouts { padding-top: 9px; }
.contractor-work-page .work-task-layouts h4 { margin: 0; color: var(--ink); font-size: 13px; font-weight: 500; }
.contractor-work-page .work-task-notes form { margin-top: 6px; }
.contractor-work-page .work-task-notes textarea { min-height: 58px; }
.contractor-work-page .work-task-notes ol { margin-top: 7px; }
.contractor-work-page .work-task-notes li { padding: 7px 0; font-size: 13px; }

.work-page-photos > .work-photo-task-group { padding: 13px 0 5px; border-top: 1px solid var(--line-soft); }
.work-page-photos > .work-photo-task-group:first-of-type { border-top: 0; }
.work-photo-task-group > h3 { margin: 0; font-size: 17px; font-weight: 600; }
.contractor-work-page .work-task-workflow { grid-template-columns: 1fr; gap: 8px; padding-top: 9px; }
.contractor-work-page .work-task-step { padding: 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-subtle); }
.contractor-work-page .work-task-step-heading { display: flex; grid-template-columns: none; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.contractor-work-page .work-task-step-heading h4,
.contractor-work-page .work-legacy-photos h4 { margin: 0; font-size: 14px; font-weight: 500; }
.contractor-work-page .work-task-step-heading > span { color: var(--muted); font-size: 11px; }
.contractor-work-page .work-photo-empty { margin: 0; color: var(--muted); font-size: 12px; }
.contractor-work-page .work-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-bottom: 3px; }
.contractor-work-page .work-photo-tile { border-radius: 8px; }
.contractor-work-page .work-photo-tile figcaption { padding: 5px 6px; font-size: 10px; }
.contractor-work-page .photo-move-selector { width: 28px; min-height: 28px; padding: 5px; border-radius: 7px; }
.contractor-work-page .photo-move-selector input { width: 18px; height: 18px; margin: 0; }
.contractor-work-page .photo-corner-action,
.contractor-work-page .photo-corner-action label,
.contractor-work-page .photo-corner-action button { width: 34px; height: 34px; }

.contractor-work-page.is-mobile-preview .work-page-context,
.contractor-work-page.is-mobile-preview .work-page-section { padding-right: 14px; padding-left: 14px; }

/* Unified operations feed. */
.operations-feed-heading { margin-bottom: 20px; }
.operations-feed {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.operations-rollout-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 13px;
}
.operations-rollout-notice strong { color: var(--ink); font-weight: 600; }
.operations-rollout-notice a { flex: 0 0 auto; color: var(--orange); }
.operations-feed-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.operations-feed-search label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(540px, 100%);
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-raised);
}
.operations-feed-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 14px;
}
.operations-feed-search button,
.operations-feed-search a,
.operations-event-actions button {
  padding: 0;
  border: 0;
  color: var(--orange);
  background: transparent;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.operations-filter-bar { border-bottom: 1px solid var(--line); }
.operations-filter-row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 6px 14px;
  scrollbar-width: thin;
}
.operations-view-filters { padding-top: 10px; }
.operations-filter-row a {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
}
.operations-filter-row a:hover { color: var(--ink); background: var(--surface-subtle); }
.operations-filter-row a.active { color: var(--ink); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); }
.operations-filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 18px;
}
.operations-filter-footer > span { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.operations-period-filters { padding-bottom: 10px; }
.operations-event-list { display: grid; }
.operations-event-row {
  display: grid;
  grid-template-columns: 96px 12px minmax(0, 1fr);
  gap: 12px;
  padding: 19px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.operations-event-row:last-child { border-bottom: 0; }
.operations-event-row > time { display: grid; align-content: start; gap: 2px; padding-top: 2px; color: var(--muted); font-size: 13px; }
.operations-event-row > time span:first-child { color: var(--ink); }
.operations-event-marker {
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--muted-2);
}
.operations-event-row.level-success .operations-event-marker { background: var(--success); }
.operations-event-row.level-warning .operations-event-marker { background: var(--warning); }
.operations-event-row.level-error .operations-event-marker { background: var(--danger); }
.operations-event-main { min-width: 0; }
.operations-event-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.operations-event-title-line h2 { margin: 0; color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.35; }
.operations-event-state { color: var(--muted); font-size: 12px; }
.operations-event-state.attention { color: var(--danger); }
.operations-event-state.resolved { color: var(--success); }
.operations-event-main > p { max-width: 900px; margin: 5px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.operations-event-meta,
.operations-deliveries,
.operations-event-links { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 8px; }
.operations-event-meta { color: var(--muted-2); font-size: 13px; }
.operations-event-meta span + span::before { content: "·"; margin-right: 14px; }
.operations-deliveries { color: var(--muted); font-size: 13px; }
.operations-deliveries .failed { color: var(--danger); }
.operations-event-links a,
.operations-event-details > summary,
.operations-feed-empty a,
.operations-pagination a {
  color: var(--orange);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.operations-event-details { margin-top: 9px; }
.operations-event-details > summary { width: max-content; cursor: pointer; }
.operations-event-details > div { display: grid; gap: 10px; max-width: 900px; margin-top: 10px; padding: 13px; border-left: 2px solid var(--line); background: var(--surface-subtle); }
.operations-event-details dl { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; }
.operations-event-details dl > div { display: grid; gap: 2px; }
.operations-event-details dt { color: var(--muted-2); font-size: 12px; }
.operations-event-details dd { margin: 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.operations-related-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 15px; }
.operations-related-links > span { color: var(--muted-2); font-size: 12px; }
.operations-related-links a { color: var(--orange); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.operations-technical-detail,
.operations-resolution-detail { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.operations-technical-detail { color: var(--danger); }
.operations-event-actions { display: grid; gap: 10px; }
.operations-resolve-form { display: grid; grid-template-columns: minmax(220px, 520px) auto; gap: 7px 10px; align-items: end; }
.operations-resolve-form label { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.operations-resolve-form label span { color: var(--muted-2); }
.operations-resolve-form textarea { width: 100%; min-height: 56px; resize: vertical; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); font: inherit; font-size: 13px; }
.operations-resolve-form button { align-self: center; }
.operations-feed-empty { display: grid; place-items: center; min-height: 260px; padding: 30px; text-align: center; }
.operations-feed-empty p { margin: 0 0 7px; color: var(--muted); font-size: 15px; }
.operations-pagination { display: flex; align-items: center; justify-content: space-between; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.operations-pagination div { display: flex; gap: 16px; }

@media (max-width: 680px) {
  .operations-feed { margin-inline: -2px; border-radius: 9px; }
  .operations-rollout-notice { align-items: flex-start; flex-direction: column; gap: 6px; padding: 11px 12px; }
  .operations-feed-search { flex-wrap: wrap; padding: 12px; }
  .operations-feed-search label { width: 100%; }
  .operations-filter-footer { align-items: flex-start; padding-right: 12px; }
  .operations-filter-footer > span { padding-top: 12px; }
  .operations-event-row { grid-template-columns: 10px minmax(0, 1fr); gap: 10px; padding: 16px 13px; }
  .operations-event-row > time { grid-column: 2; grid-row: 1; display: flex; gap: 7px; padding: 0; }
  .operations-event-marker { grid-column: 1; grid-row: 1; }
  .operations-event-main { grid-column: 2; grid-row: 2; }
  .operations-resolve-form { grid-template-columns: 1fr; }
  .operations-resolve-form button { justify-self: start; }
  .operations-event-meta span + span::before { margin-right: 9px; }
}

/* Simple console queues: Tasks and Customer Approvals. */
.simple-page-heading { align-items: flex-end; }
.page-utility-link {
  margin-bottom: 5px;
  color: var(--orange);
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.simple-queue-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.simple-queue-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.simple-queue-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(560px, 100%);
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-raised);
}
.simple-queue-search input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 14px;
}
.simple-date-filter { display: flex; align-items: center; gap: 7px; margin-left: auto; color: var(--muted); font-size: 13px; }
.simple-date-filter input { width: 145px; min-height: 38px; padding: 0 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface-raised); font: inherit; font-size: 13px; }
html[data-theme="dark"] .simple-date-filter input { color-scheme: dark; }
.queue-text-action,
a.queue-text-action,
button.queue-text-action,
.queue-primary-link,
.queue-secondary-link,
.simple-queue-empty a {
  padding: 0;
  border: 0;
  color: var(--orange);
  background: transparent;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.queue-secondary-link { color: var(--muted); text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }
.queue-primary-link { font-size: 14px; white-space: nowrap; }
.queue-muted-state { color: var(--muted-2); font-size: 13px; }
.simple-filter-bar { border-bottom: 1px solid var(--line); }
.simple-filter-row { display: flex; gap: 4px; overflow-x: auto; padding: 7px 14px; scrollbar-width: thin; }
.simple-filter-row a { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 6px 9px; border-radius: 7px; color: var(--muted); font-size: 13px; line-height: 1; text-decoration: none; }
.simple-filter-row a:hover { color: var(--ink); background: var(--surface-subtle); }
.simple-filter-row a.active { color: var(--ink); background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); }
.simple-filter-row a span { color: var(--muted-2); font-size: 12px; }
.simple-filter-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-right: 18px; }
.simple-filter-footer > span { flex: 0 0 auto; color: var(--muted); font-size: 13px; }
.simple-date-links { padding-top: 2px; padding-bottom: 10px; }
.simple-queue-section { display: flex; align-items: center; justify-content: space-between; min-height: 47px; padding: 0 20px; border-bottom: 1px solid var(--line-soft); color: var(--ink); font-size: 14px; }
.simple-queue-section span:last-child { color: var(--muted); font-size: 13px; }
.simple-queue-panel .queue-column-head { min-height: 35px; background: var(--surface); font-size: 11px; font-weight: 500; letter-spacing: .025em; }
.simple-queue-row .task-queue-summary,
.simple-queue-row .approval-queue-summary { min-height: 88px; padding: 15px 20px; }
.simple-queue-row .queue-work-order { font-size: 14px; font-weight: 600; }
.simple-queue-row .queue-customer,
.simple-queue-row .queue-value { font-size: 14px; font-weight: 400; }
.simple-queue-row .task-queue-identity > span:last-child,
.simple-queue-row .approval-queue-identity > span:last-child,
.simple-queue-row .task-queue-contractor > span:last-child:not(.queue-value),
.simple-queue-row .task-queue-schedule > span:last-child:not(.queue-value),
.simple-queue-row .approval-invoice-summary > span:last-child { font-size: 13px; }
.simple-status,
.approval-issue-flag {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-wrap: pretty;
}
.simple-status.in_progress,
.simple-status.in-progress,
.simple-status.needs_payment {
  color: #2f668d;
  background: #eaf4fa;
  border-color: #bdd9e9;
}
.simple-status.needs_signature {
  color: #82551f;
  background: #fff2dd;
  border-color: #e7c796;
}
.simple-status.complete {
  color: #286143;
  background: #e6f3eb;
  border-color: #b7dcc7;
}
.simple-status.issues,
.approval-issue-flag {
  color: #943d2a;
  background: #fff0eb;
  border-color: #e7b8ab;
}
.simple-status.inactive { color: var(--muted-2); background: var(--surface-subtle); border-color: var(--line); }
.simple-queue-row .task-queue-state { gap: 4px; }
.simple-queue-row .task-queue-state small,
.queue-inline-note { color: var(--muted); font-size: 12px; }
.simple-queue-row .task-queue-primary-action,
.simple-queue-row .approval-primary-action { justify-self: end; }
.simple-row-details { padding: 0 20px 12px; border-top: 0; background: var(--surface); }
.simple-row-details > summary { display: list-item; width: max-content; min-height: 25px; padding: 0; color: var(--orange); font-size: 13px; font-weight: 400; line-height: 25px; list-style: disclosure-closed inside; text-decoration: underline; text-underline-offset: 3px; }
.simple-row-details[open] > summary { list-style-type: disclosure-open; }
.simple-row-details > summary::-webkit-details-marker { display: inline; color: var(--muted); }
.simple-row-details .queue-task-list,
.simple-row-details .approval-detail-grid { margin-top: 10px; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.simple-row-details .queue-detail-actions { padding: 11px 0 0; border-top: 0; }
.simple-row-details .queue-detail-actions form { display: inline-flex; }
.simple-completed-queue > summary { min-height: 50px; padding: 0 20px; font-size: 14px; }
.simple-completed-queue > summary > span:nth-child(2) { color: var(--muted); font-size: 13px; }
.simple-completed-queue > summary > span:last-child { color: var(--muted); }
.simple-queue-empty { display: grid; place-items: center; min-height: 260px; padding: 30px; text-align: center; }
.simple-queue-empty p { margin: 0 0 7px; color: var(--muted); font-size: 15px; }
.approval-filter-bar .simple-filter-row:first-child { padding-top: 10px; }
.simple-queue-panel .approval-queue-columns,
.simple-queue-panel .approval-queue-summary { grid-template-columns: minmax(240px, 1.45fr) minmax(170px, .9fr) minmax(155px, .8fr) 112px; }
.simple-queue-panel .approval-status-summary { display: grid; gap: 4px; min-width: 0; }
.simple-queue-panel .approval-queue-row.status-issues { box-shadow: inset 3px 0 0 var(--danger); }
.approval-issue-type { color: var(--muted); font-size: 12px; line-height: 1.35; }
.simple-queue-panel .approval-detail-grid > div { min-height: 105px; }
.simple-queue-panel .approval-inline-error,
.simple-queue-panel .approval-detail-note { margin: 10px 0 0; }
.simple-legacy-pages { margin-top: 16px; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.simple-legacy-pages > summary { min-height: 50px; font-size: 14px; }
.simple-legacy-pages > summary > span:nth-child(2) { color: var(--muted); font-size: 13px; }

html[data-theme="dark"] .simple-status.in_progress,
html[data-theme="dark"] .simple-status.in-progress,
html[data-theme="dark"] .simple-status.needs_payment {
  color: #a9d7f5;
  background: #172d3c;
  border-color: #315873;
}
html[data-theme="dark"] .simple-status.needs_signature {
  color: #ffd09a;
  background: #3c2b19;
  border-color: #70512d;
}
html[data-theme="dark"] .simple-status.complete {
  color: #9ed5b7;
  background: #203b2e;
  border-color: #315c43;
}
html[data-theme="dark"] .simple-status.issues,
html[data-theme="dark"] .approval-issue-flag {
  color: #ffb2a1;
  background: #3b201a;
  border-color: #70463a;
}

@media (max-width: 1000px) {
  .simple-queue-toolbar { flex-wrap: wrap; }
  .simple-queue-search { flex: 1 1 440px; }
  .simple-date-filter { margin-left: 0; }
  .simple-queue-panel .approval-queue-columns,
  .simple-queue-panel .approval-queue-summary { grid-template-columns: minmax(210px, 1.35fr) minmax(150px, .8fr) minmax(145px, .75fr) 105px; }
}

@media (max-width: 820px) {
  .simple-page-heading { align-items: flex-start; }
  .page-utility-link { margin-bottom: 0; }
  .simple-queue-panel .approval-queue-summary { grid-template-columns: minmax(0, 1fr) minmax(135px, .65fr); }
  .simple-queue-panel .approval-status-summary { grid-column: 2; grid-row: 1; }
  .simple-queue-panel .approval-invoice-summary { grid-column: 1; grid-row: 2; }
  .simple-queue-panel .approval-primary-action { grid-column: 2; grid-row: 2; }
}

@media (max-width: 580px) {
  .simple-queue-panel { border-radius: 9px; }
  .simple-queue-toolbar { padding: 12px; }
  .simple-queue-search { flex-basis: 100%; }
  .simple-date-filter { order: 4; width: 100%; }
  .simple-date-filter input { flex: 1; width: auto; }
  .simple-filter-footer { align-items: flex-start; padding-right: 12px; }
  .simple-filter-footer > span { padding-top: 10px; }
  .simple-queue-section { padding: 0 14px; }
  .simple-queue-row .task-queue-summary,
  .simple-queue-row .approval-queue-summary { gap: 13px; padding: 16px 14px 10px; }
  .simple-queue-row .task-queue-primary-action,
  .simple-queue-row .approval-primary-action { justify-self: start; }
  .simple-row-details { padding: 0 14px 12px; }
  .simple-queue-panel .approval-status-summary,
  .simple-queue-panel .approval-invoice-summary,
  .simple-queue-panel .approval-primary-action { grid-column: 1; grid-row: auto; }
}

/* Simplified page shells: one page title and secondary display controls. */
.console-page .topbar { display: none; }
.console-page .nav-list { padding-top: 18px; }
.console-page .sidebar .theme-toggle {
  width: 30px;
  height: 30px;
  border-color: rgba(255,255,255,.13);
  color: var(--nav-muted);
  background: transparent;
  box-shadow: none;
}
.console-page .sidebar .theme-toggle:hover { color: #fff; border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.06); }
.console-page .assistant-content { height: 100dvh; }
.console-page .assistant-content > .console-messages { top: 16px; }

.assistant-thread-rail { padding-top: 8px; }
.assistant-rail-close { position: absolute; z-index: 2; top: 8px; right: 8px; }
.assistant-pinned-link { margin-top: 0; }
.assistant-thread-list-label { text-transform: none; letter-spacing: 0; }
.assistant-workspace-header .eyebrow + h1 { margin-top: 0; }

.customer-topbar-inner { min-height: 64px; padding-block: 6px; }
.customer-topbar .gsr-logo { width: 154px; }
.end-user-theme-footer .theme-toggle,
.auth-theme-control .theme-toggle { width: 30px; height: 30px; box-shadow: none; }
.end-user-theme-footer {
  display: flex;
  width: min(100% - 28px, 1050px);
  justify-content: flex-end;
  margin: 0 auto;
  padding: 0 0 max(20px, env(safe-area-inset-bottom));
}
.auth-theme-control { display: flex; justify-content: center; margin-top: 18px; }

@media (max-width: 1180px) {
  .assistant-thread-rail { inset: 0 auto 0 252px; }
  .assistant-rail-scrim { inset: 0 0 0 252px; }
}

@media (max-width: 820px) {
  .console-page .topbar {
    position: static;
    display: flex;
    width: 100%;
    height: 52px;
    min-height: 52px;
    justify-content: flex-start;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: none;
  }
  .console-page .menu-button { display: block; }
  .console-page .assistant-content { height: calc(100dvh - 52px); }
  .console-page .assistant-content > .console-messages { top: 64px; }
  .assistant-thread-rail { inset: 52px auto 0 0; width: min(340px, 90vw); }
  .assistant-rail-scrim { inset: 52px 0 0 0; }
}

@media (max-width: 580px) {
  .customer-topbar-inner { min-height: 58px; }
  .customer-topbar .gsr-logo { width: 140px; }
  .end-user-theme-footer { width: calc(100% - 24px); }
}

/* Console navigation can collapse without changing the mobile drawer. */
.sidebar,
.main-shell { transition: width 160ms ease, margin-left 160ms ease; }
.nav-item:focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 45%, transparent); outline-offset: 2px; }

.sidebar-header { position: relative; }
.sidebar-collapse {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: -13px;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  color: var(--nav-muted);
  background: var(--nav);
  box-shadow: 0 3px 12px rgba(0,0,0,.25);
  cursor: pointer;
  transform: translateY(-50%);
}
.sidebar-collapse:hover { color: #fff; border-color: rgba(255,255,255,.34); }
.sidebar-collapse:focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 45%, transparent); outline-offset: 2px; }
.sidebar-collapse svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 160ms ease; }

@media (min-width: 821px) {
  html.console-sidebar-collapsed .sidebar { width: 76px; }
  html.console-sidebar-collapsed .main-shell { margin-left: 76px; }
  html.console-sidebar-collapsed .sidebar-header { justify-content: center; padding-inline: 13px; }
  html.console-sidebar-collapsed .sidebar-header .brand,
  html.console-sidebar-collapsed .sidebar-header .gsr-brand-lockup { width: 50px; overflow: hidden; }
  html.console-sidebar-collapsed .sidebar-header .gsr-logo-surface { width: 50px; height: 50px; padding: 3px; overflow: hidden; }
  html.console-sidebar-collapsed .sidebar-header .gsr-logo { width: 154px; max-width: none; }
  html.console-sidebar-collapsed .sidebar-header .gsr-brand-subtitle { display: none; }
  html.console-sidebar-collapsed .sidebar-collapse svg { transform: rotate(180deg); }
  html.console-sidebar-collapsed .nav-list { padding-inline: 9px; }
  html.console-sidebar-collapsed .nav-item {
    width: 48px;
    justify-content: center;
    gap: 0;
    margin-inline: auto;
    padding-inline: 0;
  }
  html.console-sidebar-collapsed .nav-item > span:not(.nav-icon):not(.nav-badge) { display: none; }
  html.console-sidebar-collapsed .nav-item.active::before { left: -14px; }
  html.console-sidebar-collapsed .nav-badge {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 16px;
    min-height: 16px;
    padding-inline: 4px;
    font-size: 8px;
  }
  html.console-sidebar-collapsed .nav-more-items {
    margin: 3px 0 7px;
    padding: 0;
    border-left: 0;
  }
  html.console-sidebar-collapsed .nav-more:not([open]) .nav-more-items { display: none; }
  html.console-sidebar-collapsed .nav-item::after {
    content: attr(data-nav-label);
    position: absolute;
    z-index: 40;
    top: 50%;
    left: calc(100% + 10px);
    width: max-content;
    max-width: 220px;
    padding: 7px 9px;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 7px;
    color: #fff;
    background: #242424;
    box-shadow: 0 5px 18px rgba(0,0,0,.28);
    font-size: 12px;
    font-weight: 550;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    transform: translate(3px, -50%);
    transition: opacity 100ms ease, transform 100ms ease;
  }
  html.console-sidebar-collapsed .nav-item:hover::after,
  html.console-sidebar-collapsed .nav-item:focus-visible::after {
    opacity: 1;
    transform: translate(0, -50%);
  }
  html.console-sidebar-collapsed .sidebar-footer { padding-inline: 10px; }
  html.console-sidebar-collapsed .local-badge,
  html.console-sidebar-collapsed .user-meta { display: none; }
  html.console-sidebar-collapsed .user-menu { flex-direction: column; gap: 8px; padding-inline: 0; }
}

@media (min-width: 821px) and (max-width: 1180px) {
  html.console-sidebar-collapsed .assistant-thread-rail {
    inset: 0 auto 0 76px;
    width: min(330px, calc(100vw - 76px));
    transform: translateX(calc(-100% - 76px));
  }
  html.console-sidebar-collapsed .assistant-rail-scrim { inset: 0 0 0 76px; }
  html.console-sidebar-collapsed .assistant-threads-open .assistant-thread-rail { transform: translateX(0); }
}

@media (max-width: 820px) {
  .sidebar-collapse { display: none; }
}

/* The operations workspace deliberately supports both theme palettes. */
.assistant-rail-search input::placeholder,
.assistant-workspace textarea::placeholder { color: var(--muted); opacity: 1; }
.assistant-workspace .form-error {
  margin: 8px 0 0;
  padding: 9px 11px;
  border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--line));
  border-radius: 8px;
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, var(--surface));
  font-size: 12px;
  line-height: 1.45;
}
html[data-theme="dark"] .assistant-page { color-scheme: dark; }
html[data-theme="dark"] .assistant-transcript,
html[data-theme="dark"] .current-operations-scroll,
html[data-theme="dark"] .assistant-thread-list { scrollbar-color: #555 transparent; }

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .sidebar-scrim,
  .main-shell,
  .sidebar-collapse svg,
  html.console-sidebar-collapsed .nav-item::after { transition: none; }
}

/* Chat responses stay in the transcript while the validated answer is prepared. */
.assistant-workspace { position: relative; }
.assistant-transcript .chat-message-live-copy {
  min-height: 1.65em;
  white-space: pre-wrap;
}
.chat-message-optimistic { opacity: .78; }
.chat-message-uncertain .chat-message-body > p {
  border-style: dashed;
  color: var(--muted);
}
.assistant-thinking-state {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  padding: 11px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 5px 15px 15px 15px;
  color: var(--muted);
  background: var(--canvas);
  font-size: 14px;
  line-height: 1.5;
}
.assistant-thinking-dots { display: inline-flex; align-items: center; gap: 4px; }
.assistant-thinking-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  opacity: .35;
  animation: assistant-thinking-dot 1.15s ease-in-out infinite;
}
.assistant-thinking-dots i:nth-child(2) { animation-delay: 140ms; }
.assistant-thinking-dots i:nth-child(3) { animation-delay: 280ms; }
@keyframes assistant-thinking-dot {
  0%, 60%, 100% { opacity: .28; transform: translateY(0); }
  30% { opacity: .9; transform: translateY(-3px); }
}

.assistant-inline-error .chat-message-body > p {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  background: color-mix(in srgb, var(--danger) 6%, var(--surface));
}
.assistant-inline-retry {
  margin-top: 9px;
  padding: 0;
  border: 0;
  color: var(--orange);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.assistant-inline-retry:hover { color: var(--ink); }
.assistant-inline-retry:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange) 35%, transparent);
  outline-offset: 3px;
  border-radius: 3px;
}
.assistant-inline-retry:disabled { color: var(--muted); cursor: default; }

.assistant-jump-latest {
  position: absolute;
  z-index: 6;
  right: clamp(20px, 3vw, 42px);
  bottom: calc(var(--assistant-composer-height, 112px) + 12px);
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 12px;
}
.assistant-jump-latest:hover { border-color: var(--orange); }
.assistant-jump-latest:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--orange) 35%, transparent);
  outline-offset: 2px;
}
.assistant-jump-latest[hidden] { display: none; }
.assistant-workspace > .chat-composer[aria-busy="true"] textarea { border-color: var(--line); }

@media (max-width: 820px) {
  .assistant-keyboard-hint { display: none; }
  .assistant-thinking-state { font-size: 13px; }
  .assistant-jump-latest { right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-thinking-dots i { animation: none; opacity: .62; transform: none; }
  .chat-message-optimistic { opacity: 1; }
}

/* Messages: shared filters and a quiet, chronological SMS list. */
.sms-history-page { display: grid; gap: 20px; }
.sms-history-page .page-heading { margin-bottom: 0; }
.sms-history-page .conversation-filters { grid-template-columns: minmax(220px, 1fr) 150px 150px auto auto; border: 0; }
.sms-history-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; }
.sms-history-section-heading h2 { margin: 0; font-size: 16px; font-weight: 600; }
.sms-history-section-heading h2 span, .sms-held summary span { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 6px; }
.sms-history-window, .sms-history-role { color: var(--muted); font-size: 12px; font-weight: 400; }
.sms-history-section-heading select { font-size: 13px; min-height: 36px; }
.sms-upcoming .notification-list { border: 0; border-radius: 0; }
.sms-upcoming .notification-row { padding: 14px 20px; border-top: 1px solid var(--line-soft); border-bottom: 0; }
.sms-upcoming .notification-title { font-weight: 500; }
.sms-history-empty { padding: 8px 20px 20px; margin: 0; color: var(--muted); font-size: 14px; }
.sms-show-more { padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.sms-held { border-top: 1px solid var(--line-soft); }
.sms-held summary { cursor: pointer; padding: 14px 20px; font-size: 13px; }
.sms-history-list .conversation-row { grid-template-columns: minmax(0, 1fr) auto; min-height: 0; padding: 16px 20px; border-top: 1px solid var(--line-soft); border-bottom: 0; }
.sms-history-list .conversation-row-title strong { font-size: 14px; font-weight: 500; }
.sms-history-list .conversation-row-context { font-size: 12px; gap: 10px; }
.sms-history-list .conversation-preview { color: var(--muted); font-size: 13px; margin-top: 4px; }
.sms-history-list .conversation-preview.search-match { background: transparent; padding: 0; border-radius: 0; color: var(--ink); }
.sms-history-order { color: var(--muted); font-size: 12px; }
.sms-history-list .conversation-row-time { font-size: 12px; font-weight: 400; }
@media (max-width: 700px) {
    .sms-history-page .conversation-filters { grid-template-columns: 1fr 1fr; }
    .sms-history-page .conversation-search { grid-column: 1 / -1; }
    .sms-history-section-heading { flex-wrap: wrap; gap: 8px; padding: 16px; }
    .sms-upcoming .notification-row, .sms-history-list .conversation-row { padding: 14px 16px; }
    .sms-history-list .conversation-row { gap: 10px; }
    .sms-history-list .conversation-row-context { flex-wrap: wrap; }
    .sms-history-list .conversation-row-time > span { display: none; }
}

.sms-history-filters, .sms-upcoming { padding: 0; overflow: hidden; }

.sms-history-section-heading select { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; }
