:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #19362d;
  background: #f3f7f4;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  color: white;
  background: #164c3b;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  color: inherit;
  font-weight: 750;
  text-decoration: none;
}

.brand small {
  display: block;
  margin-top: 0.1rem;
  color: #b6d7c4;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
}

.brand-mark {
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border: 1px solid #a9d5b3;
  border-radius: 0.8rem;
  color: #d8f1dc;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #e0eee5;
  font-size: 0.9rem;
}

.page {
  width: min(900px, 90vw);
  min-height: calc(100vh - 140px);
  margin: 0 auto;
  padding: 3rem 0;
}

.intro {
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: #4a8065;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.5rem;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -0.04em;
}

.intro > p:last-child,
.panel > p {
  color: #60766b;
}

.panel {
  margin: 1.25rem 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid #dbe6df;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 0.75rem 2rem #173f2d0b;
}

.auth-panel {
  max-width: 32rem;
}

.form {
  display: grid;
  gap: 1rem;
}

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

label {
  display: grid;
  gap: 0.45rem;
  color: #365448;
  font-size: 0.9rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cbd9d0;
  border-radius: 0.6rem;
  color: #19362d;
  background: white;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid #2e8c5828;
  border-color: #39815c;
}

.full-width {
  grid-column: 1 / -1;
}

.button {
  min-height: 2.7rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 0.6rem;
  cursor: pointer;
  font-weight: 700;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.button-primary {
  color: #fff;
  background: #176344;
}

.button-primary:hover {
  background: #104d34;
}

.button-secondary {
  border: 1px solid #bad9c2;
  color: #176344;
  background: #e3f1e7;
}

.button-secondary:hover {
  background: #d3eadb;
}

.gps-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.field-group {
  display: grid;
  gap: 0.45rem;
}

.input-row {
  display: flex;
  gap: 0.5rem;
}

.input-row input {
  flex: 1;
  min-width: 0;
}

input[readonly] {
  border-style: dashed;
  color: #286044;
  background: #f3f7f4;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.03em;
}

.field-hint {
  color: #60766b;
  font-size: 0.85rem;
}

.field-hint.error {
  color: #9b3028;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  color: #9aaba1;
}

.link-button {
  padding: 0;
  border: 0;
  color: #176344;
  background: none;
  cursor: pointer;
  font-weight: 650;
  text-decoration: underline;
}

.tab-panel > .section-heading:first-child {
  margin-top: 0;
}

.user-list {
  display: grid;
  gap: 0.6rem;
}

.user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid #dbe6df;
  border-radius: 0.75rem;
}

.user-row p {
  margin: 0;
}

.user-name {
  font-weight: 700;
}

.user-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-form select,
.user-form input {
  width: auto;
  min-width: 9rem;
}

.button-quiet {
  border: 1px solid #75a18a;
  color: #fff;
  background: transparent;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 2.5rem 0 1rem;
}

.section-heading h2 {
  margin-bottom: 0;
}

.count-pill {
  padding: 0.35rem 0.7rem;
  border-radius: 99px;
  color: #286044;
  background: #e3f1e7;
  font-size: 0.8rem;
  font-weight: 750;
}

.asset-list {
  display: grid;
  gap: 0.8rem;
}

.tabs {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 0.35rem;
  overflow-x: auto;
  border: 1px solid #dbe6df;
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: 0 0.5rem 1.5rem #173f2d0b;
  scrollbar-width: none;
}

.tab {
  display: inline-flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.6rem;
  padding: 0.55rem 0.9rem;
  border: 0;
  border-radius: 0.6rem;
  color: #365448;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.tab:hover {
  background: #eef5f0;
}

.tab[aria-selected="true"] {
  color: #fff;
  background: #176344;
}

.tab:focus-visible {
  outline: 3px solid #2e8c5866;
  outline-offset: 2px;
}

.tab-badge {
  min-width: 1.3rem;
  padding: 0.05rem 0.4rem;
  border-radius: 99px;
  color: #fff;
  background: #b8382e;
  font-size: 0.75rem;
}

.tab-panel > .panel:first-child {
  margin-top: 0;
}

#inspect-summary:empty {
  display: none;
}

/* New Pedestal: choosing GPS + photos or manual entry. */
.mode-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.mode-choice {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  padding: 1.1rem;
  border: 2px solid #dbe6df;
  border-radius: 0.9rem;
  color: #365448;
  background: #f8fbf9;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.mode-choice strong {
  color: #19362d;
  font-size: 1.1rem;
}

.mode-choice span {
  font-size: 0.9rem;
}

.mode-choice:hover,
.mode-choice:focus-visible {
  border-color: #176344;
  background: #eef7f1;
  outline: none;
}

.step-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.manual-extras {
  display: grid;
  gap: 1rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

@media (max-width: 600px) {
  .mode-choices {
    grid-template-columns: 1fr;
  }
}

/* Photo pickers on the New and Inspect forms. */
.photo-picker {
  display: grid;
  gap: 0.6rem;
}

.picker-label {
  color: #365448;
  font-size: 0.9rem;
  font-weight: 650;
}

.picker-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* Buttons that are labels wrapping a hidden file input. */
.picker-buttons .button,
.batch-camera {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
}

.picker-buttons .button:focus-within,
.batch-camera:focus-within {
  outline: 3px solid #2e8c5866;
  outline-offset: 2px;
}

.photo-picker [data-picked]:empty {
  display: none;
}

/* Hidden but still focusable and clickable through its label (display:none can break that on iOS). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Photo import */
.drop-zone {
  position: relative;
  display: grid;
  gap: 0.35rem;
  place-items: center;
  min-height: 9rem;
  padding: 1.5rem;
  border: 2px dashed #9cc5ab;
  border-radius: 0.9rem;
  color: #286044;
  background: #f3f9f5;
  text-align: center;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: #176344;
  background: #e3f1e7;
}

/* The file input covers the whole zone, so clicks and drops both reach it. */
.drop-zone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.batch-collected {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #dbe6df;
}

.batch-summary {
  margin: 0;
  font-weight: 700;
}

.batch-photos {
  max-height: 16rem;
  margin: 0;
  /* Room for the remove buttons, which sit over each thumbnail's corner. */
  padding: 0.5rem 0.5rem 0 0;
  overflow-y: auto;
}

.batch-photo {
  position: relative;
}

.batch-photo img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid #dbe6df;
  border-radius: 0.5rem;
  object-fit: cover;
}

/* GPS dot, as on inspection thumbnails. */
.batch-photo::after {
  position: absolute;
  bottom: 0.25rem;
  left: 0.25rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #a8b6ad;
  content: "";
}

.batch-photo.gps-at::after {
  background: #176344;
}

.batch-remove {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: #365448;
  cursor: pointer;
  font-size: 0.7rem;
}

.batch-remove:hover {
  background: #b8382e;
}

.batch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.import-status {
  margin: 1rem 0 0;
  color: #365448;
  font-weight: 650;
}

.import-status:empty {
  display: none;
}

.import-status.error {
  color: #9b3028;
}

.import-groups {
  display: grid;
  gap: 0.8rem;
}

.import-group {
  display: grid;
  gap: 0.75rem;
  margin: 0;
}

.import-group h3,
.import-group > p {
  margin: 0;
}

.import-group.skipped {
  opacity: 0.6;
}

.import-group .photo-strip {
  margin: 0;
}

.import-group .form-grid {
  display: grid;
  gap: 1rem;
}

.import-new-fields {
  padding: 0.9rem;
  border-radius: 0.7rem;
  background: #f3f7f4;
}

.import-run {
  width: 100%;
  margin-top: 1rem;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

/* Condition filter: a custom menu so each count lines up on the right. */
.filter-menu {
  position: relative;
  min-width: 15rem;
}

.filter-button,
.filter-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.filter-button {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #cbd9d0;
  border-radius: 0.6rem;
  color: #19362d;
  background: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.filter-button:focus-visible {
  outline: 3px solid #2e8c5828;
  border-color: #39815c;
}

#condition-button-label {
  flex: 1;
}

.filter-count {
  margin-left: auto;
  color: #286044;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.filter-caret {
  color: #60766b;
  font-size: 0.8rem;
}

.filter-list {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 0.35rem);
  right: 0;
  left: 0;
  margin: 0;
  padding: 0.35rem;
  border: 1px solid #dbe6df;
  border-radius: 0.7rem;
  background: #fff;
  box-shadow: 0 0.75rem 2rem #173f2d26;
  list-style: none;
}

.filter-option {
  padding: 0.65rem 0.7rem;
  border-radius: 0.45rem;
  cursor: pointer;
}

.filter-option:hover,
.filter-option:focus {
  background: #eef5f0;
  outline: none;
}

.filter-option[aria-selected="true"] {
  font-weight: 700;
}

/* Condition colour dot before each name. */
.filter-option::before {
  width: 0.65rem;
  height: 0.65rem;
  flex: none;
  border-radius: 50%;
  content: "";
}

.condition-dot-urgent::before { background: #b8382e; }
.condition-dot-attention::before { background: #c98a00; }
.condition-dot-good::before { background: #176344; }
.condition-dot-none::before { border: 2px solid #a8b6ad; }
.condition-dot-all::before { background: transparent; }

.map {
  z-index: 0;
  height: 360px;
  margin-bottom: 1rem;
  border: 1px solid #dbe6df;
  border-radius: 0.85rem;
  background: #e6ede8;
}

.map .leaflet-popup-content p {
  margin: 0.25rem 0 0.4rem;
}

/* Pedestal page: header card, then a timeline of posts. */
.back-link {
  margin-bottom: 0.8rem;
}

.ped-header {
  display: grid;
  gap: 0.5rem;
  margin-top: 0;
  overflow: hidden;
}

.ped-header p {
  margin: 0;
}

.ped-map {
  z-index: 0;
  height: 190px;
  margin: calc(-1 * clamp(1.25rem, 4vw, 2rem)) calc(-1 * clamp(1.25rem, 4vw, 2rem)) 0.5rem;
  background: #e6ede8;
}

.ped-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.ped-title h2 {
  margin: 0;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  overflow-wrap: anywhere;
}

.ped-place {
  color: #365448;
  font-weight: 650;
}

.feed-heading {
  margin: 1.5rem 0 0.75rem;
}

.feed {
  display: grid;
  gap: 0.8rem;
}

.post {
  display: grid;
  gap: 0.7rem;
  margin: 0;
}

.post-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.post-who {
  display: grid;
  flex: 1;
  min-width: 0;
}

.avatar {
  display: grid;
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #176344;
  font-size: 0.9rem;
  font-weight: 800;
}

.post-delete {
  min-height: 2rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.post-edit {
  display: grid;
  gap: 0.6rem;
}

.post-edit .batch-photo.saved::after {
  content: none;
}

.batch-photo.photo-removed img {
  opacity: 0.3;
  border-style: dashed;
}

.batch-photo.photo-removed .batch-remove {
  background: #176344;
}

.post-edit-actions {
  display: flex;
  gap: 0.5rem;
}

.post-notes {
  margin: 0;
  white-space: pre-wrap;
}

/* Bigger photo tiles in posts. */
.post-photos {
  margin: 0;
}

.post-photos img {
  width: 7rem;
  height: 7rem;
}

.feed-start {
  margin: 0.25rem 0 0;
  color: #60766b;
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 600px) {
  .post-photos img {
    width: calc((100vw - 5.5rem) / 3);
    height: calc((100vw - 5.5rem) / 3);
  }
}

/* A popup window over the pedestal details; "expanded" fills the screen. */
.photo-viewer {
  width: min(860px, calc(100vw - 32px));
  max-width: none;
  height: min(640px, calc(100dvh - 32px));
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
  color: #fff;
  background: #0b1712;
  box-shadow: 0 1.5rem 3rem #0006;
}

.photo-viewer.expanded {
  width: 100vw;
  height: 100dvh;
  margin: 0;
  border-radius: 0;
}

.photo-viewer[open] {
  display: flex;
  flex-direction: column;
}

.photo-viewer::backdrop {
  background: #0f2a1f99;
}

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  font-weight: 700;
}

.viewer-actions {
  display: flex;
  gap: 0.5rem;
}

.viewer-stage {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
}

#viewer-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.4rem;
  object-fit: contain;
  user-select: none;
}

#viewer-image:not([src]) {
  width: 3rem;
  height: 3rem;
  border: 3px solid #ffffff33;
  border-top-color: #fff;
  border-radius: 50%;
  animation: viewer-spin 0.8s linear infinite;
}

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

.viewer-button {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #ffffff1f;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.viewer-button:hover {
  background: #ffffff38;
}

.viewer-button:focus-visible {
  outline: 3px solid #a9d5b3;
  outline-offset: 2px;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  width: 3.25rem;
  height: 3.25rem;
  font-size: 2rem;
  transform: translateY(-50%);
}

#viewer-prev {
  left: 0.75rem;
}

#viewer-next {
  right: 0.75rem;
}

/* Keep-or-discard popup in the New Pedestal photo loop. */
#review-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 0.4rem;
  object-fit: contain;
}

.review-dialog {
  height: min(720px, calc(100dvh - 32px));
}

.review-panel {
  display: grid;
  gap: 0.6rem;
  padding: 0 1rem 1rem;
}

.review-panel .viewer-caption {
  padding: 0;
}

.review-status {
  margin: 0;
  font-weight: 700;
  text-align: center;
}

.review-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.review-actions .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  font-size: 1.05rem;
  cursor: pointer;
}

.review-discard {
  color: #fff;
  background: #ffffff1f;
}

.review-discard:hover {
  background: #ffffff38;
}

.viewer-caption {
  margin: 0;
  padding: 0.75rem 1rem 1rem;
  color: #c9dccf;
  font-size: 0.85rem;
  text-align: center;
  word-break: break-all;
}

.asset-card {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid #dbe6df;
  border-radius: 0.85rem;
  background: white;
}

.asset-card h3 {
  margin-bottom: 0.25rem;
}

.asset-card p {
  margin: 0;
  color: #65786e;
  font-size: 0.9rem;
}

.asset-details {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
}

/* Right side of a pedestal card: condition badge and latest photo. */
.card-side {
  display: grid;
  flex: none;
  justify-items: end;
  gap: 0.6rem;
}

.card-thumb {
  position: relative;
  display: grid;
  width: 6.5rem;
  height: 6.5rem;
  place-items: center;
  padding: 0;
  overflow: hidden;
  border: 1px solid #dbe6df;
  border-radius: 0.7rem;
  background: #edf1ee;
  cursor: pointer;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-thumb:hover,
.card-thumb:focus-visible {
  border-color: #176344;
  outline: 2px solid #2e8c5833;
}

.card-thumb-count {
  position: absolute;
  right: 0.3rem;
  bottom: 0.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  color: #fff;
  background: #0b1712b3;
  font-size: 0.7rem;
  font-weight: 700;
}

.card-thumb.empty {
  align-content: center;
  gap: 0.2rem;
  border: 2px dashed #b9cdbf;
  color: #60766b;
  background: #f8fbf9;
  font-size: 0.75rem;
  font-weight: 700;
}

.card-thumb.empty span:first-child {
  font-size: 1.4rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.5rem;
}

.button-danger {
  border: 1px solid #e8c0bb;
  color: #9b3028;
  background: #fff0ed;
}

.button-danger:hover {
  color: #fff;
  background: #b8382e;
}

.card-button {
  min-height: 2.3rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.9rem;
}

.map-link {
  color: #176344;
  font-size: 0.85rem;
  font-weight: 650;
}

.asset-meta {
  font-size: 0.8rem !important;
}

.asset-notes {
  margin-top: 0.3rem !important;
  color: #365448 !important;
  white-space: pre-wrap;
}

.photo-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.photo-strip img {
  display: block;
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid #dbe6df;
  border-radius: 0.5rem;
  background: #edf1ee;
  object-fit: cover;
}

/* Photo GPS checks: at the pedestal, nearby, far away, location without a pedestal, no GPS. */
.photo-checks {
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.photo-checks:empty {
  display: none;
}

.photo-check {
  padding: 0.45rem 0.7rem;
  border-left: 4px solid;
  border-radius: 0.4rem;
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.photo-check.gps-at { border-color: #176344; color: #176344; background: #e3f5e9; }
.photo-check.gps-near { border-color: #c98a00; color: #835700; background: #fff2cf; }
.photo-check.gps-far { border-color: #b8382e; color: #9b3028; background: #fde8e5; }
.photo-check.gps-unknown,
.photo-check.gps-none { border-color: #a8b6ad; color: #53665b; background: #edf1ee; }

.photo-check::before {
  margin-right: 0.35rem;
}

.photo-check.gps-at::before { content: "✓"; }
.photo-check.gps-near::before { content: "!"; font-weight: 800; }
.photo-check.gps-far::before { content: "✕"; }

/* A coloured dot on each thumbnail shows its GPS check at a glance. */
.photo-strip a {
  position: relative;
}

.photo-strip a[class^="gps-"]::after {
  position: absolute;
  right: 0.25rem;
  bottom: 0.25rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #a8b6ad;
  content: "";
}

.photo-strip a.gps-at::after { background: #176344; }
.photo-strip a.gps-near::after { background: #c98a00; }
.photo-strip a.gps-far::after { background: #b8382e; }

.viewer-caption.gps-at { color: #8fe0ad; }
.viewer-caption.gps-near { color: #ffd479; }
.viewer-caption.gps-far { color: #ff9b91; }

.asset-tag {
  color: #286044 !important;
  font-size: 0.75rem !important;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.condition {
  flex: none;
  padding: 0.35rem 0.65rem;
  border-radius: 99px;
  color: #53665b;
  background: #edf1ee;
  font-size: 0.75rem;
  font-weight: 750;
}

.condition-good {
  color: #176344;
  background: #e3f5e9;
}

.condition-attention {
  color: #835700;
  background: #fff2cf;
}

.condition-urgent {
  color: #9b3028;
  background: #fde8e5;
}


.notice {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid #bad9c2;
  border-radius: 0.7rem;
  color: #1a5839;
  background: #eaf6ed;
}

.notice.error {
  border-color: #e8c0bb;
  color: #872d26;
  background: #fff0ed;
}

.empty-state {
  padding: 2rem;
  border: 1px dashed #cbd9d0;
  border-radius: 0.8rem;
  color: #65786e;
  text-align: center;
}

footer {
  padding: 1.25rem;
  color: #718178;
  font-size: 0.8rem;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 600px) {
  .topbar {
    padding: 0 5vw;
  }

  .account-bar {
    gap: 0.5rem;
    font-size: 0.75rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .full-width {
    grid-column: auto;
  }

  .asset-card {
    flex-direction: column-reverse;
    gap: 0.6rem;
  }

  /* On phones the badge and photo sit in a row above the details. */
  .card-side {
    display: flex;
    width: 100%;
    align-items: flex-start;
    justify-content: space-between;
  }

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

  .filter-menu {
    min-width: 0;
  }

  .map {
    height: 280px;
  }
}

.qr-name {
  padding: 0;
  border: 0;
  color: inherit;
  background: none;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

.qr-name:hover,
.qr-name:focus-visible {
  text-decoration-style: solid;
}

.qr-dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 1.25rem;
  border: 0;
  border-radius: 1rem;
  color: #19362d;
  background: #fff;
  box-shadow: 0 1.5rem 3rem #0006;
  text-align: center;
}

.qr-dialog::backdrop {
  background: #0f2a1f99;
}

.qr-dialog h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  overflow-wrap: anywhere;
}

#qr-canvas {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto;
  image-rendering: pixelated;
}

.qr-place {
  margin: 0.5rem 0 0;
  color: #365448;
  font-size: 0.9rem;
}

.qr-link {
  display: block;
  margin-top: 0.35rem;
  color: #286044;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.qr-hint {
  margin: 0.75rem 0 1rem;
  color: #53665b;
  font-size: 0.85rem;
}

.qr-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

/* Printing with the QR code open prints just its label. */
@media print {
  body:has(.qr-dialog[open]) > :not(.qr-dialog) {
    display: none !important;
  }

  .qr-dialog[open] {
    position: static;
    box-shadow: none;
  }

  .qr-dialog::backdrop {
    background: none;
  }

  .qr-hint,
  .qr-actions {
    display: none;
  }
}

/* User icons: a photo cropped to a circle, or initials. */
.avatar {
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-small {
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.7rem;
}

.avatar-large {
  width: 7rem;
  height: 7rem;
  font-size: 2.2rem;
}

#account-avatar:empty {
  display: none;
}

.avatar-preview {
  display: grid;
  place-items: center;
  margin: 0.5rem 0;
}

.user-who {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.avatar-button {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.avatar-button::after {
  position: absolute;
  right: -0.2rem;
  bottom: -0.2rem;
  display: grid;
  width: 1.2rem;
  height: 1.2rem;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e3f1e7;
  content: "📷";
  font-size: 0.55rem;
}

.avatar-button:hover .avatar,
.avatar-button:focus-visible .avatar {
  outline: 3px solid #a9d5b3;
}

/* Condition colours come from Settings. */
.condition-colored {
  color: color-mix(in srgb, var(--condition-color) 75%, #000);
  background: color-mix(in srgb, var(--condition-color) 14%, #fff);
}

.condition-dot-set::before {
  background: var(--condition-color, #a8b6ad);
}

.settings-form,
.condition-add {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.6rem;
}

.settings-form label {
  flex: 1 1 14rem;
}

.condition-settings {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

.condition-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #dbe6df;
  border-radius: 0.75rem;
}

.condition-row input:not([type=color]),
.condition-add input:not([type=color]) {
  flex: 1 1 10rem;
  min-width: 0;
}

.condition-row input[type=color],
.condition-add input[type=color] {
  width: 2.6rem;
  height: 2.4rem;
  padding: 0.15rem;
}

.condition-row.retired {
  opacity: 0.6;
  background: #f3f7f4;
}

.condition-move {
  min-width: 2.4rem;
  padding: 0.3rem 0.6rem;
}

#conditions-save {
  margin-top: 1rem;
}

/* Company logo from Settings, in place of the RC mark. */
.brand-mark.has-logo {
  width: auto;
  min-width: 2.6rem;
  max-width: 9rem;
  padding: 0.2rem;
  border-color: transparent;
  background: #fff;
}

.brand-mark.has-logo img {
  display: block;
  max-width: 100%;
  height: 2.2rem;
  object-fit: contain;
}

.logo-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.logo-preview {
  display: grid;
  width: 9rem;
  height: 9rem;
  place-items: center;
  padding: 0.5rem;
  border: 1px dashed #bad9c2;
  border-radius: 0.75rem;
  color: #53665b;
  background: #fff;
  font-size: 0.8rem;
  text-align: center;
}

.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.user-dialog {
  width: min(440px, calc(100vw - 32px));
  text-align: left;
}

.user-dialog .qr-actions {
  justify-content: flex-start;
}
