/* ==========================================================================
   Page styles: landing, auth, onboarding, feed + post cards, crack overlay,
   engineers, notifications, profile, scan home, building file.
   ========================================================================== */

/* ---- Small shared bits ---- */
.lang-btn span {
  font-weight: var(--fw-bold);
  font-size: 15px;
  line-height: 1;
}

.app-header-title.is-brand svg {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  flex: none;
}

.fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.fieldset > legend {
  padding: 0;
  margin-bottom: var(--sp-1);
}

.card.list {
  overflow: hidden;
}

.disclaimer {
  display: flex;
  gap: var(--sp-1);
  align-items: flex-start;
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.disclaimer .icon {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--brand-text);
}

.center-row {
  justify-content: center;
}

.page-intro {
  display: flex;
  flex-direction: column;
  gap: var(--sp-0);
  margin-bottom: var(--sp-2);
}

.emergency-card.is-compact {
  font-size: var(--fs-xs);
}

.emergency-card.is-compact .callout-title {
  font-size: var(--fs-sm);
}

.gate-art {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 24px;
  background: var(--brand-soft);
  color: var(--brand-text);
}

.gate-art .icon {
  width: 34px;
  height: 34px;
}

.verified-tick {
  width: 16px;
  height: 16px;
  color: var(--brand-text);
  flex: none;
}

/* ==========================================================================
   Landing
   ========================================================================== */

.landing {
  min-height: 100vh;
  background:
    radial-gradient(90% 60% at 85% -10%, var(--brand-soft-2), transparent 60%),
    radial-gradient(70% 50% at 0% 10%, var(--brand-soft), transparent 60%);
}

.landing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: var(--sp-1) var(--sp-2);
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--text);
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

.landing-brand:hover {
  text-decoration: none;
}

.landing-brand svg {
  width: 38px;
  height: 38px;
  border-radius: 11px;
}

.hero {
  display: grid;
  gap: var(--sp-5);
  align-items: center;
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: var(--sp-2) var(--sp-2) var(--sp-5);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: 1.15fr 0.85fr;
    padding: var(--sp-6) var(--sp-3) var(--sp-10);
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}

.eyebrow .icon {
  width: 16px;
  height: 16px;
}

.hero-title {
  margin-top: var(--sp-2);
  font-size: clamp(1.9rem, 6.4vw, 3.3rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
}

.hero-title:focus {
  outline: none;
}

.hero-text {
  max-width: 34em;
  margin-top: var(--sp-2);
  font-size: var(--fs-lg);
  color: var(--text-2);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  margin-top: var(--sp-3);
}

@media (max-width: 520px) {
  .hero-ctas .btn {
    flex: 1 1 100%;
  }
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.hero-note .icon {
  width: 18px;
  height: 18px;
  color: var(--ok);
}

.hero-visual {
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--sp-2) 0;
}

.hero-glow {
  position: absolute;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(63, 224, 197, 0.32), transparent 65%);
  filter: blur(16px);
}

/* Phone mockup */
.phone {
  position: relative;
  width: min(300px, 76vw);
  aspect-ratio: 9 / 18.5;
  padding: 11px;
  border-radius: 46px;
  background: #0e1110;
  box-shadow: 0 30px 70px rgba(4, 30, 28, 0.35), 0 0 0 2px #2c312f inset;
}

.phone-notch {
  position: absolute;
  top: 19px;
  left: 50%;
  z-index: 4;
  width: 86px;
  height: 24px;
  border-radius: 14px;
  background: #0e1110;
  transform: translateX(-50%);
}

.mock-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 36px;
  background: #3b3f3a;
}

.mock-screen.is-loading {
  background: linear-gradient(110deg, #3b3f3a 30%, #4a4f49 50%, #3b3f3a 70%);
  background-size: 200% 100%;
  animation: mockShimmer 1.4s linear infinite;
}

@keyframes mockShimmer {
  to { background-position: -200% 0; }
}

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

.mock-overlay {
  position: absolute;
  inset: 0;
}

.scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: 6%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--mint-400) 20%, var(--mint-400) 80%, transparent);
  box-shadow: 0 0 18px 6px rgba(63, 224, 197, 0.45);
  animation: sweep 2.4s ease-in-out infinite alternate;
  transition: opacity var(--dur-3) var(--ease);
}

.scanline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 3px;
  height: 90px;
  background: linear-gradient(to top, rgba(63, 224, 197, 0.22), transparent);
}

@keyframes sweep {
  from { top: 6%; }
  to { top: 92%; }
}

.mock-screen.is-done .scanline {
  opacity: 0;
}

.mock-step {
  position: absolute;
  top: 54px;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: rgba(10, 12, 11, 0.74);
  color: #fff;
  font-size: 13px;
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  transform: translateX(-50%);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: opacity var(--dur-3) var(--ease);
}

.mock-spinner {
  width: 16px;
  height: 16px;
  border-width: 2px;
  border-color: rgba(255, 255, 255, 0.25);
  border-top-color: var(--mint-400);
}

.mock-screen.is-done .mock-step {
  opacity: 0;
}

.mock-result {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  color: #181a17;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(130%);
  transition: transform var(--dur-4) var(--ease-out), opacity var(--dur-4) var(--ease-out);
}

.mock-screen.is-done .mock-result {
  opacity: 1;
  transform: none;
  transition-delay: 1.1s;
}

.mock-result-metric {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 11px;
  color: #51564f;
}

.mock-result-metric bdi {
  font-size: 15px;
  font-weight: var(--fw-bold);
  color: #181a17;
}

.landing-body {
  max-width: var(--wide-max);
  margin: 0 auto;
  padding: 0 var(--sp-2) var(--sp-5);
}

.landing-section {
  margin-top: var(--sp-8);
}

.landing-section:first-child {
  margin-top: 0;
}

.landing-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-0);
  margin-bottom: var(--sp-3);
}

.landing-head.row {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-1);
}

.landing-head h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.how-grid,
.colors-grid,
.trust-grid {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .how-grid,
  .colors-grid,
  .trust-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.how-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  overflow: hidden;
}

.how-num {
  position: absolute;
  top: 12px;
  inset-inline-end: 20px;
  font-size: 56px;
  font-weight: var(--fw-bold);
  line-height: 1;
  color: var(--brand-soft-2);
}

.how-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: var(--sp-1);
  border-radius: 16px;
  background: var(--brand-soft);
  color: var(--brand-text);
}

.how-icon .icon {
  width: 26px;
  height: 26px;
}

.color-card {
  display: flex;
  gap: var(--sp-2);
  padding: var(--sp-2);
  border-inline-start: 4px solid var(--border);
}

.color-green { border-inline-start-color: var(--ok); }
.color-yellow { border-inline-start-color: var(--warn); }
.color-red { border-inline-start-color: var(--danger); }

.color-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
}

.color-icon .icon {
  width: 24px;
  height: 24px;
}

.color-green .color-icon { background: var(--ok-soft); color: var(--ok-text); }
.color-yellow .color-icon { background: var(--warn-soft); color: var(--warn-text); }
.color-red .color-icon { background: var(--danger-soft); color: var(--danger-text); }

.trust {
  padding: var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.trust-item {
  display: flex;
  gap: var(--sp-2);
}

.trust-item h3 {
  margin-bottom: 4px;
}

.trust-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 14px;
  background: var(--brand);
  color: var(--text-on-brand);
}

.trust-icon .icon {
  width: 22px;
  height: 22px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-1);
  margin: 0;
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  padding: var(--sp-2) var(--sp-1);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  text-align: center;
}

.stat dd {
  margin: 0;
  font-size: clamp(1.5rem, 6vw, 2.25rem);
  font-weight: var(--fw-bold);
  color: var(--brand-text);
  line-height: 1.1;
}

.stat dt {
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.final-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-8);
  padding: var(--sp-5) var(--sp-3);
  border-radius: 28px;
  background: radial-gradient(80% 120% at 50% 0%, var(--teal-500), var(--teal-800) 70%);
  color: #fff;
  text-align: center;
}

.final-cta h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.final-cta p {
  opacity: 0.88;
}

.final-logo {
  width: 64px;
  height: 64px;
  margin-bottom: var(--sp-1);
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.final-cta .hero-ctas {
  justify-content: center;
}

.final-btn {
  background: #fff;
  color: var(--teal-800);
}

.final-btn:hover {
  background: var(--teal-25);
}

.final-ghost {
  color: #fff;
}

.final-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.landing-footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--sp-4) var(--sp-2) var(--sp-2);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

@media (max-width: 759px) {
  .center-mobile {
    justify-content: center;
    text-align: center;
  }
}

/* ==========================================================================
   Auth
   ========================================================================== */

.auth {
  max-width: 460px;
  padding-top: var(--sp-2);
}

.auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  text-align: center;
}

.auth-logo {
  width: 64px;
  height: 64px;
  margin-bottom: var(--sp-1);
  border-radius: 18px;
  box-shadow: var(--shadow-md);
}

.auth-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: var(--sp-1);
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-text);
}

.auth-icon .icon {
  width: 30px;
  height: 30px;
}

.demo-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text-2);
  text-align: center;
}

.demo-note:empty {
  display: none;
}

.demo-note .icon {
  width: 16px;
  height: 16px;
}

.demo-code {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  letter-spacing: 0.15em;
  color: var(--brand-text);
  direction: ltr;
}

/* ==========================================================================
   Onboarding
   ========================================================================== */

.onboarding {
  max-width: 560px;
}

.onb-progress {
  margin-bottom: var(--sp-3);
}

.onb-head {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.onb-head h1:focus,
.onb-done h1:focus {
  outline: none;
}

.onb-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand-text);
}

.onb-icon .icon {
  width: 28px;
  height: 28px;
}

.handle-preview {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  background: var(--surface-2);
  box-shadow: none;
}

.handle-preview .row .icon {
  width: 14px;
  height: 14px;
}

.onb-done {
  align-items: center;
  text-align: center;
  padding-top: var(--sp-3);
}

.onb-done > .stack-1,
.onb-done > .callout,
.onb-done > .handle-preview {
  width: 100%;
  text-align: start;
}

.onb-done > .handle-preview {
  flex-direction: row;
  align-items: center;
}

.done-check {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  box-shadow: 0 0 0 10px var(--ok-soft);
  animation: pop 0.5s var(--ease-out) both;
}

.done-check .icon {
  width: 44px;
  height: 44px;
  stroke-width: 3;
}

@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  70% { transform: scale(1.08); }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Feed + post cards
   ========================================================================== */

.feed {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.feed-filters {
  margin-block: var(--sp-0);
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.feed-sentinel {
  height: 1px;
}

.feed-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--sp-2);
  font-size: var(--fs-sm);
  color: var(--text-3);
}

.feed-end .icon {
  width: 18px;
  height: 18px;
  color: var(--ok);
}

.post-card {
  overflow: hidden;
}

.post-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px var(--sp-2);
}

.post-author {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: var(--fw-semibold);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.post-meta .icon {
  width: 14px;
  height: 14px;
}

.post-meta time {
  white-space: nowrap;
}

.post-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-sunken);
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity var(--dur-4) var(--ease);
}

.post-media.is-loading img {
  opacity: 0;
}

.post-media.is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 60%, transparent), transparent);
  animation: shimmer 1.4s infinite;
}

.post-media-skeleton {
  aspect-ratio: 4 / 5;
}

.post-overlay-layer {
  position: absolute;
  inset: 0;
  transition: opacity var(--dur-3) var(--ease);
}

.post-overlay-layer.is-hidden {
  opacity: 0;
}

.post-media-status {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
}

.post-media-status .status {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.overlay-toggle {
  position: absolute;
  bottom: 12px;
  inset-inline-end: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: rgba(15, 17, 15, 0.64);
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: background-color var(--dur-2) var(--ease);
}

.overlay-toggle .icon {
  width: 16px;
  height: 16px;
}

.overlay-toggle[aria-pressed="false"] {
  background: rgba(255, 255, 255, 0.88);
  color: #181a17;
}

.post-body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: 12px var(--sp-2) var(--sp-1);
}

.post-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-1);
}

.metric {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 6px 10px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.metric-label {
  font-size: 11px;
  color: var(--text-3);
}

.metric-value {
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-caption {
  font-size: var(--fs-md);
}

.post-element {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.post-element .icon {
  width: 14px;
  height: 14px;
}

.post-actions {
  display: flex;
  gap: 4px;
  padding: 4px var(--sp-1);
  border-top: 1px solid var(--border);
}

.post-action {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  transition: background-color var(--dur-2) var(--ease), color var(--dur-2);
}

.post-action:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.post-action .icon {
  width: 20px;
  height: 20px;
}

.post-action-count {
  color: var(--text-3);
  font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
}

/* "Me too" pressed */
.post-action.is-active {
  color: var(--brand-text);
  background: var(--brand-soft);
}

.post-action.is-active .post-action-count {
  color: var(--brand-text);
}

.post-action.is-active .icon {
  animation: meTooPop var(--dur-3) var(--ease-out);
}

@keyframes meTooPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.25) rotate(-8deg); }
  100% { transform: scale(1); }
}

.post-time-link {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.post-time-link:hover {
  color: var(--text-2);
  text-decoration: underline;
}

.post-view-comments {
  align-self: flex-start;
  padding: 2px 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-align: start;
}

.post-view-comments:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ==========================================================================
   Comments (sheet and post page)
   ========================================================================== */

.comments {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.comment {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  transition: opacity var(--dur-2) var(--ease);
}

.comment + .comment {
  border-top: 1px solid var(--border);
}

.comment.is-new {
  animation: commentIn var(--dur-3) var(--ease-out);
}

.comment.is-removing {
  opacity: 0.4;
  pointer-events: none;
}

@keyframes commentIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.comment-main {
  flex: 1 1 auto;
  min-width: 0;
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
}

.comment-author {
  font-weight: var(--fw-bold);
}

.comment-head .badge {
  font-size: 11px;
  padding-block: 0;
}

.comment-time {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.comment-text {
  margin-top: 2px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.comment-delete {
  flex: none;
  width: 36px;
  height: 36px;
  color: var(--text-3);
}

.comment-delete:hover {
  color: var(--danger-text);
  background: var(--danger-soft);
}

.comment-composer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

.comment-composer.is-visitor {
  align-items: stretch;
  gap: var(--sp-1);
  text-align: center;
}

.comment-row {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-1);
}

.comment-row .avatar {
  margin-bottom: 6px;
}

.comment-input {
  flex: 1 1 auto;
  min-height: 44px;
  max-height: 160px;
  padding-block: 10px;
  resize: none;
  line-height: 1.45;
}

.comment-send {
  flex: none;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--r-pill);
}

.comment-send:disabled {
  opacity: 0.45;
}

.comment-rules {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.comment-rules .icon {
  width: 14px;
  height: 14px;
  flex: none;
}

.comment-counter {
  margin-inline-start: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.comment-counter.is-over {
  color: var(--danger-text);
  font-weight: var(--fw-semibold);
}

.comments .empty {
  padding-block: var(--sp-3);
}

/* In the sheet the composer stays at the bottom while the list scrolls.
   A steady height stops the sheet jumping while comments load. */
.sheet-comments {
  height: min(78dvh, 680px);
  padding-bottom: 0;
}

.sheet-comments .sheet-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.sheet-comments .comments {
  flex: 1 1 auto;
}

.sheet-comments .comments-body {
  flex: 1 1 auto;
}

.sheet-comments .comment-composer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  padding-bottom: calc(var(--sp-2) + var(--safe-bottom));
  background: var(--bg-elevated);
}

.post-comments-title {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-bottom: var(--sp-1);
  font-size: var(--fs-lg);
}

.post-comments-title .icon {
  color: var(--brand-text);
}

/* ==========================================================================
   Share sheet
   ========================================================================== */

.share-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: var(--sp-1);
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) var(--sp-1);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-align: center;
  text-decoration: none;
  transition: background-color var(--dur-2) var(--ease), border-color var(--dur-2);
}

.share-option:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  text-decoration: none;
}

.share-option-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand-text);
}

.share-option.is-whatsapp .share-option-icon {
  background: #25d366;
  color: #fff;
}

.share-fallback {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.share-privacy {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.share-privacy .icon {
  width: 16px;
  height: 16px;
  flex: none;
  color: var(--brand-text);
}

@media (prefers-reduced-motion: reduce) {
  .post-action.is-active .icon,
  .comment.is-new {
    animation: none;
  }
}

@media (max-width: 380px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .post-action span:not(.post-action-count) {
    font-size: var(--fs-xs);
  }
}

/* ==========================================================================
   Crack overlay (self-drawing)
   ========================================================================== */

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

.crack-overlay polyline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.crack-overlay .ov-shadow {
  stroke: rgba(4, 32, 30, 0.55);
}

.crack-overlay .ov-line {
  stroke: var(--mint-400);
}

.crack-overlay.is-drawing polyline {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: ovDraw 1.5s var(--ease-out) forwards;
  animation-delay: calc(var(--ov-delay, 0ms) + var(--ov-i, 0) * 80ms);
}

@keyframes ovDraw {
  to { stroke-dashoffset: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .crack-overlay.is-drawing polyline {
    stroke-dasharray: none;
    stroke-dashoffset: 0;
    animation: none;
  }
}

.ov-marker {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: markerIn var(--dur-4) var(--ease-out) 1.3s both;
}

.ov-marker-ring {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 0 7px rgba(63, 224, 197, 0.35);
  animation: ringPulse 2.2s var(--ease) 2s infinite;
}

.ov-marker-label {
  position: absolute;
  top: 50%;
  left: calc(100% + 6px);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: rgba(10, 12, 11, 0.78);
  color: #fff;
  font-size: 12px;
  font-weight: var(--fw-bold);
  white-space: nowrap;
  unicode-bidi: plaintext;
  transform: translateY(-50%);
}

.ov-marker.is-flipped .ov-marker-label {
  left: auto;
  right: calc(100% + 6px);
}

@keyframes markerIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 0 7px rgba(63, 224, 197, 0.35); }
  50% { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 0 12px rgba(63, 224, 197, 0.1); }
}

/* ==========================================================================
   Engineers
   ========================================================================== */

.search-wrap {
  position: relative;
  margin-bottom: 12px;
}

.search-wrap > .icon {
  position: absolute;
  top: 50%;
  inset-inline-start: 14px;
  color: var(--text-3);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-input {
  padding-inline-start: 44px;
}

.eng-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 var(--sp-3);
}

.eng-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  padding: var(--sp-2);
  text-align: start;
}

.eng-card-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.eng-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
}

.eng-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.eng-sub .icon {
  width: 16px;
  height: 16px;
}

.eng-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  margin-top: 2px;
}

.eng-price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.eng-price .icon {
  width: 14px;
  height: 14px;
}

.eng-chevron {
  align-self: center;
  color: var(--text-3);
}

.eng-profile-name {
  font-size: var(--fs-xl);
  font-weight: var(--fw-bold);
}

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

.kv-label.row {
  gap: 4px;
}

.kv-label.row .icon {
  width: 14px;
  height: 14px;
}

.review {
  align-items: flex-start;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.notif-group + .notif-group {
  margin-top: var(--sp-3);
}

.notif-group-title {
  margin-bottom: var(--sp-1);
  padding-inline: 4px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-3);
}

.notif {
  align-items: flex-start;
  padding-block: 12px;
}

.notif.is-unread {
  background: color-mix(in srgb, var(--brand-soft) 60%, transparent);
}

.notif-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-text);
}

.notif-icon .icon {
  width: 20px;
  height: 20px;
}

.notif-engineerPending {
  background: var(--warn-soft);
  color: var(--warn-text);
}

.notif-verdict,
.notif-engineerVerified {
  background: var(--ok-soft);
  color: var(--ok-text);
}

.unread-dot {
  width: 10px;
  height: 10px;
  flex: none;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--brand);
}

/* ==========================================================================
   Profile
   ========================================================================== */

.profile-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.profile-name {
  font-size: var(--fs-xl);
}

.profile-name:focus {
  outline: none;
}

.profile-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 400px) {
  .profile-facts {
    grid-template-columns: 1fr;
  }
}

.profile-fact {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.profile-fact > .icon {
  margin-top: 2px;
  color: var(--brand-text);
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(160deg, var(--brand-soft), var(--surface) 60%);
}

.visitor-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.visitor-card .empty-art {
  margin-bottom: 0;
}

.danger-item .list-item-icon {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.danger-item .list-item-title {
  color: var(--danger-text);
}

.building-icon {
  background: var(--brand-soft);
  color: var(--brand-text);
}

/* ==========================================================================
   Scan home
   ========================================================================== */

.scan-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-2) 0 var(--sp-3);
  text-align: center;
}

.scan-hero h1:focus {
  outline: none;
}

.scan-hero-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin-bottom: var(--sp-1);
  border-radius: 24px;
  background: linear-gradient(160deg, var(--teal-400), var(--teal-700));
  color: #fff;
  box-shadow: var(--shadow-brand);
}

.scan-hero-icon .icon {
  width: 38px;
  height: 38px;
}

.quota-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.scan-steps {
  margin: 0;
  padding: var(--sp-1) 0;
  list-style: none;
}

.scan-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px var(--sp-2);
}

.scan-step + .scan-step {
  border-top: 1px solid var(--border);
}

.scan-step-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--brand);
  color: var(--text-on-brand);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
}

.scan-step-icon {
  display: inline-flex;
  color: var(--text-3);
}

.needs {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  margin-top: var(--sp-2);
}

/* ==========================================================================
   Building file
   ========================================================================== */

.building-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.building-hero h1:focus {
  outline: none;
}

.building-hero-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: var(--brand-soft);
  color: var(--brand-text);
}

.building-hero-icon .icon {
  width: 36px;
  height: 36px;
}

.building-facts {
  width: 100%;
  margin: 0;
  text-align: start;
}

.building-facts dd {
  margin: 0;
}
