.staff-tools {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}
.staff-dialog {
  color: #18334a;
  background: #fff;
  border: 1px solid #9ab5c8;
  border-radius: 18px;
  width: min(620px, 92vw);
  max-height: 85dvh;
  overflow: auto;
  padding: 1.25rem;
  box-shadow: 0 12px 60px #0006;
}
.staff-dialog::backdrop {
  background: #061629aa;
}
.staff-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.staff-dialog button,
.staff-dialog input,
.staff-dialog select {
  min-height: 44px;
}
.staff-dialog .btn {
  color: #18334a;
  border-color: #41647d;
}
.submission-row,
.resume-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  margin: 0.65rem 0;
  border: 1px solid #8daec3;
  border-radius: 12px;
}
.resume-card {
  color: inherit;
  text-decoration: none;
  background: var(--card-bg, #ffffff12);
}
.submission-row small,
.resume-card small {
  font-size: 0.85rem;
}
.preference-row {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 0.3rem 0.6rem;
  padding: 1rem 0;
}
.preference-row span {
  grid-column: 2;
}
.native-tabs {
  position: fixed;
  z-index: 100;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  background: #152c40;
  border-top: 1px solid #87a9bf;
  gap: 4px;
}
.native-tabs a,
.native-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  text-align: center;
  color: #fff;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: normal;
  border: 0;
  background: transparent;
  padding: 6px;
}
.native-tabs [aria-current] {
  background: #315c7d;
  border-radius: 9px;
}
.has-native-tabs {
  padding-bottom: calc(90px + env(safe-area-inset-bottom)) !important;
}
.has-native-tabs .queue-pill,
.has-native-tabs .focus-resume,
.has-native-tabs .missing-toast {
  bottom: calc(170px + env(safe-area-inset-bottom));
}
.has-native-tabs .summary-footer {
  bottom: calc(75px + env(safe-area-inset-bottom));
}
.large-text {
  font-size: 120%;
}
.large-text .question-text {
  font-size: 1.15rem !important;
  line-height: 1.6;
}
.large-text button,
.large-text input,
.large-text select,
.large-text textarea {
  font-size: 1rem !important;
}
.field-mode body {
  background: #f4f7f9 !important;
  color: #142d40 !important;
}
.field-mode canvas,
.field-mode .caustics-layer {
  display: none !important;
}
.field-mode * {
  animation: none !important;
  transition: none !important;
  text-shadow: none !important;
}
.field-mode .site-header {
  background: #16364e !important;
  color: white !important;
}
.field-mode .question-row,
.field-mode .audit-section,
.field-mode .section-body,
.field-mode .open-issue {
  background: #fff !important;
  color: #142d40 !important;
}
.field-mode .question-text,
.field-mode label,
.field-mode .notes-input {
  color: #142d40 !important;
}
.field-mode button {
  min-height: 46px;
}
.field-mode .btn-yes,
.field-mode .btn-no,
.field-mode .btn-na {
  border: 2px solid #456477 !important;
}
.field-mode .is-negative {
  border-left: 5px solid #ae2632 !important;
}
.field-mode .is-positive {
  border-left: 5px solid #136c42 !important;
}
:focus-visible {
  outline: 3px solid #df9d20 !important;
  outline-offset: 3px;
}
html {
  scroll-padding-bottom: 160px;
}
.manager-filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.manager-filters label {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.manager-filters input,
.manager-filters select {
  min-height: 44px;
  padding: 8px;
  max-width: 100%;
}
.issue-workflow-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
.issue-workflow-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.issue-workflow-form input,
.issue-workflow-form select {
  min-height: 44px;
}
.manager-metrics {
  padding: 1rem;
  border: 1px solid #89a9bf;
  border-radius: 12px;
}
.qe-preview {
  white-space: normal;
  max-height: 50vh;
  overflow: auto;
  padding: 1rem;
  border: 1px solid #89a9bf;
}

.has-native-tabs:has(.summary-footer) {
  padding-bottom: calc(210px + env(safe-area-inset-bottom)) !important;
}

.field-mode .section-nav {
  background: #e4edf3 !important;
  color: #15354d !important;
}
.field-mode .nav-tab {
  color: #15354d !important;
}
.field-mode .nav-tab.active {
  background: #244e6c !important;
  color: #fff !important;
}
.field-mode .auth-input,
.field-mode .notes-input {
  background: #fff !important;
  color: #142d40 !important;
}
.large-text .native-tabs button,
.large-text .native-tabs a {
  font-size: 0.85rem !important;
}
@media (max-width: 640px) {
  .large-text .summary-inner {
    padding: 8px 12px;
  }
  .large-text .action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .large-text .action-row .btn {
    padding: 10px 12px;
    white-space: normal;
    font-size: 0.85rem !important;
  }
}

.field-mode #focus-mode-btn {
  background: #fff !important;
  color: #183e5a !important;
  border: 1px solid #6d8ca3 !important;
}

/* "Update available" banner (shared/native-tools.js, app shell only).
   Fixed dark colours so it reads the same in both themes. */
.update-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  top: calc(8px + env(safe-area-inset-top, 0px));
  z-index: 960;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #1a2940;
  color: #fff;
  font-size: .85rem;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0,0,0,.28);
}
.update-banner[data-state="required"] { background: #9a3412; }
.update-banner > span { flex: 1 1 auto; }
.update-banner-action {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  color: #1a2940;
  font-weight: 700;
  text-decoration: none;
}
.update-banner-close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  opacity: .8;
  padding: 6px 4px;
}

.iphone-home, .iphone-assigned-title, .iphone-issue-status { display: none; }
@media (max-width: 767px) {
  .iphone-app body { background: var(--phone-bg); color: var(--phone-ink); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
  .iphone-app .site-header { background: var(--phone-navy); backdrop-filter: none; border-bottom: 0; box-shadow: 0 2px 12px #00152418; }
  .iphone-app .header-inner { padding: calc(12px + env(safe-area-inset-top)) 18px 12px; }
  .iphone-app .header-top { gap: 8px; margin-bottom: 0; }
  .iphone-app .header-top h1 { font-size: 1.18rem; line-height: 1.3; letter-spacing: -.025em; color: #fff; flex: 1; }
  .iphone-app .header-logo { width: 28px; height: 28px; object-fit: contain; }
  .iphone-app .site-header .dash-user, .iphone-app .site-header .staff-tools, .iphone-app .site-header .theme-toggle { display: none; }
  .iphone-app .header-zone-glyph { display: none; }
  .iphone-app .native-back-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .iphone-app .header-fields { width: 100%; gap: 8px; }
  .iphone-app .header-fields input { min-height: 44px; font-size: 16px; }
  .iphone-app .header-idcard { max-width: 100%; font-size: .8rem; min-height: 36px; }
  .iphone-app .progress-bar-wrap { margin-top: 12px; }
  .iphone-app .dash-main { padding: 20px 18px; }
  .iphone-app .dash-heading { color: var(--phone-muted); font-size: .78rem; letter-spacing: .08em; }
  .iphone-app .iphone-home { display: block; margin-bottom: 24px; }
  .iphone-app .iphone-home h2 { font-size: 1.7rem; line-height: 1.15; letter-spacing: -.04em; margin: 8px 0; }
  .iphone-app .iphone-eyebrow { font-size: .7rem; letter-spacing: .16em; font-weight: 750; color: var(--phone-muted); margin: 0; }
  .iphone-app .iphone-week-summary { font-size: .88rem; line-height: 1.5; color: var(--phone-muted); margin: 10px 0 16px; }
  .iphone-app .iphone-primary-action { display: flex; flex-direction: column; gap: 8px; position: relative; padding: 22px 48px 22px 20px; border-radius: 22px; background: var(--phone-action); color: #fff; text-decoration: none; box-shadow: 0 8px 24px #0d50692b; }
  .iphone-app .iphone-primary-action small { font-size: .65rem; letter-spacing: .12em; font-weight: 700; }
  .iphone-app .iphone-primary-action strong { font-size: 1.4rem; line-height: 1.25; letter-spacing: -.025em; }
  .iphone-app .iphone-primary-action > span { font-size: .82rem; line-height: 1.4; }
  .iphone-app .iphone-primary-action .iphone-action-arrow { position: absolute; right: 20px; top: 45%; font-size: 1.5rem; }
  .iphone-app #resume-drafts, .iphone-app .cloud-draft-list, .iphone-app #assigned-section .week-hero { display: none; }
  .iphone-app .iphone-assigned-title { display: block; font-size: 1rem; margin: 0 0 12px; letter-spacing: -.02em; }
  .iphone-app .iphone-other-drafts { padding: 14px 2px 0; color: var(--phone-muted); font-size: .9rem; }
  .iphone-app .iphone-other-drafts summary { min-height: 44px; cursor: pointer; }
  .iphone-app .iphone-other-drafts a { display: block; padding: 14px; margin-top: 6px; color: var(--phone-ink); text-decoration: none; background: var(--phone-card); border: 1px solid var(--phone-line); border-radius: 12px; }
  .iphone-app .audit-grid { gap: 10px; }
  .iphone-app .audit-card, .iphone-app .health-card, .iphone-app .open-issue, .iphone-app .recurring-problems tr { background: var(--phone-card); border: 1px solid var(--phone-line); border-radius: 18px; box-shadow: 0 3px 12px #09233106; color: var(--phone-ink); }
  .iphone-app .audit-card { padding: 16px; }
  .iphone-app .audit-card-title { font-size: 1rem; letter-spacing: -.02em; }
  .iphone-app .quick-actions { display: block; }
  .iphone-app .quick-actions .campus-health-card, .iphone-app .quick-actions .spot-issue-card { display: none; }
  .iphone-app .quick-actions .achv-card { background: transparent; border: 0; box-shadow: none; padding: 10px 0; }
  .iphone-app .native-tabs { background: var(--phone-navy); border-top: 1px solid #ffffff20; gap: 2px; padding-top: 8px; }
  .iphone-app .native-tabs a, .iphone-app .native-tabs button { flex-direction: column; gap: 5px; font-size: .64rem; font-weight: 600; min-height: 54px; color: #c4d5df; border-radius: 12px; }
  .iphone-app .native-tabs svg { width: 22px; height: 22px; }
  .iphone-app .native-tabs [aria-current] { color: #fff; background: #ffffff16; box-shadow: inset 0 2px #75cce0; }
  .iphone-app .staff-dialog { color: var(--phone-ink); background: var(--phone-card); border: 1px solid var(--phone-line); border-radius: 24px; padding: 20px; }
  .iphone-app .staff-dialog .btn { color: var(--phone-ink); border-color: var(--phone-line); }
  .iphone-app .iphone-account-actions { display: grid; gap: 8px; margin: 14px 0; }
  .iphone-app .iphone-account-actions a { text-decoration: none; text-align: center; padding: 12px; }
  .iphone-app .section-nav { background: var(--phone-card); border-bottom: 1px solid var(--phone-line); }
  .iphone-app .question-row { padding: 22px 16px; background: var(--phone-card); border-bottom: 1px solid var(--phone-line); }
  .iphone-app .question-text { color: var(--phone-ink); font-size: 1.08rem; line-height: 1.5; letter-spacing: -.015em; }
  .iphone-app .response-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
  .iphone-app .resp-btn { min-height: 50px; padding: 10px 8px; font-size: .95rem; border-radius: 13px; border-width: 2px; }
  .iphone-app .response-row .note-toggle { grid-column: 1 / -1; justify-self: start; min-height: 44px; }
  .iphone-app .btn-yes { color: var(--phone-good); border-color: var(--phone-good); }
  .iphone-app .btn-yes.active { color: var(--phone-card); background: var(--phone-good); }
  .iphone-app .btn-no { color: var(--phone-alert); border-color: var(--phone-alert); }
  .iphone-app .btn-no.active { color: var(--phone-card); background: var(--phone-alert); }
  .iphone-app .btn-na { color: var(--phone-muted); border-color: var(--phone-line); }
  .iphone-app .btn-na.active { color: var(--phone-ink); background: var(--phone-line); }
  .iphone-app .issue-panel.open { background: var(--phone-bg); border: 1px solid var(--phone-line); border-radius: 16px; padding: 16px; margin-top: 16px; }
  .iphone-app .issue-type-row { gap: 8px; }
  .iphone-app .issue-btn, .iphone-app .severity-btn { min-height: 44px; }
  .iphone-app .photo-upload-btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; background: var(--phone-card); color: var(--phone-link); border: 2px dashed var(--phone-line); border-radius: 14px; padding: 12px; }
  .iphone-app .photo-preview { border-radius: 12px; max-width: 100%; }
  .iphone-app .issue-notes-input, .iphone-app .notes-input { background: var(--phone-card); color: var(--phone-ink); border: 1px solid var(--phone-line); border-radius: 12px; font-size: 16px; padding: 14px; }
  .iphone-app .summary-footer { background: var(--phone-card); border-top: 1px solid var(--phone-line); }
  .iphone-app.issue-work-view #campus-sea, .iphone-app .issue-work-view #campus-sea { display: none; }
  .iphone-app .issue-work-view #campus-total { display: none; }
  .iphone-app .issue-work-view > main > section:first-child { margin-bottom: 16px; }
  .iphone-app .issue-work-view > main > section:first-child > .dash-heading-row > .dash-heading { display: none; }
  .iphone-app .range-toggle--views { background: var(--phone-card); border: 1px solid var(--phone-line); border-radius: 13px; }
  .iphone-app .range-toggle-btn { min-height: 44px; }
  .iphone-app .manager-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; background: var(--phone-card); border: 1px solid var(--phone-line); border-radius: 18px; }
  .iphone-app .manager-filters label { min-width: 0; font-size: .82rem; color: var(--phone-muted); }
  .iphone-app .manager-filters input, .iphone-app .manager-filters select { width: 100%; background: var(--phone-card); color: var(--phone-ink); border: 1px solid var(--phone-line); border-radius: 10px; font-size: 16px; }
  .iphone-app .manager-metrics { background: var(--phone-card); border: 1px solid var(--phone-line); font-size: .88rem; line-height: 1.5; border-radius: 16px; }
  .iphone-app .open-issue { padding: 18px; margin-bottom: 12px; }
  .iphone-app .open-issue-q { font-size: 1rem; line-height: 1.5; color: var(--phone-ink); }
  .iphone-app .open-issue-notes, .iphone-app .open-issue-meta { color: var(--phone-muted); line-height: 1.5; }
  .iphone-app .iphone-issue-status { display: inline-block; margin-bottom: 12px; padding: 5px 10px; border-radius: 8px; color: var(--phone-pending); background: var(--phone-pending-bg); font-size: .74rem; font-weight: 700; }
  .iphone-app [data-issue-state=resolved] .iphone-issue-status, .iphone-app [data-issue-state=verified] .iphone-issue-status { color: var(--phone-good); background: var(--phone-good-bg); }
  .iphone-app .cloud-draft-banner { margin: 14px 0; border-radius: 14px; border: 1px solid var(--phone-line); background: var(--phone-card); color: var(--phone-muted); font-size: .85rem; }
}
@media (max-width: 767px) {
  .iphone-app #lpa-back-btn { min-height: 44px; font-size: .8rem; }
  .iphone-app .response-row:has(.btn-rating) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .iphone-app .iphone-appearance { display: grid; gap: 8px; padding: 12px 0; }
  .iphone-app .iphone-appearance select { width: 100%; padding: 12px; border: 1px solid var(--phone-line); border-radius: 12px; color: var(--phone-ink); background: var(--phone-card); font-size: 16px; }
  .iphone-app [data-priority=high] .iphone-issue-status { background: var(--phone-alert-bg); color: var(--phone-alert); }
}
@media (max-width: 767px) {
  .iphone-app .header-top h1 { background: none; -webkit-text-fill-color: currentColor; }
  .iphone-app .quick-actions .achv-card { display: flex; flex-direction: row; align-items: center; padding: 12px 16px; min-height: 64px; background: var(--phone-card); border: 1px solid var(--phone-line); border-radius: 16px; }
  .iphone-app .quick-actions .achv-card::before { display: none; }
  .iphone-app .iphone-onboard { border: 1px solid var(--phone-line); border-radius: 16px; background: var(--phone-card); }
  .iphone-app .iphone-onboard > summary { padding: 16px; min-height: 50px; font-size: .9rem; color: var(--phone-muted); cursor: pointer; }
  .iphone-app .iphone-onboard .onboard-card { border: 0; box-shadow: none; margin: 0; padding: 16px; background: var(--phone-card); }
  .iphone-app #audit-grid { scroll-margin-top: calc(var(--header-h) + 16px); }
  .iphone-app .audit-card-assigned { animation: none; border-color: var(--phone-link); }
  .iphone-app .phrase-chip { min-height: 44px; }
  .iphone-app .issue-matches { background: var(--phone-card); border-color: var(--phone-line); }
}
@media (max-width: 767px) {
  .iphone-app .iphone-filter-panel, .iphone-app details.recurring-problems { background: var(--phone-card); border: 1px solid var(--phone-line); border-radius: 16px; margin-block: 12px; }
  .iphone-app .iphone-filter-panel > summary, .iphone-app details.recurring-problems > summary { padding: 15px 16px; min-height: 50px; font-size: .9rem; font-weight: 650; cursor: pointer; }
  .iphone-app .iphone-filter-panel .manager-filters { margin: 0; border: 0; }
  .iphone-app details.recurring-problems > :not(summary) { margin-inline: 16px; }
  .iphone-app .open-summary { margin: 16px 0; font-size: .88rem; color: var(--phone-muted); }
}
@media (max-width: 767px) {
  .iphone-app body:not(.zone-page) .site-header .header-inner { padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: 12px; }
  .iphone-app .nav-tab { min-height: 44px; color: var(--phone-muted); }
  .iphone-app .nav-tab.active { color: #fff; background: var(--phone-action); box-shadow: none; }
  .iphone-app .zone-page.fields-collapsed .header-top { flex-wrap: wrap; }
  .iphone-app .zone-page.fields-collapsed .header-idcard { flex: 0 0 100%; width: 100%; margin-top: 3px; }
  .iphone-app .issue-work-view #campus-overview > .dash-heading-row > .dash-heading { display: none; }
  .iphone-app .issue-work-view #campus-overview { margin-bottom: 16px; }
  .iphone-app .issue-work-view .manager-metrics { display: none; }
  .iphone-app .issue-work-view .iphone-filter-panel[open] + .manager-metrics { display: block; }
}
@media (max-width: 767px) {
  .iphone-app .btn-rating.active.rating-low { background: var(--phone-alert); color: var(--phone-card); }
  .iphone-app .btn-rating.active.rating-mid { background: var(--phone-pending); color: var(--phone-card); }
  .iphone-app .btn-rating.active.rating-high { background: var(--phone-good); color: var(--phone-card); }
}
@media (max-width: 767px) {
  .iphone-app .native-tabs button:not([aria-current]) { background: transparent; }
}
@media (max-width: 767px) {
  .iphone-app .range-toggle-scroll:has(.range-toggle--views) { overflow: visible; }
  .iphone-app .range-toggle-scroll:has(.range-toggle--views)::after { display: none; }
  .iphone-app .range-toggle--views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 4px; padding: 4px; }
  .iphone-app .range-toggle--views .range-toggle-btn { min-width: 0; white-space: normal; text-align: center; font-size: .76rem; }
}
