.supervisor-app {
  --app-orange: #c75427;
  --app-orange-dark: #9e3517;
  --app-ink: #1c1c1e;
  --app-muted: #74747c;
  --app-line: rgba(60, 60, 67, .12);
  --app-surface: rgba(255, 255, 255, .94);
  --app-bg: #f4f4f6;
  min-height: 100vh;
  background: var(--app-bg);
  color: var(--app-ink);
}

.supervisor-app .role-shell {
  width: min(100%, 680px);
  max-width: 680px;
  padding: 0 14px calc(104px + env(safe-area-inset-bottom));
}

.supervisor-app-header {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  margin: 0 -14px 16px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  border-bottom: 1px solid var(--app-line);
  background: rgba(244, 244, 246, .9);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}

.supervisor-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.supervisor-brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 1px 5px rgba(30, 30, 35, .1);
}

.supervisor-brand-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.supervisor-brand-copy strong {
  overflow: hidden;
  color: var(--app-ink);
  font-size: 16px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supervisor-brand-copy span {
  color: var(--app-muted);
  font-size: 11px;
  font-weight: 700;
}

.supervisor-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border: 1px solid rgba(199, 84, 39, .18);
  border-radius: 50%;
  background: #fff1ea;
  color: var(--app-orange-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.supervisor-home {
  display: grid;
  gap: 18px;
}

.supervisor-home[hidden] {
  display: none !important;
}

.home-greeting {
  display: grid;
  gap: 4px;
  padding: 2px 4px 0;
}

.home-greeting h1 {
  margin: 0;
  color: var(--app-ink);
  font-size: clamp(27px, 8vw, 34px);
  line-height: 1.05;
  letter-spacing: 0;
}

.home-greeting p {
  margin: 0;
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 700;
}

.supervisor-home-section {
  display: grid;
  gap: 10px;
}

.supervisor-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.supervisor-section-heading h2 {
  margin: 0;
  color: var(--app-ink);
  font-size: 18px;
  letter-spacing: 0;
}

.supervisor-section-heading button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--app-orange);
  padding: 4px;
  font-size: 12px;
  font-weight: 900;
}

.today-survey-card,
.home-quick-action,
.home-recent-row,
.home-empty-state {
  border: 1px solid var(--app-line);
  background: var(--app-surface);
  box-shadow: 0 8px 24px rgba(28, 28, 30, .05);
}

.today-survey-card {
  display: grid;
  gap: 13px;
  border-radius: 22px;
  padding: 17px;
}

.today-survey-head,
.home-recent-main {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.today-survey-reference,
.home-recent-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.today-survey-reference strong {
  color: var(--app-ink);
  font-size: 20px;
  line-height: 1.1;
}

.today-survey-reference span,
.home-recent-copy span {
  overflow: hidden;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-status-badge {
  display: inline-flex;
  min-height: 28px;
  flex: 0 0 auto;
  align-items: center;
  border-radius: 999px;
  background: #fff0e8;
  color: var(--app-orange-dark);
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 900;
}

.home-status-badge[data-status="survey-done"],
.home-status-badge[data-status="complete-work"] {
  background: #e9f7ee;
  color: #087443;
}

.home-status-badge[data-status="quotation-done"] {
  background: #edf4ff;
  color: #24517d;
}

.home-status-badge[data-status="po-receive-complete"] {
  background: #f0efff;
  color: #4f46a8;
}

.today-survey-project {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: #34343a;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.today-survey-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.today-survey-stat {
  display: grid;
  gap: 3px;
  border-radius: 14px;
  background: #f5f5f7;
  padding: 10px 11px;
}

.today-survey-stat span {
  color: #8a8a92;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.today-survey-stat strong {
  overflow: hidden;
  color: var(--app-ink);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-primary-action {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: var(--app-orange);
  color: #fff;
  padding: 11px 15px;
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 7px 16px rgba(199, 84, 39, .19);
}

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

.home-quick-action {
  display: grid;
  min-height: 94px;
  align-content: space-between;
  gap: 12px;
  border-radius: 18px;
  padding: 14px;
  color: var(--app-ink);
  text-align: left;
  text-decoration: none;
}

button.home-quick-action {
  width: 100%;
  font-family: inherit;
}

.home-quick-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  background: #fff0e8;
  color: var(--app-orange);
  font-size: 16px;
  font-weight: 900;
}

.home-quick-action strong {
  font-size: 13px;
  letter-spacing: 0;
}

.home-recent-list {
  display: grid;
  gap: 9px;
}

.home-recent-row {
  display: grid;
  gap: 10px;
  border-radius: 18px;
  padding: 13px 14px;
}

.home-recent-copy strong {
  overflow: hidden;
  color: var(--app-ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-project {
  overflow: hidden;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-recent-actions {
  display: flex;
  justify-content: flex-end;
}

.home-recent-actions button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: #f2f2f7;
  color: #42424a;
  padding: 6px 11px;
  font-size: 11px;
  font-weight: 900;
}

.home-empty-state {
  display: grid;
  gap: 5px;
  border-radius: 20px;
  padding: 20px;
  color: var(--app-muted);
  font-size: 13px;
  text-align: center;
}

.home-empty-state strong {
  color: var(--app-ink);
  font-size: 16px;
}

.supervisor-tab-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 7px max(8px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  border-top: 1px solid var(--app-line);
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
}

.supervisor-tab-bar button,
.supervisor-tab-bar a {
  display: grid;
  min-width: 0;
  min-height: 49px;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #7d7d86;
  padding: 5px 2px;
  font: 800 10px/1.1 Arial, Helvetica, sans-serif;
  text-decoration: none;
}

.supervisor-tab-icon {
  font-size: 16px;
  line-height: 1;
}

.supervisor-tab-bar [aria-current="page"] {
  background: #fff0e8;
  color: var(--app-orange-dark);
}

.supervisor-app .role-hero,
.supervisor-app .supervisor-entry-grid,
.supervisor-app .global-nav {
  display: none !important;
}

.supervisor-app .role-card:not(.survey-history-card) {
  border-radius: 22px;
}

@media (min-width: 768px) {
  .supervisor-app .role-shell {
    padding-right: 20px;
    padding-left: 20px;
  }

  .supervisor-app-header {
    margin-right: -20px;
    margin-left: -20px;
    padding-right: 24px;
    padding-left: 24px;
  }

  .supervisor-tab-bar {
    right: 50%;
    left: auto;
    width: min(100%, 680px);
    transform: translateX(50%);
    border-right: 1px solid var(--app-line);
    border-left: 1px solid var(--app-line);
    border-radius: 18px 18px 0 0;
  }
}

@media (max-width: 390px) {
  .supervisor-home {
    gap: 15px;
  }

  .today-survey-card {
    padding: 15px;
  }

  .home-quick-action {
    min-height: 88px;
    padding: 12px;
  }
}

body.supervisor-app .survey-confirm-dialog {
  box-sizing: border-box;
  width: calc(100% - 40px);
  max-width: 360px;
  max-height: calc(100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
  margin: auto;
  padding: 24px;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  background: #fff;
  color: #1c1c1e;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .16);
  text-align: left;
}

body.supervisor-app .survey-confirm-dialog::backdrop {
  background: rgba(0, 0, 0, .34);
}

body.supervisor-app:has(.survey-confirm-dialog[open]) {
  overflow: hidden;
}

body.supervisor-app .survey-confirm-dialog h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.3;
}

body.supervisor-app .survey-confirm-dialog p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.5;
  color: #6e6e73;
  overflow-wrap: anywhere;
}

body.supervisor-app .survey-confirm-dialog .survey-confirm-note {
  font-size: 13px;
}

body.supervisor-app .survey-confirm-actions {
  display: grid;
  gap: 8px;
  margin-top: 20px;
}

body.supervisor-app .survey-confirm-actions button {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e5ea;
  border-radius: 6px;
  background: #fff;
  color: #c62b23;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
}

body.supervisor-app .survey-confirm-actions [data-survey-dialog-choice="keep"] {
  background: #ff5100;
  border-color: #ff5100;
  color: #fff;
}

body.supervisor-app .survey-confirm-actions button:focus-visible {
  outline: 2px solid #007aff;
  outline-offset: 3px;
}

body.supervisor-app .survey-draft-notice:not([hidden]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 16px 0;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e5ea;
}
body.supervisor-app .survey-draft-notice div { flex: 1 1 140px; min-width: 0; }
body.supervisor-app .survey-draft-notice strong,
body.supervisor-app .survey-draft-notice span { display: block; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
body.supervisor-app .survey-draft-notice span { color: #6e6e73; }
body.supervisor-app .survey-draft-notice button {
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #e5e5ea;
  border-radius: 6px;
  color: #d74400;
  background: #fff;
  font-size: 14px;
}

/* Exact iOS-style supervisor home specification. Kept last to isolate it from legacy page rules. */
body.supervisor-app {
  --app-orange: #ff4b0a;
  --app-green: #00a84f;
  --app-blue: #087dff;
  --app-ink: #111318;
  --app-muted: #66676b;
  --app-line: #dedede;
  --app-surface: #ffffff;
  --app-bg: #fbfbfb;
  min-height: 100vh;
  margin: 0;
  background: var(--app-bg);
  color: var(--app-ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

body.supervisor-app .supervisor-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

body.supervisor-app .role-shell {
  width: min(100%, 426px);
  max-width: 426px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 22px calc(91px + env(safe-area-inset-bottom));
  background: var(--app-bg);
  box-shadow: none;
}

body.supervisor-app .supervisor-app-header {
  position: relative;
  z-index: 25;
  display: flex;
  min-height: 94px;
  align-items: center;
  justify-content: space-between;
  margin: 0 -22px 25px;
  padding: calc(17px + env(safe-area-inset-top)) 22px 16px;
  border-bottom: 1px solid var(--app-line);
  background: #fff;
}

body.supervisor-app .supervisor-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

body.supervisor-app .supervisor-brand-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border: 0;
  border-radius: 0;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

body.supervisor-app .supervisor-brand-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

body.supervisor-app .supervisor-brand-copy strong {
  overflow: hidden;
  color: var(--app-ink);
  font-size: 20px;
  font-weight: 720;
  line-height: 1.12;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.supervisor-app .supervisor-brand-copy span {
  color: var(--app-muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
}

body.supervisor-app .supervisor-avatar {
  display: grid;
  width: 43px;
  height: 43px;
  flex: 0 0 43px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e3e3e3;
  border-radius: 50%;
  background: #eeeeef;
  color: #27272a;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

body.supervisor-app .supervisor-home {
  display: grid;
  gap: 27px;
}

body.supervisor-app .supervisor-home[hidden] {
  display: none !important;
}

body.supervisor-app .home-greeting {
  display: grid;
  gap: 6px;
  padding: 0;
}

body.supervisor-app .home-greeting h1 {
  margin: 0;
  color: #0d0f12;
  font-size: 26px;
  font-weight: 730;
  line-height: 1.15;
  letter-spacing: 0;
}

body.supervisor-app .home-greeting p {
  margin: 0;
  color: var(--app-muted);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
}

body.supervisor-app .supervisor-home-section {
  display: grid;
  gap: 12px;
}

body.supervisor-app .supervisor-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
}

body.supervisor-app .supervisor-section-heading h2 {
  margin: 0;
  color: #202124;
  font-size: 18px;
  font-weight: 620;
  line-height: 1.2;
  letter-spacing: 0;
}

body.supervisor-app .supervisor-section-heading button {
  min-height: 28px;
  border: 0;
  background: transparent;
  color: var(--app-blue);
  padding: 2px 0;
  font-size: 12px;
  font-weight: 500;
}

body.supervisor-app .today-survey-card,
body.supervisor-app .home-quick-action,
body.supervisor-app .home-recent-list,
body.supervisor-app .home-empty-state {
  border: 1px solid var(--app-line);
  background: var(--app-surface);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .055);
}

body.supervisor-app .today-survey-card {
  display: grid;
  gap: 0;
  border-radius: 8px;
  padding: 18px 17px 17px;
}

body.supervisor-app .today-survey-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body.supervisor-app .today-survey-reference {
  min-width: 0;
}

body.supervisor-app .today-survey-reference strong {
  display: block;
  overflow: hidden;
  color: #101216;
  font-size: 21px;
  font-weight: 720;
  line-height: 1.12;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.supervisor-app .home-status-badge {
  display: inline-flex;
  min-height: 28px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--app-orange);
  border-radius: 5px;
  background: #fff;
  color: var(--app-orange);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

body.supervisor-app .today-survey-meta {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  color: var(--app-muted);
  font-size: 15px;
  line-height: 1.25;
}

body.supervisor-app .today-survey-divider {
  height: 1px;
  margin: 14px 0 13px;
  background: #e2e2e2;
}

body.supervisor-app .today-survey-info-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 32px;
  color: #2a2b2e;
  font-size: 14px;
  line-height: 1.3;
}

body.supervisor-app .today-survey-info-row svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

body.supervisor-app .home-primary-action {
  display: inline-flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  margin-top: 13px;
  border: 0;
  border-radius: 6px;
  background: var(--app-orange);
  color: #fff;
  padding: 11px 15px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  box-shadow: none;
}

body.supervisor-app .home-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.supervisor-app .home-quick-action {
  display: flex;
  width: 100%;
  min-height: 76px;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  border-radius: 8px;
  padding: 13px 16px;
  color: #252629;
  text-align: left;
  text-decoration: none;
}

body.supervisor-app button.home-quick-action {
  font-family: inherit;
}

body.supervisor-app .home-quick-icon {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  fill: none;
  stroke: #15171a;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

body.supervisor-app .home-quick-action strong {
  color: #242529;
  font-size: 14px;
  font-weight: 560;
  line-height: 1.2;
  letter-spacing: 0;
}

body.supervisor-app .home-recent-list {
  display: block;
  overflow: hidden;
  border-radius: 8px;
}

body.supervisor-app .home-recent-row {
  display: grid;
  width: 100%;
  min-height: 64px;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: var(--app-ink);
  padding: 14px 16px;
  font-family: inherit;
  text-align: left;
}

body.supervisor-app .home-recent-row + .home-recent-row {
  border-top: 1px solid #e3e3e3;
}

body.supervisor-app .home-recent-row strong {
  overflow: hidden;
  font-size: 15px;
  font-weight: 560;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.supervisor-app .home-recent-status {
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

body.supervisor-app .home-recent-status[data-status="survey-done"],
body.supervisor-app .home-recent-status[data-status="complete-work"] {
  color: var(--app-green);
}

body.supervisor-app .home-recent-status[data-status="quotation-done"] {
  color: var(--app-blue);
}

body.supervisor-app .home-recent-status[data-status="po-receive-complete"] {
  color: #6c5ce7;
}

body.supervisor-app .home-recent-status[data-status="pending"],
body.supervisor-app .home-recent-status[data-status="survey-pending"] {
  color: var(--app-orange);
}

body.supervisor-app .home-recent-chevron {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #5f6063;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

body.supervisor-app .home-empty-state {
  display: grid;
  gap: 6px;
  border-radius: 8px;
  padding: 18px;
  color: var(--app-muted);
  font-size: 13px;
  text-align: center;
}

body.supervisor-app .home-empty-state strong {
  color: var(--app-ink);
  font-size: 16px;
}

body.supervisor-app .supervisor-tab-bar {
  position: fixed;
  right: 50%;
  bottom: 0;
  z-index: 40;
  display: grid;
  width: min(100%, 460px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  transform: translateX(50%);
  padding: 7px 7px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--app-line);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, .035);
}

body.supervisor-app .supervisor-tab-bar button,
body.supervisor-app .supervisor-tab-bar a {
  display: grid;
  min-width: 0;
  min-height: 51px;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #66676b;
  padding: 4px 2px;
  font: 500 10px/1.1 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  text-decoration: none;
}

body.supervisor-app .supervisor-tab-icon {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.65;
}

body.supervisor-app .supervisor-tab-bar [aria-current="page"] {
  background: transparent;
  color: var(--app-orange);
}

body.supervisor-app .role-hero,
body.supervisor-app .supervisor-entry-grid,
body.supervisor-app .global-nav {
  display: none !important;
}

body.supervisor-app .role-card:not(.survey-history-card) {
  border-radius: 10px;
}

@media (max-width: 390px) {
  body.supervisor-app .role-shell {
    padding-right: 16px;
    padding-left: 16px;
  }

  body.supervisor-app .supervisor-app-header {
    margin-right: -16px;
    margin-left: -16px;
    padding-right: 16px;
    padding-left: 16px;
  }

  body.supervisor-app .supervisor-home {
    gap: 24px;
  }

  body.supervisor-app .home-quick-action {
    padding-right: 12px;
    padding-left: 12px;
  }
}

@media (min-width: 427px) {
  body.supervisor-app {
    background: #f2f2f4;
  }

  body.supervisor-app .role-shell {
    border-right: 1px solid #e4e4e4;
    border-left: 1px solid #e4e4e4;
  }
}

/* Hard viewport constraints: keep the app shell inside the phone canvas. */
html,
body.supervisor-app {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body.supervisor-app,
body.supervisor-app *,
body.supervisor-app *::before,
body.supervisor-app *::after {
  box-sizing: border-box;
}

body.supervisor-app .role-shell {
  width: 100%;
  max-width: 426px;
  min-width: 0;
  overflow-x: clip;
}

body.supervisor-app .supervisor-app-header {
  width: auto;
  min-width: 0;
  flex-wrap: nowrap;
}

body.supervisor-app .supervisor-brand,
body.supervisor-app .supervisor-brand-copy,
body.supervisor-app .supervisor-home,
body.supervisor-app .home-survey-card,
body.supervisor-app .home-survey-copy,
body.supervisor-app .home-quick-grid,
body.supervisor-app .home-recent-list,
body.supervisor-app .home-recent-row,
body.supervisor-app .home-recent-main {
  min-width: 0;
  max-width: 100%;
}

body.supervisor-app .supervisor-brand {
  flex: 1 1 auto;
}

body.supervisor-app .supervisor-avatar {
  flex: 0 0 42px;
  margin-left: auto;
}

body.supervisor-app .home-status-badge {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.supervisor-app .home-status-badge[data-status="po-received"] {
  color: #7c3aed;
  border-color: #c4b5fd;
  background: #faf5ff;
}

body.supervisor-app .home-status-badge[data-status="completed"] {
  color: #16803c;
  border-color: #86d7a2;
  background: #f2fbf5;
}

body.supervisor-app .supervisor-tab-bar {
  right: auto;
  left: 50%;
  width: min(100vw, 426px);
  transform: translateX(-50%);
}

/*
 * Supervisor home isolation.
 * apps/shared/mobile.css contains broad !important rules for legacy pages.
 * Keep this app canvas independent so the iOS layout renders consistently.
 */
body.supervisor-app {
  padding: 0 !important;
  overflow-x: hidden !important;
}

body.supervisor-app .role-shell {
  display: block !important;
  width: min(100vw, 426px) !important;
  max-width: min(100vw, 426px) !important;
  margin-right: auto !important;
  margin-left: auto !important;
}

body.supervisor-app .supervisor-app-header {
  display: flex !important;
  width: auto !important;
  grid-template-columns: none !important;
  align-items: center !important;
  justify-content: space-between !important;
}

body.supervisor-app .supervisor-brand {
  display: flex !important;
  width: auto !important;
  grid-template-columns: none !important;
  align-items: center !important;
}

body.supervisor-app .supervisor-brand-copy {
  display: grid !important;
  width: auto !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: start !important;
}

body.supervisor-app .supervisor-home,
body.supervisor-app .supervisor-home-section,
body.supervisor-app .today-survey-card,
body.supervisor-app .home-quick-grid,
body.supervisor-app .home-recent-list,
body.supervisor-app .home-empty-state {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

body.supervisor-app .supervisor-home-section {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
}

body.supervisor-app .today-survey-head {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: flex-start !important;
}

body.supervisor-app .today-survey-info-row {
  display: grid !important;
  grid-template-columns: 24px minmax(0, 1fr) !important;
  align-items: center !important;
}

body.supervisor-app .home-quick-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

body.supervisor-app .home-quick-action {
  display: flex !important;
  min-width: 0 !important;
  align-items: center !important;
}

body.supervisor-app .home-recent-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto 16px !important;
  align-items: center !important;
}

body.supervisor-app .supervisor-tab-bar {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

body.supervisor-app .supervisor-tab-bar button,
body.supervisor-app .supervisor-tab-bar a {
  display: grid !important;
  width: auto !important;
  min-width: 0 !important;
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: center !important;
}

@media (max-width: 426px) {
  body.supervisor-app .role-shell {
    border: 0 !important;
  }
}

/*
 * Supervisor home master layout.
 * Measurements mirror the approved 426px iPhone concept. This block stays last
 * because legacy responsive styles are shared with the survey forms below.
 */
body.supervisor-app {
  --supervisor-canvas: 426px;
  --supervisor-gutter: 23px;
  background: #f7f7f8 !important;
}

body.supervisor-app .role-shell {
  box-sizing: border-box !important;
  width: min(100vw, var(--supervisor-canvas)) !important;
  max-width: var(--supervisor-canvas) !important;
  margin-right: auto !important;
  margin-left: auto !important;
  padding: 0 var(--supervisor-gutter) calc(70px + env(safe-area-inset-bottom)) !important;
  background: #fdfdfd !important;
}

body.supervisor-app .supervisor-app-header {
  box-sizing: border-box !important;
  position: sticky !important;
  top: 0 !important;
  min-height: calc(69px + env(safe-area-inset-top)) !important;
  margin: 0 calc(var(--supervisor-gutter) * -1) 25px !important;
  padding: calc(10px + env(safe-area-inset-top)) var(--supervisor-gutter) 9px !important;
  border-bottom: 1px solid #e5e5e7 !important;
  background: rgba(255, 255, 255, .97) !important;
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
}

body.supervisor-app .supervisor-brand {
  gap: 13px !important;
}

body.supervisor-app .supervisor-brand-logo {
  width: 40px !important;
  height: 40px !important;
  flex-basis: 40px !important;
  border-radius: 50% !important;
  object-fit: contain !important;
}

body.supervisor-app .supervisor-brand-copy {
  gap: 2px !important;
}

body.supervisor-app .supervisor-brand-copy strong {
  font-size: 18px !important;
  font-weight: 650 !important;
  line-height: 1.12 !important;
}

body.supervisor-app .supervisor-brand-copy span {
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
}

body.supervisor-app .supervisor-avatar {
  width: 42px !important;
  height: 42px !important;
  flex-basis: 42px !important;
  border-color: #dedee1 !important;
  background: #f1f1f3 !important;
  color: #343438 !important;
  font-size: 12px !important;
}

body.supervisor-app .supervisor-home {
  display: block !important;
}

body.supervisor-app .home-greeting {
  min-height: 50px !important;
  margin: 0 0 26px !important;
  padding: 0 !important;
  gap: 5px !important;
}

body.supervisor-app .home-greeting h1 {
  font-size: 26px !important;
  font-weight: 720 !important;
  line-height: 1.08 !important;
}

body.supervisor-app .home-greeting p {
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1.15 !important;
}

body.supervisor-app .supervisor-home-section {
  gap: 11px !important;
}

body.supervisor-app .supervisor-home-section:nth-of-type(1) {
  margin-bottom: 17px !important;
}

body.supervisor-app .supervisor-home-section:nth-of-type(2) {
  margin-bottom: 26px !important;
}

body.supervisor-app .supervisor-section-heading h2 {
  font-size: 18px !important;
  font-weight: 590 !important;
  line-height: 1.2 !important;
}

body.supervisor-app .today-survey-card {
  min-height: 240px !important;
  border-radius: 7px !important;
  padding: 17px 16px 16px !important;
  border-color: #dedee0 !important;
  box-shadow: 0 3px 13px rgba(0, 0, 0, .055) !important;
}

body.supervisor-app .today-survey-reference strong {
  font-size: 20px !important;
  font-weight: 650 !important;
  line-height: 1.1 !important;
}

body.supervisor-app .home-status-badge {
  min-height: 25px !important;
  border-radius: 4px !important;
  padding: 4px 8px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

body.supervisor-app .today-survey-meta {
  gap: 4px !important;
  margin-top: 8px !important;
  font-size: 14px !important;
  line-height: 1.25 !important;
}

body.supervisor-app .today-survey-divider {
  margin: 13px 0 11px !important;
}

body.supervisor-app .today-survey-info-row {
  min-height: 29px !important;
  grid-template-columns: 23px minmax(0, 1fr) !important;
  gap: 8px !important;
  font-size: 14px !important;
}

body.supervisor-app .today-survey-info-row svg {
  width: 21px !important;
  height: 21px !important;
}

body.supervisor-app .home-primary-action {
  min-height: 36px !important;
  margin-top: 9px !important;
  border-radius: 5px !important;
  padding: 8px 14px !important;
  font-size: 15px !important;
  font-weight: 550 !important;
}

body.supervisor-app .home-quick-grid {
  grid-template-rows: repeat(2, 74px) !important;
  gap: 5px 9px !important;
}

body.supervisor-app .home-quick-action {
  min-height: 74px !important;
  height: 74px !important;
  gap: 12px !important;
  border-radius: 7px !important;
  padding: 12px 15px !important;
  border-color: #dedee0 !important;
  box-shadow: 0 2px 9px rgba(0, 0, 0, .035) !important;
}

body.supervisor-app .home-quick-icon {
  width: 31px !important;
  height: 31px !important;
  flex-basis: 31px !important;
  stroke-width: 1.55 !important;
}

body.supervisor-app .home-quick-action strong {
  font-size: 14px !important;
  font-weight: 520 !important;
}

body.supervisor-app .home-recent-list {
  border-radius: 7px !important;
  border-color: #dedee0 !important;
  box-shadow: 0 2px 9px rgba(0, 0, 0, .035) !important;
}

body.supervisor-app .home-recent-row {
  min-height: 53px !important;
  height: 53px !important;
  padding: 11px 16px !important;
}

body.supervisor-app .home-recent-row strong {
  font-size: 15px !important;
  font-weight: 520 !important;
}

body.supervisor-app .home-recent-status {
  font-size: 12px !important;
  font-weight: 520 !important;
}

body.supervisor-app .supervisor-tab-bar {
  box-sizing: border-box !important;
  min-height: calc(70px + env(safe-area-inset-bottom)) !important;
  padding: 6px 7px calc(7px + env(safe-area-inset-bottom)) !important;
  border-top-color: #e2e2e4 !important;
  background: rgba(255, 255, 255, .98) !important;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, .025) !important;
}

body.supervisor-app .supervisor-tab-bar button,
body.supervisor-app .supervisor-tab-bar a {
  min-height: 56px !important;
  gap: 3px !important;
  padding: 4px 2px !important;
  font-size: 10px !important;
  font-weight: 470 !important;
}

body.supervisor-app .supervisor-tab-icon {
  width: 23px !important;
  height: 23px !important;
}

@media (max-width: 390px) {
  body.supervisor-app {
    --supervisor-gutter: 18px;
  }

  body.supervisor-app .home-quick-action {
    padding-right: 12px !important;
    padding-left: 12px !important;
  }
}
/* Survey source selection and on-demand lifting resources. */
body.supervisor-app .resources-heading { margin: 0; padding: 0; }
body.supervisor-app .site-survey-form .resources-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  min-height: 56px;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #1c1c1e !important;
  box-shadow: none !important;
  text-align: left !important;
  cursor: pointer;
}
body.supervisor-app .resources-toggle:focus-visible { outline: 2px solid #ff5100; outline-offset: 4px; }
body.supervisor-app .resources-heading-text { display: grid; gap: 6px; min-width: 0; }
body.supervisor-app .resources-title { font-size: 18px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
body.supervisor-app .resources-summary { color: #6e6e73; font-size: 14px; font-weight: 400; line-height: 1.4; }
body.supervisor-app .resources-toggle img { width: 24px; height: 24px; flex: 0 0 24px; transform: rotate(180deg); }
body.supervisor-app .resources-toggle[aria-expanded="true"] img { transform: rotate(-90deg); }
body.supervisor-app [data-resources-content] { min-width: 0; padding-top: 16px; }
body.supervisor-app [data-resources-content][hidden],
body.supervisor-app [data-utility-civil-items][hidden],
body.supervisor-app [data-work-quantity-row][hidden],
body.supervisor-app [data-machine-editor][hidden],
body.supervisor-app [data-lifting-resources][hidden],
body.supervisor-app .machine-picker-dialog [hidden] { display: none !important; }
body.supervisor-app .machine-source-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 16px;
}
body.supervisor-app .machine-source-actions button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 56px;
  padding: 12px 8px !important;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  background: #fff;
  color: #1c1c1e;
  font-size: 15px !important;
  line-height: 1.3;
}
body.supervisor-app .machine-source-actions img,
body.supervisor-app .machine-picker-dialog img { width: 22px; height: 22px; flex: 0 0 22px; }
body.supervisor-app .machine-section .machine-list-panel { border: 0 !important; border-radius: 0 !important; background: transparent !important; padding: 0 !important; }
body.supervisor-app [data-machine-editor] { display: grid; gap: 12px; border-top: 1px solid #e5e5ea; padding-top: 16px; margin-top: 16px; }
body.supervisor-app .site-survey-form .lifting-work-toggle {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  margin: 12px 0;
  border-top: 1px solid #e5e5ea;
  border-bottom: 1px solid #e5e5ea;
}
body.supervisor-app .site-survey-form .lifting-work-toggle input {
  appearance: none !important;
  width: 50px !important;
  height: 30px !important;
  min-height: 30px !important;
  flex: 0 0 50px;
  border: 0 !important;
  border-radius: 20px !important;
  padding: 3px !important;
  background: #d1d1d6 !important;
  position: relative;
  cursor: pointer;
}
body.supervisor-app .site-survey-form .lifting-work-toggle input::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0002;
}
body.supervisor-app .site-survey-form .lifting-work-toggle input:checked { background: #ff5100 !important; }
body.supervisor-app .site-survey-form .lifting-work-toggle input:checked::after { transform: translateX(20px); }
body.supervisor-app .site-survey-form .lifting-work-toggle input:disabled { opacity: 1; cursor: default; }
body.supervisor-app [data-lifting-resources] small { display: block; color: #6e6e73; font-size: 12px; font-weight: 400; }
body.supervisor-app .work-scope-group { margin: 0 0 12px; padding: 0; border: 0; border-bottom: 1px solid #e5e5ea; border-radius: 0; background: transparent; }
body.supervisor-app .work-scope-group > summary { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 0; list-style: none; cursor: pointer; }
body.supervisor-app .work-scope-group > summary::-webkit-details-marker { display: none; }
body.supervisor-app .work-scope-group > summary > span { display: grid; flex: 1; gap: 4px; min-width: 0; }
body.supervisor-app .work-scope-group > summary small,
body.supervisor-app [data-work-group-count] { color: #6e6e73; font-size: 13px; font-weight: 400; }
body.supervisor-app .work-scope-group > summary strong { font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
body.supervisor-app .work-scope-group > summary img { width: 22px; height: 22px; flex: 0 0 22px; transform: rotate(180deg); }
body.supervisor-app .work-scope-group[open] > summary img { transform: rotate(-90deg); }
body.supervisor-app .work-scope-group > summary:focus-visible { outline: 2px solid #ff5100; outline-offset: 2px; }
body.supervisor-app .work-scope-subtitle { margin: 0 0 12px; color: #6e6e73; font-size: 14px; line-height: 1.4; }
body.supervisor-app .work-scope-row { padding: 12px 0; border-top: 1px solid #e5e5ea; min-width: 0; }
body.supervisor-app .site-survey-form .work-scope-check { display: flex !important; align-items: flex-start; gap: 10px; min-height: 44px; margin: 0; padding: 8px 0; font-size: 16px !important; line-height: 1.4 !important; font-weight: 400; cursor: pointer; }
body.supervisor-app .work-scope-check > span { min-width: 0; overflow-wrap: anywhere; }
body.supervisor-app .site-survey-form .work-scope-check input { width: 22px !important; height: 22px !important; min-height: 22px !important; margin: 0; flex: 0 0 22px; accent-color: #ff5100; }
body.supervisor-app .work-scope-quantity { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0 0 32px; min-width: 0; }
body.supervisor-app .site-survey-form .work-scope-quantity label { display: block; margin: 0; width: 100%; font-size: 13px !important; font-weight: 400; color: #6e6e73; }
body.supervisor-app .site-survey-form .work-scope-quantity input { width: 104px !important; min-width: 0 !important; min-height: 44px !important; padding: 10px 12px !important; font-size: 16px !important; }
body.supervisor-app .work-scope-quantity > span { color: #6e6e73; font-size: 14px; overflow-wrap: anywhere; }
body.supervisor-app .work-scope-quantity input[aria-invalid="true"] { border-color: #d92d20 !important; }
body.supervisor-app :where(.resources-toggle,.work-scope-group > summary,.work-scope-quantity input) { scroll-margin-top: 88px; scroll-margin-bottom: 100px; }
body.supervisor-app .machine-picker-dialog {
  box-sizing: border-box;
  width: min(560px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 20px;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  background: #fff;
  color: #1c1c1e;
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.supervisor-app .machine-picker-dialog::backdrop { background: #0006; }
body.supervisor-app:has(.machine-picker-dialog[open]) { overflow: hidden; }
body.supervisor-app .machine-picker-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.supervisor-app .machine-picker-header h2 { margin: 0; font-size: 22px !important; line-height: 1.3; }
body.supervisor-app .machine-picker-header button,
body.supervisor-app .machine-picker-row button {
  display: grid;
  place-items: center;
  width: 44px !important;
  min-height: 44px !important;
  flex: 0 0 44px;
  padding: 10px !important;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  background: #fff;
}
body.supervisor-app .machine-picker-search { display: grid; gap: 6px; margin: 16px 0 8px; font-size: 14px; }
body.supervisor-app .machine-picker-search input { box-sizing: border-box; width: 100%; min-width: 0; font-size: 16px; }
body.supervisor-app .machine-picker-status { color: #6e6e73; font-size: 14px; margin: 10px 0; }
body.supervisor-app .machine-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid #e5e5ea; }
body.supervisor-app .machine-picker-row > div { min-width: 0; display: grid; gap: 5px; }
body.supervisor-app .machine-picker-row :is(strong, span) { overflow-wrap: anywhere; }
body.supervisor-app .machine-picker-row strong { font-size: 16px; }
body.supervisor-app .machine-picker-row span { color: #6e6e73; font-size: 13px; }
body.supervisor-app .machine-picker-dialog button:focus-visible,
body.supervisor-app .lifting-work-toggle input:focus-visible { outline: 2px solid #ff5100; outline-offset: 3px; }
@media (max-width: 380px) {
  body.supervisor-app .machine-source-actions button { flex-direction: column; font-size: 14px !important; }
  body.supervisor-app .machine-picker-dialog { padding: 16px; }
}
