.rp-tracking-indicator,
.rp-tracking-indicator * {
  box-sizing: border-box;
}

.rp-tracking-indicator {
  position: fixed;
  z-index: 95;
  left: 18px;
  bottom: 18px;
  width: min(430px, calc(100vw - 36px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 12px 14px;
  direction: rtl;
  color: var(--text, var(--canvas, #171717));
  background: var(--surface, var(--canvas, #fff));
  border: 1px solid var(--line, #d8d8d8);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
}

.rp-tracking-copy {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.rp-tracking-copy div {
  min-width: 0;
}

.rp-tracking-copy strong,
.rp-tracking-copy small {
  display: block;
}

.rp-tracking-copy strong {
  font-size: 14px;
  line-height: 1.45;
}

.rp-tracking-copy small {
  margin-top: 2px;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
  line-height: 1.5;
}

.rp-live-mark {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--muted, #777);
}

.rp-tracking-indicator[data-state="live"] .rp-live-mark {
  background: var(--yellow, #e3b500);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--yellow, #e3b500) 18%, transparent);
}

.rp-tracking-indicator[data-state="paused"] .rp-live-mark,
.rp-tracking-indicator[data-state="server"] .rp-live-mark {
  background: var(--yellow, #e3b500);
}

.rp-heading,
.rp-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.rp-heading {
  margin-bottom: 22px;
}

.rp-heading h1,
.rp-card-heading h2,
.rp-trail-head h3 {
  margin: 3px 0 4px;
  color: var(--text, #171717);
  line-height: 1.35;
}

.rp-heading h1 {
  font-size: clamp(22px, 3vw, 30px);
}

.rp-card-heading h2,
.rp-trail-head h3 {
  font-size: 17px;
}

.rp-heading p,
.rp-muted,
.rp-info-card small,
.rp-empty-card p {
  margin: 0;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-eyebrow {
  color: var(--muted, #6d6d6d);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}

.rp-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 8px 15px;
  color: var(--text, #171717);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.rp-button:hover {
  transform: translateY(-1px);
}

.rp-button:disabled {
  cursor: wait;
  opacity: .58;
  transform: none;
}

.rp-button-primary {
  color: #090909;
  background: var(--yellow, #edc400);
}

.rp-button-primary:hover {
  filter: brightness(.96);
}

.rp-button-secondary,
.rp-button-quiet {
  border-color: var(--line, #d8d8d8);
  background: var(--surface, #fff);
}

.rp-button-quiet {
  color: var(--muted, #6d6d6d);
}

.rp-button-wide {
  width: 100%;
}

.rp-self-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(230px, .55fr);
  gap: 16px;
  align-items: start;
}

.rp-action-card,
.rp-info-card,
.rp-history-card,
.rp-empty-card,
.rp-dashboard-card,
.rp-staff-panel,
.rp-denied {
  border: 1px solid var(--line, #d8d8d8);
  border-radius: 15px;
  background: var(--surface, var(--canvas, #fff));
  color: var(--text, #171717);
}

.rp-action-card,
.rp-history-card,
.rp-dashboard-card,
.rp-staff-panel,
.rp-denied,
.rp-empty-card {
  padding: 18px;
}

.rp-card-heading {
  align-items: center;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line, #d8d8d8);
}

.rp-side-stack {
  display: grid;
  gap: 13px;
}

.rp-info-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px;
}

.rp-info-card strong {
  font-size: 18px;
}

.rp-time-pair,
.rp-staff-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.rp-time-pair span,
.rp-staff-metrics span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-time-pair b,
.rp-staff-metrics b {
  color: var(--text, #171717);
  font-size: 14px;
}

.rp-camera-box {
  margin: 14px 0;
  overflow: hidden;
  border: 1px dashed var(--line, #d8d8d8);
  border-radius: 12px;
  background: var(--canvas, #f8f8f8);
}

.rp-camera-idle,
.rp-camera-live,
.rp-photo-review {
  min-height: 215px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.rp-camera-idle p {
  max-width: 430px;
  margin: 0;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-camera-idle small,
.rp-photo-review small {
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-camera-glyph {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
  color: #090909;
  background: var(--yellow, #edc400);
  font-size: 22px;
}

.rp-camera-live {
  padding: 0;
}

.rp-camera-live video {
  display: block;
  width: 100%;
  max-height: 440px;
  min-height: 215px;
  object-fit: cover;
  transform: scaleX(-1);
  background: #111;
}

.rp-inline-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 12px;
}

.rp-photo-review img {
  display: block;
  width: min(100%, 460px);
  max-height: 330px;
  border-radius: 9px;
  object-fit: contain;
}

.rp-photo-review div:nth-child(2) {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rp-camera-error,
.rp-geo-message,
.rp-error,
.rp-warning {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line, #d8d8d8);
  border-radius: 9px;
  color: var(--text, #171717);
  background: color-mix(in srgb, var(--yellow, #edc400) 12%, var(--surface, #fff));
  font-size: 14px;
}

.rp-camera-error,
.rp-geo-message[data-tone="error"],
.rp-error {
  color: var(--text, #171717);
  background: color-mix(in srgb, var(--yellow, #edc400) 18%, var(--surface, #fff));
}

.rp-geo-message[data-tone="ok"] {
  background: color-mix(in srgb, var(--yellow, #edc400) 10%, var(--surface, #fff));
}

.rp-consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
  line-height: 1.7;
}

.rp-consent input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--yellow, #edc400);
}

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

.rp-history-card {
  margin-top: 16px;
}

.rp-history-list {
  display: grid;
  gap: 0;
}

.rp-history-row {
  display: grid;
  grid-template-columns: minmax(145px, .9fr) minmax(170px, 1fr) minmax(210px, 1.2fr);
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line, #d8d8d8);
}

.rp-history-row:last-child {
  border-bottom: 0;
}

.rp-history-row strong,
.rp-history-row small {
  display: block;
}

.rp-history-row small {
  margin-top: 3px;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-history-times {
  display: flex;
  gap: 16px;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-history-times b {
  color: var(--text, #171717);
  font-family: var(--latin, system-ui);
}

.rp-proof-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 7px;
}

.rp-photo-button,
.rp-map-link,
.rp-text-link {
  border: 0;
  padding: 0;
  color: var(--text, #171717);
  background: transparent;
  font-size: 14px;
  text-decoration: underline;
  text-decoration-color: var(--yellow, #edc400);
  text-underline-offset: 3px;
  cursor: pointer;
}

.rp-empty,
.rp-loading {
  padding: 28px 12px;
  color: var(--muted, #6d6d6d);
  text-align: center;
  font-size: 14px;
}

.rp-empty-card {
  text-align: center;
}

.rp-empty-card strong {
  display: block;
  margin-bottom: 5px;
}

.rp-summary-card-grid,
.rp-staff-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin: 15px 0;
}

.rp-summary-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line, #d8d8d8);
  border-radius: 10px;
  background: var(--canvas, #f8f8f8);
}

.rp-summary-card small,
.rp-summary-card strong {
  display: block;
}

.rp-summary-card small {
  overflow: hidden;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-summary-card strong {
  margin-top: 4px;
  color: var(--text, #171717);
  font: 700 21px var(--latin, system-ui);
}

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

.rp-staff-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line, #d8d8d8);
  border-radius: 11px;
  background: var(--surface, #fff);
}

.rp-staff-person {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.rp-staff-person > div {
  min-width: 0;
  flex: 1;
}

.rp-staff-person strong,
.rp-staff-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rp-staff-person small {
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-avatar {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  color: #090909;
  background: var(--yellow, #edc400);
  font-weight: 800;
}

.rp-status-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 99px;
  color: var(--muted, #6d6d6d);
  background: var(--canvas, #f8f8f8);
  font-size: 14px;
  white-space: nowrap;
}

.rp-status-pill[data-tone="success"],
.rp-status-pill[data-tone="live"] {
  color: var(--text, #171717);
  background: color-mix(in srgb, var(--yellow, #edc400) 24%, var(--surface, #fff));
}

.rp-status-pill[data-tone="warning"] {
  background: color-mix(in srgb, var(--yellow, #edc400) 15%, var(--surface, #fff));
}

.rp-status-pill[data-tone="danger"] {
  background: color-mix(in srgb, var(--yellow, #edc400) 9%, var(--surface, #fff));
}

.rp-staff-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0 12px;
}

.rp-staff-metrics span:last-child {
  grid-column: span 1;
}

.rp-staff-metrics span:last-child small {
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-trail-button {
  width: 100%;
}

.rp-staff-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 14px;
  padding: 13px;
  border: 1px solid var(--line, #d8d8d8);
  border-radius: 12px;
  background: var(--surface, #fff);
}

.rp-staff-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 150px;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-staff-toolbar input,
.rp-staff-toolbar select {
  min-height: 42px;
  min-width: 0;
  border: 1px solid var(--line, #d8d8d8);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text, #171717);
  background: var(--canvas, #fff);
  outline: none;
}

.rp-staff-toolbar input:focus,
.rp-staff-toolbar select:focus {
  border-color: var(--yellow, #edc400);
}

.rp-staff-server-time {
  margin-bottom: 10px;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-trail-host {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--line, #d8d8d8);
}

.rp-trail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.rp-trail-list {
  display: grid;
  gap: 0;
  max-height: 430px;
  overflow: auto;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.rp-trail-list li {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 75px auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line, #d8d8d8);
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-trail-list time {
  color: var(--text, #171717);
}

.rp-photo-modal[hidden] {
  display: none;
}

.rp-photo-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, .62);
}

.rp-photo-dialog {
  position: relative;
  width: min(680px, 100%);
  padding: 18px;
  border: 1px solid var(--line, #d8d8d8);
  border-radius: 14px;
  color: var(--text, #171717);
  background: var(--surface, #fff);
}

.rp-photo-dialog img {
  display: block;
  width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 9px;
  background: var(--canvas, #111);
}

.rp-photo-dialog p {
  margin: 10px 0 0;
  color: var(--muted, #6d6d6d);
  font-size: 14px;
}

.rp-photo-close {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 8px;
  width: 35px;
  height: 35px;
  border: 0;
  border-radius: 50%;
  color: var(--text, #171717);
  background: var(--surface, #fff);
  cursor: pointer;
  font-size: 21px;
}

@media (max-width: 900px) {
  .rp-self-grid {
    grid-template-columns: 1fr;
  }

  .rp-summary-card-grid,
  .rp-staff-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rp-dashboard-staff-list,
  .rp-staff-list {
    grid-template-columns: 1fr;
  }

  .rp-history-row {
    grid-template-columns: 1fr 1fr;
  }

  .rp-proof-actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 800px) {
  .rp-button,
  .rp-staff-toolbar input,
  .rp-staff-toolbar select {
    min-height: 44px;
  }

  .rp-tracking-indicator {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  .rp-heading {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .rp-action-card,
  .rp-history-card,
  .rp-dashboard-card,
  .rp-staff-panel,
  .rp-denied,
  .rp-empty-card {
    padding: 14px;
  }

  .rp-summary-card-grid,
  .rp-staff-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rp-staff-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .rp-staff-toolbar label {
    min-width: 0;
  }

  .rp-history-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .rp-history-times {
    justify-content: space-between;
  }

  .rp-staff-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rp-staff-metrics span:last-child {
    grid-column: 1 / -1;
  }

  .rp-trail-list li {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .rp-tracking-indicator {
    align-items: flex-start;
    padding: 10px;
  }

  .rp-tracking-indicator .rp-button {
    min-width: 104px;
    padding-right: 9px;
    padding-left: 9px;
  }
}
