/* Monolith Beacon PWA — app-specific styles */

.pass-animate {
  animation: passFlash 0.35s ease-out;
}

@keyframes passFlash {
  0% { background-color: rgb(220 252 231); transform: scale(1.01); }
  100% { background-color: transparent; transform: scale(1); }
}

.fail-animate {
  animation: failFlash 0.35s ease-out;
}

@keyframes failFlash {
  0% { background-color: rgb(254 226 226); }
  100% { background-color: transparent; }
}

.upload-zone-active {
  border-color: #E87D34 !important;
  background-color: rgb(255 247 237);
}

.checklist-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Mobile test app shell ── */

.test-app-body {
  min-height: 100dvh;
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

.test-sticky-shell {
  position: sticky;
  top: 0;
  z-index: 30;
}

.test-sticky-shell header {
  position: relative;
  top: auto;
}

.test-sticky-bar {
  background: rgb(249 250 251 / 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgb(229 231 235);
}

.test-sticky-inner {
  max-width: 32rem;
  margin: 0 auto;
  padding: 0.5rem 0.75rem 0.625rem;
}

.test-scroll-main {
  max-width: 32rem;
  margin: 0 auto;
  padding-bottom: 5rem;
}

.safe-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgb(229 231 235);
}

.app-header-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 32rem;
  margin: 0 auto;
  padding: 0.875rem 1rem;
  min-height: 3rem;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.app-header-icon-btn {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: rgb(55 65 81);
  text-decoration: none;
  transition: background-color 0.15s;
  flex-shrink: 0;
}

.app-header-icon-btn:hover,
.app-header-icon-btn:active {
  background: rgb(243 244 246);
}

.app-header-icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.app-header--compact .app-header-inner {
  padding: 0.625rem 0.75rem;
  min-height: 2.5rem;
}

.app-header-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-left: -0.25rem;
  border-radius: 0.5rem;
  color: rgb(55 65 81);
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
  transition: background-color 0.15s;
}

.app-header-back:hover,
.app-header-back:active {
  background: rgb(243 244 246);
}

.app-header-title {
  flex: 1;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #120B08;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header--compact .app-header-title {
  font-size: 0.9375rem;
}

.offline-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  background: rgb(254 243 199);
  color: rgb(146 64 14);
}

.app-header--brand .app-header-inner {
  align-items: center;
}

.app-header-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex: 1;
  min-width: 0;
}

.app-header-app-name {
  font-size: 0.9375rem;
  font-weight: 700;
  color: #120B08;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-header-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgb(107 114 128);
  line-height: 1.2;
  margin-top: 0.125rem;
}

.app-mark {
  display: block;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
}

.app-mark--sm {
  width: 1.75rem;
  height: 1.75rem;
}

.app-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.home-fab {
  position: fixed;
  right: 1.25rem;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: #E87D34;
  color: #fff;
  cursor: pointer;
  box-shadow:
    0 4px 14px rgb(232 125 52 / 0.4),
    0 2px 4px rgb(0 0 0 / 0.08);
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.fab-plus-icon {
  display: block;
  width: 1.5rem;
  height: 1.5rem;
  pointer-events: none;
}

.home-fab:hover {
  background: #d66f2a;
}

.home-fab:active {
  transform: scale(0.96);
  box-shadow: 0 2px 8px rgb(232 125 52 / 0.35);
}

.site-filter-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgb(229 231 235);
  background: #fff;
  color: rgb(75 85 99);
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.site-filter-pill.is-active {
  border-color: #E87D34;
  background: rgb(255 247 237);
  color: #c56a24;
}

.site-filter-pill:hover:not(.is-active) {
  border-color: rgb(209 213 219);
}

.site-card {
  position: relative;
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.site-card:hover {
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
}

.site-card-link {
  display: block;
  padding: 1.25rem;
  padding-right: 2.5rem;
  text-decoration: none;
  color: inherit;
}

.site-card-link:active {
  background: rgb(249 250 251);
  border-radius: 1rem;
}

.site-card-chevron {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(209 213 219);
  font-size: 1.25rem;
  line-height: 1;
  pointer-events: none;
}

.history-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(107 114 128);
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.history-back-link:hover {
  color: #E87D34;
}

.history-session-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid rgb(243 244 246);
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.history-session-card:hover {
  border-color: rgb(253 186 116);
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
}

.history-session-card--active {
  border-color: rgb(253 186 116);
  background: rgb(255 247 237 / 0.5);
}

.history-session-badge {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.55rem;
  border-radius: 9999px;
  background: #E87D34;
  color: #fff;
}

.history-session-badge--fail {
  background: rgb(254 226 226);
  color: rgb(185 28 28);
}

.history-session-chevron {
  flex-shrink: 0;
  color: rgb(209 213 219);
  font-size: 1.25rem;
  line-height: 1;
}

/* Overview dashboard */
.overview-panel {
  background: #fff;
  border: 1px solid rgb(243 244 246);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.overview-panel-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(107 114 128);
  margin-bottom: 0.625rem;
}

.overview-active-banner {
  background: rgb(255 247 237);
  border: 1px solid rgb(254 215 170);
  border-radius: 1rem;
  padding: 1rem;
}

.overview-resume-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.875rem;
  border-radius: 0.75rem;
  background: #E87D34;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
}

.overview-active-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.overview-abandon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(254 202 202);
  background: rgb(254 242 242);
  color: rgb(185 28 28);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.overview-abandon-btn:hover {
  background: rgb(254 226 226);
  border-color: rgb(252 165 165);
  color: rgb(153 27 27);
}

.overview-progress-track {
  height: 0.5rem;
  border-radius: 9999px;
  background: rgb(254 215 170 / 0.5);
  overflow: hidden;
}

.overview-progress-fill {
  height: 100%;
  border-radius: 9999px;
  background: #E87D34;
  transition: width 0.3s ease;
}

.overview-status-card {
  border-radius: 0.75rem;
  border: 1px solid;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
}

.overview-status-card-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 0.125rem;
}

.overview-status-card-value {
  font-weight: 600;
  line-height: 1.35;
}

.overview-status-card--due {
  background: rgb(254 242 242);
  border-color: rgb(254 202 202);
  color: rgb(127 29 29);
}

.overview-status-card--progress {
  background: rgb(255 247 237);
  border-color: rgb(254 215 170);
  color: rgb(124 45 18);
}

.overview-status-card--ok {
  background: rgb(240 253 244);
  border-color: rgb(187 247 208);
  color: rgb(20 83 45);
}

.overview-status-card--neutral {
  background: rgb(249 250 251);
  border-color: rgb(243 244 246);
  color: rgb(31 41 55);
}

.overview-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.625rem;
}

.overview-stat {
  background: rgb(249 250 251);
  border: 1px solid rgb(243 244 246);
  border-radius: 0.75rem;
  padding: 0.75rem;
  text-align: center;
}

.overview-stat-value {
  font-size: 1.375rem;
  font-weight: 700;
  color: #120B08;
  line-height: 1.2;
}

.overview-stat-value--alert {
  color: rgb(185 28 28);
}

.overview-stat-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: rgb(107 114 128);
  margin-top: 0.25rem;
}

.overview-breakdown-bar {
  display: flex;
  height: 0.625rem;
  border-radius: 9999px;
  overflow: hidden;
  background: rgb(243 244 246);
}

.overview-breakdown-pass {
  background: rgb(34 197 94);
  min-width: 0;
}

.overview-breakdown-fail {
  background: rgb(239 68 68);
  min-width: 0;
}

.overview-timeline {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.25rem;
}

.overview-timeline-month {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
}

.overview-timeline-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background: rgb(209 213 219);
}

.overview-timeline-label {
  font-size: 0.5625rem;
  font-weight: 600;
  color: rgb(156 163 175);
  text-transform: uppercase;
  line-height: 1;
}

.overview-timeline-month--current .overview-timeline-label {
  color: #120B08;
}

.overview-timeline-month--pass .overview-timeline-dot {
  background: rgb(34 197 94);
}

.overview-timeline-month--fail .overview-timeline-dot {
  background: rgb(239 68 68);
}

.overview-timeline-month--due .overview-timeline-dot,
.overview-timeline-month--progress .overview-timeline-dot {
  background: #E87D34;
}

.overview-timeline-month--current.overview-timeline-month--due .overview-timeline-dot,
.overview-timeline-month--current.overview-timeline-month--progress .overview-timeline-dot {
  box-shadow: 0 0 0 2px rgb(255 255 255), 0 0 0 3px #E87D34;
}

.overview-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.875rem;
  font-size: 0.625rem;
  color: rgb(107 114 128);
}

.overview-timeline-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.overview-legend-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgb(209 213 219);
}

.overview-legend-dot--pass {
  background: rgb(34 197 94);
}

.overview-legend-dot--fail {
  background: rgb(239 68 68);
}

.overview-legend-dot--due {
  background: #E87D34;
}

.overview-legend-dot--none {
  background: rgb(209 213 219);
}

.setup-fittings-panel {
  scroll-margin-top: 4.5rem;
}

.setup-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.setup-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3rem 0.5rem 0.3rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgb(255 237 213);
  color: rgb(120 53 15);
  border: 1px solid rgb(253 230 138);
  line-height: 1.2;
}

.setup-filter-chip:hover,
.setup-filter-chip:active {
  background: rgb(254 243 199);
}

.setup-filter-chip-x {
  font-size: 0.875rem;
  line-height: 1;
  opacity: 0.75;
}

.history-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.history-result-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: #fff;
  border: 1px solid rgb(243 244 246);
  border-radius: 0.875rem;
}

.history-result-badge {
  flex-shrink: 0;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.history-result-badge--pass {
  background: rgb(220 252 231);
  color: rgb(21 128 61);
}

.history-result-badge--fail {
  background: rgb(254 226 226);
  color: rgb(185 28 28);
}

.history-result-badge--none {
  background: rgb(243 244 246);
  color: rgb(107 114 128);
}

.history-print-root {
  display: none;
  margin-top: 1rem;
}

.history-print-root--visible {
  display: block;
}

.site-menu-card {
  background: #fff;
  border: 1px solid rgb(243 244 246);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
}

.site-menu-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgb(243 244 246);
  cursor: pointer;
  transition: background-color 0.15s;
}

.site-menu-row:last-child {
  border-bottom: none;
}

.site-menu-row:hover,
.site-menu-row:active {
  background: rgb(249 250 251);
}

.site-menu-icon {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  background: rgb(255 247 237);
  color: #E87D34;
  font-size: 1rem;
  flex-shrink: 0;
}

.site-menu-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.site-menu-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #120B08;
}

.site-menu-desc {
  font-size: 0.75rem;
  color: rgb(107 114 128);
  line-height: 1.35;
}

.site-menu-chevron {
  color: rgb(209 213 219);
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

/* Bottom tab nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  background: #120B08;
  border-top: 1px solid rgb(255 255 255 / 0.08);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  max-width: 32rem;
  margin: 0 auto;
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  padding: 0.45rem 0.125rem 0.35rem;
  color: rgb(156 163 175);
  font-size: 0.5625rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s;
  min-width: 0;
}

.bottom-nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-nav-item.is-active {
  color: #E87D34;
}

.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.375rem;
  height: 1.375rem;
  line-height: 1;
}

.bottom-nav-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Switch FAB */
.switch-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: #E87D34;
  color: white;
  padding: 0.625rem 1rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.8125rem;
  box-shadow: 0 4px 14px rgb(232 125 52 / 0.45);
  max-width: calc(32rem - 2rem);
}

.switch-fab-icon {
  font-size: 1rem;
}

/* Switch bottom sheet */
.switch-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.switch-sheet.is-open {
  pointer-events: auto;
}

.switch-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(0 0 0 / 0.4);
  opacity: 0;
  transition: opacity 0.25s;
}

.switch-sheet.is-open .switch-sheet-backdrop {
  opacity: 1;
}

.switch-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 32rem;
  margin: 0 auto;
  background: white;
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 0.75rem 1.25rem 1.5rem;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 80dvh;
  overflow-y: auto;
}

.switch-sheet.is-open .switch-sheet-panel {
  transform: translateY(0);
}

.switch-sheet-handle {
  width: 2.5rem;
  height: 0.25rem;
  background: rgb(209 213 219);
  border-radius: 9999px;
  margin: 0 auto 1rem;
}

/* Progressive switch groups */
.switch-group {
  transition: opacity 0.35s, transform 0.35s;
}

.switch-group.group-complete {
  opacity: 0.55;
}

.switch-group.group-complete .switch-group-header {
  background: rgb(243 244 246);
}

.switch-group.group-collapsing {
  opacity: 0.4;
  transform: scale(0.98);
}

.switch-group-header {
  background: white;
  transition: background 0.2s;
}

.switch-group-body .light-done {
  opacity: 0.7;
  cursor: pointer;
}

.switch-group-body .light-revising {
  opacity: 1;
  box-shadow: 0 0 0 2px rgb(249 115 22 / 0.35);
}

.duration-timer-row {
  transition: background 0.15s, border-color 0.15s;
}

.duration-row-ready {
  background: rgb(240 253 244);
  border-color: rgb(187 247 208);
}

.duration-row-waiting {
  background: rgb(255 251 235);
  border-color: rgb(253 230 138);
}

.duration-row-idle {
  background: rgb(249 250 251);
  border-color: rgb(243 244 246);
}

.duration-row-complete {
  background: white;
  border-color: rgb(229 231 235);
  opacity: 0.85;
}

.switch-group-body .light-passed {
  border-color: rgb(187 247 208);
}

.switch-group-body .light-failed {
  border-color: rgb(254 202 202);
}

/* Fitting drag reorder (manage screen) */
.fitting-drag-handle {
  touch-action: none;
  cursor: grab;
}

.fitting-drag-handle:active {
  cursor: grabbing;
}

[data-draggable-light].is-dragging {
  opacity: 0.45;
}

[data-draggable-light].is-drag-over {
  background: rgb(255 247 237);
  border-radius: 0.75rem;
}

/* Photo viewer */
body.photo-viewer-open {
  overflow: hidden;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgb(0 0 0 / 0.94);
  opacity: 0;
  transition: opacity 0.2s;
}

.photo-viewer.is-open {
  opacity: 1;
}

.photo-viewer-close {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  right: 0.75rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: rgb(255 255 255 / 0.15);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-viewer-caption {
  position: absolute;
  top: max(0.75rem, env(safe-area-inset-top, 0px));
  left: 0.75rem;
  right: 3.5rem;
  z-index: 2;
  color: rgb(255 255 255 / 0.9);
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0;
  pointer-events: none;
}

.photo-viewer-scroll {
  width: 100%;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 0.5rem 1rem;
}

.photo-viewer-img {
  max-width: none;
  width: auto;
  min-width: min(100%, 100vw - 1rem);
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

@media (min-width: 640px) {
  .bottom-nav,
  .switch-fab,
  .switch-sheet-panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 100%;
    max-width: 32rem;
  }

  .switch-sheet.is-open .switch-sheet-panel {
    transform: translateX(-50%) translateY(0);
  }

  .switch-sheet-panel {
    transform: translateX(-50%) translateY(100%);
  }
}

.auth-tab {
  padding: 0.5rem 0.75rem;
  border-radius: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: rgb(107 114 128);
  background: transparent;
  border: none;
  cursor: pointer;
}

.auth-tab.is-active {
  background: #fff;
  color: rgb(18 11 8);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06);
}

.sync-badge {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  line-height: 1;
}

.sync-badge--synced {
  background: rgb(220 252 231);
  color: rgb(21 128 61);
}

.sync-badge--pending {
  background: rgb(254 243 199);
  color: rgb(180 83 9);
}

.sync-badge--syncing {
  background: rgb(219 234 254);
  color: rgb(29 78 216);
}

.sync-badge--error {
  background: rgb(254 226 226);
  color: rgb(185 28 28);
}

.sync-badge--clickable {
  cursor: pointer;
}

/* ── Form controls — consistent inputs + selects ── */

:root {
  --bf-control-border: rgb(229 231 235);
  --bf-control-border-hover: rgb(209 213 219);
  --bf-control-bg: #fff;
  --bf-control-radius: 0.75rem;
  --bf-control-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  --bf-focus-ring: 0 0 0 3px rgb(232 125 52 / 0.22);
  --bf-focus-border: #E87D34;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='tel'],
input[type='url'],
input[type='number'],
textarea,
select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bf-control-bg);
  border: 1px solid var(--bf-control-border) !important;
  border-radius: var(--bf-control-radius) !important;
  box-shadow: var(--bf-control-shadow);
  color: rgb(18 11 8);
  font-size: 0.875rem;
  line-height: 1.35;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  width: 100%;
}

textarea {
  min-height: 4.5rem;
  resize: vertical;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.75' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 0.7rem center;
  background-repeat: no-repeat;
  background-size: 1.1rem 1.1rem;
  cursor: pointer;
  padding-right: 2.35rem;
}

input[type='text']:hover,
input[type='email']:hover,
input[type='password']:hover,
input[type='search']:hover,
input[type='tel']:hover,
input[type='url']:hover,
input[type='number']:hover,
textarea:hover,
select:hover {
  border-color: var(--bf-control-border-hover) !important;
}

input[type='text']:focus,
input[type='email']:focus,
input[type='password']:focus,
input[type='search']:focus,
input[type='tel']:focus,
input[type='url']:focus,
input[type='number']:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--bf-focus-border) !important;
  box-shadow: var(--bf-focus-ring);
}

input:disabled,
textarea:disabled,
select:disabled {
  background-color: rgb(249 250 251);
  color: rgb(156 163 175);
  cursor: not-allowed;
  opacity: 1;
}

/* Compact inline select (e.g. member role in a row) */
select.bf-select-sm {
  width: auto;
  min-width: 7.5rem;
  max-width: 11rem;
  min-height: 2.125rem;
  padding: 0.375rem 1.85rem 0.375rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.625rem !important;
  background-color: rgb(249 250 251);
  background-position: right 0.45rem center;
  background-size: 0.95rem 0.95rem;
}

select.bf-select-sm:hover,
select.bf-select-sm:focus {
  background-color: #fff;
}

/* Extra-compact filter select in sticky bars */
select.bf-select-xs {
  width: auto;
  min-height: 1.875rem;
  padding: 0.25rem 1.65rem 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.5rem !important;
  background-position: right 0.35rem center;
  background-size: 0.9rem 0.9rem;
}

/* Custom select — trigger + sheet (replaces native OS menu) */
.bf-select-wrap {
  position: relative;
  width: 100%;
  margin-top: 0.25rem;
}

.bf-select-wrap--inline {
  width: auto;
  margin-top: 0;
  display: inline-block;
}

.bf-select-wrap > select.bf-select-native,
select.bf-select-native {
  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;
  min-height: 0 !important;
  box-shadow: none !important;
  background: none !important;
  pointer-events: none !important;
}

.bf-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.625rem 0.875rem;
  text-align: left;
  background: #fff;
  border: 1px solid rgb(229 231 235);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  color: rgb(18 11 8);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.bf-select-trigger:hover {
  border-color: rgb(209 213 219);
}

.bf-select-trigger:focus {
  outline: none;
  border-color: #E87D34;
  box-shadow: 0 0 0 3px rgb(232 125 52 / 0.22);
}

.bf-select-trigger:disabled {
  background: rgb(249 250 251);
  color: rgb(156 163 175);
  cursor: not-allowed;
}

.bf-select-trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bf-select-trigger-chevron {
  flex-shrink: 0;
  color: rgb(156 163 175);
  display: flex;
}

.bf-select-trigger--sm {
  width: auto;
  min-width: 7.75rem;
  max-width: 11rem;
  min-height: 2.125rem;
  padding: 0.375rem 0.625rem 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  border-radius: 0.625rem;
  background: rgb(249 250 251);
}

.bf-select-trigger--sm:hover,
.bf-select-trigger--sm:focus {
  background: #fff;
}

.bf-select-trigger--xs {
  width: auto;
  min-width: 4.5rem;
  max-width: 7rem;
  min-height: 1.875rem;
  padding: 0.25rem 0.45rem 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.5rem;
}

.bf-select-option.is-selected {
  background: rgb(255 247 237);
}

.bf-select-option.is-selected .site-menu-title {
  color: #E87D34;
}

.bf-select-check {
  width: 1.25rem;
  flex-shrink: 0;
  text-align: center;
  font-weight: 700;
  color: #E87D34;
  font-size: 0.9375rem;
}

label:has(> .bf-select-wrap) > .bf-select-wrap {
  margin-top: 0.25rem;
}

/* Role-gated read-only cues */
.bf-readonly-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 0.75rem;
  background: rgb(249 250 251);
  border: 1px solid rgb(229 231 235);
  color: rgb(75 85 99);
  font-size: 0.75rem;
  line-height: 1.4;
}

.bf-readonly-banner .bf-lock-icon {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: rgb(156 163 175);
}

.bf-readonly input:disabled,
.bf-readonly textarea:disabled,
.bf-readonly select:disabled,
.bf-readonly button:disabled {
  opacity: 0.85;
  cursor: not-allowed;
}

.bf-section-locked-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
