/* ===== Reset-ish & Globals ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #fafafa;
  color: #333;
  line-height: 1.5;
}

body.media-viewer-open {
  overflow: hidden;
  padding-right: var(--media-viewer-scrollbar-width, 0px);
}

/* ===== Layout ===== */
header, footer {
  background: #2c3e50;
  /* color: #fff; */
  color: white;
  text-align: center;
  padding: 1rem;
}
main { padding: 1rem; }

/* nav {
  background: #fff;
  padding: .5rem 1rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid #eee;
}
nav a { color: #2c3e50; text-decoration: none; }
nav a:hover { text-decoration: underline; } */
/* ===== Navigation ===== */
nav {
  background: #fff;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center; /* center nav items */
  border-bottom: 1px solid #e6e6e6;
}

/* Turn nav links into pill buttons */
nav a {
  background: #3498db;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;   /* fully rounded edges */
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s ease, transform 0.1s ease;
}

nav a:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

nav a:active {
  background: #1f6391;
  transform: translateY(0);
}


/* Keep readable line length on larger screens */
.container {
  width: 100%;
  max-width: 1100px;
  margin-inline: auto;
}

#page-content:has(.annotation-page--fullbleed) {
  max-width: none;
}

/* ===== Typography ===== */
h1, h2, h3 { color: #2c3e50; margin: 0 0 .75rem; }
p { margin: 0 0 1rem; }

/* Header-specific override */
.site-header { background: #2c3e50; color: #fff; }
.site-header h1 { color: #fff; margin: 0; }
.site-header h2 { color: #fff; margin: 0; }

/* Fluid type that scales gently with screen size */
:root {
  --fz-base: clamp(14px, 1.4vw + 10px, 16px);
  --fz-h1: clamp(22px, 2.4vw + 12px, 32px);
  --fz-h2: clamp(18px, 2vw + 10px, 26px);
}
body { font-size: var(--fz-base); }
h1 { font-size: var(--fz-h1); }
h2 { font-size: var(--fz-h2); }

/* ===== Links & Buttons ===== */
a { color: #3498db; text-decoration: none; }
a:hover { text-decoration: underline; }

button, .btn {
  background: #3498db;
  color: #fff;
  border: 0;
  padding: .6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
}
button:hover, .btn:hover { background: #2980b9; }

/* On very small screens, make key buttons full width when placed in stacks */
.btn-block, .button-block { width: 100%; display: inline-block; }

/* ===== Images & Media ===== */
img, canvas, video { max-width: 100%; height: auto; }

/* Fabric.js canvas container (if used) */
.canvas-wrap { width: 100%; overflow: auto; }
.annotation-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: grid;
  min-height: 0;
  height: 100%;
  place-items: center;
}

.annotation-canvas-wrap .canvas-container {
  display: block;
  margin-inline: auto;
}

.annotation-canvas-wrap canvas {
  display: block;
}

/* ===== Forms ===== */
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], select, textarea {
  width: 100%;
  padding: .6rem .75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
}

/* ===== Cards (optional wrapper) ===== */
.card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  margin: 1rem 0;
}

/* ===== Home Feed ===== */
/* Home feed styles are intentionally scoped so the redesigned Home page can
   evolve without changing the rest of the application layout language. */
.home-feed-page {
  padding-block: 0.5rem 1.5rem;
}

.home-feed-shell {
  width: 100%;
  max-width: 1380px;
  margin-inline: auto;
  display: grid;
  gap: 1.25rem;
}

.home-feed-sidebar,
.home-feed-main {
  min-width: 0;
}

.home-panel,
.record-card,
.home-feed-hero,
.home-empty-state {
  border-radius: 18px;
  border-color: #d9e2ec;
  box-shadow: 0 10px 30px rgba(44, 62, 80, 0.08);
}

.home-panel,
.home-feed-hero,
.home-empty-state {
  padding: 1.25rem;
}

.home-panel__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5f6c7b;
}

.home-feed-hero {
  background: linear-gradient(135deg, #ffffff 0%, #edf6ff 100%);
}

.home-feed-hero h1,
.home-empty-state h2,
.home-panel h2,
.record-card h2 {
  margin-bottom: 0.4rem;
}

.home-action-list {
  display: grid;
  gap: 0.75rem;
}

.home-action-list__primary {
  text-align: center;
}

.home-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  background: #f7fafc;
  border: 1px solid #d9e2ec;
  color: #2c3e50;
  font-weight: 600;
  text-decoration: none;
}

.home-action-link:hover {
  text-decoration: none;
  border-color: #b8c6d6;
  background: #eef5fb;
}

.home-stat-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.home-stat-list__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.home-stat-list__row dt {
  color: #5f6c7b;
  font-weight: 600;
}

.home-stat-list__row dd {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  color: #2c3e50;
}

.home-panel--placeholder {
  background: #f8fafc;
  border-style: dashed;
}

.record-feed {
  display: grid;
  gap: 1rem;
}

.record-card {
  padding: 0;
  overflow: hidden;
}

.record-card__header,
.record-card__content,
.record-card__footer {
  padding-inline: 1.25rem;
}

.record-card__header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding-top: 1.25rem;
}

.record-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.record-card__label,
.record-card__property {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.record-card__label {
  background: #dff3ff;
  color: #116188;
}

.record-card__label--professional {
  background: #fff8dd;
  color: #7a5710;
}

.record-card__label--company {
  background: #efe9ff;
  color: #5a3a9a;
}

.record-card__property {
  background: #eef4f8;
  color: #526273;
}

.record-card__trust-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  border: 1px solid #d7c38a;
  background: #fff8dd;
  color: #7a5710;
  font-size: 0.82rem;
  font-weight: 700;
}

.record-card__date {
  color: #6b7c93;
  font-size: 0.92rem;
  white-space: nowrap;
}

.record-card__media {
  margin-top: 1rem;
  border-top: 1px solid #edf2f7;
  border-bottom: 1px solid #edf2f7;
  background: #f8fafc;
}

.record-card__media img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.record-card__content {
  padding-top: 1.1rem;
  padding-bottom: 1rem;
}

.record-card__content p {
  margin-bottom: 0;
  color: #526273;
}

.record-card__author {
  margin-bottom: 0.45rem;
  color: #116188;
  font-size: 0.92rem;
  font-weight: 700;
}

.record-card__footer {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding-top: 0.95rem;
  padding-bottom: 1.25rem;
  border-top: 1px solid #edf2f7;
}

.record-card__action-form {
  margin: 0;
}

.record-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.6rem 1rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  appearance: none;
}

.record-card__action:hover {
  text-decoration: none;
}

.record-card__action--primary {
  background: #2c7fb8;
  color: #fff;
}

.record-card__action--primary:hover {
  background: #246792;
}

.record-card__action--secondary {
  border: 1px solid #c7d4e2;
  background: #f8fbfd;
  color: #176087;
}

.record-card__action--secondary:hover {
  background: #edf6fb;
}

.record-card__action--saved {
  background: #176087;
  color: #fff;
}

.record-card__action--saved:hover {
  background: #0f4d6d;
}

.record-card__action--placeholder {
  background: #eef2f7;
  color: #6b7c93;
  cursor: not-allowed;
}

.home-empty-state .btn {
  margin-top: 0.5rem;
}

.records-page {
  padding-block: 0.5rem 1.5rem;
}

.records-page__shell {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  display: grid;
  gap: 0.85rem;
}

.records-page__hero {
  border-radius: 18px;
  border-color: #d9e2ec;
  box-shadow: 0 10px 30px rgba(44, 62, 80, 0.08);
  padding: 1.25rem;
  background: linear-gradient(135deg, #ffffff 0%, #edf6ff 100%);
  overflow: visible;
}

.records-page__hero-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.records-page__hero-actions {
  display: grid;
  gap: 0.65rem;
  justify-items: stretch;
  min-width: min(100%, 360px);
}

.records-page__top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
  align-items: flex-start;
}

.records-page__report-action-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.38rem;
  /* The inline progress drawer anchors here so desktop can slide it out
     without changing the size of the hero card or record card itself. */
  position: relative;
}

.records-page__report-action-stack .record-card__action {
  width: 100%;
}

.records-page__report-status-anchor {
  /* Keep the progress panel out of normal flow on desktop. Reintroducing an
     in-flow anchor here would make Records cards grow/shrink while polling. */
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  width: min(340px, calc(100vw - 2rem));
  opacity: 0;
  transform: translate3d(18px, 0, 0);
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 12;
}

.records-page__report-status-anchor[hidden] {
  display: none !important;
}

.records-page__report-status-anchor.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.records-page__report-status-anchor--hero {
  transform-origin: top right;
}

.records-page__report-status-anchor--card {
  transform-origin: top right;
}

.records-page__report-status-panel {
  display: grid;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfe 100%);
  box-shadow: 0 8px 20px rgba(44, 62, 80, 0.08);
}

.records-page__report-status-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.records-page__report-status-title {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.records-page__report-status-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #607180;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.records-page__report-status-close:hover,
.records-page__report-status-close:focus-visible {
  color: #176087;
}

.records-page__report-status-row {
  display: grid;
  gap: 0.5rem;
}

.records-page__report-status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: capitalize;
}

.records-page__report-status-badge--queued {
  background: #eef4f8;
  color: #526273;
}

.records-page__report-status-badge--starting {
  background: #fff7e8;
  color: #8a5b10;
}

.records-page__report-status-badge--running {
  background: #e7f3f8;
  color: #176087;
}

.records-page__report-status-badge--completed {
  background: #eef8f2;
  color: #1e6b45;
}

.records-page__report-status-badge--failed {
  background: #fff0f0;
  color: #9b2c2c;
}

.records-page__report-status-text {
  margin: 0;
  color: #526273;
  font-size: 0.88rem;
  line-height: 1.45;
}

.records-page__report-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.records-page__report-status-actions .record-card__action {
  min-height: 34px;
  padding: 0.42rem 0.78rem;
  font-size: 0.84rem;
}

.record-card__action.is-submitting,
.record-card__action:disabled {
  opacity: 0.78;
  cursor: progress;
}

.records-page__latest-report-action {
  align-self: center;
  min-height: 0;
  min-width: 0;
  padding: 0.08rem;
  width: auto !important;
  border-radius: 10px;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.records-page__latest-report-action:hover,
.records-page__latest-report-action:focus-visible {
  background: transparent;
  box-shadow: none;
  transform: translateY(-1px);
}

.records-page__latest-report-icon {
  display: block;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
}

.records-page__hero-row p {
  margin-bottom: 0;
  color: #526273;
  max-width: 60ch;
}

.records-page__controls {
  margin-top: -0.05rem;
}

.records-page__manual-toggle.is-active {
  border-color: #176087;
  background: #e7f3f8;
  color: #176087;
}

.records-page__manual-order-notice {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border-color: #b8d5e4;
  background: linear-gradient(180deg, #f6fbfe 0%, #eef7fb 100%);
}

.records-page__manual-order-notice[hidden] {
  display: none !important;
}

.records-page__manual-order-notice p {
  margin: 0;
  color: #445365;
  font-size: 0.9rem;
}

.records-page__reorder-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border-color: #b8d5e4;
  background: linear-gradient(180deg, #ffffff 0%, #f4f9fc 100%);
  box-shadow: inset 0 0 0 1px rgba(184, 213, 228, 0.45);
}

.records-page__reorder-panel[hidden] {
  display: none !important;
}

.records-page__reorder-panel-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.records-page__reorder-panel-copy .home-panel__eyebrow,
.records-page__reorder-panel-copy p {
  margin: 0;
}

.records-page__reorder-panel-copy .home-panel__eyebrow {
  font-size: 0.72rem;
}

.records-page__reorder-panel-copy p {
  color: #445365;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}

.records-page__reorder-panel-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.records-page__reorder-panel .record-action-button:disabled,
.records-page__reorder-panel .record-action-link:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.records-page__reorder-panel .record-action-button,
.records-page__reorder-panel .record-action-link {
  min-height: 36px;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
}

.records-page__controls select:disabled,
.records-page__controls button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.records-page__delete-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, auto);
  column-gap: 1rem;
  row-gap: 0.6rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  margin: 0;
  border-radius: 14px;
  border-color: #d9e2ec;
  box-shadow: inset 0 0 0 1px rgba(217, 226, 236, 0.55);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
}

.records-page__delete-panel[hidden] {
  display: none !important;
}

.records-page__delete-panel.is-active {
  border-color: #e4b8b8;
  background: linear-gradient(180deg, #fffdfd 0%, #fff7f7 100%);
  box-shadow: inset 0 0 0 1px rgba(228, 184, 184, 0.55);
}

.records-page__delete-panel-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
  max-width: 28rem;
}

.records-page__delete-panel-copy h2,
.records-page__delete-panel-copy p {
  margin: 0;
}

.records-page__delete-panel-copy .home-panel__eyebrow {
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
}

.records-page__delete-panel-copy h2 {
  font-size: 0.96rem;
  line-height: 1.2;
}

.records-page__delete-panel-copy p {
  color: #526273;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
}

.records-page__delete-confirm {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  color: #445365;
  font-size: 0.83rem;
  line-height: 1.35;
  max-width: none;
  justify-content: flex-end;
  white-space: normal;
  text-align: right;
}

.records-page__delete-confirm input {
  accent-color: #b24a43;
  flex: 0 0 auto;
  margin: 0;
  margin-top: 0.1rem;
}

.records-page__delete-confirm span {
  inline-size: min(16.5rem, 100%);
  text-wrap: balance;
}

.records-page__delete-panel-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-self: end;
  gap: 0.5rem;
  min-width: 18rem;
}

.records-page__delete-panel-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: space-between;
  width: 100%;
}

.records-page__delete-panel .record-action-button:disabled,
.records-page__delete-panel .record-action-link:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.records-page__delete-panel .record-action-button,
.records-page__delete-panel .record-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
}

.records-page__feed {
  gap: 0.85rem;
}

.records-page__record-card {
  border-color: #d9e2ec;
  box-shadow: 0 3px 10px rgba(44, 62, 80, 0.05);
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  overflow: visible;
}

.records-page__record-card .record-card__content,
.records-page__record-card .record-card__footer {
  padding-inline: 0.9rem;
}

.records-page__record-card .record-card__content {
  padding-top: 0.9rem;
  padding-bottom: 0.55rem;
}

.records-page__record-card .record-card__footer {
  padding-top: 0.55rem;
  padding-bottom: 0.85rem;
}

.records-page__record-card.is-pending-delete {
  border-color: #e4b8b8;
  background: linear-gradient(180deg, #fffdfd 0%, #fff7f7 100%);
}

.records-page__shared-chip {
  background: #eef8f2;
  color: #1e6b45;
}

.records-page__card-shell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 140px;
  gap: 0.8rem;
  align-items: start;
}

.records-page__id-rail {
  display: grid;
  gap: 0.15rem;
  align-content: start;
  justify-items: center;
  min-height: 100%;
  padding: 0.45rem 0.35rem;
  border-right: 1px solid #e4ebf3;
  color: #526273;
  text-align: center;
}

.records-page__drag-handle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  padding: 10px 6px;
  border: 1px dashed #b8c7d4;
  border-radius: 999px;
  background: #f6f9fc;
  color: #607180;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.25em;
  line-height: 1;
  user-select: none;
  touch-action: none;
  cursor: grab;
}

.records-page__drag-handle:active {
  cursor: grabbing;
}

.records-page__drag-handle svg {
  width: 20px;
  height: 28px;
  display: block;
  fill: currentColor;
}

.records-page__record-card.is-manual-order-mode {
  border-color: #b8d5e4;
}

.records-page__record-card.is-manual-order-mode .records-page__drag-handle {
  display: inline-flex;
  cursor: grab;
}

.records-page__record-card.is-manual-order-mode .records-page__drag-handle:hover,
.records-page__record-card.is-manual-order-mode .records-page__drag-handle:focus-visible {
  border-color: #176087;
  background: #e7f3f8;
  color: #176087;
  outline: none;
}

.records-page__record-card.is-manual-order-mode .records-page__drag-handle.is-dragging {
  cursor: grabbing;
  border-color: #176087;
  background: #176087;
  color: #fff;
}

.records-page__feed.is-record-dragging .records-page__record-card {
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.records-page__record-card.is-record-dragging {
  background-color: #e6f6ea !important;
  position: relative;
  border: 2px solid #34a853 !important;
  box-shadow:
    0 18px 40px rgba(52, 168, 83, 0.25),
    0 6px 12px rgba(0, 0, 0, 0.25) !important;
  transform: scale(1.01);
  z-index: 1000;
  transition: none;
}

.records-page__record-card.is-record-drop-before {
  box-shadow:
    inset 0 4px 0 #176087,
    0 3px 10px rgba(44, 62, 80, 0.05);
}

.records-page__record-card.is-record-drop-after {
  box-shadow:
    inset 0 -4px 0 #176087,
    0 3px 10px rgba(44, 62, 80, 0.05);
}

.records-page__id-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.records-page__id-value {
  color: #176087;
  font-size: 1rem;
  line-height: 1.1;
}

.records-page__content-main {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

.records-page__summary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.records-page__meta-row {
  gap: 0.4rem;
  min-width: 0;
}

.records-page__meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.62rem;
  background: #f4f7fa;
  color: #526273;
  font-size: 0.8rem;
  font-weight: 700;
  max-width: 100%;
}

.records-page__pending-delete-chip {
  background: #fff0f0;
  color: #9b2c2c;
}

.records-page__pending-delete-chip[hidden] {
  display: none !important;
}

.records-page__summary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  align-items: flex-start;
}

.records-page__view-action {
  min-height: 36px;
  padding: 0.45rem 0.82rem;
  text-decoration: none;
}

.records-page__view-action:hover,
.records-page__view-action:focus-visible {
  text-decoration: none;
}

.records-page__summary-actions .record-card__action {
  min-height: 36px;
  padding: 0.45rem 0.78rem;
  font-size: 0.86rem;
}

.records-page__edit-action {
  border-color: #d9e2ec;
  background: #fff;
  color: #526273;
}

.records-page__edit-action:hover {
  background: #f5f8fb;
}

.records-page__title-line {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: baseline;
}

.records-page__title-line h2 {
  margin: 0;
  min-width: 0;
  font-size: 1.08rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.records-page__summary-text {
  margin: 0;
  color: #526273;
  font-size: 0.92rem;
  line-height: 1.35;
}

.records-page__thumb-column {
  width: 100%;
}

.records-page__attachments strong,
.records-page__documents strong {
  color: #2c3e50;
  font-size: 0.8rem;
}

.records-page__asset-band {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.9rem;
  align-items: start;
}

.records-page__asset-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  min-width: 0;
}

.records-page__attachment-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.records-page__attachment-links a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #d9e2ec;
  background: #fbfdff;
  color: #176087;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
}

.records-page__attachment-links a:hover {
  background: #edf6fb;
}

.records-page__documents {
  min-width: 0;
}

.records-page__document-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.45rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.records-page__document-item {
  display: flex;
  max-width: 100%;
}

.records-page__document-item a {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 0.28rem 0.55rem;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #fbfdff;
  color: #176087;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.84rem;
  line-height: 1.2;
  word-break: break-word;
}

.records-page__document-item a:hover {
  background: #edf6fb;
}

.records-page__footer {
  justify-content: flex-end;
  align-items: center;
  padding-left: calc(0.9rem + 64px + 0.8rem);
  padding-top: 0.06rem;
  padding-bottom: 0.18rem;
  border-top: 1px solid #f1f5f9;
  min-height: 0;
  gap: 0.4rem;
}

.records-page__footer-note {
  margin: 0 auto 0 0;
  color: #9b2c2c;
  font-size: 0.8rem;
  font-weight: 700;
}

.records-page__footer .record-card__action {
  min-height: 28px;
  padding: 0.24rem 0.62rem;
  font-size: 0.8rem;
}

.records-page__delete-action {
  appearance: none;
  border: 1px solid #e4b8b8;
  background: #fff9f9;
  color: #9b2c2c;
  font: inherit;
  cursor: pointer;
  min-height: 28px;
  padding: 0.24rem 0.62rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.records-page__delete-action:hover {
  background: #ffe3e3;
}

.records-page__delete-action.is-pending-delete {
  border-color: #c77979;
  background: #9b2c2c;
  color: #fff;
}

.records-page__delete-action.is-pending-delete:hover {
  background: #7f1d1d;
}

.records-page__empty-state {
  border-radius: 18px;
  border-color: #d9e2ec;
  box-shadow: 0 10px 30px rgba(44, 62, 80, 0.08);
}

@media (max-width: 960px) {
  .records-page__delete-panel {
    grid-template-columns: 1fr;
    row-gap: 0.75rem;
  }

  .records-page__delete-panel-controls {
    width: 100%;
    min-width: 0;
    align-items: stretch;
    justify-self: stretch;
  }

  .records-page__delete-confirm {
    justify-content: flex-end;
  }
}

@media (max-width: 760px) {
  .records-page__hero-row {
    flex-direction: column;
  }

  .records-page__hero-actions,
  .records-page__top-actions {
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }

  .records-page__report-action-stack {
    width: 100%;
    max-width: 100%;
  }

  .records-page__report-status-anchor {
    /* Mobile falls back to an in-flow vertical reveal because the desktop
       overlay pattern does not have enough horizontal room on narrow screens. */
    position: static;
    width: 100%;
    margin-top: 0.18rem;
    transform: translate3d(0, -8px, 0);
    z-index: auto;
  }

  .records-page__report-status-anchor.is-visible {
    transform: translateY(0);
  }

  .records-page__delete-panel {
    row-gap: 0.75rem;
  }

  .records-page__delete-panel-controls {
    align-items: stretch;
  }

  .records-page__delete-confirm {
    max-width: none;
    justify-content: flex-end;
  }

  .records-page__reorder-panel {
    grid-template-columns: 1fr;
  }

  .records-page__reorder-panel-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .records-page__card-shell {
    grid-template-columns: 1fr;
  }

  .records-page__id-rail {
    grid-auto-flow: column;
    justify-content: flex-start;
    justify-items: start;
    border-right: 0;
    border-bottom: 1px solid #e4ebf3;
    padding: 0 0 0.45rem;
  }

  .records-page__summary-header,
  .records-page__title-line {
    flex-direction: column;
    align-items: flex-start;
  }

  .records-page__summary-actions {
    justify-content: flex-start;
  }

  .records-page__thumb-column {
    max-width: 180px;
  }

  .records-page__footer {
    padding-left: 0.9rem;
    justify-content: flex-start;
  }
}

.account-page {
  padding-block: 0.5rem 1.5rem;
}

.account-shell {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  display: grid;
  gap: 1.1rem;
}

.account-card {
  border-radius: 18px;
  border-color: #d9e2ec;
  box-shadow: 0 10px 30px rgba(44, 62, 80, 0.08);
  padding: 1.25rem;
}

.account-card--primary {
  background: linear-gradient(135deg, #ffffff 0%, #edf6ff 100%);
}

.account-kv {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0 0;
}

.account-kv__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.8rem 0.95rem;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #f8fbfe;
}

.account-kv__row dt {
  font-weight: 700;
  color: #52606d;
}

.account-kv__row dd {
  margin: 0;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #ecfdf3;
  color: #166534;
  font-size: 0.88rem;
  font-weight: 700;
}

.account-badge--muted {
  background: #eef2f7;
  color: #44576b;
}

.account-actions {
  margin-top: 1rem;
}

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

.admin-user-row {
  display: grid;
  gap: 0.9rem;
}

.admin-user-row__identity h2 {
  margin-bottom: 0.35rem;
}

.admin-user-row__identity p {
  margin-bottom: 0;
  color: #52606d;
}

.admin-user-row__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.admin-user-row__actions {
  display: flex;
  justify-content: flex-start;
}

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

@media (min-width: 860px) {
  .home-feed-shell {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1.55fr) minmax(220px, 280px);
    align-items: start;
  }

  .home-feed-sidebar {
    position: sticky;
    top: 1rem;
  }
}

@media (max-width: 859px) {
  .home-feed-sidebar--right {
    order: 3;
  }

  .home-feed-main {
    order: 2;
  }

  .home-feed-sidebar--left {
    order: 1;
  }
}

@media (max-width: 640px) {
  .record-card__header,
  .record-card__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .record-card__footer {
    width: 100%;
  }

  .record-card__action {
    width: 100%;
  }
}

/* ===== Tables ===== */
/* Mobile: horizontal scroll container to keep columns readable */
.table-responsive { width: 100%; overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px; /* allows scroll on phones instead of cramped columns */
}
th, td {
  border: 1px solid #e6e6e6;
  padding: .6rem .75rem;
  text-align: left;
  vertical-align: top;
}
th { background: #f3f4f6; font-weight: 600; }

/* ===== Utilities ===== */
.grid {
  display: grid;
  gap: 1rem;
}
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }

/* ===== Breakpoints (mobile-first) ===== */
@media (min-width: 600px) {
  main { padding: 1.25rem; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  main { padding: 1.5rem; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ===== Graphical Task Logging ===== */
/* The New Record workflow uses stacked panels rather than a wizard. CSS here
   should support progressive disclosure without introducing hidden navigation
   assumptions that belong in JavaScript state logic. */
.task-flow {
  display: grid;
  gap: 1.5rem;
}

.task-flow--step3-return-pending {
  opacity: 0;
  pointer-events: none;
}

.task-flow--step3-return .task-flow__intro,
.task-flow--step3-return [data-step-panel="property"],
.task-flow--step3-return [data-step-panel="image"] {
  display: none;
}

.task-flow--visible-property .task-flow__intro,
.task-flow--visible-image .task-flow__intro,
.task-flow--visible-subitem .task-flow__intro,
.task-flow--visible-details .task-flow__intro,
.task-flow--visible-property [data-step-panel]:not([data-step-panel="property"]),
.task-flow--visible-image [data-step-panel]:not([data-step-panel="image"]),
.task-flow--visible-subitem [data-step-panel]:not([data-step-panel="subitem"]),
.task-flow--visible-details [data-step-panel="property"],
.task-flow--visible-details [data-step-panel="image"] {
  display: none;
}

/* Step 4 keeps Step 3 available above for review, so give the page enough
   trailing room for the details panel to align near the top on entry. */
.task-flow--visible-details {
  padding-bottom: clamp(10rem, 30vh, 22rem);
}

.task-flow__intro p {
  max-width: 60ch;
}

.task-flow__panel {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 6px 18px rgba(44, 62, 80, 0.08);
  scroll-margin-top: 1rem;
  transition: opacity 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.task-flow__panel--locked {
  background: #fbfdff;
  border-style: dashed;
  border-color: #d9e2ec;
  opacity: 0.82;
}

.task-flow__panel--completed {
  border-color: #c7d7e6;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.task-flow__panel--active {
  border-color: #9fc5de;
  box-shadow: 0 14px 34px rgba(23, 96, 135, 0.12);
  transform: translateY(-1px);
}

.task-flow__step-copy {
  max-width: 60ch;
}

.task-flow__panel-header {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.task-flow__eyebrow {
  margin: 0 0 0.3rem;
  color: #52606d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.task-flow__status {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #eef5fb;
  color: #176087;
  font-size: 0.85rem;
  font-weight: 700;
}

.task-flow__panel--locked .task-flow__status {
  background: #f1f5f9;
  color: #52606d;
}

.task-flow__panel-actions,
.task-flow__workspace-actions {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
}

.task-flow__back-link {
  appearance: none;
  border: 1px solid #d9e2ec;
  background: #fff;
  color: #2c3e50;
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.task-flow__back-link:hover {
  background: #f8fbfd;
}

.task-flow__section-heading {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.property-grid,
.image-grid {
  display: grid;
  gap: 1rem;
}

.task-flow__summary-banner,
.task-flow__workspace-banner {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #d9e2ec;
  background: #f8fbfd;
  color: #102a43;
}

.task-flow__workspace-banner {
  background: linear-gradient(135deg, #edf6ff 0%, #f8fbfd 100%);
  border-color: #b8d0e4;
  font-weight: 600;
}

.task-flow__collapsed-note {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px dashed #bcccdc;
  background: #f8fbfd;
  color: #52606d;
}

.task-flow__panel--locked #image-grid {
  display: none;
}

.property-card,
.image-tile {
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #fff;
  padding: 0;
  overflow: hidden;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.property-card:hover,
.image-tile:hover {
  border-color: #3498db;
  box-shadow: 0 10px 22px rgba(52, 152, 219, 0.14);
  transform: translateY(-2px);
}

.property-card.is-active,
.image-tile.is-active {
  border-color: #1f6391;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
}

.property-card__media,
.image-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #edf2f7;
}

.property-card__placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  color: #52606d;
  background: linear-gradient(135deg, #edf2f7, #d9e2ec);
}

.property-card__body {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem 1rem 1rem;
}

.property-card__body span,
.selection-summary span,
.inline-upload__label span {
  color: #52606d;
  font-size: 0.92rem;
}

.image-tile span {
  display: block;
  padding: 0.75rem 0.9rem 0.9rem;
  font-weight: 600;
}

.empty-state {
  border: 1px dashed #bcccdc;
  border-radius: 12px;
  padding: 1rem;
  background: #f8fbfd;
  color: #52606d;
}

.inline-upload {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.inline-upload__label {
  display: grid;
  gap: 0.35rem;
}

.record-detail-page {
  max-width: 960px;
  padding-block: 0.5rem 1.5rem;
}

.record-detail-card {
  display: grid;
  gap: 1.25rem;
}

.record-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.2rem 0;
}

.record-topbar__back {
  font-weight: 700;
  white-space: nowrap;
}

.record-topbar__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

.record-topbar__meta span {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #52606d;
  font-size: 0.88rem;
  font-weight: 600;
}

.record-title-block {
  display: grid;
  gap: 0.35rem;
}

.record-title-block__eyebrow {
  margin: 0;
  color: #52606d;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.record-edit-flow {
  display: grid;
  gap: 1.1rem;
}

.record-edit-flow--readonly input[readonly],
.record-edit-flow--readonly textarea[readonly],
.record-edit-flow--readonly input:disabled {
  background: #f8fbfd;
  color: #44576b;
  cursor: default;
}

.record-detail-card--readonly .record-action-button,
.record-detail-card--readonly .record-action-link {
  min-height: 40px;
}

.record-section {
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  padding: 1rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.06);
}

.record-section--hero {
  background: linear-gradient(180deg, #ffffff 0%, #eef5fb 100%);
}

.record-section--guest-media {
  display: grid;
  gap: 0.9rem;
}

.record-section__heading {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.record-section__eyebrow {
  margin: 0 0 0.25rem;
  color: #52606d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.record-section__heading h2 {
  margin-bottom: 0;
}

.record-section__heading--compact {
  margin-bottom: 0.7rem;
}

.record-section__supporting-copy,
.record-media-panel__copy {
  color: #52606d;
  max-width: 58ch;
  margin-bottom: 0;
  font-size: 0.95rem;
}

.record-main-photo-link {
  display: block;
  text-decoration: none;
  cursor: zoom-in;
}

.record-main-photo-link:hover {
  text-decoration: none;
}

.record-main-photo {
  display: block;
  width: 100%;
  max-height: 540px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid #d9e2ec;
  background: #edf2f7;
  box-shadow: 0 18px 32px rgba(44, 62, 80, 0.12);
}

.record-edit-fields {
  display: grid;
  gap: 0.9rem;
}

.record-inline-toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #f8fbfd;
}

.record-inline-toggle input {
  width: auto;
  margin-top: 0.1rem;
}

.record-inline-toggle--subtle {
  margin-top: 0.85rem;
}

.record-upload-dropzone {
  display: grid;
  gap: 0.35rem;
  padding: 1.15rem;
  border: 1.5px dashed #b8c6d6;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbfd 0%, #f3f8fc 100%);
  cursor: pointer;
}

.record-upload-dropzone:hover {
  border-color: #8fa5bb;
  background: linear-gradient(180deg, #f5fbff 0%, #eef5fb 100%);
}

.record-upload-dropzone.is-dragover {
  border-color: #2c7fb8;
  background: linear-gradient(180deg, #eef7ff 0%, #dff1ff 100%);
  box-shadow: 0 0 0 3px rgba(44, 127, 184, 0.14);
}

.record-upload-dropzone__title {
  color: #2c3e50;
  font-weight: 700;
}

.record-upload-dropzone__copy {
  color: #52606d;
  font-size: 0.95rem;
}

.record-upload-dropzone input {
  margin-top: 0.5rem;
}

.record-media-preview {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d9e2ec;
  background: #edf2f7;
}

.record-media-empty,
.main-photo-helper {
  color: #52606d;
}

.record-media-empty {
  border: 1px dashed #bcccdc;
  border-radius: 12px;
  padding: 1rem;
  background: #f8fbfd;
}

.record-media-empty--hero {
  min-height: 180px;
  display: grid;
  place-items: center;
}

.record-linked-image {
  display: grid;
  gap: 1rem;
}

.record-media-list {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.record-media-item,
.record-media-item-card {
  display: grid;
  gap: 0.5rem;
  border-radius: 14px;
}

.record-media-item--single {
  text-decoration: none;
  cursor: zoom-in;
}

.record-media-item-card {
  border: 1px solid #d9e2ec;
  background: #fff;
  padding: 0.85rem;
  box-shadow: 0 8px 18px rgba(44, 62, 80, 0.05);
}

.record-media-item-card.is-community-shared {
  border-color: #77b8a7;
  background: linear-gradient(180deg, #ffffff 0%, #f5fffb 100%);
  box-shadow: 0 10px 24px rgba(62, 145, 118, 0.10);
}

.record-media-item-card--feature {
  padding: 1rem;
}

.record-media-item-card--current {
  border-color: #8fb3c9;
  background: #f5fbff;
}

.record-media-item-card img,
.record-media-item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #d9e2ec;
  background: #edf2f7;
}

.record-media-item--single .record-reference-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: auto;
  object-fit: contain;
}

.record-media-item:hover,
.record-media-item:focus-visible {
  text-decoration: none;
}

[data-media-viewer-trigger] img {
  cursor: zoom-in;
}

.record-media-item__body {
  display: grid;
  gap: 0.4rem;
}

.record-media-item__name,
.record-attachment-list__name {
  margin: 0;
  font-weight: 700;
  color: #2c3e50;
  word-break: break-word;
}

.record-media-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: #dff3ff;
  color: #116188;
  font-size: 0.82rem;
  font-weight: 700;
}

.record-media-item__meta,
.record-attachment-list__meta,
.record-main-photo-note {
  margin: 0;
  color: #52606d;
}

.record-media-share-controls {
  display: grid;
  gap: 0.45rem;
  align-items: start;
}

.record-share-state-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.record-share-state-badge--shared {
  background: #e6fbf3;
  color: #0d6b50;
  border: 1px solid #b6ead5;
}

.record-share-state-badge--private {
  background: #f4f7fa;
  color: #5b6b79;
  border: 1px solid #d9e2ec;
}

.record-share-toggle {
  border-style: dashed;
}

.record-media-item-card.is-community-shared .record-share-toggle {
  border-color: #9ed6c6;
  background: #f1fcf7;
}

.record-media-action {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  width: fit-content;
  padding: 0.55rem 0.8rem;
  border: 1px solid #d9e2ec;
  border-radius: 999px;
  background: #f8fbfd;
  color: #2c3e50;
  cursor: pointer;
  font-weight: 600;
}

.record-media-action input {
  width: auto;
  margin: 0;
}

.record-media-actions,
.record-attachment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.record-media-actions form,
.record-attachment-actions form {
  margin: 0;
}

.record-delete-action {
  appearance: none;
  border: 1px solid #e4b8b8;
  background: #fff5f5;
  color: #9b2c2c;
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.record-delete-action:hover {
  background: #ffe3e3;
}

.record-delete-action.is-pending-delete {
  border-color: #c77979;
  background: #9b2c2c;
  color: #fff;
}

.record-delete-action.is-pending-delete:hover {
  background: #7f1d1d;
}

.record-replace-action {
  appearance: none;
  border: 1px solid #b7cfe0;
  background: #f4fbff;
  color: #176087;
  border-radius: 999px;
  padding: 0.55rem 0.8rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.record-replace-action:hover {
  background: #e3f2fb;
}

.record-replace-action.is-pending-replace {
  border-color: #7ba7c6;
  background: #176087;
  color: #fff;
}

.record-replace-action.is-pending-replace:hover {
  background: #0f4d6d;
}

.record-attachment-list {
  display: grid;
  gap: 0.6rem;
  padding-left: 0;
  margin: 0;
  list-style: none;
}

.record-attachment-list__item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #fff;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
}

.media-viewer[hidden] {
  display: none !important;
}

.media-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(4px);
}

.media-viewer__dialog {
  position: relative;
  z-index: 1;
  width: min(90vw, 1400px);
  height: min(90vh, 900px);
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 1.25rem;
  overflow: auto;
  overscroll-behavior: contain;
}

.media-viewer__frame {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 0.75rem;
  box-sizing: border-box;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 18px;
  background: rgba(248, 251, 253, 0.08);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.28);
}

.media-viewer__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  margin: auto;
  object-fit: contain;
  border-radius: 14px;
  background: #edf2f7;
}

.media-viewer__close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 2;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2933;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.media-viewer__close:hover {
  background: #ffffff;
}

.record-media-item-card.is-pending-delete,
.record-attachment-list__item.is-pending-delete {
  opacity: 0.72;
  border-style: dashed;
  border-color: #e4b8b8;
  background: #fff8f8;
}

.record-media-item-card.is-pending-delete .record-media-item__name::after,
.record-attachment-list__item.is-pending-delete .record-attachment-list__name::after {
  content: " Pending removal";
  margin-left: 0.35rem;
  color: #9b2c2c;
  font-size: 0.85rem;
  font-weight: 700;
}

.record-media-item-card.is-pending-replace,
.record-attachment-list__item.is-pending-replace {
  border-color: #9fc5de;
  background: #f4fbff;
}

.record-media-item-card.is-pending-replace .record-media-item__name::after,
.record-attachment-list__item.is-pending-replace .record-attachment-list__name::after {
  content: " Pending replacement";
  margin-left: 0.35rem;
  color: #176087;
  font-size: 0.85rem;
  font-weight: 700;
}

.record-replacement-note {
  margin: 0;
  color: #176087;
  font-size: 0.92rem;
  font-weight: 600;
}

.main-photo-options {
  display: grid;
  gap: 0.65rem;
}

.new-record-sharing-options {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.main-photo-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #d9e2ec;
  border-radius: 12px;
  background: #fff;
}

.main-photo-option input {
  width: auto;
  margin-top: 0.1rem;
}

.record-upload-preview-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 1rem;
}

.record-upload-preview-list__heading {
  display: grid;
  gap: 0.25rem;
}

.record-media-item-card--upload {
  background: #fbfdff;
  border-style: dashed;
}

.record-community-gallery {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.record-community-gallery__item {
  display: block;
  border-radius: 14px;
  overflow: hidden;
}

.record-community-gallery__item img {
  display: block;
  width: 100%;
  height: auto;
}

.record-edit-panel__actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  padding-top: 0.25rem;
}

.record-action-button,
.record-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
}

button.record-action-link {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.record-action-button {
  appearance: none;
  border: 1px solid #176087;
  background: #176087;
  color: #fff;
  cursor: pointer;
  font: inherit;
}

.record-action-button:hover,
.record-action-link:hover {
  text-decoration: none;
}

.record-action-button--secondary,
.record-action-link--secondary {
  border: 1px solid #d9e2ec;
  background: #fff;
  color: #2c3e50;
}

.viewer-shell {
  display: grid;
  gap: 0.75rem;
}

.viewer-shell--workspace {
  width: 100%;
  justify-items: center;
  align-items: start;
}

.subitem-stage {
  position: relative;
  width: 100%;
  max-width: 800px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid #d9e2ec;
  background: #f3f7fa;
  --viewer-zoom: 1;
}

.viewer-shell--workspace .subitem-stage {
  max-width: min(100%, 1280px);
  margin-inline: auto;
}

.subitem-stage.is-zoomed {
  cursor: grab;
}

.subitem-stage.is-panning {
  cursor: grabbing;
}

.subitem-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 0 0;
  will-change: transform;
}

.subitem-stage img,
.subitem-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.subitem-overlay {
  pointer-events: none;
  z-index: 1;
}

.subitem-label-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.subitem-box {
  position: absolute;
  border: 2px solid rgba(31, 99, 145, 0.72);
  background: rgba(52, 152, 219, 0.06);
  color: #102a43;
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0;
  overflow: visible;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.subitem-box:hover,
.subitem-box:focus-visible {
  border-color: rgba(23, 96, 135, 0.95);
  background: rgba(52, 152, 219, 0.1);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 10px rgba(23, 96, 135, 0.18);
}

.subitem-box--ellipse,
.subitem-box[data-shape-type="ellipse"] {
  border-radius: 50%;
}

.subitem-box--line,
.subitem-box[data-shape-type="line"],
.subitem-box--polyline,
.subitem-box[data-shape-type="polyline"],
.subitem-box--polygon,
.subitem-box[data-shape-type="polygon"] {
  position: absolute;
  border: none;
  background: transparent;
  overflow: visible;
  pointer-events: none;
  outline: none;
  display: block;
}

.subitem-box__line-visible,
.subitem-box__polyline-visible,
.subitem-box__polygon-visible {
  stroke: rgba(31, 99, 145, 0.88);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: none;
  pointer-events: none;
  transition: stroke 0.18s ease, stroke-width 0.18s ease, fill 0.18s ease, filter 0.18s ease;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.5));
}

.subitem-box__line-hit,
.subitem-box__polyline-hit {
  stroke: transparent;
  stroke-width: 24;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: none;
  pointer-events: stroke;
  cursor: pointer;
}

.subitem-box__polygon-visible {
  fill: rgba(52, 152, 219, 0.08);
  stroke-width: 3;
}

.subitem-box__polygon-hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 12;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: none;
  pointer-events: all;
  cursor: pointer;
}

.subitem-box--line:focus,
.subitem-box--polyline:focus,
.subitem-box--polygon:focus {
  outline: none;
}

.subitem-box--line.is-active,
.subitem-box--line.is-locked,
.subitem-box--polyline.is-active,
.subitem-box--polyline.is-locked,
.subitem-box--polygon.is-active,
.subitem-box--polygon.is-locked {
  border: none;
  background: transparent;
}

.subitem-box--line.is-active .subitem-box__line-visible,
.subitem-box--polyline.is-active .subitem-box__polyline-visible,
.subitem-box--polygon.is-active .subitem-box__polygon-visible {
  stroke: rgba(23, 96, 135, 0.96);
  stroke-width: 5;
  filter: drop-shadow(0 0 4px rgba(23, 96, 135, 0.22));
}

.subitem-box--polygon.is-active .subitem-box__polygon-visible {
  fill: rgba(52, 152, 219, 0.1);
}

.subitem-box--line.is-locked .subitem-box__line-visible,
.subitem-box--polyline.is-locked .subitem-box__polyline-visible,
.subitem-box--polygon.is-locked .subitem-box__polygon-visible {
  stroke-dasharray: 10 6;
}

.subitem-box__label {
  position: absolute;
  background: rgba(255, 255, 255, 0.92);
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  min-width: 7rem;
  max-width: 18rem;
  max-height: calc(1.2em * 2 + 0.4rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  z-index: 2;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(16, 42, 67, 0.12);
}

.subitem-box__label.is-visible,
.subitem-box__label.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.subitem-box.is-active {
  border-color: rgba(23, 96, 135, 0.95);
  background: rgba(52, 152, 219, 0.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.72),
    0 0 8px rgba(23, 96, 135, 0.18);
}

.subitem-box.is-locked {
  border-style: dashed;
}

.subitem-box--line,
.subitem-box--line:hover,
.subitem-box--line:focus,
.subitem-box--line:focus-visible,
.subitem-box--line.is-active,
.subitem-box--line.is-locked,
.subitem-box--polyline,
.subitem-box--polyline:hover,
.subitem-box--polyline:focus,
.subitem-box--polyline:focus-visible,
.subitem-box--polyline.is-active,
.subitem-box--polyline.is-locked,
.subitem-box--polygon,
.subitem-box--polygon:hover,
.subitem-box--polygon:focus,
.subitem-box--polygon:focus-visible,
.subitem-box--polygon.is-active,
.subitem-box--polygon.is-locked {
  border: none;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.subitem-box--line:hover .subitem-box__line-visible,
.subitem-box--polyline:hover .subitem-box__polyline-visible,
.subitem-box--line:focus-visible .subitem-box__line-visible,
.subitem-box--polyline:focus-visible .subitem-box__polyline-visible,
.subitem-box--polygon:focus-visible .subitem-box__polygon-visible,
.subitem-box--polygon:hover .subitem-box__polygon-visible {
  stroke: rgba(23, 96, 135, 0.96);
  stroke-width: 5;
  filter: drop-shadow(0 0 4px rgba(23, 96, 135, 0.22));
}

.subitem-box--line.is-active .subitem-box__line-visible,
.subitem-box--polyline.is-active .subitem-box__polyline-visible,
.subitem-box--polygon.is-active .subitem-box__polygon-visible {
  stroke: rgba(23, 96, 135, 0.96);
}

.subitem-box--line.is-locked .subitem-box__line-visible,
.subitem-box--polyline.is-locked .subitem-box__polyline-visible,
.subitem-box--polygon.is-locked .subitem-box__polygon-visible {
  stroke-dasharray: 10 6;
}

.selection-status {
  font-weight: 600;
  color: #102a43;
}

.viewer-shell--workspace .selection-status {
  width: min(100%, 1280px);
  margin-inline: auto;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #f8fbfd;
  border: 1px solid #d9e2ec;
}

.task-flow__panel--workspace {
  gap: 1rem;
  border-color: #9fc5de;
  box-shadow: 0 14px 34px rgba(23, 96, 135, 0.12);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.task-flow__panel--workspace #subitem-empty {
  margin-top: 0;
}

.selection-summary {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: #f8fbfd;
  border: 1px solid #d9e2ec;
}

.selection-summary div {
  display: grid;
  gap: 0.2rem;
}

.task-details-form {
  display: grid;
  gap: 1rem;
  max-width: 760px;
}

.task-details-form__row {
  display: grid;
  gap: 1rem;
}

/* ===== Property Management Workspace ===== */
.property-workspace {
  display: grid;
  gap: 1.5rem;
}

.property-overview {
  display: grid;
  gap: 1.5rem;
}

.property-overview__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.property-overview-card {
  display: grid;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.property-overview-card:hover,
.property-overview-card:focus {
  border-color: #3498db;
  box-shadow: 0 14px 30px rgba(52, 152, 219, 0.16);
  transform: translateY(-2px);
}

.property-overview-card__media {
  background: #0f172a;
}

.property-overview-card__media img,
.property-overview-card__placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
}

.property-overview-card__media img {
  object-fit: cover;
}

.property-overview-card__placeholder {
  place-items: center;
  color: #52606d;
  background:
    radial-gradient(circle at 30% 30%, rgba(52, 152, 219, 0.18), transparent 28%),
    linear-gradient(135deg, #edf2f7, #d9e2ec);
  font-weight: 800;
}

.property-overview-card__body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.property-overview-card__body h2 {
  margin: 0;
}

.property-overview-card__body p {
  margin-bottom: 0;
  color: #52606d;
}

.property-overview-card__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.property-overview-card__meta span {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #334e68;
  font-size: 0.86rem;
  font-weight: 700;
}

.property-overview-card__action {
  color: #176087;
  font-weight: 800;
}

.property-overview__empty {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

.property-form-page {
  max-width: 820px;
}

.property-form-page--with-context {
  max-width: 1120px;
}

.property-form-card__fields {
  display: grid;
  gap: 1rem;
}

.property-form-card__fields label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.property-form-card__fields input[readonly],
.property-form-card__fields textarea[readonly] {
  background: #f8fbfd;
  color: #52606d;
  cursor: default;
}

.property-workspace__topbar,
.property-workspace__section,
.property-image-card,
.property-subitem-card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(44, 62, 80, 0.08);
}

.property-workspace__topbar {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem;
  flex-wrap: wrap;
}

.property-workspace__topbar h1,
.property-workspace__section h2,
.property-image-card h3,
.property-subitem-card h3 {
  margin-top: 0;
}

.property-workspace__topbar p,
.property-workspace__section-header p,
.property-image-card p,
.property-subitem-card p {
  color: #52606d;
}

.property-workspace__section {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.property-workspace__section-header {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.property-workspace__section-header p {
  max-width: 64ch;
  margin-bottom: 0;
}

.property-workspace__footer-actions {
  padding-top: 0.5rem;
  border-top: 1px solid #e6e6e6;
}

.property-image-grid {
  display: grid;
  gap: 1rem;
}

.property-image-manager__body {
  display: grid;
  gap: 1rem;
}

.property-image-manager__body[hidden] {
  display: none !important;
}

.property-image-card {
  display: grid;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.property-image-card.is-marked-delete {
  border-color: #c2410c;
  background: #fff7ed;
  opacity: 0.82;
}

.property-image-card__preview {
  position: relative;
  display: block;
  color: inherit;
  text-decoration: none;
  background: #0f172a;
  overflow: hidden;
}

.property-image-card__preview img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.property-image-card__preview span {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  display: inline-flex;
  width: fit-content;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-weight: 700;
}

.property-image-card__preview:hover img,
.property-image-card__preview:focus img {
  transform: scale(1.02);
  opacity: 0.88;
}

.property-image-card__body {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
}

.property-dropzone {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 2px dashed #f97316;
  border-radius: 14px;
  background: #fff7ed;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.property-dropzone:hover,
.property-dropzone.is-dragover {
  background: #ffedd5;
  border-color: #ea580c;
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.16);
}

.property-dropzone--compact {
  padding: 0.75rem;
}

.property-dropzone__title {
  font-weight: 800;
  color: #9a3412;
}

.property-dropzone__copy {
  color: #7c2d12;
  font-size: 0.92rem;
}

.property-dropzone input {
  margin-top: 0.35rem;
}

.property-delete-toggle {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem;
  border-radius: 10px;
  background: #f8fbfd;
  color: #334e68;
}

.property-subitems {
  border-color: #d9e2ec;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfd 100%);
}

.property-subitems__controls {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 0.85rem;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #f8fbfd;
}

.property-subitems__controls label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.property-subitems__count {
  color: #52606d;
  font-size: 0.95rem;
  font-weight: 700;
}

.property-subitems__result-summary {
  margin: -0.25rem 0 0;
  color: #52606d;
  font-size: 0.92rem;
  font-weight: 700;
}

.property-subitems__search {
  flex: 1 1 280px;
}

.property-subitems__sort {
  flex: 0 1 180px;
}

.property-subitems__search input,
.property-subitems__sort select {
  min-height: 40px;
  border: 1px solid #bcccdc;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}

.property-subitems__search input {
  width: 100%;
  background: #fff;
}

.property-subitems__sort select {
  background: #fff;
}

.property-subitems__direction {
  min-width: 84px;
}

.property-subitems__body {
  display: grid;
  gap: 0.75rem;
}

.property-subitems__body[hidden],
.property-subitem-card[hidden],
.property-empty-card[hidden] {
  display: none !important;
}

.subitem-card-list {
  display: grid;
  gap: 0.75rem;
}

.property-subitem-card {
  display: grid;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem;
  grid-template-columns: minmax(0, 1fr) auto;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.property-subitem-card:hover {
  border-color: #d9eaf7;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.property-subitem-card--inactive {
  background: #f8fafc;
  opacity: 0.78;
}

.property-subitem-card__view {
  display: grid;
  gap: 1rem;
  align-items: start;
  grid-template-columns: minmax(136px, 180px) minmax(0, 1fr);
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  border-radius: 18px;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.property-subitem-card__view:hover,
.property-subitem-card__view:focus-visible {
  background: #f8fbff;
  box-shadow: inset 0 0 0 1px #d9eaf7;
  text-decoration: none;
}

.property-subitem-card__view:focus-visible {
  outline: 2px solid #176087;
  outline-offset: 3px;
}

.property-subitem-card__thumb {
  width: 100%;
}

.property-subitem-card__thumb-frame,
.property-subitem-card__thumb-placeholder {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid #d9e2ec;
  background: #0f172a;
  aspect-ratio: 4 / 3;
}

.property-subitem-card__thumb-stage {
  position: absolute;
  left: var(--thumb-stage-left, 0%);
  top: var(--thumb-stage-top, 0%);
  width: var(--thumb-stage-width, 100%);
  height: var(--thumb-stage-height, 100%);
}

.property-subitem-card__thumb-stage img {
  display: block;
  width: 100%;
  height: 100%;
}

.property-subitem-card__thumb-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.property-subitem-card__thumb-shape {
  fill: rgba(249, 115, 22, 0.15);
  stroke: #f97316;
  stroke-width: 2.4;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.75));
}

.property-subitem-card__thumb-shape--line,
.property-subitem-card__thumb-shape--polyline {
  fill: none;
}

.property-subitem-card__thumb-shape--polygon {
  fill: rgba(249, 115, 22, 0.11);
}

.property-subitem-card__thumb-placeholder {
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.82)),
    linear-gradient(135deg, #f8fbfd, #d9eaf7);
  color: #f8fbfd;
  font-weight: 700;
  text-align: center;
  padding: 0.75rem;
}

.property-subitem-card__view-content {
  display: grid;
  gap: 0.85rem;
  align-items: start;
}

.property-subitem-card__view-copy {
  display: grid;
  gap: 0.35rem;
}

.property-subitem-card__view-copy h3,
.property-subitem-card__view-copy p {
  color: inherit;
}

.property-subitem-card__view-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: #176087;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
}

.property-subitem-card__meta,
.property-subitem-card__actions {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.property-subitem-card__meta span {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #334e68;
  font-size: 0.86rem;
  font-weight: 700;
}

.property-subitem-card__actions {
  display: grid;
  gap: 0.5rem;
  justify-items: end;
}

.property-subitem-card__secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #d9e2ec;
  background: #fff;
  color: #2c3e50;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.property-subitem-card__secondary-action:hover,
.property-subitem-card__secondary-action:focus-visible {
  text-decoration: none;
  box-shadow: 0 0 0 1px #bcccdc;
}

.property-subitem-card__secondary-action--danger {
  border-color: #fdba74;
  color: #9a3412;
  background: #fff7ed;
}

.property-subitem-card__actions form {
  margin: 0;
}

@media (max-width: 720px) {
  .property-subitem-card__view {
    grid-template-columns: 1fr;
  }

  .property-subitem-card__thumb-frame,
  .property-subitem-card__thumb-placeholder {
    aspect-ratio: 16 / 9;
  }
}

.property-empty-card {
  border-radius: 12px;
}

.subitem-edit-context__grid {
  display: grid;
  gap: 1rem;
}

.subitem-edit-context__card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  background: #f8fbfd;
}

.subitem-edit-context__main {
  display: grid;
  gap: 1rem;
}

.subitem-edit-context__image-frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
  border: 1px solid #d9e2ec;
  width: 100%;
  max-width: 100%;
}

.subitem-edit-context__image-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.subitem-edit-context__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.subitem-edit-context__shape {
  fill: rgba(249, 115, 22, 0.16);
  stroke: #f97316;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.85));
}

.subitem-edit-context__shape--line,
.subitem-edit-context__shape--polyline {
  fill: none;
}

.subitem-edit-context__shape--polygon {
  fill: rgba(249, 115, 22, 0.12);
}

.subitem-edit-context__main h3 {
  margin-top: 0;
}

.subitem-edit-context__meta-panel {
  display: grid;
  gap: 0.65rem;
  align-content: start;
}

.subitem-edit-context__meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0;
}

.subitem-edit-context__meta span {
  display: inline-flex;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: #eef2f7;
  color: #52606d;
  font-size: 0.86rem;
  font-weight: 700;
}

.subitem-edit-context__detail,
.subitem-edit-context__fallback,
.subitem-edit-context__empty {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 0.85rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e6e6e6;
  color: #52606d;
  font-weight: 700;
}

.subitem-edit-context__detail p {
  margin: 0;
  font-weight: 600;
}

@media (min-width: 760px) {
  .property-image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subitem-edit-context__card {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .subitem-edit-context__main {
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.24fr);
    align-items: start;
  }
}

@media (min-width: 1100px) {
  .property-image-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.annotate-link {
  white-space: nowrap;
}

@media (min-width: 700px) {
  .property-grid,
  .image-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

@media (min-width: 860px) {
  .record-linked-image {
    grid-template-columns: minmax(0, 1.2fr) minmax(250px, 0.8fr);
    align-items: start;
  }
}

@media (max-width: 640px) {
  .record-topbar,
  .record-edit-panel__actions,
  .record-attachment-list__item,
  .task-flow__panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .record-topbar__meta {
    justify-content: flex-start;
  }
}

@media (min-width: 960px) {
  .task-flow__panel--workspace {
    padding: 1.25rem;
  }
}

/* ===== Annotation Editor ===== */
.annotation-page {
  display: grid;
  gap: 1rem;
}

.annotation-page--fullbleed {
  width: 100%;
  gap: 1.25rem;
  min-height: calc(100dvh - 2rem);
  align-content: start;
  overflow: hidden;
}

.annotation-page--fullbleed .card {
  margin: 0;
}

.annotation-page__header {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
}

.annotation-layout {
  display: grid;
  gap: 1rem;
}

.annotation-workspace {
  width: 100%;
  align-items: start;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.annotation-canvas-panel,
.annotation-sidebar {
  min-width: 0;
}

.annotation-canvas-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.annotation-canvas-panel__actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.annotation-canvas-panel__return {
  margin-left: auto;
}

.annotation-tool-button {
  position: relative;
  min-height: 2.75rem;
  padding-inline: 0.95rem;
  border: 1px solid #c7d4e2;
  background: linear-gradient(180deg, #ffffff 0%, #edf2f7 100%);
  color: #102a43;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: background-color 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.annotation-tool-button:hover {
  border-color: #98aec5;
  background: linear-gradient(180deg, #ffffff 0%, #e4ebf3 100%);
}

.annotation-tool-button.is-active {
  border-color: #0f5f98;
  background: linear-gradient(180deg, #1f6391 0%, #174d72 100%);
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.annotation-tool-button.is-active::after {
  content: "Active";
  position: absolute;
  top: -0.5rem;
  right: 0.55rem;
  padding: 0.1rem 0.38rem;
  border-radius: 999px;
  background: #fff4d6;
  color: #7c4a03;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(16, 42, 67, 0.16);
}

.annotation-tool-button.is-active:hover {
  background: linear-gradient(180deg, #246e9f 0%, #174d72 100%);
}

.annotation-tool-button--finish {
  border-style: dashed;
  border-color: #3d7a63;
  background: linear-gradient(180deg, #f4fbf7 0%, #dcefe5 100%);
  color: #1f513a;
}

.annotation-tool-button--finish:hover {
  border-color: #29624b;
  background: linear-gradient(180deg, #f8fcf9 0%, #d0e8dc 100%);
}

.annotation-tool-button--cancel {
  border-color: #c79d4b;
  background: linear-gradient(180deg, #fff9eb 0%, #f3e3b8 100%);
  color: #734f00;
}

.annotation-tool-button--cancel:hover {
  border-color: #aa7e1f;
  background: linear-gradient(180deg, #fffaf0 0%, #ecd79c 100%);
}

.annotation-canvas-wrap,
.annotation-canvas-wrap canvas {
  touch-action: none;
}

@media (pointer: coarse) {
  .annotation-tool-button {
    min-height: 3.15rem;
    padding-inline: 1.15rem;
  }
}

.annotation-status {
  margin-top: 0.75rem;
  font-weight: 600;
  color: #102a43;
}

.annotation-label-layer {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 3;
}

.annotation-floating-label {
  position: absolute;
  padding: 0.2rem 0.4rem;
  background: rgba(255, 255, 255, 0.92);
  color: #102a43;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(16, 42, 67, 0.12);
  max-width: 18rem;
  white-space: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

.annotation-floating-label.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.annotation-sidebar {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.annotation-editor-group {
  display: grid;
  gap: 0.75rem;
}

.annotation-summary {
  display: grid;
  gap: 0.25rem;
}

.annotation-selected-row {
  display: grid;
  gap: 0.6rem;
}

.annotation-selected-existing {
  padding: 0.75rem;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fbfd;
  color: #334e68;
  font-weight: 600;
}

.annotation-search-group {
  position: relative;
  display: grid;
  gap: 0.35rem;
}

.annotation-name-group {
  position: relative;
  display: grid;
  gap: 0.35rem;
}

.annotation-duplicate-warning {
  margin: 0;
  color: #8d2b0b;
  font-weight: 600;
}

.annotation-search-results {
  display: grid;
  gap: 0.5rem;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 20;
  padding: 0.5rem;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.14);
  max-height: 280px;
  overflow-y: auto;
}

.annotation-search-results[hidden] {
  display: none !important;
}

.annotation-search-result {
  background: #fff;
  color: #102a43;
  border: 1px solid #d9e2ec;
  display: grid;
  gap: 0.2rem;
  text-align: left;
}

.annotation-search-result span,
.annotation-search-empty {
  color: #52606d;
  font-size: 0.92rem;
}

.annotation-search-result.is-active {
  border-color: #1f6391;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.18);
}

#toggle-lock {
  background: #52606d;
}

#toggle-lock:hover {
  background: #334e68;
}

.annotation-sidebar__actions {
  display: grid;
  gap: 0.75rem;
}

.annotation-remove {
  background: #d64545;
}

.annotation-remove:hover {
  background: #b73434;
}

@media (min-width: 960px) {
  .annotation-page--fullbleed {
    height: calc(100dvh - 2rem);
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .annotation-workspace {
    grid-template-columns: minmax(0, 1fr) clamp(320px, 24vw, 380px);
    align-items: stretch;
    min-height: 0;
    height: min(calc(100dvh - 8rem), 90dvh);
    max-height: min(calc(100dvh - 8rem), 90dvh);
  }

  .annotation-page--fullbleed .annotation-canvas-panel,
  .annotation-page--fullbleed .annotation-sidebar {
    min-height: 0;
  }

  .annotation-page--fullbleed .annotation-sidebar {
    position: sticky;
    top: 1rem;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
  }
}
